/* =========================================================================
   CPSP Data System — Modern Premium SaaS
   Display: Bricolage Grotesque (variable)
   Body:    Manrope
   Mono:    JetBrains Mono
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wdth,wght@12..96,75..100,200..800&family=Manrope:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* ---- Surface tokens ------------------------------------------- */
    --bg:            #F6F8F7;     /* faint green-tinted off-white — page */
    --bg-2:          #ECF0EE;     /* soft green-grey */
    --surface:       #FFFFFF;
    --surface-2:     #FAFBFA;     /* very subtle elevated */
    --surface-glass: rgba(255, 255, 255, 0.72);

    /* ---- Ink tokens — CPSP charcoal-slate ------------------------- */
    --ink:           #192025;     /* CPSP dark (bg_color_2) */
    --ink-2:         #232D33;     /* CPSP header slate */
    --ink-3:         #47555E;     /* mid slate */
    --muted:         #6C7A82;     /* cool slate-grey */
    --muted-2:       #9CA8AE;     /* light slate-grey */

    /* ---- Lines ---------------------------------------------------- */
    --line:          #E6EBE8;
    --line-2:        #DBE2DE;
    --line-strong:   #C6D0CB;

    /* ---- Brand accents — CPSP signature green -------------------- */
    --brand:         #009066;     /* CPSP signature green (primary) */
    --brand-2:       #00A374;     /* lighter for gradients */
    --brand-deep:    #006E4C;     /* deepest tone */

    --accent:        #00B07F;     /* brighter emerald (CTA / pop) */
    --accent-2:      #00C892;     /* hover lift */
    --accent-soft:   #D8F5EB;     /* emerald surface */
    --accent-ink:    #00674A;     /* deep emerald text */

    --cpsp-blue:      #2F51A3;    /* CPSP secondary blue */
    --cpsp-blue-soft: #E5EBF6;
    --cpsp-teal:      #25A7B4;    /* CPSP teal accent */
    --cpsp-teal-soft: #DCF1F3;
    --cpsp-orange:    #E69328;    /* CPSP orange accent */
    --cpsp-orange-soft:#FCEBD3;

    --indigo:        #2F51A3;     /* alias for legacy info color */
    --indigo-soft:   #E5EBF6;
    --green:         #009066;     /* alias to CPSP green */
    --green-soft:    #D8F5EB;
    --amber:         #B45309;
    --amber-soft:    #FEF3C7;
    --rose:          #BE123C;
    --rose-soft:     #FFE4E6;

    /* ---- Type ----------------------------------------------------- */
    --display: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
    --sans:    'Manrope', system-ui, -apple-system, sans-serif;
    --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* ---- Geometry ------------------------------------------------- */
    --r-xs: 6px;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 22px;

    /* ---- Shadows (soft, layered) --------------------------------- */
    --shadow-1: 0 1px 2px rgba(10, 10, 10, 0.04), 0 1px 1px rgba(10, 10, 10, 0.03);
    --shadow-2: 0 1px 2px rgba(10, 10, 10, 0.04), 0 4px 12px -4px rgba(10, 10, 10, 0.08);
    --shadow-3: 0 1px 2px rgba(10, 10, 10, 0.04), 0 8px 24px -8px rgba(10, 10, 10, 0.12), 0 24px 48px -16px rgba(10, 10, 10, 0.10);
    --shadow-pop: 0 1px 0 rgba(0,144,102,0.06), 0 12px 32px -10px rgba(0,144,102,0.32);

    /* ---- Motion --------------------------------------------------- */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================================================================
   Reset & base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: var(--sans);
    background-color: var(--bg);
    /* Soft diagonal wash so the page never reads as flat grey */
    background-image: linear-gradient(160deg, #F3F8F5 0%, #F6F8F7 42%, #EEF4F6 100%);
    background-attachment: fixed;
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "ss02", "cv11";
}

/* Full-viewport ambient colour mesh — fresh, premium app feel.
   CPSP green (top-left), blue (top-right), teal (bottom) bloom softly. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 45% at 6% -6%, rgba(0, 176, 127, 0.13), transparent 60%),
        radial-gradient(ellipse 50% 42% at 100% 2%, rgba(47, 81, 163, 0.09), transparent 58%),
        radial-gradient(ellipse 70% 45% at 50% 112%, rgba(37, 167, 180, 0.10), transparent 62%);
    z-index: -2;
    pointer-events: none;
}

/* Faint dot-grid texture — adds depth without noise */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(25, 32, 37, 0.05) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 0%, #000 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 0%, #000 0%, transparent 75%);
    opacity: .5;
    z-index: -1;
    pointer-events: none;
}

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

a { color: var(--ink); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: var(--accent); }

p { margin: 0 0 1rem; color: var(--ink-3); }

h1, h2, h3, h4, h5, h6 {
    color: var(--ink);
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.08;
    margin: 0 0 .5rem;
    font-variation-settings: "wdth" 95;
}
h1 {
    font-size: clamp(2.4rem, 4.5vw, 3.6rem);
    font-weight: 580;
    letter-spacing: -0.04em;
    font-variation-settings: "wdth" 100, "opsz" 96;
}
h2 { font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; }
h3 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; }
h4 { font-size: 1.2rem; font-weight: 600; }
h5 { font-size: 1.025rem; font-weight: 600; }
h6 { font-size: .85rem; font-weight: 600; font-family: var(--sans); }

code, pre, .font-monospace, .text-monospace { font-family: var(--mono) !important; }
code {
    color: var(--ink-2);
    background: var(--bg-2);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: .86em;
    font-weight: 500;
}

/* =========================================================================
   Layout
   ========================================================================= */
.main-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.content-wrapper { flex: 1; padding-bottom: 6rem; }
.container { max-width: 1320px; }
.container-wide {
    width: 100%;
    max-width: 1560px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
@media (max-width: 768px) {
    .container-wide { padding-left: 1rem; padding-right: 1rem; }
}

/* =========================================================================
   Navigation — sticky glass bar
   ========================================================================= */
.app-navbar {
    background: var(--surface-glass);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.app-navbar > .container {
    max-width: 1560px;
    padding-top: 14px;
    padding-bottom: 14px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
@media (max-width: 768px) {
    .app-navbar > .container { padding-left: 1rem; padding-right: 1rem; }
}

.app-navbar .navbar-brand {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--ink);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: 0;
    font-variation-settings: "wdth" 100;
}
.app-navbar .navbar-brand .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 60%, var(--brand-deep) 100%);
    color: #FFFFFF;
    border-radius: 7px;
    font-family: var(--display);
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: -0.04em;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.app-navbar .navbar-brand .brand-mark::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(0,176,127,.7), transparent 60%);
    opacity: 0;
    transition: opacity .25s var(--ease);
}
.app-navbar .navbar-brand:hover .brand-mark::after { opacity: 1; }
.app-navbar .navbar-brand .brand-tag {
    font-family: var(--sans);
    font-size: .68rem;
    font-weight: 500;
    color: var(--muted);
    background: var(--bg-2);
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0;
    text-transform: none;
    margin-left: .25rem;
}

