/* =============================================================================
   01. DESIGN TOKENS
   ICGC Form Management Portal — Apple iOS/macOS Inspired Design System
   International Central Gospel Church
   ============================================================================= */

:root {
    /* ── Primary Greens ──────────────────────────────────────────────────── */
    --c-green-900: #123629;
    --c-green-800: #174332;
    --c-green-700: #20563F;
    --c-green-600: #2D6B4F;
    --c-green-500: #397D5C;
    --c-green-100: #EAF2ED;
    --c-green-50:  #F3F7F4;

    /* ── Gold Accents ────────────────────────────────────────────────────── */
    --c-gold-800: #98783C;
    --c-gold-700: #AD8C4D;
    --c-gold-500: #C1A66E;
    --c-gold-300: #DFD0A9;
    --c-gold-50:  #F6F1E6;

    /* ── Neutrals ────────────────────────────────────────────────────────── */
    --c-bg:        #F5F7F6;
    --c-surface:   #FFFFFF;
    --c-surface-2: #F8FAF9;
    --c-text:      #25342C;
    --c-text-2:    #69776F;
    --c-muted:     #929C95;
    --c-border:    #E6EBE7;
    --c-border-2:  #D4DDD6;

    /* ── Status ──────────────────────────────────────────────────────────── */
    --c-success:    #27835A;
    --c-success-bg: #EAF5EE;
    --c-warning:    #A97924;
    --c-warning-bg: #FBF3E3;
    --c-danger:     #C44F4F;
    --c-danger-bg:  #FCEEEE;
    --c-info:       #4679A5;
    --c-info-bg:    #EDF4FA;

    /* ── Semantic aliases (keep old names pointing to new tokens so
           existing PHP classes continue working) ──────────────────────── */
    --bg:           var(--c-bg);
    --panel:        var(--c-surface);
    --panel-alt:    var(--c-surface-2);
    --primary:      var(--c-green-700);
    --primary-dark: var(--c-green-900);
    --primary-light:var(--c-green-500);
    --accent:       var(--c-gold-700);
    --accent-light: var(--c-gold-300);
    --muted:        var(--c-text-2);
    --border:       var(--c-border);
    --success:      var(--c-success);
    --warning:      var(--c-warning);
    --danger:       var(--c-danger);
    --text:         var(--c-text);
    --shadow:       0 1px 3px rgba(18,54,41,.06), 0 4px 12px rgba(18,54,41,.08);

    /* ── Old green/gold aliases (keep for tick-sheet category colours) ── */
    --green-900: var(--c-green-900);
    --green-800: var(--c-green-800);
    --green-700: var(--c-green-700);
    --green-600: var(--c-green-600);
    --green-100: var(--c-green-100);
    --green-50:  var(--c-green-50);
    --gold-700:  var(--c-gold-800);
    --gold-600:  var(--c-gold-700);
    --gold-500:  var(--c-gold-700);
    --gold-400:  var(--c-gold-500);
    --gold-300:  var(--c-gold-300);
    --gold-100:  var(--c-gold-50);
    --gold-50:   var(--c-gold-50);

    /* ── Typography ──────────────────────────────────────────────────────── */
    --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
                 "Segoe UI", Inter, Roboto, sans-serif;
    --font-mono: "SF Mono", "Fira Mono", "Consolas", monospace;

    /* ── Spacing ─────────────────────────────────────────────────────────── */
    --sp-1:  4px;
    --sp-2:  8px;
    --sp-3:  12px;
    --sp-4:  16px;
    --sp-5:  20px;
    --sp-6:  24px;
    --sp-8:  32px;
    --sp-10: 40px;
    --sp-12: 48px;

    /* ── Radii ───────────────────────────────────────────────────────────── */
    --r-sm:  8px;
    --r-md:  12px;
    --r-lg:  16px;
    --r-xl:  20px;
    --r-pill:999px;

    /* ── Transitions ─────────────────────────────────────────────────────── */
    --t-fast:   .15s ease;
    --t-normal: .22s ease;
    --t-spring: .28s cubic-bezier(.34,1.4,.64,1);

    /* ── Shadows ─────────────────────────────────────────────────────────── */
    --shadow-xs: 0 1px 2px rgba(18,54,41,.05);
    --shadow-sm: 0 1px 3px rgba(18,54,41,.06), 0 4px 12px rgba(18,54,41,.08);
    --shadow-md: 0 4px 16px rgba(18,54,41,.10), 0 1px 4px rgba(18,54,41,.06);
    --shadow-lg: 0 12px 40px rgba(18,54,41,.14), 0 2px 8px rgba(18,54,41,.06);
    --shadow-xl: 0 24px 60px rgba(18,54,41,.18), 0 4px 12px rgba(18,54,41,.08);
}

body {
    font-family: var(--font-body);
    background: var(--c-bg);
    color: var(--c-text);
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 1.05em;
    line-height: 1;
    vertical-align: middle;
}

