/* ==========================================================================
   BBI Complaint Portal — visual system
   Layered over Bootstrap 5.3. Restyles only; no class is renamed or removed,
   so every existing template keeps working.
   ========================================================================== */

:root {
    /* --- ink: near-black carrying a violet bias, so greys feel chosen ----- */
    --ink:        #150f24;
    --ink-2:      #575070;
    --ink-3:      #8b84a0;
    --on-dark:    #f4f1fb;
    --on-dark-2:  #b9aee0;

    /* --- surfaces -------------------------------------------------------- */
    --canvas:     #f5f3fa;
    --surface:    #ffffff;
    --surface-2:  #faf8ff;
    --line:       #e8e3f4;
    --line-strong:#d9d2ec;

    /* --- brand ----------------------------------------------------------- */
    --brand:        #6220d0;
    --brand-ink:    #4c1494;
    --brand-bright: #8b45e8;
    --brand-soft:   #f1eafe;
    --command:      #1b1130;   /* the top bar */
    --command-2:    #271a45;

    /* --- semantic (kept distinct from brand so state never reads as accent) */
    --ok:        #12864a;
    --ok-soft:   #dcf5e7;
    --warn:      #b45309;
    --warn-soft: #fdefd3;
    --crit:      #c62b3f;
    --crit-soft: #fde7ea;
    --info:      #1d4ed8;
    --info-soft: #e2e9ff;
    --idle:      #64748b;
    --idle-soft: #eef1f5;

    --radius:    12px;
    --radius-lg: 16px;
    --shadow-1:  0 1px 2px rgba(21, 15, 36, .06), 0 1px 3px rgba(21, 15, 36, .04);
    --shadow-2:  0 4px 16px -6px rgba(76, 20, 148, .18), 0 1px 3px rgba(21, 15, 36, .05);

    /* legacy names still referenced by existing templates */
    --brand-primary:       var(--brand);
    --brand-primary-hover: var(--brand-ink);
    --brand-primary-light: var(--brand-bright);
    --text-primary:   var(--ink);
    --text-secondary: var(--ink-2);
    --text-muted:     var(--ink-3);
    --gridline:       var(--line);
    --surface-1:      var(--surface);
    --page-plane:     var(--canvas);
    --status-good:     var(--ok);
    --status-warning:  var(--warn);
    --status-critical: var(--crit);
    --status-hold:     var(--idle);
    --status-cancelled:#475569;
    --series-blue:   #2a78d6;
    --series-aqua:   #12a594;
    --series-yellow: #eda100;
    --series-green:  #12864a;
    --series-violet: var(--brand-bright);
    --series-red:    #e34948;
}

/* ==========================================================================
   base
   ========================================================================== */
body {
    background: var(--canvas);
    color: var(--ink);
    font-feature-settings: "cv02", "cv03", "cv04";
    -webkit-font-smoothing: antialiased;
}

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

/* Figures line up in columns wherever they are compared. */
td, th, .stat-value, .metric, .tabnum { font-variant-numeric: tabular-nums; }

a { text-decoration: none; }

::selection { background: var(--brand-soft); color: var(--brand-ink); }