.app-navbar .nav-link {
    color: var(--ink-3) !important;
    font-weight: 500;
    font-size: .88rem;
    padding: .5rem .85rem !important;
    border-radius: var(--r-xs);
    position: relative;
    transition: color .18s var(--ease), background-color .18s var(--ease);
    letter-spacing: -0.005em;
}
.app-navbar .nav-link:hover {
    color: var(--ink) !important;
    background: var(--bg-2);
}
.app-navbar .nav-link.active {
    color: var(--ink) !important;
    background: var(--bg-2);
}

.app-navbar .dropdown-toggle::after {
    margin-left: .35em;
    border-top-color: currentColor;
    opacity: .55;
}
.dropdown-menu {
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
    background: var(--surface);
    padding: .35rem;
    font-family: var(--sans);
    font-size: .88rem;
    margin-top: .35rem !important;
    min-width: 12rem;
}
.dropdown-item {
    border-radius: var(--r-xs);
    padding: .5rem .75rem;
    color: var(--ink-2);
    font-weight: 500;
}
.dropdown-item:hover, .dropdown-item:focus {
    background: var(--bg-2);
    color: var(--ink);
}

.user-snippet {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-left: auto;
}
.user-name {
    font-size: .85rem;
    color: var(--ink-2);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}
.user-name::before {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-logout {
    border: 1px solid var(--line-2);
    background: var(--surface);
    color: var(--ink-2);
    padding: .42rem .85rem;
    font-size: .82rem;
    font-weight: 500;
    border-radius: var(--r-xs);
    transition: all .18s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.btn-logout:hover {
    border-color: var(--ink);
    color: var(--ink);
    background: var(--surface);
    transform: translateY(-1px);
    box-shadow: var(--shadow-2);
}

/* =========================================================================
   Page header — compact, dashboard-style
   ========================================================================= */
.page-header {
    background: transparent;
    padding: 1.5rem 0 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.page-header .container,
.page-header .container-wide { position: relative; }

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin: 0;
    color: var(--ink);
    font-variation-settings: "wdth" 100, "opsz" 24;
    /* gradient text on smaller titles reads cleaner if subtler */
    background: none;
    -webkit-text-fill-color: currentColor;
}
.page-header .subtitle {
    font-size: .92rem;
    color: var(--muted);
    font-weight: 400;
    margin: .25rem 0 0;
    max-width: 70ch;
    line-height: 1.45;
}

/* When page-header has a right-side actions cluster, h1+subtitle stack on the left */
.page-header .d-flex > div:first-child h1 { font-size: 1.55rem; }

/* Pill label — sits inline above h1, much smaller now */
.page-tag {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .15rem .55rem .15rem .4rem;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-3);
    margin-bottom: .55rem;
    box-shadow: var(--shadow-1);
    line-height: 1.4;
}
.page-tag::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    animation: pulseDot 2.4s ease-in-out infinite;
}
/* Variant: data-source / status flavour. Smaller pulse, recoloured by class. */
.page-tag.cache::before    { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.page-tag.fetched::before  { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.page-tag.muted {
    background: var(--bg-2);
    color: var(--muted);
    border-color: var(--line);
    box-shadow: none;
}
.page-tag.muted::before { animation: none; }
@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 3px var(--accent-soft); }
    50% { box-shadow: 0 0 0 5px rgba(0,144,102,0.10); }
}

@media (max-width: 768px) {
    .page-header { padding: 1.25rem 0 1rem; margin-bottom: 1.25rem; }
    .page-header h1 { font-size: 1.4rem; }
    .page-header .subtitle { font-size: .88rem; }
}

/* =========================================================================
   Cards
   ========================================================================= */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.card.shadow-sm, .card.shadow-lg, .card.border-0 {
    border: 1px solid var(--line);
    box-shadow: var(--shadow-2);
}

.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 1.25rem 1.5rem;
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 600;
}
.card-header h3, .card-header h4, .card-header h5 {
    margin: 0;
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: -0.02em;
}
.card-header h3 { font-size: 1.2rem; }
.card-header h5 { font-size: 1.05rem; }
.card-header h3 i, .card-header h4 i, .card-header h5 i {
    color: var(--accent);
    margin-right: .45rem;
}
.card-header.bg-white { background: var(--surface) !important; }

.card-body { padding: 1.5rem; }
.card.bg-light { background: var(--bg-2) !important; border-color: var(--line); }

/* Inner sub-cards (used inside results cards) */
.card .card.border {
    border: 1px solid var(--line) !important;
    border-radius: var(--r-md) !important;
    box-shadow: none;
}
.card .card.border:hover {
    border-color: var(--line-strong) !important;
    box-shadow: var(--shadow-1);
}

/* =========================================================================
   Forms
   ========================================================================= */
.form-label {
    color: var(--ink-2);
    font-size: .82rem !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: -0.005em;
    margin-bottom: .5rem;
}
.form-label.text-muted { color: var(--ink-2) !important; }

.form-control,
.form-select {
    background: var(--surface);
    border: 1px solid var(--line-2);
    color: var(--ink);
    padding: .68rem .9rem;
    border-radius: var(--r-sm);
    font-family: var(--sans);
    font-size: .94rem;
    font-weight: 500;
    box-shadow: var(--shadow-1);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.form-control::placeholder { color: var(--muted-2); font-weight: 400; }
.form-control:focus,
.form-select:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 4px rgba(10,10,10,0.06), var(--shadow-1);
    outline: 0;
}

.input-group-text {
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    color: var(--ink-3);
    border-radius: var(--r-sm) 0 0 var(--r-sm);
}

.form-check-input {
    border: 1.5px solid var(--line-strong);
    background-color: var(--surface);
    width: 1.05em;
    height: 1.05em;
    margin-top: .25em;
    cursor: pointer;
}
.form-check-input:checked {
    background-color: var(--ink);
    border-color: var(--ink);
}
.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(10,10,10,0.10);
    border-color: var(--ink);
}
.form-check-label { color: var(--ink-2); font-size: .9rem; font-weight: 500; }
.form-switch .form-check-input { width: 2.4em; }
.form-switch .form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-text { font-size: .82rem; color: var(--muted); }

/* =========================================================================
   Buttons — premium SaaS style
   ========================================================================= */
.btn {
    font-family: var(--sans);
    font-weight: 600;
    font-size: .9rem;
    border-radius: var(--r-sm);
    padding: .6rem 1.05rem;
    letter-spacing: -0.005em;
    transition: all .18s var(--ease);
    border-width: 1px;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}
.btn-sm { padding: .42rem .8rem; font-size: .82rem; border-radius: var(--r-xs); }