/* =============================================================================
   02. GLOBAL RESET & PAGE LAYOUT
   ============================================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: .9375rem;
    line-height: 1.55;
    background: var(--c-bg);
    color: var(--c-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--c-green-700);
    text-decoration: none;
    transition: color var(--t-fast);
}
a:hover { color: var(--c-green-600); }

h1, h2, h3, h4 { color: var(--c-text); line-height: 1.2; }
h1 { font-size: 1.5rem;   font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.125rem; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 1rem;     font-weight: 600; }

/* Page shell */
.page-shell {
    max-width: 1260px;
    margin: 28px auto;
    padding: 0 24px 56px;
    animation: fadeInUp .38s cubic-bezier(.22,1,.36,1) both;
}
.narrow-page { max-width: 920px; }

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
    padding-bottom: var(--sp-5);
    border-bottom: 1px solid var(--c-border);
    animation: slideInLeft .36s .04s cubic-bezier(.22,1,.36,1) both;
}

.eyebrow {
    display: inline-block;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--c-gold-700);
    margin-bottom: var(--sp-1);
}

.page-actions {
    display: flex;
    gap: var(--sp-2);
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}

.section-title {
    font-size: .875rem;
    font-weight: 700;
    color: var(--c-green-800);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0 0 var(--sp-5);
    padding-bottom: var(--sp-3);
    border-bottom: 2px solid var(--c-gold-300);
}

.subsection-title {
    font-size: .75rem;
    font-weight: 700;
    color: var(--c-gold-700);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: var(--sp-6) 0 var(--sp-3);
}

/* Two-column layout */
.two-col-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--sp-5);
    margin-bottom: var(--sp-5);
}

.dashboard-summary {
    margin-bottom: var(--sp-5);
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--sp-6);
}

.dashboard-summary-grid > div {
    min-width: 0;
}

.dashboard-summary-grid .list-compact li > div {
    min-width: 0;
}

.dashboard-summary-grid .list-compact small {
    line-height: 1.5;
}

.dashboard-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-5);
    margin-bottom: var(--sp-5);
}

.dashboard-admin-grid > .card {
    min-width: 0;
}

.admin-trend-list,
.admin-metric-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.admin-trend-row {
    display: grid;
    grid-template-columns: 72px minmax(60px, 1fr) 36px;
    align-items: center;
    gap: var(--sp-3);
    font-size: .82rem;
}

.admin-trend-track {
    height: 9px;
    overflow: hidden;
    border-radius: var(--r-pill);
    background: var(--c-green-100);
}

.admin-trend-track span {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: var(--c-green-600);
}

.admin-trend-row strong {
    text-align: right;
    color: var(--c-green-700);
}

.admin-metric-list > div {
    display: flex;
    justify-content: space-between;
    gap: var(--sp-3);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--c-border);
    font-size: .875rem;
}

.admin-metric-list strong {
    color: var(--c-green-700);
}

.admin-note {
    display: block;
    margin-top: var(--sp-4);
    color: var(--c-muted);
    line-height: 1.5;
}

.admin-activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-activity-list li {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--c-border);
    overflow-wrap: anywhere;
    font-size: .82rem;
}

.admin-activity-list li > strong {
    color: var(--c-green-800);
}

.admin-activity-list li > small {
    color: var(--c-muted);
}

/* =============================================================================
   03. NAVIGATION
   ============================================================================= */

/* Nav wrapper — full-width sticky strip that holds the contained nav */
.nav-wrapper {
    position: sticky;
    top: 0;
    z-index: 200;
    background: transparent;
    padding: 10px 16px 0;
    /* subtle page-level backdrop so the pill nav reads against any background */
}

.top-nav {
    display: flex;
    align-items: center;
    height: 88px;
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 20px;
    background: var(--c-green-900);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(18,54,41,.35), 0 1px 0 rgba(255,255,255,.04) inset;
    /* NOT sticky itself — wrapper handles that */
    position: relative;
    top: auto;
    z-index: auto;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    text-decoration: none;
    color: #fff;
    flex-shrink: 0;
    padding-right: 20px;
    margin-right: 4px;
    border-right: 1px solid rgba(255,255,255,.1);
    height: 100%;
    transition: opacity var(--t-fast);
}
.brand:hover { opacity: .85; color: #fff; }

.brand-logo {
    height: 62px;
    width: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.4));
}
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.brand-name {
    font-size: .875rem;
    font-weight: 700;
    color: var(--c-gold-300);
    letter-spacing: .02em;
    white-space: nowrap;
}
.brand-sub {
    font-size: .625rem;
    color: rgba(255,255,255,.5);
    text-transform: uppercase;
    letter-spacing: .1em;
    white-space: nowrap;
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--sp-2);
    margin-left: auto;
    border-radius: var(--r-sm);
    transition: background var(--t-fast);
}
.nav-toggle:hover { background: rgba(255,255,255,.08); }
.nav-toggle span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: rgba(255,255,255,.85);
    border-radius: 2px;
    transition: transform .22s ease, opacity .22s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Nav body — flex row, links sit left, user sits right */
.nav-body {
    display: flex;
    align-items: center;
    flex: 1;
    height: 100%;
    min-width: 0;
}

