/* ============================================================
   VIGIE — Tender Monitor Platform
   Design System — Custom CSS (no framework dependency)
   ============================================================ */

/* ── CSS Custom Properties (Design Tokens) ────────────────── */
:root {
    --color-primary:    #10367A;   /* EDF Navy */
    --color-primary-dark: #0b2555;
    --color-accent:     #3A6BC4;   /* Blue */
    --color-accent-light: #5a8bd4;
    --color-go:         #15803d;   /* Green */
    --color-go-bg:      #dcfce7;
    --color-nogo:       #b91c1c;   /* Red */
    --color-nogo-bg:    #fee2e2;
    --color-review:     #b45309;   /* Amber */
    --color-review-bg:  #fef3c7;
    --color-bg:         #F8F9FC;
    --color-surface:    #FFFFFF;
    --color-border:     #E2E8F0;
    --color-border-dark: #CBD5E1;
    --color-text:       #1A1A2E;
    --color-muted:      #64748B;
    --color-muted-light: #94A3B8;
    --color-danger:     #DC2626;
    --color-warning:    #D97706;
    --color-success:    #16A34A;
    --color-info:       #2563EB;

    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', 'Courier New', monospace;

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);

    --sidebar-width: 240px;
    --topbar-height: 60px;
    --transition: 150ms ease;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-light); text-decoration: underline; }

img { display: block; max-width: 100%; }

ul, ol { list-style: none; }

/* ── Layout Shell ──────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    gap: 16px;
    border-bottom: 1px solid var(--color-border);
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.topbar-logo img {
    height: 32px;
    width: auto;
}

.topbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: .5px;
}

.topbar-spacer { flex: 1; }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-muted);
    font-size: .85rem;
}

.topbar-user-name { font-weight: 600; color: var(--color-text); }
.topbar-user-role {
    font-size: .75rem;
    background: #EEF2FF;
    padding: 2px 8px;
    border-radius: 20px;
    color: var(--color-primary);
}

.topbar-logout {
    background: #F1F5F9;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    font-size: .8rem;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition);
}
.topbar-logout:hover {
    background: #E2E8F0;
    color: var(--color-text);
    text-decoration: none;
}

.app-shell {
    display: flex;
    padding-top: var(--topbar-height);
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    z-index: 90;
    padding: 16px 0;
}

.sidebar-section {
    padding: 8px 0 4px;
}

.sidebar-divider {
    height: 1px;
    background: var(--color-border);
    margin: 8px 16px;
}

.sidebar-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--color-muted-light);
    padding: 6px 20px 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    color: var(--color-muted);
    font-size: .875rem;
    font-weight: 500;
    border-radius: 0;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
    position: relative;
}

.sidebar-link:hover {
    background: var(--color-bg);
    color: var(--color-text);
    text-decoration: none;
}

.sidebar-link.active {
    color: var(--color-primary);
    background: #EFF4FF;
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--color-primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-link svg, .sidebar-link .icon {
    width: 16px; height: 16px;
    opacity: .7;
    flex-shrink: 0;
}
.sidebar-link.active svg, .sidebar-link.active .icon { opacity: 1; }

.sidebar-sub .sidebar-link {
    padding-left: 44px;
    font-size: .82rem;
}

/* ── Main Content ──────────────────────────────────────────── */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 28px 32px;
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    flex: 1;
}

.page-subtitle {
    font-size: .875rem;
    color: var(--color-muted);
    margin-top: 2px;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    flex: 1;
}

.card-body { padding: 20px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
    color: #fff;
    text-decoration: none;
}

.btn-accent {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}
.btn-accent:hover:not(:disabled) {
    background: var(--color-accent-light);
    color: #fff;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-outline:hover:not(:disabled) {
    background: var(--color-primary);
    color: #fff;
    text-decoration: none;
}

.btn-ghost {
    background: transparent;
    color: var(--color-muted);
    border-color: var(--color-border);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--color-bg);
    color: var(--color-text);
    text-decoration: none;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
}
.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    color: #fff;
    text-decoration: none;
}

.btn-success {
    background: var(--color-success);
    color: #fff;
    border-color: var(--color-success);
}

.btn-sm {
    padding: 5px 10px;
    font-size: .8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: var(--radius);
}