/* Primary — CPSP forest green with subtle gradient + soft glow */
.btn-primary {
    background: linear-gradient(180deg, var(--brand-2) 0%, var(--brand) 100%);
    border-color: var(--brand-deep);
    color: #FFFFFF;
    box-shadow: 0 1px 0 rgba(255,255,255,0.10) inset, 0 1px 2px rgba(0,110,76,0.20);
}
.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
    border-color: var(--brand-deep);
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.10) inset, 0 8px 22px -8px rgba(0,110,76,0.45);
}
.btn-primary:active { transform: translateY(0); }

/* Outline variants — clean SaaS chips */
.btn-outline-primary {
    color: var(--brand);
    border-color: var(--line-2);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}
.btn-outline-primary:hover {
    background: var(--brand);
    color: #FFFFFF;
    border-color: var(--brand);
    transform: translateY(-1px);
    box-shadow: var(--shadow-2);
}

.btn-outline-secondary {
    color: var(--ink-2);
    border-color: var(--line-2);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}
.btn-outline-secondary:hover {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-2);
}

.btn-outline-success {
    color: var(--green);
    border-color: var(--line-2);
    background: var(--surface);
}
.btn-outline-success:hover { background: var(--green); color: var(--surface); border-color: var(--green); }

.btn-outline-info {
    color: var(--indigo);
    border-color: var(--line-2);
    background: var(--surface);
}
.btn-outline-info:hover { background: var(--indigo); color: var(--surface); border-color: var(--indigo); }

.btn-outline-danger {
    color: var(--rose);
    border-color: var(--line-2);
    background: var(--surface);
}
.btn-outline-danger:hover { background: var(--rose); color: var(--surface); border-color: var(--rose); }

.btn-outline-dark {
    color: var(--ink);
    border-color: var(--line-2);
    background: var(--surface);
}
.btn-outline-dark:hover { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.btn-light { background: var(--surface); color: var(--ink-2); border-color: var(--line-2); box-shadow: var(--shadow-1); }
.btn-light:hover { background: var(--bg-2); color: var(--ink); }

.btn-success {
    background: var(--green);
    border-color: var(--green);
    color: var(--surface);
}

/* Coral CTA (used selectively for high-emphasis actions) */
.btn-accent {
    background: linear-gradient(180deg, var(--accent-2) 0%, var(--accent) 100%);
    border-color: var(--accent);
    color: var(--surface);
    box-shadow: var(--shadow-pop);
}
.btn-accent:hover { transform: translateY(-1px); color: var(--surface); }

/* =========================================================================
   Tables — premium data grid
   ========================================================================= */
.table {
    color: var(--ink-2);
    font-size: .87rem;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum", "ss02";
}
.table thead th,
.table > thead > tr > th,
.table-light > tr > th {
    background: var(--bg-2) !important;
    color: var(--ink-3) !important;
    font-family: var(--sans);
    font-weight: 600;
    font-size: .72rem !important;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: left;
    border-bottom: 1px solid var(--line-2);
    border-top: none;
    padding: .7rem 1rem;
    white-space: nowrap;
    position: relative;
    vertical-align: middle;
}
.table thead th.text-end, .table thead th.num { text-align: right; }
.table thead th.text-center { text-align: center; }
.table thead th:first-child { padding-left: 1.25rem; }
.table thead th:last-child  { padding-right: 1.25rem; }

.table tbody td {
    padding: .65rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
    color: var(--ink-2);
    font-weight: 500;
    line-height: 1.45;
}
.table tbody td:first-child { padding-left: 1.25rem; }
.table tbody td:last-child  { padding-right: 1.25rem; }
.table tbody tr:last-child td { border-bottom: none; }

.table-hover tbody tr {
    transition: background-color .15s var(--ease), box-shadow .18s var(--ease);
}
.table-hover tbody tr:hover {
    background: var(--bg-2);
    box-shadow: inset 3px 0 0 var(--accent);
}
.table-striped tbody tr:nth-of-type(odd) { background: var(--surface-2); }
.table-striped.table-hover tbody tr:hover { background: var(--bg-2); }

.table td code,
.table td .font-monospace {
    font-family: var(--mono) !important;
    background: transparent;
    padding: 0;
    color: var(--ink);
    font-size: .82rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.table td code {
    background: var(--bg-2);
    padding: 1px 7px;
    border-radius: 5px;
    font-size: .78rem;
    color: var(--brand);
    font-weight: 600;
}

/* Numeric/right-aligned cells */
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Sticky table heads — give breathing room and crisp shadow */
.table thead.sticky-top th {
    background: var(--bg-2) !important;
    box-shadow: 0 1px 0 var(--line-2), 0 6px 12px -10px rgba(10,10,10,.12);
    top: 0;
    z-index: 5;
}

/* Card body padding 0 + table inside — neutralize default first/last gap */
.card .card-body.p-0 .table thead th { background: var(--bg-2) !important; }

/* Compact density variant */
.table-compact tbody td { padding: .5rem 1rem; font-size: .83rem; }
.table-compact thead th { padding: .55rem 1rem; font-size: .68rem !important; }

/* Table-responsive shell — round corners + soft inner border */
.card .card-body > .table-responsive,
.card > .card-body.p-0 > .table-responsive {
    border-radius: 0;
    overflow: auto;
}
.card-body.p-0 > .table-responsive {
    border-top: 1px solid var(--line);
}

/* =========================================================================
   Badges — modern pill chips
   ========================================================================= */
.badge {
    font-family: var(--sans);
    font-weight: 600;
    font-size: .72rem !important;
    letter-spacing: -0.005em;
    text-transform: none;
    padding: .35em .65em;
    border-radius: 999px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}
.badge.bg-light { background: var(--bg-2) !important; color: var(--ink-2) !important; border-color: var(--line-2); }
.badge.bg-info { background: var(--indigo-soft) !important; color: var(--indigo) !important; border-color: transparent; }
.badge.bg-success-subtle { background: var(--green-soft) !important; color: var(--green) !important; border-color: transparent; }
.badge.bg-warning-subtle { background: var(--amber-soft) !important; color: var(--amber) !important; border-color: transparent; }
.badge.bg-secondary-subtle { background: var(--bg-2) !important; color: var(--ink-3) !important; border-color: var(--line-2); }
.badge.bg-white { background: var(--surface) !important; color: var(--ink-2) !important; border-color: var(--line-2); }

/* =========================================================================
   Alerts
   ========================================================================= */
.alert {
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    padding: 1rem 1.15rem;
    font-size: .92rem;
    background: var(--surface);
    color: var(--ink-2);
    box-shadow: var(--shadow-1);
}
.alert-info, .alert.bg-info-subtle {
    background: var(--indigo-soft);
    border-color: transparent;
    color: var(--ink-2);
}
.alert-warning, .alert.bg-warning-subtle {
    background: var(--amber-soft);
    border-color: transparent;
    color: var(--amber);
}
.alert-danger {
    background: var(--rose-soft);
    border-color: transparent;
    color: var(--rose);
}
.alert-success {
    background: var(--green-soft);
    border-color: transparent;
    color: var(--green);
}
.alert-light { background: var(--bg-2); border-color: var(--line); }
.alert .text-info-emphasis { color: var(--ink-2) !important; }
.alert .text-warning-emphasis { color: var(--amber) !important; }

/* =========================================================================
   Record cards — premium individual result rendering
   ========================================================================= */
.record-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.record-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--brand) 0%, var(--accent) 100%);
    opacity: 0;
    transition: opacity .25s var(--ease);
}
.record-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
}
.record-card:hover::before { opacity: 1; }

