/* Project-level overrides. The brand design system (colors, fonts, components)
   is configured via the Tailwind CDN config and <style> block in App.razor.
   Add any additional custom CSS here. */
/*:root {
    --background: 0 0% 100%;
    --foreground: 171 50% 12%;
    --card: 0 0% 100%;
    --card-foreground: 171 50% 12%;
    --popover: 0 0% 100%;
    --popover-foreground: 171 50% 12%;
    --primary: 170 71% 21%;*/ /* emerald green */
/*--primary-foreground: 0 0% 100%;*/ /* white */
/*--secondary: 160 30% 96%;
    --secondary-foreground: 171 50% 12%;
    --muted: 160 30% 96%;
    --muted-foreground: 171 12% 42%;*/
/*--accent: 160 30% 96%;*/
/*--accent: 171 12% 42%;
    --accent-foreground: 171 50% 12%;
    --border: 160 20% 88%;
    --input: 160 20% 88%;
    --ring: 170 71% 21%;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    border: 1px solid hsl(var(--input));
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    line-height: 1.4;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}


    input:focus,
    select:focus,
    textarea:focus {
        border-color: hsl(var(--ring));
        box-shadow: 0 0 0 2px hsl(var(--ring) / 0.25);
    }*/

/* ── Sidebar theme (consumed by AppSidebar.razor via hsl(var(--sidebar-*))) ──
   The sidebar is a dark forest panel; foreground/muted are light so text reads
   on it, primary is the gold brand accent used for the logo tile. */
/*:root {
    --sidebar-background: 172 66% 10%;
    --sidebar-foreground: 158 24% 80%;
    --sidebar-border: 172 38% 20%;
    --sidebar-muted: 158 14% 60%;
    --sidebar-primary: 43 55% 51%;
    --sidebar-primary-foreground: 172 71% 8%;*/
/*--sidebar-accent: 172 44% 17%;*/
/*--sidebar-accent: 171 12% 42%;
    --sidebar-accent-foreground: 0 0% 100%;
}*/

/* Sidebar nav item — icon + label row. Used as `sidebar-link`, plus the
   Tailwind helpers `w-full`, `active`, `justify-center`, `text-xs`, `py-2`. */
/*.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.7rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    color: hsl(var(--sidebar-foreground));
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background-color .15s ease, color .15s ease;
}

    .sidebar-link:hover {
        background: hsl(var(--sidebar-accent));
        color: hsl(var(--sidebar-accent-foreground));
    }

    .sidebar-link.active {
        background: hsl(var(--sidebar-accent));
        color: hsl(var(--sidebar-accent-foreground));
        font-weight: 600;
    }

    .sidebar-link svg {
        flex-shrink: 0;
    }*/

/* ── KPI / stat cards (global; previously only defined inside AuthorMetrics) ── */
/*.kpi-card {
    position: relative;
    overflow: hidden;
}

.kpi-card-navy {
    background: linear-gradient(135deg, #001a4d 0%, #003d99 100%);
}

.kpi-card-teal {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
}

.kpi-card-amber {
    background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
}

.kpi-card-blue {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 300ms ease-in-out;
}*/

/* ════════════════════════════════════════════════════════════════════
   Component layer — classes referenced throughout the app (dialogs,
   buttons, status badges, table rows). Without these the modals render
   in normal page flow (no overlay), which looks like "popups don't open".
   ════════════════════════════════════════════════════════════════════ */

/* ── Modal / dialog (used by DialogPanel.razor + ~22 raw .dialog-backdrop pages) ── */
/*.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: rgba(6, 35, 31, 0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    overflow-y: auto;
    animation: dialogFade .15s ease-out;
}

    .dialog-backdrop.nested {
        z-index: 60;
    }

.dialog-box {
    position: relative;
    width: 100%;
    max-width: 32rem;*/ /* overridden by Tailwind sm:max-w-* utilities when present */
/*margin: auto;
    background: #fff;
    border-radius: 0.85rem;
    box-shadow: 0 24px 60px -12px rgba(6, 35, 31, 0.35);
    padding: 1.25rem;
    animation: dialogPop .16s cubic-bezier(.16, 1, .3, 1);
}

@keyframes dialogFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes dialogPop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}*/