/* Nav links — compact, no stretching */
.nav-links {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 12px;
    gap: 2px;
    flex: 0 0 auto;   /* ← key: do NOT grow to fill space */
    overflow-x: auto;
    scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding: 0 14px;
    color: rgba(255,255,255,.7);
    font-size: .8125rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.nav-links a:hover {
    color: rgba(255,255,255,.95);
    background: rgba(255,255,255,.06);
}
.nav-links a[aria-current="page"] {
    color: var(--c-gold-300);
    border-bottom-color: var(--c-gold-500);
    font-weight: 600;
}

/* Divider — invisible flex spacer that pushes user pill to the right */
.nav-divider {
    flex: 1;
    min-width: 16px;
    height: 1px;
    background: transparent;
}

/* Nav user */
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    flex-shrink: 0;
}
.nav-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    text-align: right;
}
.nav-user-name {
    font-size: .8rem;
    font-weight: 600;
    color: rgba(255,255,255,.9);
    white-space: nowrap;
}
.nav-user-role {
    font-size: .65rem;
    color: var(--c-gold-300);
    text-transform: uppercase;
    letter-spacing: .07em;
    white-space: nowrap;
}
.nav-user-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-user-actions a {
    color: rgba(255,255,255,.75);
    font-size: .78rem;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: var(--r-sm);
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast);
    white-space: nowrap;
}
.nav-user-actions a:hover {
    color: rgba(255,255,255,.95);
    background: rgba(255,255,255,.08);
}
.nav-logout {
    background: rgba(255,255,255,.06) !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    color: rgba(255,255,255,.8) !important;
    border-radius: var(--r-sm) !important;
    padding: 5px 12px !important;
    font-size: .78rem !important;
    transition: background var(--t-fast), border-color var(--t-fast) !important;
}
.nav-logout:hover {
    background: rgba(193,166,110,.2) !important;
    border-color: var(--c-gold-500) !important;
    color: var(--c-gold-300) !important;
}

@media (max-width: 860px) {
    .nav-wrapper { padding: 8px 10px 0; }
    .top-nav { height: auto; flex-wrap: wrap; padding: 10px 16px 12px; border-radius: 12px; }
    .brand { height: auto; border-right: none; padding-right: 0; }
    .nav-toggle { display: flex; }
    .nav-body {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        height: auto;
        padding: var(--sp-2) 0 var(--sp-2);
        border-top: 1px solid rgba(255,255,255,.08);
        margin-top: 8px;
        gap: var(--sp-1);
    }
    .nav-body.open { display: flex; }
    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        overflow: visible;
        width: 100%;
        padding: 0;
        gap: 2px;
        flex: 0 0 auto;
    }
    .nav-links a {
        height: auto;
        width: 100%;
        padding: var(--sp-3) var(--sp-3);
        border-bottom: none;
        border-left: 2px solid transparent;
        margin-bottom: 0;
        border-radius: var(--r-sm);
    }
    .nav-links a:hover,
    .nav-links a[aria-current="page"] {
        border-bottom: none;
        border-left-color: var(--c-gold-500);
        background: rgba(255,255,255,.06);
    }
    .nav-divider { flex: 0; width: 100%; height: 1px; background: rgba(255,255,255,.08); margin: var(--sp-2) 0; }
    .nav-user { flex-direction: row; flex-wrap: wrap; padding-left: 0; gap: 8px; width: 100%; }
    .nav-user-pill { flex: 1; border-radius: 10px; padding: 8px 12px; }
    .nav-action-btn { flex: 1; justify-content: center; }
}

/* =============================================================================
   04. STATISTICS CARDS
   ============================================================================= */

.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
}

.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-lg);
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    cursor: default;
    min-width: 160px;
    flex: 0 0 auto;   /* ← do NOT stretch — natural width only */
    width: 180px;     /* fixed comfortable width */
    transition: transform var(--t-spring), box-shadow var(--t-normal);
    box-shadow: var(--shadow-md);
    animation: fadeInUp .4s cubic-bezier(.22,1,.36,1) both;
}
.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Gloss layer */
.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(255,255,255,.12) 0%, transparent 60%);
    pointer-events: none;
    border-radius: inherit;
}

/* Decorative ring */
.stat-card::after {
    content: '';
    position: absolute;
    bottom: -18px;
    right: -18px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    transition: transform .4s ease;
}
.stat-card:hover::after { transform: scale(1.7); }

.stat-card span {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: rgba(255,255,255,.78);
    position: relative;
}
.stat-card strong {
    font-size: 2.25rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    position: relative;
    text-shadow: 0 1px 4px rgba(0,0,0,.12);
}