.record-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.4rem;
}
.record-identity {
    display: flex;
    align-items: center;
    gap: .9rem;
    min-width: 0;
}
.record-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 60%, var(--brand-deep) 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px -4px rgba(0,110,76,0.45), inset 0 1px 0 rgba(255,255,255,0.10);
    overflow: hidden;
    position: relative;
    letter-spacing: -0.02em;
}
.record-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.record-avatar.empty {
    background: var(--bg-2);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 500;
    box-shadow: inset 0 0 0 1px var(--line-2);
    font-family: var(--sans);
}
.record-name {
    font-family: var(--display);
    font-size: 1.18rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.025em;
    overflow: hidden;
    text-overflow: ellipsis;
}
.record-meta {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    font-size: .78rem;
}
.record-meta .meta-chip {
    font-family: var(--mono);
    background: var(--bg-2);
    color: var(--ink-3);
    padding: 2px 8px;
    border-radius: 5px;
    font-weight: 500;
    letter-spacing: -0.01em;
    border: 1px solid var(--line);
}
.record-meta .meta-chip strong { color: var(--ink); font-weight: 600; }

.record-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    align-items: center;
}

.record-body {
    padding: 1.1rem 1.4rem 1.25rem;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 60%);
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem 2rem;
}
.field-group {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.field-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: .25rem;
    display: flex;
    align-items: center;
    gap: .45rem;
}
.field-label::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 1.5px;
    background: var(--accent);
    border-radius: 1px;
}
.field-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .75rem;
    padding: .25rem 0;
    font-size: .85rem;
    border-bottom: 1px dashed transparent;
}
.field-row .k {
    color: var(--muted);
    font-weight: 500;
    flex-shrink: 0;
}
.field-row .v {
    color: var(--ink);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
    min-width: 0;
}
.field-row .v.mono {
    font-family: var(--mono);
    font-size: .82rem;
    letter-spacing: -0.01em;
}

/* Result summary strip — shown at top of result section with current criteria */
.result-summary {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    padding: .7rem 1rem;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    margin-bottom: 1rem;
    font-size: .85rem;
    color: var(--ink-3);
}
.result-summary .summary-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}
.result-summary .chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    padding: .2rem .65rem;
    font-family: var(--mono);
    font-size: .75rem;
    color: var(--ink-2);
    font-weight: 500;
}
.result-summary .chip strong { color: var(--ink); font-weight: 600; }
.result-summary .chip.accent {
    background: var(--accent-soft);
    border-color: transparent;
    color: var(--accent-ink);
}

/* Detail block (expanded credential / synopsis / workshop / registration) */
.detail-block {
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 1.25rem 1.4rem;
    margin-top: 1rem;
    position: relative;
}
.detail-block::before {
    content: "";
    position: absolute;
    top: 0; left: 1.4rem; right: 1.4rem;
    height: 2px;
    background: linear-gradient(90deg, var(--brand), var(--accent), transparent);
    border-radius: 0 0 2px 2px;
}
.detail-title {
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 1rem;
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}
.detail-title .ref {
    font-family: var(--mono);
    font-size: .76rem;
    color: var(--muted);
    font-weight: 500;
    background: var(--bg-2);
    padding: 2px 8px;
    border-radius: 5px;
    border: 1px solid var(--line);
}