/* ── Buttons ── */
/*.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
    cursor: pointer;
    transition: filter .15s ease, opacity .15s ease;
}

    .btn-primary:hover {
        filter: brightness(1.08);
    }

    .btn-primary:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

.btn-ghost-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    width: 2rem;
    border-radius: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: hsl(var(--muted-foreground));
    transition: background-color .15s ease, color .15s ease;
}

    .btn-ghost-icon:hover {
        background: hsl(var(--muted));
        color: hsl(var(--foreground));
    }*/

/* ── Status badges / pills (base + color variants from StatusCls() helpers) ── */
/*.status-badge,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.45;
    white-space: nowrap;
    border: 1px solid transparent;
}*/

/* status-* variants */
/*.status-accepted, .status-success {
    background: #dcfce7;
    color: #166534;
}

.status-review, .status-info {
    background: #dbeafe;
    color: #1e40af;
}

.status-screening {
    background: #f1f5f9;
    color: #334155;
}

.status-rejected, .status-error {
    background: #fee2e2;
    color: #991b1b;
}

.status-revision, .status-warning {
    background: #fef3c7;
    color: #92400e;
}

.status-production {
    background: #ede9fe;
    color: #5b21b6;
}

.status-submitted {
    background: #ccfbf1;
    color: #115e59;
}*/

/* badge-* variants */
/*.badge-default, .badge-secondary {
    background: #f1f5f9;
    color: #334155;
}

.badge-secondary-solid {
    background: #475569;
    color: #fff;
}

.badge-muted {
    background: #f1f5f9;
    color: #64748b;
}

.badge-green, .badge-emerald {
    background: #dcfce7;
    color: #166534;
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.badge-amber {
    background: #fef3c7;
    color: #92400e;
}

.badge-orange {
    background: #ffedd5;
    color: #9a3412;
}

.badge-red {
    background: #fee2e2;
    color: #991b1b;
}

.badge-outline {
    background: transparent;
    border-color: #cbd5e1;
    color: #475569;
}

.badge-outline-amber {
    background: transparent;
    border-color: #fcd34d;
    color: #92400e;
}

.badge-outline-blue {
    background: transparent;
    border-color: #93c5fd;
    color: #1e40af;
}*/

/* ── Data table rows ── */
/*.data-table-row {
    border-bottom: 1px solid hsl(var(--border));
    transition: background-color .12s ease;
}

    .data-table-row:hover {
        background: hsl(220 20% 97%);
    }*/
/* ── Dialog (paste into css/app.css) ───────────────────────────── */

/*.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 35, 31, 0.45);
    padding: 1rem;
    backdrop-filter: blur(2px);
}

.dialog-box {
    width: 100%;
    background: hsl(var(--card));
    color: hsl(var(--card-foreground));
    border-radius: 1rem;
    box-shadow: 0 22px 50px -20px rgba(6, 35, 31, 0.5);
    padding: 1.25rem 1.5rem;*/
/* IMPORTANT: no overflow here — the inner .flex-1 body scrolls.
       Height is capped by max-h-[90vh] in the markup. */
/*}*/

/* ghost icon button (close X) */
/*.btn-ghost-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    width: 2rem;
    border-radius: 0.5rem;
    color: hsl(var(--muted-foreground));
    transition: background .15s, color .15s;
}

    .btn-ghost-icon:hover {
        background: hsl(var(--muted));
        color: hsl(var(--foreground));
    }*/
/* placeholder — chhota aur halka */
/*.inp::placeholder,
input::placeholder,
textarea::placeholder {
    color: hsl(var(--muted-foreground));
    opacity: 0.6;
    font-size: 0.875rem;*/ /* input ke barabar, bada na ho */
/*font-weight: 400;
}*/

/* focus state */
/*.inp:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}*/
/* ── .inp base (input + textarea + select) ─────────────────── */
/*.inp {
    width: 100%;
    border: 1px solid hsl(var(--input));
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    line-height: 1.4;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}*/

/* placeholder — chhota aur halka (input + textarea dono) */
/*.inp::placeholder,
    textarea.inp::placeholder,
    textarea::placeholder,
    input::placeholder {
        color: hsl(var(--muted-foreground)) !important;
        opacity: 0.55 !important;
        font-size: 0.8125rem !important;*/ /* ~13px, content se chhota */
/*font-weight: 400 !important;
        line-height: 1.4;
    }

    .inp:focus {
        border-color: hsl(var(--ring));
        box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
    }

    .inp:disabled {
        background: hsl(var(--muted) / .4);
        cursor: not-allowed;
        opacity: 0.7;
    }*/