:focus-visible {
    outline: 2px solid var(--brand-bright);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ==========================================================================
   command bar — dark, anchored, with a real active state
   ========================================================================== */
.app-navbar {
    background: linear-gradient(180deg, var(--command-2), var(--command));
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    box-shadow: 0 1px 0 rgba(21, 15, 36, .5), 0 8px 24px -18px rgba(21, 15, 36, .9);
    padding-top: .35rem;
    padding-bottom: .35rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-navbar .navbar-brand { display: flex; align-items: center; gap: .7rem; padding-block: .3rem; }
.app-navbar .navbar-brand img {
    height: 34px; width: auto; display: block;
    /* the mark is violet-on-transparent; render it white on the dark bar */
    filter: brightness(0) invert(1);
    opacity: .96;
}
.app-navbar .brand-divider { width: 1px; height: 24px; background: rgba(255,255,255,.18); }
.app-navbar .brand-app-name {
    color: var(--on-dark); font-weight: 640; font-size: .95rem; letter-spacing: -.01em;
}

.app-navbar .navbar-nav { gap: .12rem; align-items: center; }

.app-navbar .nav-link {
    color: var(--on-dark-2);
    font-weight: 550;
    font-size: .875rem;
    padding: .5rem .8rem;
    border-radius: 9px;
    position: relative;
    transition: color .13s ease, background-color .13s ease;
}
.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus { color: #fff; background: rgba(255,255,255,.08); }

/* the missing piece: you can now see which section you are in */
.app-navbar .nav-link.is-active { color: #fff; background: rgba(255,255,255,.11); }
.app-navbar .nav-link.is-active::after {
    content: "";
    position: absolute; left: .8rem; right: .8rem; bottom: -.36rem;
    height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--brand-bright), #d8b4fe);
}

.app-navbar .dropdown-menu {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    padding: .35rem;
    margin-top: .4rem;
}
.app-navbar .dropdown-item { border-radius: 8px; font-size: .875rem; font-weight: 500; padding: .5rem .7rem; }
.app-navbar .dropdown-item:hover { background: var(--brand-soft); color: var(--brand-ink); }

.app-navbar .navbar-text { color: var(--on-dark-2); font-size: .85rem; }
.app-navbar .navbar-text strong { color: #fff; font-weight: 600; }

.app-navbar .navbar-toggler {
    border-color: rgba(255,255,255,.22);
    padding: .3rem .55rem;
}
.app-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* user chip in the bar */
.badge-brand-soft {
    background: rgba(168, 85, 247, .22);
    color: #e9d5ff;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: capitalize;
    border: 1px solid rgba(216, 180, 254, .25);
}

/* ==========================================================================
   buttons
   ========================================================================== */
.btn { font-weight: 570; border-radius: 10px; letter-spacing: -.005em; }
.btn-sm { border-radius: 8px; font-size: .8125rem; }

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-ink);
    --bs-btn-hover-border-color: var(--brand-ink);
    --bs-btn-active-bg: var(--brand-ink);
    --bs-btn-active-border-color: var(--brand-ink);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: 139, 69, 232;
    box-shadow: 0 1px 2px rgba(76,20,148,.24);
}
.btn-primary:hover { box-shadow: 0 4px 12px -4px rgba(98,32,208,.45); }

.btn-outline-brand {
    color: var(--brand); border: 1px solid var(--line-strong); background: var(--surface);
    font-weight: 570;
}
.btn-outline-brand:hover, .btn-outline-brand:focus {
    color: #fff; background: var(--brand); border-color: var(--brand);
}
/* the logout button sits on the dark bar */
.app-navbar .btn-outline-brand {
    color: var(--on-dark-2); background: transparent; border-color: rgba(255,255,255,.22);
}
.app-navbar .btn-outline-brand:hover {
    color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4);
}

.btn-outline-secondary { border-color: var(--line-strong); color: var(--ink-2); }
.btn-outline-secondary:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ==========================================================================
   cards & page furniture
   ========================================================================== */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    background: var(--surface);
}

/* page title band — gives every screen a consistent header */
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    margin: .25rem 0 1.1rem;
}
.page-head h1, .page-head h2, .page-head h3, .page-head h4 {
    margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -.025em;
}
.page-head .page-sub { color: var(--ink-3); font-size: .85rem; margin-top: .15rem; }

.section-label, .chart-card h6 {
    color: var(--ink-3); font-weight: 700; text-transform: uppercase;
    font-size: .7rem; letter-spacing: .07em;
}

/* ==========================================================================
   stat tiles
   ========================================================================== */
.stat-tile {
    position: relative; overflow: hidden;
    border-radius: var(--radius-lg);
}
.stat-tile .stat-label {
    color: var(--ink-3); font-size: .7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em;
}
.stat-tile .stat-value {
    font-weight: 720; font-size: 2rem; line-height: 1.15;
    letter-spacing: -.035em; color: var(--ink);
}