/* =========================================================================
   Stats grid — premium dashboard cards
   ========================================================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 0 0 3rem;
}
.stat-card {
    padding: 1.5rem 1.5rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    position: relative;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
    overflow: hidden;
    box-shadow: var(--shadow-1);
}
.stat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    opacity: .85;
}
.stat-card.accent-purple::before { background: linear-gradient(90deg, var(--cpsp-blue), #4B6FD1); }
.stat-card.accent-teal::before   { background: linear-gradient(90deg, var(--cpsp-teal), #4CC4D0); }
.stat-card.accent-orange::before { background: linear-gradient(90deg, var(--cpsp-orange), #F0AE5A); }
.stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 100% 0%, rgba(0,144,102,0.12), transparent 60%);
    opacity: 0;
    transition: opacity .3s var(--ease);
    pointer-events: none;
}
.stat-card.accent-purple::after { background: radial-gradient(ellipse 70% 60% at 100% 0%, rgba(47,81,163,0.12), transparent 60%); }
.stat-card.accent-teal::after   { background: radial-gradient(ellipse 70% 60% at 100% 0%, rgba(37,167,180,0.12), transparent 60%); }
.stat-card.accent-orange::after { background: radial-gradient(ellipse 70% 60% at 100% 0%, rgba(230,147,40,0.13), transparent 60%); }
.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-2);
    box-shadow: var(--shadow-3);
}
.stat-card:hover::after { opacity: 1; }

.stat-card .stat-icon-wrapper {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Soft-tinted at rest (per accent), solid on hover */
    background: var(--accent-soft);
    color: var(--accent-ink);
    border-radius: var(--r-sm);
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
    transition: background-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
    position: relative;
    z-index: 1;
}
.stat-card:hover .stat-icon-wrapper {
    background: var(--brand);
    color: #FFFFFF;
    transform: rotate(-4deg) scale(1.05);
    box-shadow: 0 6px 16px -6px rgba(0,110,76,0.45);
}
.stat-card.accent-purple .stat-icon-wrapper { background: var(--cpsp-blue-soft); color: var(--cpsp-blue); }
.stat-card.accent-teal   .stat-icon-wrapper { background: var(--cpsp-teal-soft); color: #0C7C88; }
.stat-card.accent-orange .stat-icon-wrapper { background: var(--cpsp-orange-soft); color: #A9660C; }
.stat-card.accent-purple:hover .stat-icon-wrapper { box-shadow: 0 6px 16px -6px rgba(47,81,163,0.45); }
.stat-card.accent-teal:hover   .stat-icon-wrapper { box-shadow: 0 6px 16px -6px rgba(37,167,180,0.45); }
.stat-card.accent-orange:hover .stat-icon-wrapper { box-shadow: 0 6px 16px -6px rgba(230,147,40,0.45); }

.stat-value {
    font-family: var(--display);
    font-variation-settings: "wdth" 100, "opsz" 96;
    font-size: clamp(2rem, 3.4vw, 2.6rem);
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: .5rem;
    font-feature-settings: "tnum", "lnum";
    position: relative;
    z-index: 1;
}
.stat-label {
    font-family: var(--sans);
    font-size: .85rem;
    color: var(--muted);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.stat-card.accent-purple:hover .stat-icon-wrapper { background: var(--cpsp-blue); }
.stat-card.accent-emerald:hover .stat-icon-wrapper { background: var(--accent); }
.stat-card.accent-orange:hover .stat-icon-wrapper { background: var(--cpsp-orange); }
.stat-card.accent-teal:hover .stat-icon-wrapper { background: var(--cpsp-teal); }

/* =========================================================================
   Feature index grid — premium app shortcut cards
   ========================================================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin: 0 0 3rem;
}

.feature-card {
    padding: 1.5rem 1.5rem 1.4rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
    text-decoration: none;
    overflow: hidden;
    box-shadow: var(--shadow-1);
    min-height: 200px;
}
.feature-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 100% 0%, rgba(0, 144, 102, 0.10), transparent 55%),
        radial-gradient(circle at 0% 100%, rgba(0, 110, 76, 0.06), transparent 55%);
    opacity: 0;
    transition: opacity .3s var(--ease);
    pointer-events: none;
}
.feature-card::after {
    content: "↗";
    position: absolute;
    top: 1.4rem;
    right: 1.4rem;
    font-size: 1.05rem;
    color: var(--muted-2);
    transition: transform .3s var(--ease), color .3s var(--ease);
    font-family: var(--mono);
}
.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-3);
}
.feature-card:hover::before { opacity: 1; }
.feature-card:hover::after {
    transform: translate(3px, -3px);
    color: var(--accent);
}

.card-icon-wrapper {
    width: 42px;
    height: 42px;
    background: var(--accent-soft) !important;
    color: var(--accent-ink);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    transition: background-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
    position: relative;
    z-index: 1;
}
.feature-card:hover .card-icon-wrapper {
    background: var(--brand) !important;
    color: #FFFFFF;
    transform: rotate(-5deg);
    box-shadow: 0 6px 16px -6px rgba(0,110,76,0.5);
}

.feature-card h3 {
    font-family: var(--display);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 .5rem;
    letter-spacing: -0.02em;
    color: var(--ink);
    position: relative;
    z-index: 1;
    font-variation-settings: "wdth" 100;
}
.feature-card p {
    font-size: .9rem;
    color: var(--muted);
    margin: 0 0 1.25rem;
    flex-grow: 1;
    line-height: 1.55;
    position: relative;
    z-index: 1;
}
.card-action {
    margin-top: auto;
    color: var(--ink);
    font-weight: 600;
    font-size: .85rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    transition: gap .2s var(--ease);
    position: relative;
    z-index: 1;
}
.feature-card:hover .card-action { gap: .65rem; }
.card-action i { transition: transform .25s var(--ease); }
.feature-card:hover .card-action i { transform: translateX(3px); color: var(--accent); }

/* =========================================================================
   Modal
   ========================================================================= */
.modal-content {
    border: 1px solid var(--line-2);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-3);
}
.modal-header {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    padding: 1.25rem 1.5rem;
}
.modal-title {
    font-family: var(--display);
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.02em;
}
.modal-body { padding: 1.5rem; }
.modal-footer {
    border-top: 1px solid var(--line);
    padding: 1rem 1.5rem;
}

/* =========================================================================
   Pills / Tabs
   ========================================================================= */
.nav-pills {
    background: var(--surface);
    padding: .35rem;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    display: inline-flex;
    box-shadow: var(--shadow-1);
    gap: .25rem;
}
.nav-pills .nav-link {
    color: var(--ink-3);
    background: transparent;
    border: none;
    border-radius: var(--r-sm);
    padding: .5rem .9rem;
    margin: 0;
    font-size: .87rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: -0.005em;
    transition: all .18s var(--ease);
}
.nav-pills .nav-link:hover {
    color: var(--ink);
    background: var(--bg-2);
}
.nav-pills .nav-link.active {
    color: var(--ink);
    background: var(--bg-2);
    box-shadow: var(--shadow-1);
}
.nav-pills .nav-link i { color: var(--accent); margin-right: .25rem; }

/* =========================================================================
   Footer
   ========================================================================= */
.app-footer {
    background: transparent;
    border-top: 1px solid var(--line);
    padding: 1.75rem 0;
    margin-top: 2rem;
    color: var(--muted);
    font-size: .85rem;
}
.app-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.app-footer .row { width: 100%; }

/* =========================================================================
   Misc utility overrides
   ========================================================================= */
.text-muted { color: var(--muted) !important; }
.text-primary { color: var(--ink) !important; }
.text-dark { color: var(--ink) !important; }
.text-success { color: var(--green) !important; }
.text-warning { color: var(--amber) !important; }
.text-danger { color: var(--rose) !important; }
.text-secondary { color: var(--muted) !important; }
.text-info { color: var(--indigo) !important; }
.text-white { color: var(--surface) !important; }

.bg-light { background: var(--bg-2) !important; }
.bg-white { background: var(--surface) !important; }
.bg-primary { background: var(--ink) !important; }
.bg-primary-subtle { background: var(--accent-soft) !important; }

.border, .border-light-subtle { border-color: var(--line) !important; }

.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }

.shadow-sm { box-shadow: var(--shadow-1) !important; }
.shadow { box-shadow: var(--shadow-2) !important; }
.shadow-lg { box-shadow: var(--shadow-3) !important; }

.btn-close {
    background-color: transparent;
    opacity: .55;
    transition: opacity .18s var(--ease);
}
.btn-close:hover { opacity: 1; }

.spinner-border-sm { width: .9rem; height: .9rem; border-width: .14em; }

a.feature-card { color: inherit; }

/* Sortable indicators */
.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    position: relative;
    transition: color .15s var(--ease);
}
.sortable:hover { color: var(--ink) !important; }
.sortable[data-sort-dir="asc"]::after {
    content: " ↑"; font-size: .82rem; color: var(--accent); font-weight: 700;
}
.sortable[data-sort-dir="desc"]::after {
    content: " ↓"; font-size: .82rem; color: var(--accent); font-weight: 700;
}

/* =========================================================================
   Auth panels — modern centered card with gradient frame
   ========================================================================= */