/* ════════════════════════════════════════════════════════════════════
   Project-level overrides. Brand design system (colors, fonts) is in the
   Tailwind config + <style> block in App.razor. This file holds CSS
   variables, form defaults, and the component layer.

   NOTE: element selectors are wrapped in :where() so their specificity is
   ZERO — that lets Tailwind utilities (pl-9, bg-white, border-slate-300,
   py-2, ...) override them. Without :where(), `input[type="text"]` (0,1,1)
   beats `.pl-9` (0,1,0) and the utility silently does nothing.
   ════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design-system CSS Variables (match React index.css exactly) ── */
:root {
    --background: 150 12% 97%;
    --foreground: 161 40% 10%;
    --card: 0 0% 100%;
    --card-foreground: 161 40% 10%;
    --popover: 0 0% 100%;
    --popover-foreground: 161 40% 10%;
    --primary: 161 55% 15%;
    --primary-foreground: 150 30% 98%;
    --secondary: 150 18% 92%;
    --secondary-foreground: 161 40% 15%;
    --muted: 150 14% 94%;
    --muted-foreground: 158 10% 45%;
    --accent: 160 50% 32%;
    --accent-foreground: 0 0% 100%;
    --destructive: 0 72% 51%;
    --destructive-foreground: 0 0% 100%;
    --border: 150 12% 88%;
    --input: 150 12% 88%;
    --ring: 161 55% 15%;
    --radius: 0.5rem;
    --warning: 42 92% 48%;
    --success: 160 55% 36%;
    --info: 205 70% 48%;
    /* sidebar — deep forest green */
    --sidebar-background: 161 56% 11%;
    --sidebar-foreground: 150 12% 78%;
    --sidebar-primary: 45 64% 58%; /* gold — logo + active link */
    --sidebar-primary-foreground: 161 56% 10%;
    --sidebar-accent: 161 45% 17%;
    --sidebar-accent-foreground: 150 25% 95%;
    --sidebar-border: 161 40% 19%;
    --sidebar-muted: 158 20% 32%;
    --kpi-gradient-1: linear-gradient(135deg, hsl(161 55% 15%), hsl(161 48% 25%));
    --kpi-gradient-2: linear-gradient(135deg, hsl(160 50% 30%), hsl(160 50% 40%));
    --kpi-gradient-3: linear-gradient(135deg, hsl(45 64% 42%), hsl(45 64% 52%));
    --kpi-gradient-4: linear-gradient(135deg, hsl(185 45% 32%), hsl(185 45% 42%));
    /* gold — logo mark / brand highlight */
    --gold: 45 64% 48%;
    --gold-foreground: 161 56% 10%;
}

/* ── Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    border-color: hsl(var(--border));
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
}

/* ── Semantic color utilities (used via inline style workaround since Tailwind CDN doesn't have our vars) ── */
.bg-background {
    background: hsl(var(--background));
}

.bg-card {
    background: hsl(var(--card));
}

.bg-muted {
    background: hsl(var(--muted));
}

.bg-primary {
    background: hsl(var(--primary));
}

.bg-accent {
    background: hsl(var(--accent));
}

.text-foreground {
    color: hsl(var(--foreground));
}

.text-card-foreground {
    color: hsl(var(--card-foreground));
}

.text-muted-foreground {
    color: hsl(var(--muted-foreground));
}

.text-primary {
    color: hsl(var(--primary));
}

.text-accent {
    color: hsl(var(--accent));
}

.text-destructive {
    color: hsl(var(--destructive));
}

.border-border {
    border-color: hsl(var(--border));
}

.border-input {
    border-color: hsl(var(--input));
}

.ring-ring {
    --tw-ring-color: hsl(var(--ring));
}

/* ── KPI Cards ── */
.kpi-card {
    border-radius: .75rem;
    padding: 1.25rem;
    color: white;
    box-shadow: 0 4px 6px -1px rgb(0 0 0/.1),0 2px 4px -2px rgb(0 0 0/.1);
    transition: all .3s;
}

    .kpi-card:hover {
        box-shadow: 0 10px 15px -3px rgb(0 0 0/.1),0 4px 6px -4px rgb(0 0 0/.1);
        transform: translateY(-2px);
    }

.kpi-card-navy {
    background: var(--kpi-gradient-1);
}

.kpi-card-teal {
    background: var(--kpi-gradient-2);
}

.kpi-card-amber {
    background: var(--kpi-gradient-3);
}

.kpi-card-blue {
    background: var(--kpi-gradient-4);
}