/* Per-card gradients using nth-child */
.stat-card:nth-child(1)  { background: linear-gradient(140deg, #174332 0%, #2D6B4F 100%); }
.stat-card:nth-child(2)  { background: linear-gradient(140deg, #AD8C4D 0%, #DFD0A9 100%); }
.stat-card:nth-child(3)  { background: linear-gradient(140deg, #20563F 0%, #397D5C 100%); }
.stat-card:nth-child(4)  { background: linear-gradient(140deg, #98783C 0%, #C1A66E 100%); }
.stat-card:nth-child(5)  { background: linear-gradient(140deg, #123629 0%, #20563F 100%); }
.stat-card:nth-child(6)  { background: linear-gradient(140deg, #7d5000 0%, #AD8C4D 100%); }
.stat-card:nth-child(7)  { background: linear-gradient(140deg, #2D6B4F 0%, #4d9e77 100%); }
.stat-card:nth-child(8)  { background: linear-gradient(140deg, #6b5500 0%, #C1A66E 100%); }
.stat-card:nth-child(9)  { background: linear-gradient(140deg, #174332 0%, #2D6B4F 100%); }
.stat-card:nth-child(10) { background: linear-gradient(140deg, #AD8C4D 0%, #98783C 100%); }

/* Staggered entrance delays */
.stat-card:nth-child(1)  { animation-delay: .04s; }
.stat-card:nth-child(2)  { animation-delay: .08s; }
.stat-card:nth-child(3)  { animation-delay: .12s; }
.stat-card:nth-child(4)  { animation-delay: .16s; }
.stat-card:nth-child(5)  { animation-delay: .20s; }
.stat-card:nth-child(6)  { animation-delay: .24s; }
.stat-card:nth-child(7)  { animation-delay: .28s; }
.stat-card:nth-child(8)  { animation-delay: .32s; }
.stat-card:nth-child(9)  { animation-delay: .36s; }
.stat-card:nth-child(10) { animation-delay: .40s; }

/* Named semantic variants */
.stat-card.card-total     { background: linear-gradient(140deg, #123629, #20563F); }
.stat-card.card-progress  { background: linear-gradient(140deg, #20563F, #397D5C); }
.stat-card.card-submitted { background: linear-gradient(140deg, #98783C, #AD8C4D); }
.stat-card.card-approved  { background: linear-gradient(140deg, #27835A, #397D5C); }
.stat-card.card-returned  { background: linear-gradient(140deg, #8B2E2E, #C44F4F); }
.stat-card.card-completed { background: linear-gradient(140deg, #7d5000, #C1A66E); }
.stat-card.card-followup  { background: linear-gradient(140deg, #AD8C4D, #DFD0A9); }
.stat-card.card-avg       { background: linear-gradient(140deg, #2D6B4F, #4d9e77); }

/* =============================================================================
   05. CARDS & PANELS
   ============================================================================= */

.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform var(--t-normal), box-shadow var(--t-normal);
    animation: fadeInUp .38s .06s cubic-bezier(.22,1,.36,1) both;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.panel-form {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 20px;
    animation: scaleIn .34s .05s cubic-bezier(.22,1,.36,1) both;
}

/* Info grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--sp-3);
    margin-bottom: 20px;
}
.info-item {
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-left: 3px solid var(--c-gold-500);
    border-radius: var(--r-md);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: transform var(--t-fast), box-shadow var(--t-fast), border-left-color var(--t-fast);
}
.info-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xs);
    border-left-color: var(--c-green-600);
}
.info-item span {
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--c-muted);
}
.info-item strong { font-size: .9rem; color: var(--c-text); font-weight: 600; }

/* List compact */
.list-compact {
    list-style: none;
    margin: var(--sp-4) 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}
.list-compact li {
    display: flex;
    justify-content: space-between;
    gap: var(--sp-3);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--c-border);
    font-size: .875rem;
    color: var(--c-text-2);
}
.list-compact li strong { color: var(--c-green-700); font-weight: 600; }

/* =============================================================================
   06. BUTTONS
   ============================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 9px 18px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--t-normal);
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--c-green-700);
    color: #fff;
    border-color: var(--c-green-800);
}
.btn-primary:hover {
    background: var(--c-green-600);
    color: #fff;
    box-shadow: 0 4px 14px rgba(32,86,63,.3);
}

.btn-secondary {
    background: var(--c-gold-50);
    color: var(--c-gold-800);
    border-color: var(--c-gold-300);
}
.btn-secondary:hover {
    background: var(--c-gold-300);
    color: var(--c-gold-800);
}

.btn-success {
    background: var(--c-success);
    color: #fff;
    border-color: #1e6a49;
}
.btn-success:hover {
    background: #206e4c;
    color: #fff;
    box-shadow: 0 4px 14px rgba(39,131,90,.3);
}

.btn-danger {
    background: var(--c-danger-bg);
    color: var(--c-danger);
    border-color: #e8aaaa;
}
.btn-danger:hover {
    background: var(--c-danger);
    color: #fff;
}

.btn-link {
    background: transparent;
    color: var(--c-green-700);
    padding: 0;
    border: none;
    font-weight: 600;
}
.btn-link:hover { color: var(--c-gold-700); transform: none; }

.btn-lg { padding: 12px 26px; font-size: .9375rem; border-radius: var(--r-lg); }
.full-width { width: 100%; }

/* Disabled */
.btn:disabled, .btn[disabled] {
    opacity: .45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Focus visible ring */
.btn:focus-visible {
    outline: 2px solid var(--c-green-500);
    outline-offset: 2px;
}

/* =============================================================================
   07. FORMS & INPUTS
   ============================================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.full-width { grid-column: 1 / -1; }

label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--c-green-800);
    text-transform: uppercase;
    letter-spacing: .05em;
}
label span { color: var(--c-green-800); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }

input, select, textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--c-border-2);
    border-radius: var(--r-md);
    font-family: var(--font-body);
    font-size: .9rem;
    line-height: 1.4;
    color: var(--c-text);
    background: #fff;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
    -webkit-appearance: none;
    appearance: none;
}
select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2369776F' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 36px; cursor: pointer; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--c-green-600);
    box-shadow: 0 0 0 3px rgba(45,107,79,.12);
    transform: translateY(-1px);
}

input[readonly], textarea[readonly] {
    background: var(--c-surface-2);
    color: var(--c-text-2);
    cursor: default;
    border-color: var(--c-border);
}
input[readonly]:focus, textarea[readonly]:focus {
    transform: none;
    box-shadow: none;
    border-color: var(--c-border);
}

input:disabled, select:disabled, textarea:disabled {
    background: var(--c-surface-2);
    color: var(--c-muted);
    cursor: not-allowed;
    opacity: .65;
}

textarea { resize: vertical; min-height: 90px; }
input[type="file"] {
    padding: 8px 12px;
    background: #fff;
    cursor: pointer;
}
input[type="checkbox"], input[type="radio"] {
    width: 16px; height: 16px;
    accent-color: var(--c-green-700);
    cursor: pointer;
    flex-shrink: 0;
}

.required { color: var(--c-danger); font-weight: 700; font-size: .8rem; }

.checkbox-field {
    flex-direction: row !important;
    align-items: center;
    gap: var(--sp-3) !important;
    font-size: .9rem;
    color: var(--c-text);
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 400 !important;
}
.checkbox-field input { width: auto !important; }
.checkbox-field span {
    color: var(--c-text) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 400 !important;
    font-size: .875rem !important;
}

.form-actions {
    display: flex;
    gap: var(--sp-3);
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Form sections */
.form-section { margin-bottom: var(--sp-6); }
.form-section-header { margin-bottom: var(--sp-3); padding-left: 2px; }
.form-section-header h2 { font-size: .95rem; font-weight: 700; color: var(--c-green-800); margin: 0 0 2px; }
.form-section-header p  { margin: 0; color: var(--c-text-2); font-size: .82rem; }

/* =============================================================================
   08. DATA TABLES
   ============================================================================= */

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--sp-2);
}
.data-table th,
.data-table td {
    padding: 11px var(--sp-3);
    text-align: left;
    border-bottom: 1px solid var(--c-border);
    font-size: .8375rem;
}
.data-table th {
    background: var(--c-green-50);
    color: var(--c-green-800);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-bottom: 2px solid var(--c-border);
    white-space: nowrap;
}
.data-table tbody tr {
    transition: background var(--t-fast);
    animation: fadeInUp .28s cubic-bezier(.22,1,.36,1) both;
}
.data-table tbody tr:hover td { background: var(--c-green-50); }
.data-table tbody tr:nth-child(1)  { animation-delay: .03s; }
.data-table tbody tr:nth-child(2)  { animation-delay: .06s; }
.data-table tbody tr:nth-child(3)  { animation-delay: .09s; }
.data-table tbody tr:nth-child(4)  { animation-delay: .12s; }
.data-table tbody tr:nth-child(5)  { animation-delay: .15s; }
.data-table tbody tr:nth-child(6)  { animation-delay: .18s; }
.data-table tbody tr:nth-child(7)  { animation-delay: .21s; }
.data-table tbody tr:nth-child(8)  { animation-delay: .24s; }
.data-table tbody tr:nth-child(n+9){ animation-delay: .27s; }

/* Action cell */
.action-cell { white-space: nowrap; }
.action-cell .btn { margin-right: var(--sp-1); }

/* Code in tables */
code.action-code, td code {
    background: var(--c-green-50);
    color: var(--c-green-800);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: .78rem;
    font-family: var(--font-mono);
}

/* =============================================================================
   09. STATUS BADGES
   ============================================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    white-space: nowrap;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.badge:hover { transform: scale(1.05); }

/* Checklist status */
.badge-status-draft        { background: #F1F5F9; color: #475569; }
.badge-status-in_progress  { background: var(--c-success-bg); color: var(--c-success); }
.badge-status-submitted    { background: var(--c-info-bg);    color: var(--c-info); }
.badge-status-returned     { background: var(--c-warning-bg); color: var(--c-warning); }
.badge-status-approved     { background: var(--c-success-bg); color: #1e6a49; }
.badge-status-completed    { background: var(--c-green-100);  color: var(--c-green-900); }
.badge-status-cancelled    { background: #F1F5F9; color: #94a3b8; text-decoration: line-through; }
.badge-status-not_started  { background: #F1F5F9; color: #64748b; }
.badge-status-complete     { background: var(--c-success-bg); color: var(--c-success); }

/* User status */
.badge-user-active    { background: var(--c-success-bg); color: var(--c-success); }
.badge-user-inactive  { background: #F1F5F9;  color: #64748b; }
.badge-user-suspended { background: var(--c-danger-bg); color: var(--c-danger); }

/* =============================================================================
   10. ALERTS & NOTIFICATIONS
   ============================================================================= */

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    border-radius: var(--r-md);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: .875rem;
    line-height: 1.5;
    border: 1px solid transparent;
    animation: slideInRight .3s cubic-bezier(.22,1,.36,1) both;
}
.alert-error   { background: var(--c-danger-bg);  color: var(--c-danger);  border-color: #f0baba; }
.alert-success { background: var(--c-success-bg); color: var(--c-success); border-color: #b3dfc7; }
.alert-warning { background: var(--c-warning-bg); color: var(--c-warning); border-color: #f0d9a8; }
.alert-info    { background: var(--c-info-bg);    color: var(--c-info);    border-color: #b8d0e8; }
.js-flash      { transition: opacity .5s ease; }

/* =============================================================================
   11. TICK-SHEET & CHECKLIST
   ============================================================================= */

.howto-box {
    background: var(--c-gold-50);
    border: 1px solid var(--c-gold-300);
    border-left: 4px solid var(--c-gold-700);
    border-radius: var(--r-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: .85rem;
    color: var(--c-gold-800);
    line-height: 1.6;
    animation: slideInRight .36s .08s cubic-bezier(.22,1,.36,1) both;
}
.howto-box ol { margin: 6px 0 0 18px; padding: 0; }
.howto-box strong { color: var(--c-gold-800); font-weight: 700; }
.tick-yes { color: var(--c-success);  font-weight: 700; }
.tick-no  { color: var(--c-danger);   font-weight: 700; }
.tick-na  { color: var(--c-muted);    font-weight: 700; }

/* Category blocks */
.tick-category {
    border-radius: var(--r-md);
    border: 1.5px solid transparent;
    margin-bottom: 14px;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
    animation: slideInLeft .38s cubic-bezier(.22,1,.36,1) both;
}
.tick-category:hover { box-shadow: var(--shadow-sm); }
.tick-category.all-done { border-color: var(--c-green-600); }

.tick-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 16px;
    font-weight: 700;
    font-size: .72rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #fff;
}
.tick-category.all-done .tick-category-header { background: var(--c-green-600) !important; }

.tick-cat-progress {
    background: rgba(255,255,255,.2);
    border-radius: var(--r-pill);
    padding: 2px 9px;
    font-size: .7rem;
    font-weight: 600;
}

/* Category header colours */
.cat-personal      .tick-category-header { background: #20563F; }
.cat-ministry      .tick-category-header { background: #174332; }
.cat-education     .tick-category-header { background: #AD8C4D; }
.cat-employment    .tick-category-header { background: #98783C; }
.cat-family        .tick-category-header { background: #2D6B4F; }
.cat-nok           .tick-category-header { background: #7d5000; }
.cat-children      .tick-category-header { background: #397D5C; }
.cat-beneficiaries .tick-category-header { background: #6b5500; }
.cat-documents     .tick-category-header { background: #123629; }

/* Category body tints */
.cat-personal      { background: #F3F7F4; }
.cat-ministry      { background: #F0F4F1; }
.cat-education     { background: #FAF6EC; }
.cat-employment    { background: #FAF4E8; }
.cat-family        { background: #F3F7F4; }
.cat-nok           { background: #FAF6EC; }
.cat-children      { background: #F0F4F1; }
.cat-beneficiaries { background: #FAF9F0; }
.cat-documents     { background: #F0F4F1; }

/* Stagger */
.tick-category:nth-child(1) { animation-delay: .04s; }
.tick-category:nth-child(2) { animation-delay: .08s; }
.tick-category:nth-child(3) { animation-delay: .12s; }
.tick-category:nth-child(4) { animation-delay: .16s; }
.tick-category:nth-child(5) { animation-delay: .20s; }
.tick-category:nth-child(6) { animation-delay: .24s; }
.tick-category:nth-child(7) { animation-delay: .28s; }
.tick-category:nth-child(8) { animation-delay: .32s; }
.tick-category:nth-child(9) { animation-delay: .36s; }

/* Tick items */
.tick-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: var(--sp-2);
    padding: 12px 14px;
}

.tick-item {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    padding: 10px 11px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.tick-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(18,54,41,.10);
}
.tick-item-done    { border-color: var(--c-green-600); background: var(--c-green-50); }
.tick-item-missing { border-color: var(--c-danger);    background: var(--c-danger-bg); }
.tick-item-na      { border-color: #D1D9D3; background: #FAFAFA; opacity: .75; }

.tick-item-label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.3;
}

/* Tick select */
.tick-select {
    padding: 7px 10px;
    border-radius: var(--r-sm);
    font-size: .84rem;
    font-weight: 600;
    border: 1px solid var(--c-border-2);
    width: 100%;
    cursor: pointer;
    transition: background .18s, border-color .18s, color .18s;
}
.tick-select-yes   { background: var(--c-success-bg); color: var(--c-success); border-color: #a0d4b8; }
.tick-select-no    { background: var(--c-danger-bg);  color: var(--c-danger);  border-color: #e8aaaa; }
.tick-select-na    { background: #F1F5F9; color: #64748b; border-color: #d4dde6; }
.tick-select-empty { background: #fff; color: var(--c-muted); }

/* Read-only chips */
.tick-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 26px;
    border-radius: 6px;
    font-weight: 700;
    font-size: .84rem;
}
.tick-chip-yes   { background: var(--c-success-bg); color: var(--c-success); }
.tick-chip-no    { background: var(--c-danger-bg);  color: var(--c-danger); }
.tick-chip-na    { background: #F1F5F9; color: #64748b; font-size: .7rem; }
.tick-chip-empty { background: #FAFAFA; color: #94a3b8; }

/* Note input */
.tick-note-input {
    font-size: .76rem;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--c-border);
    color: var(--c-muted);
    background: transparent;
    width: 100%;
    transition: background var(--t-fast), color var(--t-fast);
}
.tick-note-input:focus { background: #fff; color: var(--c-text); }

/* All-done flash */
@keyframes all-done-flash {
    0%   { box-shadow: 0 0 0 0 rgba(39,131,90,.4); }
    100% { box-shadow: 0 0 0 10px rgba(39,131,90,0); }
}
.tick-category.all-done { animation: all-done-flash .55s ease-out; }

/* Progress bars */
.progress-bar-wrap {
    background: var(--c-green-100);
    border-radius: var(--r-pill);
    height: 6px;
    overflow: hidden;
    margin-bottom: 3px;
    min-width: 80px;
}
.progress-bar-fill {
    background: linear-gradient(90deg, var(--c-green-700), var(--c-gold-500));
    height: 100%;
    border-radius: var(--r-pill);
    transition: width .6s cubic-bezier(.22,1,.36,1);
}

.live-progress-bar-wrap {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-left: 4px solid var(--c-gold-700);
    border-radius: var(--r-md);
    padding: 14px 18px;
    box-shadow: var(--shadow-xs);
    margin-bottom: 20px;
}

/* Compact table inputs */
.compact-input  { padding: 6px 8px; font-size: .84rem; }
.compact-select { padding: 6px 8px; font-size: .84rem; }
.sections-table td { vertical-align: middle; }

/* =============================================================================
   12. TABS
   ============================================================================= */

.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-bottom: 18px;
    border-bottom: 1.5px solid var(--c-border);
    animation: fadeIn .28s .1s ease both;
}
.tab-btn {
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1.5px;
    padding: 9px 15px;
    font-family: var(--font-body);
    font-size: .8125rem;
    font-weight: 600;
    color: var(--c-muted);
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.tab-btn:hover { color: var(--c-green-700); background: var(--c-green-50); }
.tab-btn.active {
    color: var(--c-green-800);
    border-bottom-color: var(--c-gold-700);
    background: var(--c-surface-2);
    font-weight: 700;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeInUp .28s cubic-bezier(.22,1,.36,1) both; }
.tab-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--c-border); }

/* =============================================================================
   13. COLLAPSIBLE SECTIONS
   ============================================================================= */

.collapsible-section {
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-2);
    background: var(--c-surface);
    overflow: hidden;
}
.collapsible-header {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 13px 18px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--c-green-800);
    cursor: pointer;
    list-style: none;
    transition: background var(--t-fast);
}
.collapsible-header:hover { background: var(--c-green-50); }
.collapsible-header::before {
    content: '▸';
    font-size: .72rem;
    color: var(--c-gold-700);
    transition: transform .22s cubic-bezier(.22,1,.36,1);
    flex-shrink: 0;
}
details[open] > .collapsible-header::before { transform: rotate(90deg); }
details[open] > :not(summary) { animation: fadeInUp .25s cubic-bezier(.22,1,.36,1) both; }
.collapsible-section > .panel-form {
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--c-border);
    animation: none;
}

/* =============================================================================
   14. LOGIN PAGE
   ============================================================================= */

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, var(--c-green-900) 0%, var(--c-green-800) 55%, var(--c-green-700) 100%);
    padding: 20px;
    animation: fadeIn .4s ease both;
}
.auth-card {
    width: min(460px, 100%);
    background: #fff;
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    padding: 36px 32px;
    border-top: 4px solid var(--c-gold-500);
    animation: scaleIn .5s cubic-bezier(.34,1.4,.64,1) both;
}
.brand-block {
    text-align: center;
    margin-bottom: var(--sp-6);
}
.brand-block img {
    height: 88px;
    margin-bottom: var(--sp-4);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.15));
}
.brand-block h1 {
    font-size: 1.25rem;
    color: var(--c-green-800);
    margin-bottom: 6px;
}
.brand-block p {
    color: var(--c-text-2);
    font-size: .82rem;
    margin: 0;
    line-height: 1.55;
}
.stacked-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* =============================================================================
   15. MODALS
   ============================================================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18,54,41,.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 16px;
    animation: fadeIn .2s ease both;
}
.modal-card {
    background: var(--c-surface);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    padding: 26px 28px;
    width: min(540px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    border-top: 4px solid var(--c-gold-500);
    animation: scaleIn .28s cubic-bezier(.34,1.4,.64,1) both;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-3);
}
.modal-header h3 { color: var(--c-green-800); font-size: 1rem; }
.modal-close {
    font-size: 1.35rem;
    line-height: 1;
    color: var(--c-muted);
    padding: 0 4px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    transition: background var(--t-fast), color var(--t-fast);
}
.modal-close:hover { background: var(--c-border); color: var(--c-text); }

/* =============================================================================
   16. PROGRESS BARS
   (already defined in tick-sheet section; additional live wrapper here)
   ============================================================================= */

/* (No duplication needed — progress-bar-wrap and progress-bar-fill above) */

/* =============================================================================
   17. SUPERVISOR REVIEW PANEL
   ============================================================================= */

.review-panel {
    background: var(--c-success-bg);
    border: 1.5px solid #b3dfc7;
    border-radius: var(--r-lg);
    padding: 22px 24px;
    margin-top: 24px;
    animation: scaleIn .36s .08s cubic-bezier(.22,1,.36,1) both;
}
.review-panel .section-title { color: var(--c-green-800); border-bottom-color: var(--c-gold-300); }

tr.row-needs-review { animation: goldFlash 2.2s ease-in-out infinite; }
tr.row-needs-review td { font-weight: 600; }

/* =============================================================================
   18. RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 960px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .page-shell { padding-left: 16px; padding-right: 16px; }
    .page-header { flex-direction: column; }
    .stats-grid  { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .form-grid   { grid-template-columns: 1fr; }
    .tick-items-grid { grid-template-columns: 1fr 1fr; }
    .search-input { min-width: 100%; }
    .modal-card { padding: 20px; }
    .auth-card  { padding: 28px 22px; }
    .two-col-layout { grid-template-columns: 1fr; }
    .dashboard-summary-grid { grid-template-columns: 1fr; gap: var(--sp-4); }
    h1 { font-size: 1.3rem; }
    .btn-lg { padding: 11px 20px; font-size: .875rem; }
    .data-table { font-size: .8rem; }
    .data-table th, .data-table td { padding: 9px 8px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .tick-items-grid { grid-template-columns: 1fr; }
}

/* =============================================================================
   19. MISCELLANEOUS COMPONENTS
   ============================================================================= */

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.filter-form {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
}
.filter-form select { width: auto; min-width: 150px; }
.search-input {
    padding: 9px 13px;
    border: 1px solid var(--c-border-2);
    border-radius: var(--r-md);
    font: inherit;
    font-size: .875rem;
    min-width: 230px;
    background: #fff;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-input:focus {
    outline: none;
    border-color: var(--c-green-600);
    box-shadow: 0 0 0 3px rgba(45,107,79,.1);
}
.result-count { color: var(--c-muted); font-size: .8rem; white-space: nowrap; }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    justify-content: center;
    margin-top: 20px;
    color: var(--c-muted);
    font-size: .875rem;
}

/* Document upload */
.doc-upload-form {
    background: var(--c-surface-2);
    border: 1.5px dashed var(--c-border-2);
    border-radius: var(--r-md);
    padding: 16px;
    margin-bottom: 18px;
    transition: border-color var(--t-fast), background var(--t-fast);
}
.doc-upload-form:hover {
    border-color: var(--c-green-500);
    background: var(--c-green-50);
}

/* How-to box (already in tick-sheet section) */

/* Review queue highlighted rows */
@keyframes goldFlash {
    0%, 100% { background: var(--c-gold-50); }
    50%       { background: #f0e8cc; }
}

/* Regions picker */
.regions-box {
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 14px 16px;
}
.regions-label { margin: 0 0 10px; font-size: .875rem; }
.regions-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--sp-2);
    margin-bottom: var(--sp-1);
}

/* Repeater table */
.repeater-table input,
.repeater-table select { padding: 6px 8px; font-size: .84rem; min-width: 0; }
.repeater-table td { vertical-align: middle; padding: 6px; }

/* =============================================================================
   20. ANIMATIONS
   ============================================================================= */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(.94); }
    to   { opacity: 1; transform: scale(1); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ── Login page additions ─────────────────────────────────────────────────── */
.brand-block .portal-name {
    display: inline-block;
    margin: 6px 0 0;
    font-size: .82rem;
    font-weight: 700;
    color: var(--c-green-700);
    text-transform: uppercase;
    letter-spacing: .1em;
}

.login-credit {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--c-border);
    text-align: center;
}
.login-credit p {
    margin: 0 0 3px;
    font-size: .72rem;
    color: var(--c-muted);
    line-height: 1.6;
}
.login-credit strong {
    color: var(--c-green-800);
    font-weight: 700;
}

/* ── Nav user area — pill + action buttons (kept for avatar/pill classes) ── */
.nav-user-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 999px;
    padding: 5px 12px 5px 6px;
}
.nav-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--c-gold-700);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0;
}

/* Icon action buttons (Profile + Logout) */
.nav-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,.7);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast);
    white-space: nowrap;
}
.nav-action-btn:hover {
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.95);
}

/* Mobile nav user pill */
@media (max-width: 860px) {
    .nav-user-pill { flex: 1; border-radius: 10px; padding: 8px 12px; }
    .nav-action-btn { flex: 1; justify-content: center; }
}

/* ── Checklist detail stats — same card style as dashboard ───────────────── */
.checklist-stats {
    margin-bottom: 24px;
}
/* Smaller number font for text values on checklist cards */
.stat-card .stat-text {
    font-size: 1rem;
    line-height: 1.3;
    word-break: break-word;
}
.stat-card small {
    font-size: 1.1rem;
    font-weight: 600;
    opacity: .75;
}
/* Badge rendered on a coloured card */
.badge-on-card {
    background: rgba(255,255,255,.22);
    color: #fff;
    border: 1px solid rgba(255,255,255,.3);
    font-size: .72rem;
    padding: 4px 10px;
    text-decoration: none !important;
}

/* ── Export buttons ──────────────────────────────────────────────────────── */
.export-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 5px 10px 5px 12px;
}
.export-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--c-muted);
    white-space: nowrap;
    margin-right: 2px;
}
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: .76rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all .15s ease;
    white-space: nowrap;
}
.btn-excel {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}
.btn-excel:hover { background: #2e7d32; color: #fff; }

.btn-word {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #bbdefb;
}
.btn-word:hover { background: #1565c0; color: #fff; }

.btn-pdf {
    background: #fce4ec;
    color: #c62828;
    border-color: #f8bbd0;
}
.btn-pdf:hover { background: #c62828; color: #fff; }