.cpsp-auth-shell {
    min-height: calc(100vh - 220px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}
.cpsp-auth-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 40% at 50% 30%, rgba(0, 144, 102, 0.10), transparent 60%),
        radial-gradient(ellipse 60% 50% at 50% 80%, rgba(0, 110, 76, 0.06), transparent 60%);
    pointer-events: none;
    z-index: 0;
}
.cpsp-auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--shadow-3);
    position: relative;
    z-index: 1;
}
.cpsp-auth-mark {
    text-align: center;
    padding: 2.5rem 2rem 1rem;
}
.cpsp-auth-mark .seal {
    width: 56px; height: 56px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 60%, var(--brand-deep) 100%);
    color: #FFFFFF;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 700;
    position: relative;
    box-shadow: 0 8px 22px -8px rgba(0,110,76,0.45);
}
.cpsp-auth-mark .seal::after {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: calc(var(--r-md) + 10px);
    background: linear-gradient(135deg, var(--accent), transparent);
    z-index: -1;
    opacity: .35;
    filter: blur(14px);
}
.cpsp-auth-mark h2 {
    font-size: 1.65rem;
    margin: 0 0 .5rem;
    letter-spacing: -0.025em;
}
.cpsp-auth-mark p { font-size: .92rem; margin: 0; color: var(--muted); }
.cpsp-auth-body { padding: 1.25rem 2rem 2rem; }
.cpsp-auth-foot {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid var(--line);
    background: var(--bg-2);
    font-size: .82rem;
    color: var(--muted);
}
.cpsp-auth-foot a { color: var(--ink-2); font-weight: 500; }
.cpsp-auth-foot a:hover { color: var(--accent); }

/* =========================================================================
   Analytics primitives — bar charts, mini-bars, KPI rail
   ========================================================================= */

/* KPI rail — large headline metric tiles, 4-up */
.kpi-rail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 1.1rem 1.25rem 1.25rem;
    box-shadow: var(--shadow-1);
    position: relative;
    overflow: hidden;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.kpi::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--brand), var(--accent), transparent);
    opacity: 0;
    transition: opacity .25s var(--ease);
}
.kpi:hover::before { opacity: 1; }
.kpi-label {
    font-size: .72rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .65rem;
}
.kpi-label i { color: var(--brand); font-size: .9rem; }
.kpi-value {
    font-family: var(--display);
    font-variation-settings: "wdth" 100, "opsz" 96;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
    letter-spacing: -0.04em;
    font-feature-settings: "tnum", "lnum";
    margin-bottom: .25rem;
}
.kpi-sub {
    font-size: .8rem;
    color: var(--muted);
    font-weight: 500;
}
.kpi-sub strong { color: var(--ink-2); font-weight: 600; }
.kpi.accent .kpi-value { color: var(--brand); }
.kpi.warn .kpi-value { color: var(--amber); }
.kpi.danger .kpi-value { color: var(--rose); }

/* Vertical bar chart (12-month trend) */
.bar-chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
    align-items: end;
    gap: .35rem;
    height: 220px;
    padding: .5rem 0 0;
}
.bar-chart .bar {
    background: linear-gradient(180deg, var(--accent) 0%, var(--brand) 100%);
    min-height: 2px;
    border-radius: 5px 5px 0 0;
    position: relative;
    transition: filter .18s var(--ease), transform .18s var(--ease);
    cursor: default;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
}
.bar-chart .bar:hover {
    filter: brightness(1.1);
    transform: scaleY(1.02);
}
.bar-chart .bar[data-zero="true"] {
    background: var(--bg-2);
    box-shadow: none;
    min-height: 2px;
}
.bar-chart .bar .val {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--mono);
    font-size: .7rem;
    color: var(--ink-2);
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 1px 5px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity .15s var(--ease);
    pointer-events: none;
    white-space: nowrap;
}
.bar-chart .bar:hover .val { opacity: 1; }
.bar-chart-x {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
    gap: .35rem;
    margin-top: .5rem;
    padding-top: .5rem;
    border-top: 1px solid var(--line);
}
.bar-chart-x .x-label {
    font-family: var(--mono);
    font-size: .65rem;
    color: var(--muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Horizontal mini-bars (by-level, by-status, top diagnoses) */
.mini-bars {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.mini-bar-row {
    display: grid;
    grid-template-columns: minmax(90px, 30%) 1fr 50px;
    align-items: center;
    gap: .65rem;
    font-size: .85rem;
}
.mini-bar-row .mb-label {
    color: var(--ink-2);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mini-bar-track {
    height: 8px;
    background: var(--bg-2);
    border-radius: 999px;
    position: relative;
    overflow: hidden;
}
.mini-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--brand) 100%);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
    transition: width .4s var(--ease);
}
.mini-bar-fill.muted {
    background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink-2) 100%);
}
.mini-bar-fill.warn { background: linear-gradient(90deg, var(--amber) 0%, #92400e 100%); }
.mini-bar-fill.danger { background: linear-gradient(90deg, var(--rose) 0%, #7f1d1d 100%); }
.mini-bar-row .mb-value {
    text-align: right;
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Donut/ring (status approval) — pure CSS conic-gradient */
.donut {
    --pct: 0;
    --size: 130px;
    --thickness: 14px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: conic-gradient(
        var(--accent) calc(var(--pct) * 1%),
        var(--bg-2) calc(var(--pct) * 1%) 100%
    );
    position: relative;
    flex-shrink: 0;
}
.donut::after {
    content: "";
    position: absolute;
    inset: var(--thickness);
    background: var(--surface);
    border-radius: 50%;
    box-shadow: inset 0 1px 4px rgba(10,10,10,.05);
}
.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.donut-center .num {
    font-family: var(--display);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1;
}
.donut-center .lbl {
    font-size: .65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-top: 4px;
}

/* Section header inside cards */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}
.section-head h6 {
    margin: 0;
    font-family: var(--sans);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: .4rem;
}
.section-head h6::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 1.5px;
    background: var(--accent);
    border-radius: 1px;
}

/* Two-column analytics layout */
.analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (max-width: 992px) {
    .analytics-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   IMM status banner (used in trainee Exams detail)
   ========================================================================= */
.imm-banner {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 1rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}
.imm-banner::before {
    content: "";
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
}
.imm-banner.imm-passed::before { background: linear-gradient(180deg, var(--brand) 0%, var(--accent) 100%); }
.imm-banner.imm-attempted::before { background: linear-gradient(180deg, var(--amber) 0%, var(--ochre, var(--amber)) 100%); }
.imm-banner.imm-none::before { background: var(--line-strong); }

.imm-banner .imm-icon {
    width: 56px; height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-md);
    font-size: 1.6rem;
}
.imm-banner.imm-passed .imm-icon {
    background: var(--accent-soft);
    color: var(--accent-ink);
}
.imm-banner.imm-attempted .imm-icon {
    background: var(--amber-soft);
    color: var(--amber);
}
.imm-banner.imm-none .imm-icon {
    background: var(--bg-2);
    color: var(--muted);
}
.imm-banner .imm-text { min-width: 0; }
.imm-banner .imm-title {
    font-family: var(--display);
    font-weight: 600;
    color: var(--ink);
    font-size: 1.05rem;
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.imm-pill {
    font-family: var(--sans);
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
}
.imm-pill.pass  { background: var(--accent-soft); color: var(--accent-ink); }
.imm-pill.warn  { background: var(--amber-soft); color: var(--amber); }
.imm-pill.muted { background: var(--bg-2); color: var(--muted); border-color: var(--line); }

.imm-banner .imm-sub {
    font-size: .85rem;
    color: var(--muted);
    margin-top: 2px;
}

.imm-banner .imm-diploma {
    font-size: .82rem;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: .55rem .75rem;
    min-width: 240px;
}
.imm-banner .imm-diploma .d-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .15rem .75rem;
}
.imm-banner .imm-diploma .k {
    color: var(--muted);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
    display: block;
    margin-bottom: 1px;
}
.imm-banner .imm-diploma .v {
    color: var(--ink);
    font-weight: 500;
    font-size: .85rem;
}
.imm-banner .imm-diploma .v.mono { font-family: var(--mono); }

@media (max-width: 768px) {
    .imm-banner { grid-template-columns: 56px 1fr; }
    .imm-banner .imm-diploma { grid-column: 1 / -1; }
}

/* =========================================================================
   Workshops grid (catalog cards)
   ========================================================================= */
.workshop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.workshop-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 1.1rem 1.15rem 1.15rem;
    box-shadow: var(--shadow-1);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
    position: relative;
    overflow: hidden;
}
.workshop-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}
.workshop-card .ws-type {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: .6rem;
}
.workshop-card h4 {
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 .65rem;
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: var(--ink);
}
.workshop-card .ws-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .5rem;
}
.workshop-card .ws-meta .meta-chip {
    font-family: var(--mono);
    font-size: .72rem;
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--ink-3);
    padding: 2px 7px;
    border-radius: 5px;
}
.workshop-card .ws-meta .meta-chip strong { color: var(--ink); font-weight: 600; }