/* ── Sidebar ── */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    border-radius: .5rem;
    padding: .625rem .75rem;
    font-size: .875rem;
    font-weight: 500;
    transition: all .2s;
    color: hsl(var(--sidebar-foreground));
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

    .sidebar-link:hover {
        background: hsl(var(--sidebar-accent));
        color: hsl(var(--sidebar-accent-foreground));
    }

    .sidebar-link.active {
        background: hsl(var(--sidebar-accent));
        color: hsl(var(--sidebar-primary));
    }

/* ── Status Badges ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: .125rem .625rem;
    font-size: .75rem;
    font-weight: 500;
}

.status-submitted {
    background: #dbeafe;
    color: #1e40af;
}

.status-review {
    background: #fef3c7;
    color: #8a5a06;
}

.status-accepted {
    background: #d3f2e2;
    color: #0d5238;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.status-revision {
    background: #ece9fb;
    color: #4c3b96;
}

.status-screening {
    background: #eef2f0;
    color: #40534b;
}

.status-production {
    background: #d3f2e2;
    color: #0d5238;
}

.status-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-warning {
    background: #fdf3c8;
    color: #8a5a06;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

.status-success {
    background: #d3f2e2;
    color: #0d5238;
}

/* ── Data Table Row ── */
.data-table-row {
    border-bottom: 1px solid hsl(var(--border));
    transition: background .15s;
}

    .data-table-row:hover {
        background: hsl(var(--muted)/.5);
    }

/* ── Card ── */
.card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: .75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0/.1);
}

/* ── Buttons ── */
.btn-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border: none;
}

    .btn-primary:hover {
        background: hsl(220 60% 24%);
    }

.btn-outline {
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
}

    .btn-outline:hover {
        background: hsl(var(--muted));
    }

.btn-accent {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    border: none;
}

.btn-destructive {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
    border: none;
}

/* ── Input ── */
.input-field {
    display: block;
    width: 100%;
    border-radius: .5rem;
    border: 1px solid hsl(var(--input));
    background: hsl(var(--card));
    padding: .5rem .75rem;
    font-size: .875rem;
    color: hsl(var(--foreground));
    outline: none;
}

    .input-field:focus {
        border-color: hsl(var(--ring));
        box-shadow: 0 0 0 2px hsl(var(--ring)/.2);
    }

    .input-field::placeholder {
        color: hsl(var(--muted-foreground));
    }

/* ── Tab (vertical) ── */
.tab-vertical {
    display: flex;
    align-items: center;
    gap: .5rem;
    border-radius: .5rem;
    padding: .625rem .75rem;
    font-size: .75rem;
    font-weight: 500;
    transition: all .15s;
    cursor: pointer;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: hsl(var(--foreground));
}

    .tab-vertical:hover {
        background: hsl(var(--muted));
    }

    .tab-vertical.active {
        background: hsl(var(--primary));
        color: hsl(var(--primary-foreground));
    }

/* ── Horizontal Tab ── */
.tab-h {
    padding: .5rem 1rem;
    font-size: .875rem;
    font-weight: 500;
    transition: all .15s;
    cursor: pointer;
    background: none;
    border: none;
    color: hsl(var(--muted-foreground));
    border-bottom: 2px solid transparent;
}

    .tab-h:hover {
        color: hsl(var(--foreground));
    }

    .tab-h.active {
        color: hsl(var(--primary));
        border-bottom-color: hsl(var(--primary));
    }

/* ── Progress ── */
.progress-bar {
    height: 6px;
    border-radius: 3px;
    background: hsl(var(--muted));
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: hsl(var(--accent));
    transition: width .3s ease;
}

/* ── Mono ── */
.mono-text {
    font-family: 'JetBrains Mono',monospace;
}

/* ── Animations ── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(.95)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%)
    }

    to {
        transform: translateX(0)
    }
}

.animate-fade-in {
    animation: fadeIn .4s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn .15s ease-out;
}

.animate-slide-in {
    animation: slideIn .3s ease-out;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: 3px;
}

/* ── Dialog Backdrop ── */
.dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0/.45);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .75rem;
    animation: fadeIn .15s ease-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dialog-box {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: .75rem;
    box-shadow: 0 20px 60px -10px rgb(0 0 0/.4);
    animation: scaleIn .2s ease-out;
    padding: 1rem;
    width: 100%;
    max-width: 32rem;
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 640px) {
    .dialog-backdrop {
        padding: 1rem;
    }

    .dialog-box {
        padding: 1.5rem;
    }
}

