/* ==========================================================================
   Theme overlay — layers on top of admin.css (which itself layers on top of
   Bootstrap 5), per the brand design system. Overrides tokens + component
   patterns; does not replace the structural classes (.layout, .side, .panel,
   .field, etc.) admin.css already defines.
   ========================================================================== */

:root {
    --brand-primary: #1d2a70;
    --brand-primary-rgb: 29, 42, 112;
    --brand-primary-dark: #131d52;
    --brand-primary-light: rgba(var(--brand-primary-rgb), .08);
    --brand-accent: #4954c7;
    --brand-ink: #10152b;
    --brand-muted: #667085;
    --brand-bg: #f4f6fb;
    --brand-border: #e4e7ec;
    --brand-sidebar-bg: #0d1530;
    --brand-sidebar-bg-2: #10193a;
    --brand-radius: 14px;
    --brand-radius-sm: 10px;
    --brand-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --brand-shadow-md: 0 4px 14px rgba(16, 24, 40, .08);
    --brand-shadow-lg: 0 20px 50px rgba(16, 24, 40, .16);

    /* Re-point admin.css's own tokens at the brand palette so every
       component built from --brand/--bg/--line/--radius-* etc. picks
       this theme up automatically. */
    --bg: var(--brand-bg);
    --line: var(--brand-border);
    --line-strong: #d0d5dd;
    --txt: var(--brand-ink);
    --muted: var(--brand-muted);
    --brand: var(--brand-primary);
    --brand-2: var(--brand-accent);
    --brand-soft: var(--brand-primary-light);
    --brand-ring: rgba(var(--brand-primary-rgb), .15);
    --radius-sm: var(--brand-radius-sm);
    --radius-md: var(--brand-radius-sm);
    --radius-lg: var(--brand-radius);
    --shadow-xs: var(--brand-shadow-sm);
    --shadow-sm: var(--brand-shadow-sm);
    --shadow-md: var(--brand-shadow-md);
}

/* ---------------- Typography ---------------- */
body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: .925rem;
    color: var(--brand-ink);
    background: var(--brand-bg);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--brand-ink);
}

/* ---------------- Buttons ---------------- */
.btn {
    border-radius: 9px;
    font-weight: 600;
    font-size: .875rem;
    transition: all .15s ease;
}

.btn-primary {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    box-shadow: 0 1px 2px rgba(var(--brand-primary-rgb), .24);
}

.btn-primary:hover {
    background: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: var(--brand-ink);
    border-color: var(--brand-border);
}

.btn-secondary:hover {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.btn-danger {
    border-radius: 9px;
    font-weight: 600;
    font-size: .875rem;
}

/* Pill CTA — hero / landing-style buttons (e.g. Sign In). */
.btn-pill {
    border-radius: 999px;
    padding: 15px 24px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.btn-pill .icon-box {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease;
    flex-shrink: 0;
}

.btn-pill:hover .icon-box {
    transform: translateX(2px);
}

/* ---------------- Forms ---------------- */
.field input,
.field textarea,
.field select,
.form-control,
.form-select {
    border-radius: 9px;
    border: 1px solid var(--brand-border);
    transition: box-shadow .15s ease, border-color .15s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), .15);
    outline: none;
}

/* Hero inputs — larger, icon-inset variant used on the login screen. */
.hero-field { position: relative; margin-bottom: 16px; }
.hero-field label {
    display: block;
    text-transform: uppercase;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .06em;
    color: var(--brand-primary);
    margin-bottom: 8px;
}
.hero-field .hero-icon {
    position: absolute;
    left: 18px;
    top: 42px;
    color: var(--brand-muted);
    font-size: 15px;
    pointer-events: none;
}
.hero-field input {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--brand-border);
    padding: 14px 16px 14px 52px;
    font-size: .95rem;
    transition: box-shadow .15s ease, border-color .15s ease;
}
.hero-field input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(var(--brand-primary-rgb), .07);
    outline: none;
}

/* ---------------- Sidebar ---------------- */
.side {
    background: linear-gradient(180deg, var(--brand-sidebar-bg) 0%, var(--brand-sidebar-bg-2) 100%);
    width: 264px;
}

.layout { grid-template-columns: 264px 1fr; }

.side nav a { color: #aeb6d4; }

.side nav a:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
    transform: none;
}

.side nav a.active {
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(var(--brand-primary-rgb), .35);
}

.side nav a.active::before { display: none; }

/* Sidebar scrollbar (light, since it sits on a dark bg). */
.side::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-track { background: transparent; }
.side::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 6px; }
.side::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .32); }

/* ---------------- Topbar ---------------- */
.topbar {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid var(--brand-border);
}

/* ---------------- Stat tiles ---------------- */
.stat-card {
    border-radius: 14px;
    box-shadow: var(--brand-shadow-sm);
}
.stat-card .num, .stat-body .num { font-size: 1.65rem; font-weight: 800; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; }

/* ---------------- Tables ---------------- */
.table thead th,
table.dataTable thead th {
    text-transform: uppercase;
    font-size: .68rem;
    letter-spacing: .05em;
    color: var(--brand-muted);
    font-weight: 700;
    border-bottom-color: var(--brand-border) !important;
}

.table-striped > tbody > tr:hover,
table.dataTable tbody tr:hover {
    background: var(--brand-primary-light) !important;
}

/* ---------------- Badges ---------------- */
.badge {
    font-weight: 600;
    letter-spacing: .01em;
    font-size: .72rem;
}

.badge-ok { background: rgba(22, 163, 74, .12); color: #15803d; }
.badge-warning { background: rgba(217, 119, 6, .12); color: #b45309; }

/* ---------------- Filter dropdown (e.g. "All clients" list filters) ------ */
.filter-select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23667085' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    border: 1px solid var(--brand-border);
    border-radius: 9px;
    padding: 9px 38px 9px 14px;
    font-weight: 600;
    font-size: .875rem;
    color: var(--brand-ink);
    cursor: pointer;
    min-width: 180px;
    transition: box-shadow .15s ease, border-color .15s ease;
}
.filter-select:hover { border-color: #c7cbd6; }
.filter-select:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), .15);
}

/* ---------------- Icon-only row actions (fit on one line) ---------------- */
.action-btns { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
.btn-icon-sq {
    width: 32px; height: 32px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 13px;
}

/* ---------------- Eyebrow badge (small uppercase pill above a headline) --- */
.eyebrow-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    font-weight: 700;
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
}

/* ---------------- Timeline (procedure revision history) ------------------ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
    content: '';
    position: absolute; left: 8px; top: 4px; bottom: 4px;
    width: 2px; background: var(--brand-border);
}
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item::before {
    content: '';
    position: absolute; left: -28px; top: 3px;
    width: 12px; height: 12px; border-radius: 50%;
    background: #cbd5e1; border: 2px solid #fff; box-shadow: 0 0 0 2px #cbd5e1;
}
.timeline-item.is-current::before { background: var(--brand-primary); box-shadow: 0 0 0 2px var(--brand-primary); }
.timeline-item.is-done::before { background: #16a34a; box-shadow: 0 0 0 2px #16a34a; }

/* ---------------- Scrollbars (light surfaces) ----------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d5dd; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #98a2b3; }
