/* ===================================================================
   AkiliLex v0.2 - Pan-African Professional Design System
   =================================================================== */

:root {
    /* ===========================================================
       LIGHT BEIGE PALETTE - body warm, chrome dark
       =========================================================== */

    /* Core palette - navy & gold lineage */
    --navy:         #1a2c4e;
    --navy-light:   #2e4570;
    --navy-darker:  #0f1a30;
    --navy-50:      #eef2f8;
    --navy-100:     #d8e0ed;
    --gold:         #b08d47;
    --gold-light:   #d4b676;
    --gold-pale:    #f7efde;

    /* Pan-African accent layer */
    --terracotta:   #a14b2e;
    --terracotta-pale: #fbeee8;
    --sage:         #5a7a4a;
    --sage-pale:    #eef4eb;
    --ochre:        #c08a30;
    --ochre-pale:   #fdf3e0;
    --indigo:       #2e4a7a;
    --indigo-pale:  #e8eef7;

    /* Slate layer - dark chrome for topbar, sidebar, public header, footer */
    --slate:        #1d2330;
    --slate-light:  #2a3142;
    --slate-line:   #364056;

    /* Neutral system - BEIGE body, white cards */
    --paper:        #ffffff;       /* card surfaces - crisp white for content */
    --cream:        #ebe3d2;       /* deeper beige for hover / raised */
    --cream-light:  #faf6ea;       /* lightest beige - for subtle section variation */
    --bg:           #f8f2e6;       /* MAIN BODY - lighter warm beige */
    --ink:          #1a1a1a;       /* main body text */
    --ink-muted:    #5a5a5a;       /* muted text */
    --ink-faint:    #8a8478;       /* faint text */
    --border:       #ddd0b3;       /* warm beige dividers */
    --border-strong:#c2b48c;       /* stronger beige border for inputs */

    /* Semantic */
    --success:      var(--sage);
    --danger:       var(--terracotta);
    --warning:      var(--ochre);
    --info:         var(--indigo);

    /* Typography */
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-serif: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;

    /* Geometry */
    --radius-sm: 4px;
    --radius:    7px;
    --radius-lg: 10px;
    --radius-xl: 14px;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(26,44,78,0.04);
    --shadow:    0 1px 3px rgba(26,44,78,0.06), 0 1px 2px rgba(26,44,78,0.04);
    --shadow-md: 0 4px 6px rgba(26,44,78,0.05), 0 2px 4px rgba(26,44,78,0.04);
    --shadow-lg: 0 10px 24px rgba(26,44,78,0.08), 0 4px 8px rgba(26,44,78,0.04);
    --shadow-xl: 0 20px 40px rgba(26,44,78,0.10), 0 10px 20px rgba(26,44,78,0.05);

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===========================================================
   BODY BASE
   =========================================================== */
body {
    background: var(--bg);
    color: var(--ink);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1, "liga" 1, "ss01" 1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--navy);
    margin: 0 0 0.4em 0;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.01em;
}
h1 { font-size: 1.55rem; letter-spacing: -0.02em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
h4 { font-size: 0.92rem; font-weight: 600; }

a { color: var(--navy); text-decoration: none; transition: color 0.15s var(--ease-out); }
a:hover { color: var(--gold); }

hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
code { font-family: var(--font-mono); font-size: 0.88em; background: var(--cream); padding: 0.1em 0.3em; border-radius: 3px; }

/* ===== Solid filled icon defaults ===== */
.icon-svg {
    width: 18px; height: 18px;
    fill: currentColor;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
.icon-svg.sm { width: 14px; height: 14px; }
.icon-svg.lg { width: 22px; height: 22px; }
.icon-svg.xl { width: 32px; height: 32px; }

/* ===== Top bar ===== */

.topbar {
    background: linear-gradient(180deg, var(--slate-light) 0%, var(--slate) 100%);
    color: #ffffff;
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    border-bottom: 2px solid var(--gold);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
    height: 76px;
}
.topbar .brand-area {
    display: flex; align-items: center;
    padding: 0 1rem;
    border-right: 1px solid rgba(255,255,255,0.08);
    width: 200px;
}
.topbar .brand-area img {
    height: 54px;
    width: auto;
}
.topbar nav {
    display: flex; gap: 0.1rem; align-items: center;
    flex: 1; min-width: 0;
    padding: 0 1rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;          /* Firefox: hide scrollbar */
}
.topbar nav::-webkit-scrollbar { display: none; }   /* WebKit: hide scrollbar */
.topbar nav a {
    color: rgba(255,255,255,0.78);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 0.3rem;
    transition: all 0.15s var(--ease-out);
}
.topbar nav a:hover { color: #ffffff; background: rgba(255,255,255,0.08); }
.topbar nav a.active { color: #ffffff; background: rgba(176,141,71,0.20); }
.topbar nav a .icon-svg { width: 15px; height: 15px; opacity: 0.85; }

.topbar .right-area {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0 1rem;
}
.topbar .user-chip {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.35rem 0.85rem 0.35rem 0.45rem;
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    font-size: 0.85rem;
    color: #ffffff;
    transition: background 0.15s var(--ease-out);
}
.topbar .user-chip:hover { background: rgba(255,255,255,0.10); color: #ffffff; }
.topbar .user-chip .avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--navy);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    font-family: var(--font-serif);
}
.topbar .signout {
    color: rgba(255,255,255,0.6);
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    display: flex; align-items: center; gap: 0.35rem;
}
.topbar .signout:hover { color: #ffffff; background: rgba(255,255,255,0.08); }

/* ===== Sidebar layout ===== */

.layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    min-height: calc(100vh - 76px);
}
.sidebar {
    background: linear-gradient(180deg, var(--slate) 0%, var(--slate-light) 100%);
    border-right: 1px solid var(--slate-line);
    padding: 0.6rem 0 1rem 0;
    overflow-y: auto;
    color: #d4cfc1;
}
.sidebar-section {
    padding: 0 0.6rem 0.25rem 0.6rem;
    margin-bottom: 0.55rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding-bottom: 0.45rem;
}
.sidebar-section:last-child { border-bottom: none; }
.sidebar-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--gold-light);
    padding: 0 0.5rem 0.25rem 0.5rem;
    margin-bottom: 0.15rem;
    opacity: 0.7;
}
.sidebar a {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.32rem 0.5rem;
    border-radius: var(--radius);
    color: #d4cfc1;
    font-size: 0.79rem;
    font-weight: 500;
    margin-bottom: 1px;
    transition: all 0.12s var(--ease-out);
    position: relative;
}
.sidebar a:hover { background: rgba(255,255,255,0.06); color: #ffffff; }
.sidebar a.active {
    background: linear-gradient(90deg, rgba(212,182,118,0.18) 0%, rgba(212,182,118,0.04) 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--gold);
}
.sidebar a.active::before { display: none; }
.sidebar a .nav-icon {
    width: 22px; height: 22px;
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s var(--ease-out);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.sidebar a .nav-icon .icon-svg { width: 13px; height: 13px; fill: #ffffff; }

/* Each chip is fully filled with brand colour - white icon on top = stunning */
.sidebar a .nav-icon.c-navy      { background: linear-gradient(135deg, #2e4570, #1a2c4e); }
.sidebar a .nav-icon.c-gold      { background: linear-gradient(135deg, #d4b676, #b08d47); }
.sidebar a .nav-icon.c-sage      { background: linear-gradient(135deg, #6d8f5b, #5a7a4a); }
.sidebar a .nav-icon.c-terracotta{ background: linear-gradient(135deg, #b8593a, #a14b2e); }
.sidebar a .nav-icon.c-ochre     { background: linear-gradient(135deg, #d99c3a, #c08a30); }
.sidebar a .nav-icon.c-indigo    { background: linear-gradient(135deg, #426195, #2e4a7a); }
.sidebar a:hover .nav-icon       { transform: scale(1.08) rotate(-2deg); box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.sidebar a.active .nav-icon      {
    background: linear-gradient(135deg, #d4b676, #b08d47);
    box-shadow: 0 2px 8px rgba(176,141,71,0.35);
}
.sidebar a.active .nav-icon .icon-svg { fill: #ffffff; }

.sidebar a .count {
    margin-left: auto;
    background: var(--gold);
    color: var(--paper);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
.sidebar a.active .count { background: var(--gold-light); color: var(--navy); }

/* ===== Main content ===== */

.main {
    padding: 0.75rem 1.2rem 1.5rem;
    max-width: 1500px;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border);
}
.page-header h1 { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.2px; }
.page-header .subtitle { color: var(--ink-muted); font-size: 0.75rem; margin-top: 0.1rem; }
.page-header .actions { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.page-header .breadcrumb {
    font-size: 0.66rem;
    color: var(--ink-faint);
    margin-bottom: 0.2rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.page-header .breadcrumb a { color: var(--ink-faint); }
.page-header .breadcrumb a:hover { color: var(--navy); }

/* ===== Cards ===== */

.card {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem 0.9rem;
    box-shadow: var(--shadow-xs);
    margin-bottom: 0.55rem;
    transition: box-shadow 0.2s var(--ease-out);
}
.card.hover:hover { box-shadow: var(--shadow-md); }
.card-header {
    margin: -0.75rem -0.9rem 0.65rem -0.9rem;
    padding: 0.5rem 0.9rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--cream-light) 0%, var(--paper) 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: -0.1px;
}
.card-header .icon-svg { color: var(--gold); margin-right: 0.45rem; width: 14px; height: 14px; }

/* ===== Stat cards ===== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.65rem;
}
/* Force a fixed 6-column row when six or fewer stat cards present and viewport wide enough */
@media (min-width: 1100px) {
    .stats-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
    .stats-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
    .stats-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.55rem 0.7rem;
    box-shadow: var(--shadow-xs);
    transition: all 0.2s var(--ease-out);
    position: relative;
    overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--gold);
}
.stat-card .stat-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.25rem;
}
.stat-card .label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--ink-faint);
    font-weight: 600;
    line-height: 1.2;
}
.stat-card .stat-icon {
    width: 22px; height: 22px;
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    flex-shrink: 0;
}
.stat-card .stat-icon .icon-svg { width: 13px; height: 13px; fill: #ffffff; }
.stat-card .value {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.stat-card .sub {
    font-size: 0.64rem;
    color: var(--ink-muted);
    margin-top: 0.15rem;
    line-height: 1.3;
}
.stat-card.navy::before       { background: var(--navy); }
.stat-card.navy .stat-icon    { background: linear-gradient(135deg, #2e4570, #1a2c4e); }
.stat-card.gold::before       { background: var(--gold); }
.stat-card.gold .stat-icon    { background: linear-gradient(135deg, #d4b676, #b08d47); }
.stat-card.sage::before       { background: var(--sage); }
.stat-card.sage .stat-icon    { background: linear-gradient(135deg, #6d8f5b, #5a7a4a); }
.stat-card.ochre::before      { background: var(--ochre); }
.stat-card.ochre .stat-icon   { background: linear-gradient(135deg, #d99c3a, #c08a30); }
.stat-card.terracotta::before { background: var(--terracotta); }
.stat-card.terracotta .stat-icon { background: linear-gradient(135deg, #b8593a, #a14b2e); }
.stat-card.indigo::before     { background: var(--indigo); }
.stat-card.indigo .stat-icon  { background: linear-gradient(135deg, #426195, #2e4a7a); }

/* ===== Tables ===== */

table.data {
    width: 100%;
    border-collapse: collapse;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}
table.data th {
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-darker) 100%);
    color: #ffffff;
    text-align: left;
    padding: 0.4rem 0.7rem;
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.65px;
    text-transform: uppercase;
}
table.data td {
    padding: 0.38rem 0.7rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    vertical-align: middle;
    line-height: 1.4;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--cream-light); }

/* ===== Buttons ===== */

.btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.32rem 0.65rem;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s var(--ease-out);
    text-decoration: none;
    line-height: 1.35;
    letter-spacing: 0.1px;
    white-space: nowrap;
}
.btn .icon-svg { width: 12px; height: 12px; }
.btn-sm { padding: 0.22rem 0.5rem; font-size: 0.72rem; }
.btn-sm .icon-svg { width: 11px; height: 11px; }

.btn-primary {
    background: var(--navy); color: #ffffff;
    box-shadow: var(--shadow-xs);
}
.btn-primary:hover { background: var(--navy-darker); color: #ffffff; transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-gold {
    background: linear-gradient(180deg, var(--gold) 0%, #97793b 100%);
    color: #ffffff;
    box-shadow: var(--shadow-xs);
}
.btn-gold:hover { background: linear-gradient(180deg, #c19a55 0%, var(--gold) 100%); color: #ffffff; transform: translateY(-1px); }

.btn-outline {
    background: var(--paper); color: var(--navy);
    border-color: var(--border-strong);
}
.btn-outline:hover { background: var(--cream); border-color: var(--navy); color: var(--navy); }

.btn-success { background: var(--sage); color: #ffffff; }
.btn-success:hover { background: #455c39; color: #ffffff; }
.btn-danger  { background: var(--terracotta); color: #ffffff; }
.btn-danger:hover { background: #823a23; color: #ffffff; }
.btn-link    { background: transparent; color: var(--navy); padding: 0.25rem 0.4rem; }
.btn-link:hover { color: var(--gold); background: var(--cream-light); }
.btn-lg { padding: 0.55rem 1rem; font-size: 0.9rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===== Forms ===== */

.form-group { margin-bottom: 0.55rem; }
.form-row { display: grid; gap: 0.55rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.2rem;
    letter-spacing: 0.2px;
}
.form-group .help {
    display: block;
    font-size: 0.68rem;
    color: var(--ink-muted);
    margin-top: 0.18rem;
}
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=tel], input[type=url],
input[type=search], select, textarea {
    width: 100%;
    padding: 0.32rem 0.55rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    color: var(--ink);
    background: var(--paper);
    transition: all 0.15s var(--ease-out);
    line-height: 1.4;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(176,141,71,0.18);
}
textarea { min-height: 60px; resize: vertical; font-family: var(--font-sans); }
.form-group.required label::after { content: " *"; color: var(--terracotta); }

/* Toggle switch */
.toggle {
    display: inline-flex; align-items: center; gap: 0.6rem;
    cursor: pointer;
    user-select: none;
}
.toggle input { display: none; }
.toggle .track {
    width: 38px; height: 22px;
    background: #d4cfc0;
    border-radius: 11px;
    position: relative;
    transition: background 0.2s var(--ease-out);
}
.toggle .track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: var(--paper);
    border-radius: 50%;
    box-shadow: var(--shadow-xs);
    transition: transform 0.2s var(--ease-spring);
}
.toggle input:checked + .track { background: var(--sage); }
.toggle input:checked + .track::after { transform: translateX(16px); }

/* ===== Badges ===== */

.badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.14rem 0.45rem;
    font-size: 0.64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    background: var(--ink-faint);
    color: #ffffff;
    line-height: 1.3;
}
.badge-secondary { background: #93a0b3; }
.badge-primary   { background: var(--navy); }
.badge-info      { background: var(--info); }
.badge-success   { background: var(--success); }
.badge-warning   { background: var(--warning); }
.badge-danger    { background: var(--danger); }
.badge-dark      { background: var(--navy-darker); }
.badge-light     { background: var(--cream); color: var(--navy); border: 1px solid var(--border); }

/* ===== Flash messages ===== */

.flash {
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.6rem;
    border-left: 4px solid;
    background: var(--paper);
    font-size: 0.85rem;
    display: flex; align-items: center; gap: 0.6rem;
    animation: slideDown 0.25s var(--ease-out);
}
.flash .icon-svg { flex-shrink: 0; }
.flash-success { border-left-color: var(--sage);       background: var(--sage-pale);      color: #2d4523; }
.flash-success .icon-svg { color: var(--sage); }
.flash-error, .flash-danger { border-left-color: var(--terracotta); background: var(--terracotta-pale); color: #5d2613; }
.flash-error .icon-svg, .flash-danger .icon-svg { color: var(--terracotta); }
.flash-warning { border-left-color: var(--ochre);      background: var(--ochre-pale);     color: #6b4a14; }
.flash-warning .icon-svg { color: var(--ochre); }
.flash-info    { border-left-color: var(--indigo);     background: var(--indigo-pale);    color: #1d2f4f; }
.flash-info .icon-svg { color: var(--indigo); }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== Progress bar ===== */

.progress {
    background: var(--border);
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
}
.progress-bar {
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
    height: 100%;
    transition: width 0.5s var(--ease-out);
    border-radius: 999px;
}

/* ===== Empty state ===== */

.empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--ink-muted);
}
.empty-icon {
    width: 48px; height: 48px;
    background: var(--gold-pale);
    color: var(--gold);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 0.6rem;
}
.empty-icon .icon-svg { width: 22px; height: 22px; }
.empty h3 { color: var(--navy); margin-bottom: 0.3rem; font-size: 1rem; }
.empty p { max-width: 460px; margin: 0 auto 0.75rem; font-size: 0.85rem; }

/* ===== Public site ===== */

.public-body {
    background: linear-gradient(180deg, var(--cream-light) 0%, var(--paper) 100%);
}
.public-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.1rem 2rem;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
}
.public-nav img { height: 58px; }
.public-nav .flex { display: flex; gap: 0.5rem; }

.hero {
    padding: 4.5rem 1.5rem 3.5rem 1.5rem;
    text-align: center;
    max-width: 920px;
    margin: 0 auto;
}
.hero .eyebrow {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 3.5px;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 1.25rem;
}
.hero h1 {
    font-size: 2.85rem;
    line-height: 1.1;
    margin-bottom: 1.1rem;
    letter-spacing: -0.025em;
    color: var(--navy);
}
.hero h1 .accent { color: var(--gold); }
.hero p.lead {
    font-size: 1.18rem;
    color: var(--ink-muted);
    margin-bottom: 2rem;
    line-height: 1.55;
}
.hero .actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 3rem 1.5rem;
    max-width: 1140px;
    margin: 0 auto;
}
.feature {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    text-align: left;
    box-shadow: var(--shadow-xs);
    transition: all 0.25s var(--ease-out);
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature .icon-wrap {
    width: 48px; height: 48px;
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
}
.feature .icon-wrap .icon-svg { width: 22px; height: 22px; stroke-width: 1.8; }
.feature.c-gold .icon-wrap       { background: var(--gold-pale);     color: var(--gold); }
.feature.c-sage .icon-wrap       { background: var(--sage-pale);     color: var(--sage); }
.feature.c-ochre .icon-wrap      { background: var(--ochre-pale);    color: var(--ochre); }
.feature.c-indigo .icon-wrap     { background: var(--indigo-pale);   color: var(--indigo); }
.feature.c-terracotta .icon-wrap { background: var(--terracotta-pale);color: var(--terracotta); }
.feature.c-navy .icon-wrap       { background: var(--navy-50);       color: var(--navy); }
.feature h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature p { color: var(--ink-muted); margin: 0; font-size: 0.92rem; line-height: 1.55; }

.public-footer {
    background: var(--navy);
    color: rgba(255,255,255,0.7);
    padding: 2.5rem 1.5rem;
    text-align: center;
    font-size: 0.88rem;
    margin-top: 4rem;
}
.public-footer img { height: 38px; margin-bottom: 1rem; }
.public-footer a { color: var(--gold-light); }

/* ===== Auth pages ===== */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at 20% 20%, rgba(176,141,71,0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(26,44,78,0.05) 0%, transparent 50%),
        var(--cream-light);
}
.auth-card {
    background: var(--paper);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 50px rgba(26,44,78,0.10), 0 8px 16px rgba(26,44,78,0.04);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem 2.25rem 2rem;
    border-top: 4px solid var(--gold);
}
.auth-card .logo-area {
    text-align: center;
    margin-bottom: 0.5rem;
}
.auth-card .logo-area img { height: 64px; }
.auth-card .tagline {
    text-align: center;
    color: var(--ink-faint);
    font-size: 0.78rem;
    margin-bottom: 2rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.auth-card h2 { text-align: center; margin-bottom: 1.5rem; font-size: 1.2rem; }
.auth-card .footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--ink-muted);
}

/* ===== Brief detail ===== */

.brief-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 900px) { .brief-detail-grid { grid-template-columns: 1fr; } }

.timeline {
    list-style: none;
    margin: 0; padding: 0;
    border-left: 2px solid var(--border);
    margin-left: 8px;
}
.timeline li {
    padding: 0.5rem 0 0.75rem 1.25rem;
    position: relative;
    font-size: 0.9rem;
}
.timeline li::before {
    content: '';
    position: absolute;
    left: -7px; top: 0.85rem;
    width: 12px; height: 12px;
    background: var(--gold);
    border: 2px solid var(--paper);
    border-radius: 50%;
}
.timeline .when { color: var(--ink-muted); font-size: 0.78rem; margin-top: 2px; }
.timeline .who  { font-weight: 600; color: var(--navy); }

.kv-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.6rem 1rem;
    font-size: 0.92rem;
}
.kv-grid dt { color: var(--ink-faint); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.kv-grid dd { margin: 0; color: var(--ink); }

/* ===== Settings page tabs ===== */

.settings-tabs {
    display: flex;
    gap: 0.15rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.65rem;
    overflow-x: auto;
}
.settings-tabs a {
    padding: 0.4rem 0.75rem;
    color: var(--ink-muted);
    font-size: 0.78rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.15s var(--ease-out);
    display: flex; align-items: center; gap: 0.35rem;
    white-space: nowrap;
}
.settings-tabs a:hover { color: var(--navy); }
.settings-tabs a.active { color: var(--navy); border-bottom-color: var(--gold); font-weight: 600; }
.settings-tabs a .icon-svg { width: 13px; height: 13px; }

/* ===== Utilities ===== */

/* ===== Impersonation banner ===== */
.impersonation-banner {
    background: linear-gradient(180deg, #c08a30 0%, #a07020 100%);
    color: #ffffff;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.12);
    position: sticky;
    top: 0;
    z-index: 60;
    border-bottom: 2px solid #7a5510;
}
.impersonation-banner .ib-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.impersonation-banner .ib-left .icon-svg { fill: #ffffff; width: 18px; height: 18px; }
.impersonation-banner .ib-sub {
    font-size: 0.72rem;
    opacity: 0.85;
    margin-left: 0.5rem;
    padding-left: 0.8rem;
    border-left: 1px solid rgba(255,255,255,0.3);
}
.impersonation-banner .ib-exit {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: background 0.15s;
}
.impersonation-banner .ib-exit:hover { background: rgba(255,255,255,0.25); color: #ffffff; }
.impersonation-banner .ib-exit .icon-svg { fill: #ffffff; }
.impersonation-banner + .topbar { top: 38px; }
.text-muted { color: var(--ink-muted); }
.text-faint { color: var(--ink-faint); }
.text-small { font-size: 0.85rem; }
.text-xs    { font-size: 0.78rem; }
.text-right { text-align: right; }
.text-center{ text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.between { justify-content: space-between; }
.center { align-items: center; }
.wrap { flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.bold { font-weight: 600; }
.serif { font-family: var(--font-serif); }
.uppercase { text-transform: uppercase; letter-spacing: 1px; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { border-right: none; border-bottom: 1px solid var(--border); padding: 1rem 0; }
    .topbar { padding: 0; height: auto; flex-wrap: wrap; }
    .topbar .brand-area { width: auto; padding: 0.75rem 1rem; }
    .topbar nav { padding: 0.4rem 0.75rem; flex-wrap: nowrap; overflow-x: auto; }
    .main { padding: 1.25rem 1rem; }
    .hero h1 { font-size: 2rem; }
    .auth-card { padding: 2rem 1.5rem; }
}

/* ===========================================================
   PRINT MODE - hide chrome (topbar, sidebar, action bars)
   so physical documents print clean
   =========================================================== */
@media print {
    body { background: #ffffff !important; }
    .topbar, .sidebar, .actions-bar, .impersonation-banner { display: none !important; }
    .main { padding: 0 !important; max-width: 100% !important; }
    .card, table.data { box-shadow: none !important; }
}

/* ===========================================================
   MOBILE / TABLET RESPONSIVE - hamburger menu, sidebar drawer,
   table overflow, form stacking
   =========================================================== */

/* ===== HAMBURGER BUTTON ===== */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 0;
    width: 38px;
    height: 38px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s var(--ease-out);
    flex-shrink: 0;
}
.mobile-menu-toggle .hamburger-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.25s var(--ease-out);
    transform-origin: center;
}
.mobile-menu-toggle.is-active .hamburger-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.mobile-menu-toggle.is-active .hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.mobile-menu-toggle.is-active .hamburger-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}
.mobile-menu-toggle:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--gold-light);
}

/* ===== SIDEBAR BACKDROP ===== */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease-out), visibility 0.25s;
    z-index: 998;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.sidebar-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ===== TABLET: <= 1024px ===== */
@media (max-width: 1024px) {
    .main { padding: 0.65rem 1rem 1.5rem; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
    .form-row { grid-template-columns: 1fr 1fr; }
}

/* ===== MOBILE: <= 900px ===== */
@media (max-width: 900px) {
    /* Show hamburger */
    .mobile-menu-toggle {
        display: inline-flex;
        margin-right: 0.6rem;
    }

    /* Topbar reflows */
    .topbar {
        padding: 0;
        gap: 0;
    }
    .topbar .brand-area {
        flex: 1;
        padding-left: 0;
    }
    .topbar .brand-area img { height: 28px; }
    .topbar nav { display: none; }
    .topbar .right-area { padding-right: 0.5rem; gap: 0.4rem; }
    .topbar .user-chip span { display: none; }
    .topbar .signout .icon-svg { width: 18px; height: 18px; }

    /* Sidebar becomes a drawer */
    .layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px;
        max-width: 80vw;
        transform: translateX(-100%);
        transition: transform 0.28s var(--ease-out);
        z-index: 999;
        box-shadow: 4px 0 20px rgba(0,0,0,0.25);
        overflow-y: auto;
        padding-top: 1rem;
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar a { padding: 0.65rem 1rem; font-size: 0.9rem; }

    body.sidebar-mobile-open { overflow: hidden; }

    .main {
        padding: 0.65rem 0.85rem 1.5rem;
    }

    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
    .form-row { grid-template-columns: 1fr; gap: 0.55rem; }

    /* Headings tighten */
    .page-header h1 { font-size: 1.15rem; }
    .page-header { padding-bottom: 0.4rem; margin-bottom: 0.5rem; }
    .page-header .actions { width: 100%; }
    .page-header .actions .btn { font-size: 0.75rem; padding: 0.3rem 0.55rem; }
}

/* ===== SMALL MOBILE: <= 600px ===== */
@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
    .main { padding: 0.5rem 0.65rem 1.2rem; }
    .card { padding: 0.65rem 0.75rem; }
    .card-header { padding: 0.45rem 0.75rem; font-size: 0.78rem; margin: -0.65rem -0.75rem 0.55rem -0.75rem; }
    .settings-tabs a { padding: 0.35rem 0.55rem; font-size: 0.72rem; }
    .btn { font-size: 0.78rem; padding: 0.28rem 0.55rem; }
    .btn-lg { font-size: 0.85rem; padding: 0.55rem 1rem; }
}

/* ===== TABLE HORIZONTAL SCROLL on mobile ===== */
@media (max-width: 900px) {
    .table-scroll, .card > table.data, table.data {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    table.data {
        min-width: 540px;
    }
    table.data th, table.data td {
        white-space: nowrap;
    }
}

/* ===== IMPERSONATION BANNER on mobile ===== */
@media (max-width: 768px) {
    .impersonation-banner {
        font-size: 0.72rem;
        padding: 0.4rem 0.6rem;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
}

/* ===========================================================
   HELP / TUTORIAL PAGES
   =========================================================== */

.help-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-darker) 100%);
    color: #ffffff;
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
}
.help-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 0%, rgba(176,141,71,0.20) 0%, transparent 50%);
}
.help-hero > * { position: relative; z-index: 1; }
.help-hero .eyebrow {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 0.5rem;
    display: inline-block;
}
.help-hero h1 { color: #ffffff; font-size: 1.6rem; font-weight: 700; margin: 0 0 0.5rem 0; letter-spacing: -0.5px; }
.help-hero p { color: #d4cfc1; margin: 0; max-width: 640px; font-size: 0.92rem; line-height: 1.55; }
.help-hero .reading-time {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.72rem;
    background: rgba(255,255,255,0.10);
    padding: 0.3rem 0.65rem;
    border-radius: 12px;
    margin-top: 0.75rem;
    color: #e6e2d8;
}

.help-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 900px) {
    .help-grid { grid-template-columns: 1fr; }
}

.help-toc {
    position: sticky;
    top: 1rem;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}
.help-toc .toc-title {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 0.55rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.help-toc ol {
    list-style: none;
    counter-reset: tocstep;
    padding: 0;
    margin: 0;
}
.help-toc ol li { counter-increment: tocstep; }
.help-toc ol li a {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.32rem 0.4rem;
    border-radius: 4px;
    color: var(--ink);
    font-size: 0.78rem;
    line-height: 1.35;
    border-left: 2px solid transparent;
    transition: all 0.12s var(--ease-out);
    margin-bottom: 1px;
}
.help-toc ol li a:hover {
    background: var(--cream-light);
    border-left-color: var(--gold);
    color: var(--navy);
}
.help-toc ol li a::before {
    content: counter(tocstep, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--gold);
    flex-shrink: 0;
    margin-top: 1px;
    font-weight: 600;
}
@media (max-width: 900px) {
    .help-toc { position: relative; top: 0; max-height: none; }
}

.help-content { min-width: 0; }
.help-lesson {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.1rem;
    scroll-margin-top: 1rem;
}
.help-lesson .lesson-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.help-lesson h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--navy);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.3px;
}
.help-lesson .lesson-intro {
    color: var(--ink-muted);
    margin: 0 0 1.1rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
}
.help-lesson h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navy);
    margin: 1.2rem 0 0.5rem 0;
}
.help-lesson p { margin: 0 0 0.7rem 0; font-size: 0.88rem; line-height: 1.6; color: var(--ink); }
.help-lesson p:last-child { margin-bottom: 0; }
.help-lesson strong { color: var(--navy-darker); font-weight: 600; }
.help-lesson ul:not(.help-steps) { padding-left: 1.2rem; margin: 0 0 0.85rem 0; }
.help-lesson ul:not(.help-steps) li { margin-bottom: 0.3rem; font-size: 0.88rem; line-height: 1.55; }

/* Numbered step list with icons */
.help-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    counter-reset: helpstep;
}
.help-steps > li {
    counter-increment: helpstep;
    display: flex;
    gap: 0.85rem;
    padding: 0.6rem 0.75rem 0.6rem 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 0.45rem;
    background: var(--cream-light);
    border-left: 3px solid var(--gold);
}
.help-steps > li > .step-num {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--navy);
    color: #ffffff;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
}
.help-steps > li > .step-num::before { content: counter(helpstep, decimal-leading-zero); }
.help-steps > li > .step-body { flex: 1; min-width: 0; }
.help-steps > li > .step-body h4 {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 0 0 0.2rem 0;
    color: var(--navy-darker);
}
.help-steps > li > .step-body p {
    margin: 0;
    font-size: 0.83rem;
    line-height: 1.55;
    color: var(--ink);
}
.help-steps > li > .step-body p + p { margin-top: 0.3rem; }

/* Inline keyboard-like buttons in instructions */
.help-content kbd, .help-lesson kbd {
    display: inline-block;
    padding: 1px 6px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: var(--navy);
    color: #ffffff;
    border-radius: 3px;
    border: 1px solid var(--navy-darker);
    margin: 0 1px;
    line-height: 1.4;
    font-weight: 500;
}
.help-content kbd.gold, .help-lesson kbd.gold {
    background: var(--gold);
    border-color: #8b6d33;
}
.help-content code, .help-lesson code {
    background: var(--paper);
    border: 1px solid var(--border);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--navy);
}

/* Tips / warnings / callouts inside lessons */
.help-callout {
    display: flex;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius);
    margin: 0.85rem 0;
    align-items: flex-start;
}
.help-callout .callout-icon {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.help-callout .callout-icon .icon-svg { width: 12px; height: 12px; color: #ffffff; }
.help-callout .callout-body { flex: 1; font-size: 0.83rem; line-height: 1.55; }
.help-callout .callout-body p { font-size: 0.83rem; margin: 0; }
.help-callout strong { color: inherit; }

.help-callout.tip { background: var(--sage-pale); border-left: 3px solid var(--sage); }
.help-callout.tip .callout-icon { background: var(--sage); }
.help-callout.tip strong { color: #2d4523; }

.help-callout.warn { background: var(--ochre-pale); border-left: 3px solid var(--ochre); }
.help-callout.warn .callout-icon { background: var(--ochre); }
.help-callout.warn strong { color: #6b4a14; }

.help-callout.danger { background: var(--terracotta-pale); border-left: 3px solid var(--terracotta); }
.help-callout.danger .callout-icon { background: var(--terracotta); }
.help-callout.danger strong { color: #5d2613; }

.help-callout.info { background: var(--indigo-pale); border-left: 3px solid var(--indigo); }
.help-callout.info .callout-icon { background: var(--indigo); }
.help-callout.info strong { color: #1d2f4f; }

/* Section nav hint at bottom of each lesson */
.help-next {
    margin-top: 1.1rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--ink-muted);
}
.help-next a {
    color: var(--navy);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.help-next a:hover { color: var(--gold); }


/* ===========================================================
   Trial countdown + continuation-conditions banner
   =========================================================== */
.trial-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius, 8px);
    background: var(--paper, #fff);
}
.trial-banner .tb-main { display: flex; align-items: center; gap: 0.7rem; min-width: 260px; flex: 1; }
.trial-banner .tb-icon { display: inline-flex; flex-shrink: 0; }
.trial-banner .tb-icon svg { width: 22px; height: 22px; }
.trial-banner .tb-text { display: flex; flex-direction: column; gap: 0.1rem; }
.trial-banner .tb-text strong { font-size: 0.95rem; color: var(--ink); }
.trial-banner .tb-sub { font-size: 0.78rem; color: var(--ink-muted); line-height: 1.4; }
.trial-banner .tb-conditions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.trial-banner .tb-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    white-space: nowrap;
    border: 1px solid var(--border);
    background: var(--cream-light, #faf7f0);
    color: var(--ink-muted);
}
.trial-banner .tb-chip svg { width: 14px; height: 14px; }
.trial-banner .tb-chip.ok { background: var(--sage-pale, #e8f0e6); color: #2f6b3a; border-color: transparent; }
.trial-banner .tb-chip.pending { background: var(--ochre-pale, #f6ecd8); color: #8a5a12; border-color: transparent; }

/* Variants */
.trial-banner.tb-warn   { border-left-color: var(--gold, #b08d47); }
.trial-banner.tb-danger { border-left-color: var(--danger, #c0392b); background: #fdf3f2; }
.trial-banner.tb-ok     { border-left-color: var(--sage, #6b8f5e); }

@media (max-width: 640px) {
    .trial-banner { flex-direction: column; align-items: flex-start; }
    .trial-banner .tb-conditions { width: 100%; }
}