/* Schedule timeline rows */
.schedule-row {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: .75rem 0;
    border-bottom: 1px solid var(--line);
}
.schedule-row:last-child { border-bottom: none; }
.schedule-date {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    text-align: center;
    padding: .35rem .5rem;
    font-family: var(--mono);
    line-height: 1.1;
}
.schedule-date .d-month {
    display: block;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--brand);
    font-weight: 700;
}
.schedule-date .d-day {
    display: block;
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
    margin: 1px 0 2px;
}
.schedule-date .d-year {
    display: block;
    font-size: .62rem;
    color: var(--muted);
}
.schedule-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.schedule-meta .name {
    font-weight: 600;
    color: var(--ink);
    font-size: .94rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.schedule-meta .sub {
    font-size: .8rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
}
.schedule-meta .sub i { margin-right: .2rem; opacity: .7; }

/* =========================================================================
   Alerts feed
   ========================================================================= */
.feed {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.feed-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 1rem 1.15rem;
    box-shadow: var(--shadow-1);
    position: relative;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.feed-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.feed-item .feed-source {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-2);
    color: var(--ink-3);
    border: 1px solid var(--line);
    margin-right: .5rem;
}
.feed-item .feed-source.eportal { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.feed-item .feed-source.fcps1 { background: var(--indigo-soft); color: var(--indigo); border-color: transparent; }
.feed-item .feed-source.update { background: var(--amber-soft); color: var(--amber); border-color: transparent; }

.feed-item .feed-head {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .35rem;
    flex-wrap: wrap;
}
.feed-item .feed-date {
    font-family: var(--mono);
    font-size: .72rem;
    color: var(--muted);
}
.feed-item h4 {
    font-family: var(--sans);
    font-size: .98rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 .35rem;
    letter-spacing: -0.01em;
    line-height: 1.35;
}
.feed-item p {
    font-size: .87rem;
    color: var(--ink-3);
    margin: 0;
    line-height: 1.5;
}
.feed-item .feed-foot {
    margin-top: .6rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
}
.feed-item .pill {
    font-size: .68rem;
    font-weight: 500;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--bg-2);
    color: var(--ink-3);
    border: 1px solid var(--line);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.feed-item .pill.active { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.feed-item .pill.expired { background: var(--rose-soft); color: var(--rose); border-color: transparent; }

/* Tabs strip used on workshops + alerts */
.tabs-strip {
    display: inline-flex;
    background: var(--surface);
    padding: .35rem;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
    gap: .25rem;
    margin-bottom: 1rem;
}
.tabs-strip .tab-btn {
    background: transparent;
    border: 0;
    color: var(--ink-3);
    font-size: .85rem;
    font-weight: 500;
    padding: .45rem .85rem;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all .15s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.tabs-strip .tab-btn:hover { color: var(--ink); background: var(--bg-2); }
.tabs-strip .tab-btn.active { color: var(--ink); background: var(--bg-2); box-shadow: var(--shadow-1); }
.tabs-strip .tab-btn .badge { background: var(--ink); color: var(--surface) !important; padding: 0 6px; font-size: .65rem; }

/* =========================================================================
   Photo lightbox
   ========================================================================= */
.cpsp-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, .82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s var(--ease);
}
.cpsp-lightbox.open { opacity: 1; pointer-events: auto; }
.cpsp-lightbox-inner {
    position: relative;
    max-width: min(92vw, 720px);
    max-height: 90vh;
    text-align: center;
}
.cpsp-lightbox img {
    width: auto;
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--r-md);
    box-shadow: 0 20px 80px rgba(0,0,0,.6);
    background: var(--surface);
}
.cpsp-lightbox-close {
    position: absolute;
    top: -38px;
    right: 0;
    width: 32px; height: 32px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s var(--ease);
}
.cpsp-lightbox-close:hover { background: rgba(255,255,255,.22); }
.cpsp-lightbox-caption {
    color: #fff;
    margin-top: .75rem;
    font-family: var(--display);
    font-size: 1rem;
    letter-spacing: -0.01em;
}

/* =========================================================================
   Recent / saved searches strip
   ========================================================================= */
.recent-searches {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .65rem 1rem;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    margin-bottom: 1rem;
    font-size: .82rem;
}
.recent-searches .rs-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
    color: var(--muted);
    margin-right: .35rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.recent-searches .rs-label i { color: var(--accent); }
.recent-searches .rs-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    padding: .2rem .65rem;
    font-family: var(--mono);
    font-size: .76rem;
    color: var(--ink-2);
    transition: all .15s var(--ease);
    text-decoration: none;
    font-weight: 500;
}
.recent-searches .rs-chip:hover {
    border-color: var(--ink);
    color: var(--ink);
    background: var(--surface);
}
.recent-searches .rs-chip strong { color: var(--ink); font-weight: 600; }
.recent-searches .rs-chip .rs-field {
    color: var(--muted);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-right: .15rem;
}
.recent-searches .rs-clear {
    margin-left: auto;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: .76rem;
    cursor: pointer;
    padding: 0;
}
.recent-searches .rs-clear:hover { color: var(--rose); }

/* =========================================================================
   Trainee Timeline
   ========================================================================= */
.timeline {
    position: relative;
    padding: 0 0 0 24px;
    margin: 0;
    list-style: none;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--brand) 50%, var(--line));
    border-radius: 2px;
}
.timeline-item {
    position: relative;
    padding: .35rem 0 1rem 16px;
}
.timeline-item::before {
    content: "";
    position: absolute;
    left: -22px;
    top: .55rem;
    width: 12px; height: 12px;
    background: var(--surface);
    border: 2px solid var(--brand);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.timeline-item.t-elog::before    { border-color: var(--brand); }
.timeline-item.t-cex::before     { border-color: var(--cpsp-blue); box-shadow: 0 0 0 3px var(--indigo-soft); }
.timeline-item.t-paper::before   { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.timeline-item.t-poster::before  { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.timeline-item.t-jclub::before   { border-color: var(--ink-3); box-shadow: 0 0 0 3px var(--bg-2); }
.timeline-item.t-research::before{ border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-soft); }
.timeline-item.t-exam::before    { border-color: var(--brand-deep); box-shadow: 0 0 0 3px var(--accent-soft); }
.timeline-item.t-workshop::before{ border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.timeline-item.t-activity::before{ border-color: var(--ochre, var(--amber)); box-shadow: 0 0 0 3px var(--amber-soft); }

.timeline-head {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 2px;
}
.timeline-date {
    font-family: var(--mono);
    font-size: .72rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: .04em;
}
.timeline-source {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--bg-2);
    color: var(--ink-3);
    border: 1px solid var(--line);
}
.timeline-source.elog    { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.timeline-source.cex     { background: var(--indigo-soft); color: var(--cpsp-blue); border-color: transparent; }
.timeline-source.paper   { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.timeline-source.poster  { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.timeline-source.exam    { background: var(--bg-2); color: var(--ink); }
.timeline-source.workshop{ background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.timeline-source.activity{ background: var(--amber-soft); color: var(--amber); border-color: transparent; }

.timeline-title {
    font-family: var(--sans);
    font-weight: 600;
    color: var(--ink);
    font-size: .92rem;
    margin: 0;
    line-height: 1.4;
    letter-spacing: -0.01em;
}
.timeline-desc {
    font-size: .82rem;
    color: var(--muted);
    margin-top: 1px;
    line-height: 1.45;
}

/* =========================================================================
   Compare trainees
   ========================================================================= */
.compare-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 220px repeat(var(--cols, 3), minmax(0, 1fr));
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-1);
}
.compare-grid > div {
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--line);
}
.compare-grid > .row-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
    color: var(--muted);
    background: var(--bg-2);
    align-content: center;
    display: flex;
    align-items: center;
}
.compare-grid > .col-head {
    background: var(--bg-2);
    font-family: var(--display);
    font-weight: 600;
    color: var(--ink);
    border-bottom: 1px solid var(--line-2);
    line-height: 1.2;
    font-size: .98rem;
    letter-spacing: -0.015em;
}
.compare-grid > .row-label.first,
.compare-grid > .col-head { border-top: none; }
.compare-grid > .cell-num {
    font-family: var(--display);
    font-weight: 600;
    color: var(--ink);
    font-size: 1.3rem;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

/* =========================================================================
   Specialty browser
   ========================================================================= */
.spec-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 1rem 1.15rem;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
    box-shadow: var(--shadow-1);
}
.spec-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-2);
}
.spec-card .spec-id {
    font-family: var(--mono);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    background: var(--bg-2);
    padding: 1px 6px;
    border-radius: 4px;
}
.spec-card h4 {
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 600;
    margin: .5rem 0 .35rem;
    color: var(--ink);
    letter-spacing: -0.015em;
    line-height: 1.25;
}
.spec-card .spec-stats {
    display: flex;
    gap: 1rem;
    margin-top: .65rem;
    padding-top: .65rem;
    border-top: 1px solid var(--line);
    font-size: .85rem;
}
.spec-card .spec-stats .s {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.spec-card .spec-stats .s .n {
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--brand);
    line-height: 1;
}
.spec-card .spec-stats .s .l {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 768px) {
    .card-body { padding: 1.15rem; }
    .app-navbar .nav-link { padding: .4rem .65rem !important; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   UI/UX Enhancements (Modern Bento & Micro-animations)
   ========================================================================= */

/* Empty states */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--muted);
}
.empty-state i {
    font-size: 2.2rem;
    color: var(--line-strong);
    margin-bottom: .75rem;
    display: block;
}
.empty-state span {
    font-size: .95rem;
    font-weight: 500;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 0 0 3rem;
    grid-auto-flow: dense;
}
.bento-grid .span-2 {
    grid-column: span 2;
}
.bento-hero {
    min-height: 240px;
    background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
    border-color: var(--line-strong);
}
@media (max-width: 768px) {
    .bento-grid .span-2 {
        grid-column: span 1;
    }
}