/* Nested dialogs (sub-dialogs within detail modal) */
.dialog-backdrop.nested {
    z-index: 60;
}

    .dialog-backdrop.nested .dialog-box {
        max-width: 28rem;
    }

/* ── Section header ── */
.section-header {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

/* ── Filter pill ── */
.filter-pill {
    border-radius: .5rem;
    padding: .375rem .75rem;
    font-size: .75rem;
    font-weight: 500;
    transition: all .15s;
    cursor: pointer;
}

    .filter-pill.active {
        background: hsl(var(--primary));
        color: hsl(var(--primary-foreground));
        border-color: hsl(var(--primary));
    }

    .filter-pill.inactive {
        background: hsl(var(--card));
        color: hsl(var(--card-foreground));
        border: 1px solid hsl(var(--border));
    }

        .filter-pill.inactive:hover {
            background: hsl(var(--muted));
        }

/* ── Form label & input used in Master pages ── */
.lbl {
    display: block;
    font-size: .75rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    margin-bottom: .25rem;
}

.inp {
    display: block;
    width: 100%;
    border-radius: .5rem;
    border: 1px solid hsl(var(--input));
    background: hsl(var(--card));
    padding: .5rem .75rem;
    font-size: .875rem;
    color: hsl(var(--foreground));
    outline: none;
}

    .inp:focus {
        border-color: hsl(var(--ring));
        box-shadow: 0 0 0 2px hsl(var(--ring)/.2);
    }

    .inp::placeholder {
        color: hsl(var(--muted-foreground));
    }

/* ── Badge variants (mirror React Badge) ── */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: calc(var(--radius) - 2px);
    padding: .125rem .5rem;
    font-size: .75rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.badge-outline {
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
    background: transparent;
}

.badge-secondary {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

/* ── Ghost icon button ── */
.btn-ghost-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .375rem;
    padding: .375rem;
    background: none;
    border: none;
    cursor: pointer;
    color: hsl(var(--muted-foreground));
    transition: all .15s;
}

    .btn-ghost-icon:hover {
        background: hsl(var(--muted));
    }

    .btn-ghost-icon.danger:hover {
        background: #fee2e2;
        color: #dc2626;
    }

/* ── Thead muted bg ── */
.thead-muted {
    background: hsl(var(--muted)/.5);
}

/* thead fallback if opacity not supported */
.bg-muted-half {
    background: hsl(215 22% 91%);
}

/* ── Tab nav inside scrollable containers — prevent wrapping ── */
.overflow-x-auto > button,
.overflow-x-auto > a {
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Responsive Table Utilities ── */

/* Compact table cells on mobile */
@media (max-width: 767px) {
    .resp-table th,
    .resp-table td {
        padding: .5rem .625rem;
        font-size: .75rem;
    }

    .resp-table th {
        font-size: .6875rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .resp-table th,
    .resp-table td {
        padding: .5rem .75rem;
    }
}

/* ── Mobile & Tablet Responsive ── */

/* Touch-friendly tap targets */
@media (max-width: 640px) {
    /* Scale down h1 on mobile */
    h1 {
        font-size: 1.25rem !important; /* text-xl */
    }

    /* Scale down h2 section headers */
    h2 {
        font-size: 1.125rem !important;
    }

    .sidebar-link {
        padding: .75rem;
        font-size: .8125rem;
    }

    .kpi-card {
        padding: 1rem;
    }


    .filter-pill {
        padding: .5rem .875rem;
        font-size: .8125rem;
    }

    .tab-h {
        padding: .5rem .75rem;
        font-size: .8125rem;
        white-space: nowrap;
    }

    .status-badge {
        font-size: .6875rem;
        padding: .125rem .5rem;
    }

    .section-header {
        font-size: 1rem;
    }

    .btn-primary, .btn-outline, .btn-accent, .btn-destructive {
        padding: .5rem 1rem;
        font-size: .8125rem;
    }

    .input-field, .inp {
        font-size: 1rem; /* Prevent iOS zoom on focus */
    }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1023px) {
    .dialog-box {
        max-width: 90vw;
    }
}

/* Safe area insets for iOS notch/home indicator */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .min-h-screen {
        min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }
}

/* Improve scrollbar for touch devices */
@media (pointer: coarse) {
    ::-webkit-scrollbar {
        width: 3px;
        height: 3px;
    }

    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
}