.btn-icon {
    padding: 7px;
    border-radius: var(--radius-sm);
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .3px;
}

.badge-go {
    background: var(--color-go-bg);
    color: var(--color-go);
    border: 1px solid #bbf7d0;
}

.badge-nogo {
    background: var(--color-nogo-bg);
    color: var(--color-nogo);
    border: 1px solid #fecaca;
}

.badge-review {
    background: var(--color-review-bg);
    color: var(--color-review);
    border: 1px solid #fde68a;
}

.badge-unknown {
    background: #f1f5f9;
    color: var(--color-muted);
    border: 1px solid var(--color-border);
}

.badge .score {
    font-size: .65rem;
    opacity: .8;
    font-weight: 600;
}

/* Status badges */
.badge-new { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-reviewed { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.badge-interest { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.badge-shortlisted { background: #fdf4ff; color: #9333ea; border: 1px solid #e9d5ff; }
.badge-dismissed { background: #f8fafc; color: var(--color-muted); border: 1px solid var(--color-border); }

/* Score circles */
.score-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: .875rem;
}
.score-high { background: #dcfce7; color: #15803d; }
.score-mid  { background: #fef3c7; color: #b45309; }
.score-low  { background: #fee2e2; color: #b91c1c; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    font-size: .875rem;
}

thead th {
    background: #F8FAFC;
    color: var(--color-muted);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
    color: var(--color-text);
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: #FAFBFF; }

.td-title {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.form-label span.required {
    color: var(--color-danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--color-border-dark);
    border-radius: var(--radius);
    font-size: .875rem;
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(58,107,196,.15);
}
.form-control::placeholder { color: var(--color-muted-light); }
.form-control:disabled { background: var(--color-bg); opacity: .7; cursor: not-allowed; }

textarea.form-control { resize: vertical; min-height: 100px; }

select.form-control { cursor: pointer; appearance: auto; }

.form-hint {
    font-size: .78rem;
    color: var(--color-muted);
    margin-top: 4px;
}

.form-error {
    font-size: .78rem;
    color: var(--color-danger);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Toggle / Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}
.toggle {
    position: relative;
    width: 44px; height: 24px;
    cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--color-border-dark);
    border-radius: 24px;
    transition: background var(--transition);
}
.toggle input:checked + .toggle-track { background: var(--color-accent); }
.toggle-thumb {
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition);
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }

/* ── Alerts / Notifications ─────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: .875rem;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert-error   { background: var(--color-nogo-bg); color: var(--color-nogo); border: 1px solid #fecaca; }
.alert-success { background: var(--color-go-bg); color: var(--color-go); border: 1px solid #bbf7d0; }
.alert-warning { background: var(--color-review-bg); color: var(--color-review); border: 1px solid #fde68a; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px; height: 36px;
    padding: 0 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: .85rem;
    color: var(--color-text);
    text-decoration: none;
    background: var(--color-surface);
    transition: all var(--transition);
}
.page-link:hover { background: var(--color-bg); border-color: var(--color-accent); color: var(--color-accent); text-decoration: none; }
.page-link.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.page-link.disabled { opacity: .4; cursor: default; pointer-events: none; }

/* ── Filters Panel ──────────────────────────────────────────── */
.filters-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 20px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.filter-group label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 5px;
}

.btn-group {
    display: inline-flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.btn-group .btn {
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--color-border);
}
.btn-group .btn:last-child { border-right: none; }
.btn-group .btn.active { background: var(--color-primary); color: #fff; }

/* ── Stats Grid ─────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--color-muted);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}

.stat-sub {
    font-size: .75rem;
    color: var(--color-muted);
    margin-top: 4px;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ── Site Tree ────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap');

.tree-grid {
    display: grid;
    gap: 20px;
}

.tree-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    font-family: 'Space Grotesk', var(--font-family);
}

.tree-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    background: linear-gradient(135deg, #f4f7ff 0%, #ffffff 60%);
    border-bottom: 1px solid var(--color-border);
}

.tree-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
}

.tree-subtitle {
    font-size: .8rem;
    color: var(--color-muted);
    word-break: break-all;
}

.tree-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(80px, 1fr));
    gap: 10px;
}

.tree-stats .stat {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 8px 10px;
    text-align: center;
}

.tree-card-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    padding: 18px 22px 22px;
}

.tree-section-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 10px;
}

.tree-root,
.tree-branch {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tree-branch {
    margin-left: 18px;
    border-left: 1px dashed var(--color-border-dark);
    padding-left: 14px;
}

.tree-node {
    margin-bottom: 8px;
}

.tree-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #f8fafc;
}

.tree-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent);
    flex-shrink: 0;
}

.tree-link {
    color: var(--color-text);
    font-weight: 600;
    font-size: .85rem;
    text-decoration: none;
}

.tree-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tree-toggle {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-muted);
    font-size: .7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--transition), color var(--transition), border var(--transition);
}

.tree-toggle.is-open {
    transform: rotate(90deg);
    color: var(--color-primary);
    border-color: #c7d2fe;
    background: #eef2ff;
}

.tree-toggle-spacer {
    width: 22px;
    height: 22px;
    display: inline-block;
}

.tree-branch[data-collapsed="true"] {
    display: none;
}

.tree-link:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.tree-side {
    display: grid;
    gap: 16px;
}

.tree-panel {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
}

.tree-link-list {
    display: grid;
    gap: 8px;
    font-size: .85rem;
}

.badge-sm {
    font-size: .7rem;
    padding: 2px 6px;
    border-radius: 999px;
}

.badge-muted {
    background: #e2e8f0;
    color: #475569;
}

@media (max-width: 1100px) {
    .tree-card-body {
        grid-template-columns: 1fr;
    }

    .tree-stats {
        grid-template-columns: repeat(2, minmax(80px, 1fr));
    }
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title { font-size: 1.1rem; font-weight: 700; flex: 1; }

.modal-body { padding: 20px 24px; }

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 20px;
}

.tab-link {
    padding: 10px 20px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--color-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
}
.tab-link:hover { color: var(--color-text); text-decoration: none; }
.tab-link.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }

/* ── Detail Page ────────────────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
    align-items: start;
}

.meta-list { display: flex; flex-direction: column; gap: 10px; }
.meta-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.meta-key { font-size: .8rem; color: var(--color-muted); font-weight: 500; white-space: nowrap; }
.meta-value { font-size: .875rem; color: var(--color-text); font-weight: 500; text-align: right; }

/* ── Notes Thread ───────────────────────────────────────────── */
.note {
    padding: 14px;
    border-left: 3px solid var(--color-border);
    margin-bottom: 14px;
    background: var(--color-bg);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.note-meta {
    font-size: .75rem;
    color: var(--color-muted);
    margin-bottom: 6px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.note-author { font-weight: 600; color: var(--color-text); }
.note-body { font-size: .875rem; line-height: 1.6; }

/* ── Login Page ─────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, #1e40af 100%);
    padding: 20px;
}

.login-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo img { height: 52px; width: auto; margin: 0 auto 12px; }

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--color-text);
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: .875rem;
    color: var(--color-muted);
    text-align: center;
    margin-bottom: 28px;
}

/* ── Utility classes ────────────────────────────────────────── */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--color-muted); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.hidden { display: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.rounded { border-radius: var(--radius); }
.border { border: 1px solid var(--color-border); }
.bg-surface { background: var(--color-surface); }

/* Deadline urgency */
.deadline-urgent { color: var(--color-danger); font-weight: 600; }
.deadline-expired { color: var(--color-muted); text-decoration: line-through; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: translateX(0); }
    .content { margin-left: 0; padding: 16px; }
    .topbar { padding: 0 12px; }
    .filters-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    vertical-align: middle;
}
.spinner-dark {
    border-color: rgba(0,0,0,.1);
    border-top-color: var(--color-primary);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-muted);
}
.empty-state svg { width: 48px; height: 48px; opacity: .3; margin: 0 auto 16px; }
.empty-state h3 { font-size: 1.1rem; color: var(--color-text); margin-bottom: 6px; }
.empty-state p { font-size: .875rem; }

/* ── Two-column layout ──────────────────────────────────────── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .two-col, .three-col { grid-template-columns: 1fr; }
}

/* ── Section spacing ────────────────────────────────────────── */
.section { margin-bottom: 28px; }
.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-border);
}