/* Enhancing stats grid glowing elements */
.text-gradient {
    background: linear-gradient(90deg, var(--brand-deep), var(--brand-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}
.glow-icon {
    text-shadow: 0 0 12px rgba(0, 144, 102, 0.4);
    animation: glowPulse 3s infinite alternate;
}
@keyframes glowPulse {
    from { text-shadow: 0 0 8px rgba(0, 144, 102, 0.2); }
    to { text-shadow: 0 0 16px rgba(0, 144, 102, 0.6); }
}

/* Modern Toasts */
.toast-container {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    z-index: 1055;
    pointer-events: none;
}
.modern-toast {
    pointer-events: auto;
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
    color: var(--ink);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    min-width: 250px;
    max-width: 400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.4s var(--ease);
}
.modern-toast .btn-close {
    background-size: 0.8em;
    opacity: 0.5;
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 0 0 3rem;
    grid-auto-flow: dense;
}
.bento-grid .span-2 {
    grid-column: span 2;
}
.bento-hero {
    min-height: 240px;
    background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
    border-color: var(--line-strong);
}
@media (max-width: 768px) {
    .bento-grid .span-2 {
        grid-column: span 1;
    }
}

/* Enhancing stats grid glowing elements */
.text-gradient {
    background: linear-gradient(90deg, var(--brand-deep), var(--brand-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}
.glow-icon {
    text-shadow: 0 0 12px rgba(0, 144, 102, 0.4);
    animation: glowPulse 3s infinite alternate;
}
@keyframes glowPulse {
    from { text-shadow: 0 0 8px rgba(0, 144, 102, 0.2); }
    to { text-shadow: 0 0 16px rgba(0, 144, 102, 0.6); }
}

/* Modern Toasts */
.toast-container {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    z-index: 1055;
    pointer-events: none;
}
.modern-toast {
    pointer-events: auto;
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
    color: var(--ink);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    min-width: 250px;
    max-width: 400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.4s var(--ease);
}
.modern-toast .btn-close {
    background-size: 0.8em;
    opacity: 0.5;
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