/* ==========================================================================
   KPI tiles — colour carries the meaning, so the state of the day reads
   before any number is parsed: red needs action, amber is moving, green is
   done, violet is a performance figure.
   ========================================================================== */
.kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .7rem;
    margin-bottom: 1rem;
}
@media (max-width: 767.98px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.kpi {
    position: relative; overflow: hidden;
    border-radius: 13px; padding: .8rem .95rem; color: #fff; border: 0;
    box-shadow: 0 6px 18px -8px rgba(21, 15, 36, .4), inset 0 1px 0 rgba(255, 255, 255, .22);
    text-decoration: none; display: block;
}
a.kpi:hover { color: #fff; filter: brightness(1.06); }
.kpi::after {
    content: ""; position: absolute; right: -26px; top: -34px;
    width: 92px; height: 92px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.30), transparent 68%);
}
.kpi-open { background: linear-gradient(135deg, #f0526b 0%, #c62b3f 55%, #9d0f26 100%); }
.kpi-prog { background: linear-gradient(135deg, #fbbf3c 0%, #ef8b0d 55%, #c2620a 100%); }
.kpi-done { background: linear-gradient(135deg, #34d98a 0%, #12a15c 55%, #0a7440 100%); }
.kpi-perf { background: linear-gradient(135deg, #a855f7 0%, #6220d0 55%, #4a1194 100%); }
.kpi-info { background: linear-gradient(135deg, #60a5fa 0%, #2563eb 55%, #1a3fa8 100%); }
.kpi-idle { background: linear-gradient(135deg, #94a3b8 0%, #64748b 55%, #47546a 100%); }

.kpi .kpi-label {
    position: relative; font-size: .6rem; font-weight: 780; letter-spacing: .09em;
    text-transform: uppercase; color: rgba(255, 255, 255, .86);
}
.kpi .kpi-value {
    position: relative; font-size: 1.5rem; font-weight: 760; letter-spacing: -.035em;
    margin-top: .15rem; line-height: 1.15; text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.kpi .kpi-value small { font-size: .72rem; font-weight: 600; color: rgba(255,255,255,.8); letter-spacing: 0; }
.kpi .kpi-note { position: relative; font-size: .655rem; color: rgba(255,255,255,.82); margin-top: .12rem; font-weight: 550; }

/* ==========================================================================
   ticket age — the audit found a complaint open 22 days that nothing surfaced
   ========================================================================== */
.age { font-size: .74rem; font-weight: 680; white-space: nowrap; }
.age-hot  { color: var(--crit); }
.age-warm { color: var(--warn); }
.age-cool { color: var(--ink-3); }

/* ==========================================================================
   tables — denser, scannable, with a clear row target
   ========================================================================== */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead > tr > th {
    background: var(--surface-2);
    color: var(--ink-3);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--line);
    padding: .7rem .85rem;
    white-space: nowrap;
}
.table > tbody > tr > td {
    padding: .78rem .85rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    font-size: .875rem;
    color: var(--ink);
}
.table > tbody > tr:last-child > td { border-bottom: 0; }
.table > tbody > tr[onclick] { cursor: pointer; transition: background-color .1s ease; }
.table > tbody > tr[onclick]:hover { background: var(--brand-soft); }

/* the table inside a card should meet its edges cleanly */
.card > .table-responsive:first-child > .table > thead > tr > th:first-child,
.card > .table > thead > tr > th:first-child { border-top-left-radius: var(--radius-lg); }
.card > .table-responsive, .card > .table { border-radius: var(--radius-lg); overflow: hidden; }

/* ==========================================================================
   status badges — colour + icon + text (never colour alone)
   ========================================================================== */
.status-badge {
    display: inline-flex; align-items: center; gap: .35rem;
    font-weight: 650; font-size: .74rem; letter-spacing: .01em;
    padding: .32em .68em; border-radius: 999px;
    border: 1px solid transparent; white-space: nowrap;
}
.status-badge-Open        { background: var(--crit-soft);  color: var(--crit);  border-color: rgba(198,43,63,.18); }
.status-badge-In-Progress { background: var(--warn-soft);  color: var(--warn);  border-color: rgba(180,83,9,.18); }
.status-badge-Resolved    { background: var(--ok-soft);    color: var(--ok);    border-color: rgba(18,134,74,.18); }
.status-badge-Pending     { background: var(--crit-soft);  color: var(--crit);  border-color: rgba(198,43,63,.18); }
.status-badge-Completed   { background: var(--ok-soft);    color: var(--ok);    border-color: rgba(18,134,74,.18); }
.status-badge-Hold        { background: var(--idle-soft);  color: var(--idle);  border-color: rgba(100,116,139,.2); }
.status-badge-Cancelled   { background: #e2e8f0;           color: #475569;      border-color: rgba(71,85,105,.2); }
.status-badge-Converted   { background: var(--brand-soft); color: var(--brand-ink); border-color: rgba(98,32,208,.18); }

/* ==========================================================================
   forms
   ========================================================================== */
.form-label { font-weight: 620; font-size: .82rem; color: var(--ink); margin-bottom: .35rem; }
.form-control, .form-select {
    border-color: var(--line-strong);
    border-radius: 10px;
    padding: .55rem .75rem;
    font-size: .9rem;
    color: var(--ink);
    background-color: var(--surface);
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-bright);
    box-shadow: 0 0 0 3.5px rgba(139, 69, 232, .16);
}
.form-control::placeholder { color: var(--ink-3); }
.form-text { color: var(--ink-3); font-size: .78rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: var(--brand-bright); box-shadow: 0 0 0 3px rgba(139,69,232,.16); }

/* ==========================================================================
   alerts & modals
   ========================================================================== */
.alert { border: 1px solid transparent; border-radius: var(--radius); font-size: .88rem; box-shadow: var(--shadow-1); }
.alert-success { background: var(--ok-soft);   color: #0b6136; border-color: rgba(18,134,74,.2); }
.alert-danger  { background: var(--crit-soft); color: #94162a; border-color: rgba(198,43,63,.2); }
.alert-warning { background: var(--warn-soft); color: #8a4008; border-color: rgba(180,83,9,.2); }
.alert-info    { background: var(--info-soft); color: #16349b; border-color: rgba(29,78,216,.2); }

.modal-content { border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 24px 60px -20px rgba(21,15,36,.45); }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-title { font-weight: 680; letter-spacing: -.02em; font-size: 1.05rem; }

.list-group-item { border-color: var(--line); font-size: .875rem; }
.list-group-item-action:hover { background: var(--brand-soft); }

.badge { font-weight: 640; letter-spacing: .01em; }

/* ==========================================================================
   responsive — technicians work from phones in the field
   ========================================================================== */
@media (max-width: 991.98px) {
    .app-navbar { position: static; }
    .app-navbar .navbar-nav { gap: .1rem; padding: .5rem 0; align-items: stretch; }
    .app-navbar .nav-link { padding: .6rem .75rem; }
    .app-navbar .nav-link.is-active::after { left: 0; right: auto; bottom: auto; top: .55rem;
        width: 3px; height: 1.2rem; }
    .app-navbar .navbar-text { padding: .5rem .75rem 0; }
    .app-navbar .btn-outline-brand { margin: .5rem .75rem 0; display: block; }
}

@media (max-width: 575.98px) {
    .page-head h1, .page-head h2, .page-head h3, .page-head h4 { font-size: 1.15rem; }
    .stat-tile .stat-value { font-size: 1.6rem; }
    .table > tbody > tr > td, .table > thead > tr > th { padding: .6rem .55rem; font-size: .82rem; }
    /* keep tap targets comfortable for gloved hands */
    .btn-sm { padding: .4rem .7rem; }
    .form-check-input { width: 1.2em; height: 1.2em; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   signal band — is the load rising, and what is driving it
   ========================================================================== */
.signal {
    display: flex; align-items: center; gap: 1rem;
    border-radius: 14px; padding: .85rem 1.1rem; margin-bottom: 1rem;
    border: 1px solid transparent;
}
.signal-up   { background: linear-gradient(100deg, #fff1f2, #fff7f7 60%); border-color: rgba(198,43,63,.22); }
.signal-down { background: linear-gradient(100deg, #ecfdf3, #f6fefa 60%); border-color: rgba(18,134,74,.22); }
.signal-figure { display: flex; align-items: baseline; gap: .3rem; flex: none; }
.signal-arrow { font-size: .95rem; }
.signal-pct { font-size: 1.6rem; font-weight: 760; letter-spacing: -.035em; }
.signal-up .signal-figure   { color: var(--crit); }
.signal-down .signal-figure { color: var(--ok); }
.signal-text { font-size: .87rem; line-height: 1.5; color: var(--ink-2); }
.signal-text strong { color: var(--ink); font-weight: 680; }

/* ==========================================================================
   resolution spread — the shape behind the average
   ========================================================================== */
.spread { display: flex; flex-direction: column; gap: .42rem; }
.spread-row { display: grid; grid-template-columns: 3.4rem 1fr 1.8rem; align-items: center; gap: .6rem; }
.spread-label { font-size: .72rem; font-weight: 640; color: var(--ink-2); text-align: right; }
.spread-track { height: 9px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.spread-bar { height: 100%; border-radius: 99px; }
.spread-fast { background: linear-gradient(90deg, #34d98a, #12a15c); }
.spread-slow { background: linear-gradient(90deg, #fbbf3c, #ef8b0d); }
.spread-n { font-size: .76rem; font-weight: 700; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.spread-foot { margin-top: .7rem; font-size: .74rem; color: var(--ink-3); }
.spread-foot strong { color: var(--ok); }

/* ==========================================================================
   area hotspots
   ========================================================================== */
.hotspots { display: flex; flex-direction: column; gap: .3rem; }
.hotspot {
    position: relative; display: grid; grid-template-columns: 1fr auto;
    align-items: center; gap: .6rem; padding: .5rem .6rem;
    border-radius: 9px; overflow: hidden;
}
.hotspot-bar {
    position: absolute; inset: 0 auto 0 0; z-index: 0;
    background: linear-gradient(90deg, rgba(139,69,232,.16), rgba(139,69,232,.05));
    border-radius: 9px;
}
.hotspot-body { position: relative; z-index: 1; min-width: 0; }
.hotspot-area { font-size: .84rem; font-weight: 660; letter-spacing: -.01em; }
.hotspot-meta { font-size: .7rem; color: var(--ink-3); margin-top: .05rem; }
.hotspot-n {
    position: relative; z-index: 1; font-size: .95rem; font-weight: 740;
    color: var(--brand); font-variant-numeric: tabular-nums;
}

/* repeat-customer count chip */
.repeat-n {
    display: inline-block; min-width: 1.6rem; text-align: center;
    background: var(--warn-soft); color: var(--warn);
    border: 1px solid rgba(180,83,9,.2);
    font-size: .74rem; font-weight: 730; padding: .12rem .45rem; border-radius: 999px;
}

/* ==========================================================================
   DASHBOARD
   The old dashboard stacked nineteen equal-weight tiles across five headed
   sections, several of them showing the same figure twice. Everything below
   exists to create hierarchy instead: one loud row that says what needs doing,
   one quiet strip that holds the running totals, and cards that group by
   subject rather than by widget type.
   ========================================================================== */

/* --- header ------------------------------------------------------------- */
.dash-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin: .1rem 0 .9rem;
}
.dash-title { font-size: 1.45rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.dash-sub   { color: var(--ink-3); font-size: .8rem; margin-top: .2rem; }
.dash-meta  { display: flex; align-items: center; gap: .85rem; font-size: .72rem; color: var(--ink-3); }
.dash-clock {
    font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink-2);
    letter-spacing: .01em;
}
.dash-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
/* the pulse tells you the page is live without a countdown shouting numbers */
@keyframes bbi-pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.dash-meta .dot { animation: bbi-pulse 2.4s ease-in-out infinite; }

/* --- KPI refinements ---------------------------------------------------- */
/* A large, very faint glyph gives each tile an identity you read before the
   number, and fills space the old flat blocks left empty. */
.kpi-ico {
    position: absolute; right: .55rem; bottom: -.35rem;
    font-size: 3.1rem; line-height: 1; color: rgba(255, 255, 255, .17);
    pointer-events: none;
}
.kpi { padding: .85rem 1rem .9rem; }
.kpi .kpi-value { font-size: 1.85rem; }

/* --- at a glance -------------------------------------------------------- */
/* Replaces three headed sections of white cards. Running totals are context,
   not calls to action, so they get one quiet card and small type. */
.glance { display: flex; flex-wrap: wrap; }
.glance-sec {
    flex: 1 1 auto; min-width: 0;
    padding: .85rem 1.15rem;
    border-left: 1px solid var(--line);
}
.glance-sec:first-child { border-left: 0; }
.glance-sec-label {
    color: var(--ink-3); font-size: .625rem; font-weight: 780;
    text-transform: uppercase; letter-spacing: .09em; margin-bottom: .5rem;
}
.glance-row { display: flex; gap: 1.5rem; }
.glance-item { min-width: 0; }
.glance-n {
    font-size: 1.3rem; font-weight: 730; letter-spacing: -.03em;
    line-height: 1.1; color: var(--ink); white-space: nowrap;
}
.glance-k {
    font-size: .68rem; color: var(--ink-3); margin-top: .1rem;
    font-weight: 560; white-space: nowrap;
}
.glance-n.is-good { color: var(--ok); }
.glance-n.is-crit { color: var(--crit); }
@media (max-width: 991.98px) {
    .glance-sec { flex: 1 1 100%; border-left: 0; border-top: 1px solid var(--line); }
    .glance-sec:first-child { border-top: 0; }
    .glance-row { gap: 1.1rem; }
}

/* --- card headers ------------------------------------------------------- */
/* One header treatment everywhere, so cards stop looking hand-assembled. */
.card-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: .75rem; padding: .8rem 1.05rem .7rem;
    border-bottom: 1px solid var(--line);
}
.card-head .ch-title {
    font-size: .875rem; font-weight: 700; letter-spacing: -.012em; color: var(--ink);
}
.card-head .ch-sub { font-size: .72rem; color: var(--ink-3); font-weight: 500; margin-top: .12rem; }
.card-head .ch-meta { font-size: .7rem; color: var(--ink-3); white-space: nowrap; }
.card-head a.ch-meta { font-weight: 640; color: var(--brand); text-decoration: none; }
.card-head a.ch-meta:hover { text-decoration: underline; }
.card-body-p { padding: .9rem 1.05rem 1rem; }

/* --- podium -------------------------------------------------------------
   Laid out along the card width: rank, face, name, score. The previous
   vertical stack left most of a 441px card empty. --------------------- */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
@media (max-width: 1199.98px) { .podium { grid-template-columns: 1fr; } }
.podium-item {
    position: relative;
    display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center; gap: .55rem;
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: .65rem .8rem; background: var(--surface-2);
}
.podium-item.is-first {
    background: linear-gradient(135deg, #f6efff 0%, #ffffff 62%);
    border-color: var(--brand-primary-light);
    box-shadow: 0 5px 16px -10px rgba(98, 32, 208, .55);
}
/* A numbered chip stays legible at 20px; the medal emoji did not. */
.podium-rank {
    width: 19px; height: 19px; flex: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .64rem; font-weight: 800; color: #fff;
    background: var(--idle); box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
}
.podium-rank.r1 { background: linear-gradient(150deg, #f7cf51, #bd8905); }
.podium-rank.r2 { background: linear-gradient(150deg, #ccd1d9, #929aa6); }
.podium-rank.r3 { background: linear-gradient(150deg, #e0a06a, #a2602e); }
.podium-av {
    width: 32px; height: 32px; flex: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand); color: #fff; font-weight: 700; font-size: .82rem;
}
.podium-item.is-first .podium-av { background: var(--brand-ink); }
.podium-info { min-width: 0; }
.podium-name {
    font-size: .82rem; font-weight: 670; letter-spacing: -.012em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.podium-split { font-size: .66rem; color: var(--ink-3); margin-top: .1rem; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; }
.podium-split b { color: var(--ink-2); font-weight: 660; }
.podium-score { text-align: right; padding-left: .2rem; }
.podium-score b {
    display: block; font-size: 1.4rem; font-weight: 745; letter-spacing: -.04em;
    line-height: 1; color: var(--brand);
}
.podium-score span {
    font-size: .58rem; color: var(--ink-3); font-weight: 700;
    letter-spacing: .07em; text-transform: uppercase;
}
/* Ties the podium row back to the banner above, so the repeated name reads
   as a cross-reference rather than a mistake. */
.podium-star {
    display: inline-flex; align-items: center; gap: .18rem;
    font-size: .58rem; font-weight: 760; letter-spacing: .04em;
    text-transform: uppercase; color: var(--brand);
    background: var(--brand-soft); border: 1px solid var(--brand-primary-light);
    border-radius: 99px; padding: .04rem .35rem; margin-left: .35rem;
    vertical-align: 1px;
}

/* --- workload bars ------------------------------------------------------ */
/* Was a stacked Chart.js canvas. Plain markup renders identically at this size,
   loads nothing, and lines up with the rest of the type scale. */
.wl { display: flex; flex-direction: column; gap: .55rem; }
.wl-row { display: grid; grid-template-columns: minmax(0, 8.5rem) 1fr auto; gap: .6rem; align-items: center; }
.wl-name { font-size: .78rem; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-bar { display: flex; height: 9px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.wl-done { background: var(--ok); }
.wl-todo { background: var(--warn); }
.wl-n { font-size: .72rem; font-weight: 640; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.wl-n b { color: var(--ok); }
.wl-n i { color: var(--warn); font-style: normal; }
.wl-key { display: flex; gap: .8rem; font-size: .68rem; color: var(--ink-3); }
.wl-key span { display: inline-flex; align-items: center; gap: .3rem; }
.wl-key i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* --- employee of the month --------------------------------------------- */
.eom {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem .85rem; border-radius: var(--radius);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
    color: #fff; position: relative; overflow: hidden;
}
.eom::after {
    content: ""; position: absolute; right: -30px; top: -40px;
    width: 110px; height: 110px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.22), transparent 68%);
}
.eom-av {
    width: 42px; height: 42px; flex: none; border-radius: 50%;
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3);
    display: flex; align-items: center; justify-content: center;
    font-weight: 720; font-size: 1.05rem; position: relative;
}
.eom-k { font-size: .6rem; font-weight: 780; letter-spacing: .09em; text-transform: uppercase; color: rgba(255,255,255,.82); position: relative; }
.eom-name { font-size: .98rem; font-weight: 700; letter-spacing: -.015em; position: relative; }
.eom-sub { font-size: .68rem; color: rgba(255,255,255,.85); position: relative; }
.eom-n { margin-left: auto; text-align: right; position: relative; }
.eom-n b { display: block; font-size: 1.5rem; font-weight: 750; letter-spacing: -.035em; line-height: 1; }
.eom-n span { font-size: .62rem; color: rgba(255,255,255,.82); font-weight: 600; }

/* --- compact tables inside split cards ---------------------------------- */
.card .table.table-tight > tbody > tr > td,
.card .table.table-tight > thead > tr > th { padding: .48rem .8rem; font-size: .78rem; }
.card .table.table-tight > thead > tr > th { font-size: .625rem; }
