@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: 220 20% 97%;
    --foreground: 220 40% 10%;
    --card: 0 0% 100%;
    --card-foreground: 220 40% 10%;
    --popover: 0 0% 100%;
    --popover-foreground: 220 40% 10%;
    --primary: 220 60% 18%;
    --primary-foreground: 210 40% 98%;
    --secondary: 215 25% 92%;
    --secondary-foreground: 220 40% 15%;
    --muted: 215 20% 94%;
    --muted-foreground: 215 15% 50%;
    --accent: 175 55% 38%;
    --accent-foreground: 0 0% 100%;
    --destructive: 0 72% 51%;
    --destructive-foreground: 0 0% 100%;
    --border: 215 20% 88%;
    --input: 215 20% 88%;
    --ring: 220 60% 18%;
    --radius: 0.5rem;
    --warning: 38 92% 50%;
    --success: 170 55% 40%;
    --info: 210 80% 55%;
    --sidebar-background: 220 55% 12%;
    --sidebar-foreground: 215 20% 80%;
    --sidebar-primary: 175 55% 50%;
    --sidebar-primary-foreground: 220 55% 10%;
    --sidebar-accent: 220 50% 18%;
    --sidebar-accent-foreground: 210 40% 95%;
    --sidebar-border: 220 45% 20%;
    --sidebar-muted: 220 30% 30%;
    --kpi-gradient-1: linear-gradient(135deg, hsl(220 60% 18%), hsl(220 55% 28%));
    --kpi-gradient-2: linear-gradient(135deg, hsl(175 55% 35%), hsl(175 55% 45%));
    --kpi-gradient-3: linear-gradient(135deg, hsl(38 92% 45%), hsl(38 92% 55%));
    --kpi-gradient-4: linear-gradient(135deg, hsl(210 80% 50%), hsl(210 80% 60%));
}

/* ── 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: #92400e;
}

.status-accepted {
    background: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.status-revision {
    background: #ede9fe;
    color: #5b21b6;
}

.status-screening {
    background: #f1f5f9;
    color: #475569;
}

.status-production {
    background: #cffafe;
    color: #155e75;
}

.status-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-warning {
    background: #fef9c3;
    color: #854d0e;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

.status-success {
    background: #d1fae5;
    color: #065f46;
}

/* ── 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: 1rem;
    animation: fadeIn .15s ease-out;
}

.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;
}

/* ── 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%); }
