/* ================================================================
   Banaybanay Document Tracking System — "Baybay" theme
   Coastal municipal design system: ocean teal, sand paper, coral accent.
   Display: Fraunces · Body: Figtree
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Figtree:wght@400;500;600;700;800&display=swap');

:root {
    /* Brand — ocean teal (from the municipal seal's lagoon). Variable names
       kept as --red* / --navy* for backwards-compat with existing templates. */
    --red:           #0E5C63;   /* primary — deep ocean teal */
    --red-pressed:   #083F45;
    --red-soft:      #DBEEEF;
    --red-text:      #083F45;

    --teal:          #0E5C63;
    --teal-pressed:  #083F45;
    --teal-soft:     #DBEEEF;
    --teal-text:     #083F45;
    --teal-deep:     #072E33;   /* sidebar / login sky */
    --teal-deeper:   #041D21;

    --navy:          #1E4D5C;   /* petrol — secondary official elements */
    --navy-pressed:  #153A46;
    --navy-soft:     #DCE8EC;

    --coral:         #E0633A;   /* sunrise coral — the one sharp accent */
    --coral-pressed: #BF4D27;
    --coral-soft:    #FBE4DA;

    --yellow:        #F2C14E;   /* sand gold — used very sparingly */
    --palm:          #2E7D4F;   /* palm green */

    /* Status */
    --green:         #2E9E5B;   /* Approved / Released */
    --green-soft:    #DDF3E4;
    --green-text:    #1D6B3E;
    --orange:        #E08A1E;   /* For Approval / Pending */
    --orange-soft:   #FBEBD3;
    --orange-text:   #8A5207;
    --red-status:    #D0433A;   /* Rejected / Disapproved / Cancelled */
    --red-status-soft: #FBE3E0;
    --blue-status:   #2572C4;   /* In Progress / Encoded */
    --blue-soft:     #DCE9F8;

    /* Neutrals — warm sand paper */
    --bg:            #F4EFE6;   /* page background */
    --bg-grouped:    #F4EFE6;
    --surface:       #FFFDF9;   /* cards */
    --surface-2:     #F8F4EC;   /* nested */
    --hairline:      rgba(63, 50, 30, 0.12);
    --hairline-strong: rgba(63, 50, 30, 0.22);
    --label:         #1B1A17;
    --label-2:       #4A463F;
    --gray:          #7D776C;
    --gray-2:        #A39C8F;
    --gray-3:        #C9C2B4;
    --fill-1:        rgba(110, 95, 70, 0.10);
    --fill-2:        rgba(110, 95, 70, 0.16);
    --fill-input:    #EEE7DA;

    /* Spacing scale (8px base) */
    --s-1: 4px;  --s-2: 8px;  --s-3: 12px;  --s-4: 16px;
    --s-5: 20px; --s-6: 24px; --s-7: 32px;  --s-8: 48px;

    /* Radii — tighter, more "official form" than iOS */
    --r-sm: 6px;  --r-md: 10px; --r-lg: 14px; --r-xl: 18px; --r-pill: 999px;

    /* Shadows — warm */
    --shadow-1: 0 1px 2px rgba(50, 35, 10, 0.05);
    --shadow-2: 0 2px 10px rgba(50, 35, 10, 0.08);
    --shadow-3: 0 10px 28px rgba(50, 35, 10, 0.14);
    --shadow-modal: 0 24px 60px rgba(20, 30, 30, 0.30);

    /* Fonts */
    --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
    --font-body: 'Figtree', -apple-system, 'Segoe UI', sans-serif;

    /* Layout */
    --sidebar-w: 268px;
    --sidebar-w-collapsed: 72px;
    --topbar-h: 58px;
    --tabbar-h: 64px;
    --flag-h: 4px;

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --t-fast: 150ms;
    --t-base: 220ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html, body {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--label);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}
body { letter-spacing: 0; }
h1, h2, h3, .page-head h1, .title-lg, .title-md, .modal-title { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }

/* ================================================================
   Typography helpers (iOS hierarchy)
   ================================================================ */
.title-lg   { font-size: 28px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; color: var(--label); }
.title-md   { font-size: 22px; font-weight: 700; letter-spacing: -0.02em;  line-height: 1.2;  color: var(--label); }
.title-sm   { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; color: var(--label); }
.body       { font-size: 15px; color: var(--label); }
.body-sm    { font-size: 14px; color: var(--label-2); }
.meta       { font-size: 13px; color: var(--gray); }
.meta-tiny  { font-size: 11px; color: var(--gray); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }

/* ================================================================
   Flag bar — a 4px tricolour line replaces the old black strip
   ================================================================ */
.flag-bar {
    height: var(--flag-h);
    background: linear-gradient(90deg, #0038A8 0 34%, #CE1126 34% 67%, #FCD116 67% 100%);
}
.gov-topbar { display: none; }
.flag-stripe { display: inline-flex; gap: 3px; margin-right: 8px; vertical-align: middle; }
.flag-stripe span { width: 4px; height: 11px; border-radius: 1px; }
.flag-stripe .b { background: #0038A8; }
.flag-stripe .r { background: #CE1126; }
.flag-stripe .y { background: #FCD116; }

/* ================================================================
   App shell (dark teal sidebar + sand main)
   ================================================================ */
.app-shell { display: flex; min-height: calc(100vh - var(--flag-h)); }

.sidebar {
    width: var(--sidebar-w);
    background:
        radial-gradient(120% 60% at 0% 100%, rgba(224,99,58,0.18) 0%, transparent 60%),
        linear-gradient(180deg, var(--teal-deep) 0%, var(--teal-deeper) 100%);
    color: rgba(255,255,255,0.82);
    display: flex; flex-direction: column;
    position: sticky; top: 0;
    height: calc(100vh - var(--flag-h));
    overflow-y: auto;
    transition: width var(--t-base) var(--ease);
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }

.sidebar-brand {
    padding: var(--s-5) var(--s-4) var(--s-4);
    border-bottom: 1px solid rgba(255,255,255,0.10);
    display: flex; align-items: center; gap: var(--s-3);
}
.sidebar-seal {
    width: 44px; height: 44px;
    background: #fff;
    border-radius: 50%;
    padding: 2px;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.10);
}
.sidebar-seal img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.sidebar-brand-text { overflow: hidden; transition: opacity var(--t-fast) var(--ease); }
.sidebar.collapsed .sidebar-brand-text { opacity: 0; pointer-events: none; }
.sidebar-brand-text .lgu {
    font-size: 10px; color: rgba(255,255,255,0.55); text-transform: uppercase;
    letter-spacing: 0.12em; font-weight: 600;
}
.sidebar-brand-text .name {
    font-family: var(--font-display);
    font-size: 16px; font-weight: 600; color: #fff;
    line-height: 1.15; margin-top: 2px; letter-spacing: 0;
}

.sidebar-nav { padding: var(--s-3); flex: 1; }
.sidebar-section-label {
    font-size: 10.5px;
    color: rgba(255,255,255,0.42);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    padding: var(--s-4) var(--s-3) var(--s-2);
}
.sidebar.collapsed .sidebar-section-label { opacity: 0; height: 0; padding: 0; }

.sidebar-link {
    position: relative;
    display: flex; align-items: center; gap: var(--s-3);
    padding: 9px var(--s-3) 9px 14px;
    border-radius: var(--r-md);
    color: rgba(255,255,255,0.72);
    text-decoration: none;
    font-size: 14px; font-weight: 500;
    margin-bottom: 2px;
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
    min-height: 40px;
}
.sidebar-link i { font-size: 17px; flex-shrink: 0; width: 22px; text-align: center; opacity: 0.85; }
.sidebar-link:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar-link.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-weight: 600;
}
.sidebar-link.active::before {
    content: ''; position: absolute; left: 0; top: 9px; bottom: 9px;
    width: 3px; border-radius: 3px; background: var(--coral);
}
.sidebar-link.active i { color: #fff; opacity: 1; }
.sidebar.collapsed .sidebar-link span { display: none; }
.sidebar.collapsed .sidebar-link { justify-content: center; padding: 9px; }

.sidebar-footer {
    padding: var(--s-3) var(--s-4);
    border-top: 1px solid rgba(255,255,255,0.10);
}
.user-block {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-2);
    border-radius: var(--r-md);
}
.user-avatar {
    width: 36px; height: 36px; flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--coral), var(--coral-pressed));
    color: #fff; font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    text-transform: uppercase;
}
.user-meta { overflow: hidden; flex: 1; min-width: 0; }
.sidebar.collapsed .user-meta, .sidebar.collapsed .user-actions { display: none; }
.user-meta .user-name {
    font-size: 13px; font-weight: 600; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-meta .user-role { font-size: 11px; color: rgba(255,255,255,0.55); }
.user-actions { margin-top: var(--s-2); display: flex; gap: 6px; }
.sidebar .user-actions .btn-outline-secondary {
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.18);
}
.sidebar .user-actions .btn-outline-secondary:hover { background: rgba(255,255,255,0.14); color: #fff; }

.btn-sidebar-toggle {
    background: var(--fill-1);
    border: none;
    width: 36px; height: 36px;
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    color: var(--label-2);
    cursor: pointer;
    transition: background var(--t-fast) var(--ease);
}
.btn-sidebar-toggle:hover { background: var(--fill-2); }

/* ================================================================
   Main content area
   ================================================================ */
.main {
    flex: 1;
    min-width: 0;
    display: flex; flex-direction: column;
}
.topbar {
    height: var(--topbar-h);
    background: rgba(244,239,230,0.88);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--hairline);
    display: flex; align-items: center;
    padding: 0 var(--s-5);
    position: sticky; top: 0; z-index: 30;
}
.topbar .menu-btn { display: none; }
.topbar .topbar-title {
    font-family: var(--font-display);
    font-size: 19px; font-weight: 600; color: var(--label);
    letter-spacing: 0;
}
.topbar .topbar-actions { margin-left: auto; display: flex; gap: var(--s-2); }

.content {
    padding: var(--s-6) var(--s-5);
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

/* ================================================================
   Page header (iOS large title)
   ================================================================ */
.page-head {
    margin-bottom: var(--s-6);
    display: flex; flex-wrap: wrap; gap: var(--s-4);
    align-items: flex-end; justify-content: space-between;
}
.page-head h1 {
    font-size: 30px; font-weight: 600; letter-spacing: -0.01em;
    line-height: 1.15; color: var(--label); margin: 0;
}
.page-head .page-sub {
    font-size: 14px; color: var(--gray); margin-top: 4px;
    display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center;
}

/* ================================================================
   Cards & grouped lists
   ================================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-1);
}
.card-header {
    padding: var(--s-4) var(--s-5) var(--s-3);
    border-bottom: 1px solid var(--hairline);
    background: var(--surface);
    display: flex; align-items: center; gap: var(--s-2);
    font-size: 13px; font-weight: 600;
    color: var(--gray);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.card-header i { color: var(--red); font-size: 15px; }
.card-body { padding: var(--s-5); }

/* Grouped list (iOS Settings-style) */
.group-list {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-1);
}
.group-list .group-row {
    display: flex; align-items: center;
    padding: var(--s-3) var(--s-5);
    min-height: 52px;
    border-bottom: 1px solid var(--hairline);
    background: var(--surface);
    transition: background var(--t-fast) var(--ease);
    color: var(--label); text-decoration: none;
}
.group-list .group-row:last-child { border-bottom: none; }
.group-list .group-row:hover { background: var(--fill-1); }
.group-list .group-row .row-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--red-soft); color: var(--red);
    display: flex; align-items: center; justify-content: center;
    margin-right: var(--s-3);
    font-size: 16px;
}
.group-list .group-row .row-content {
    flex: 1; min-width: 0;
}
.group-list .group-row .row-title { font-weight: 500; font-size: 15px; }
.group-list .group-row .row-sub { font-size: 13px; color: var(--gray); margin-top: 2px; }
.group-list .group-row .row-trail {
    color: var(--gray); font-size: 14px;
    display: flex; align-items: center; gap: var(--s-2);
}
.group-list .group-row .chevron { color: var(--gray-3); font-size: 14px; }

/* Section label above grouped list */
.section-label {
    font-size: 12px; font-weight: 600;
    color: var(--gray);
    text-transform: uppercase; letter-spacing: 0.05em;
    padding: 0 var(--s-3) var(--s-2);
    margin-top: var(--s-5);
}

/* ================================================================
   Stat tiles (iOS dashboard tile)
   ================================================================ */
.stat-tile {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    box-shadow: var(--shadow-1);
    transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
    position: relative;
}
.stat-tile:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.stat-tile .tile-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--s-3);
}
.stat-tile .tile-label {
    font-size: 13px; font-weight: 600; color: var(--gray);
    text-transform: uppercase; letter-spacing: 0.04em;
}
.stat-tile .tile-icon {
    width: 36px; height: 36px; border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.stat-tile.tile-red    .tile-icon { background: var(--red-soft);    color: var(--red); }
.stat-tile.tile-navy   .tile-icon { background: var(--navy-soft);   color: var(--navy); }
.stat-tile.tile-green  .tile-icon { background: var(--green-soft);  color: var(--green-text); }
.stat-tile.tile-orange .tile-icon { background: var(--orange-soft); color: var(--orange-text); }
.stat-tile.tile-blue   .tile-icon { background: var(--blue-soft);   color: var(--blue-status); }
.stat-tile .tile-value {
    font-family: var(--font-display);
    font-size: 34px; font-weight: 600; letter-spacing: -0.01em;
    line-height: 1; color: var(--label);
}
.stat-tile .tile-meta { font-size: 12px; color: var(--gray); margin-top: 6px; }

/* ================================================================
   Buttons
   ================================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border-radius: var(--r-md);
    padding: 10px 16px;
    font-size: 14px; font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
    text-decoration: none;
    min-height: 40px;
    line-height: 1;
    white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 6px 12px; font-size: 13px; min-height: 32px; border-radius: 10px; }
.btn-lg { padding: 13px 22px; font-size: 15px; min-height: 48px; }

.btn-primary, .btn-navy {
    background: var(--red); color: #fff; border-color: var(--red);
}
.btn-primary:hover, .btn-navy:hover { background: var(--red-pressed); border-color: var(--red-pressed); color: #fff; }

.btn-outline-primary, .btn-outline {
    background: var(--surface); color: var(--label); border: 1px solid var(--hairline-strong);
}
.btn-outline-primary:hover, .btn-outline:hover { background: var(--fill-1); }
.btn-outline-primary.active { background: var(--red); color: #fff; border-color: var(--red); }

.btn-ghost {
    background: transparent; color: var(--red); border: none;
    padding: 8px 12px;
}
.btn-ghost:hover { background: var(--red-soft); }

.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-outline-secondary {
    background: var(--surface); color: var(--label-2); border: 1px solid var(--hairline-strong);
}
.btn-outline-secondary:hover { background: var(--fill-1); }
.btn-danger { background: var(--red-status); border-color: var(--red-status); color: #fff; }

.btn-icon {
    width: 40px; min-width: 40px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ================================================================
   Forms
   ================================================================ */
.form-control, .form-select {
    background: var(--fill-input);
    border: 1px solid transparent;
    border-radius: var(--r-md);
    padding: 11px 14px;
    font-size: 15px;
    color: var(--label);
    transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
    width: 100%;
}
.form-control:focus, .form-select:focus {
    background: var(--surface);
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(14, 92, 99, 0.14);
    outline: none;
}
.form-control::placeholder { color: var(--gray-2); }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--label-2);
    margin-bottom: 6px;
}
.form-label .required { color: var(--red); margin-left: 2px; }
.form-text { color: var(--gray); font-size: 12px; margin-top: 4px; }

/* Search input (rounded full) */
.input-search {
    position: relative;
    display: flex; align-items: center;
}
.input-search .form-control {
    border-radius: var(--r-pill);
    padding-left: 38px;
    background: var(--fill-input);
}
.input-search i.search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--gray); font-size: 15px; pointer-events: none;
}

/* Bootstrap input-group compatibility */
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: 0; }
.input-group > :first-child { border-top-left-radius: var(--r-md) !important; border-bottom-left-radius: var(--r-md) !important; }
.input-group > :last-child  { border-top-right-radius: var(--r-md) !important; border-bottom-right-radius: var(--r-md) !important; }
.input-group-text {
    background: var(--fill-input); border: 1px solid transparent; color: var(--gray);
    padding: 11px 14px; font-size: 14px;
}
.input-group .btn { border-radius: var(--r-md); }
.form-check-input { accent-color: var(--red); }

/* ================================================================
   Status badges (Philippine government conventions)
   ================================================================ */
.badge, .status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    font-size: 11.5px; font-weight: 600;
    border-radius: var(--r-pill);
    letter-spacing: 0.02em;
    line-height: 1.5;
    border: 1px solid transparent;
}
.badge.bg-primary, .status-encoded { background: var(--blue-soft) !important; color: var(--blue-status) !important; }
.badge.bg-info { background: var(--fill-1) !important; color: var(--label-2) !important; }
.badge.bg-secondary { background: var(--fill-1) !important; color: var(--label-2) !important; }
.badge.bg-success, .status-approved, .status-released {
    background: var(--green-soft) !important; color: var(--green-text) !important;
}
.badge.bg-warning, .badge.bg-warning-subtle, .status-pending, .status-for-approval {
    background: var(--orange-soft) !important; color: var(--orange-text) !important;
}
.badge.bg-danger, .status-disapproved, .status-cancelled, .status-rejected {
    background: var(--red-status-soft) !important; color: var(--red-status) !important;
}

/* Role badge tone */
.role-chip {
    display: inline-flex; align-items: center;
    background: var(--red-soft); color: var(--red-text);
    padding: 2px 8px; border-radius: var(--r-pill);
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.02em;
}

/* ================================================================
   Tables (dense, scannable — gov register style)
   ================================================================ */
.table-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-1);
}
.table {
    width: 100%; margin: 0;
    color: var(--label);
    border-collapse: separate; border-spacing: 0;
}
.table th {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--gray);
    background: var(--surface-2);
    border-bottom: 1px solid var(--hairline);
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
    position: sticky; top: 0;
}
.table td {
    font-size: 13.5px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--hairline);
    vertical-align: middle;
    color: var(--label);
}
.table tbody tr { transition: background var(--t-fast) var(--ease); }
.table tbody tr:hover { background: var(--fill-1); }
.table tbody tr:last-child td { border-bottom: none; }
.table-light { background: var(--surface-2) !important; }
.table-hover tbody tr:hover { background: var(--fill-1); }

/* Reference / control numbers — tabular figures, copyable */
.ref-no {
    font-family: 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px; font-weight: 600;
    color: var(--label);
    background: var(--fill-input);
    padding: 2px 8px; border-radius: 6px;
    user-select: all;
}

/* ================================================================
   Alerts (iOS toast-ish but inline)
   ================================================================ */
.alert {
    border: 1px solid transparent;
    border-radius: var(--r-md);
    padding: 12px 16px;
    font-size: 14px;
    display: flex; align-items: flex-start; gap: 10px;
}
.alert i { margin-top: 2px; font-size: 16px; }
.alert-success {
    background: var(--green-soft); color: var(--green-text); border-color: rgba(52,199,89,0.25);
}
.alert-danger {
    background: var(--red-status-soft); color: var(--red-status); border-color: rgba(255,59,48,0.25);
}
.alert-info {
    background: var(--blue-soft); color: var(--blue-status); border-color: rgba(0,122,255,0.20);
}
.alert-warning {
    background: var(--orange-soft); color: var(--orange-text); border-color: rgba(255,149,0,0.25);
}

/* Toast banner (slides in from top) */
.toast-stack {
    position: fixed; top: 16px; left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast-banner {
    background: rgba(28,28,30,0.95);
    color: #fff;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 18px;
    border-radius: var(--r-pill);
    font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow-3);
    pointer-events: auto;
    display: flex; align-items: center; gap: 8px;
    animation: toastIn 200ms var(--ease);
}
@keyframes toastIn {
    from { transform: translateY(-20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ================================================================
   Segmented control (iOS)
   ================================================================ */
.segmented {
    display: inline-flex;
    background: var(--fill-input);
    padding: 3px;
    border-radius: var(--r-md);
    gap: 2px;
}
.segmented button {
    border: none; background: transparent;
    padding: 6px 14px; font-size: 13px; font-weight: 600;
    color: var(--label-2);
    border-radius: 9px;
    cursor: pointer;
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.segmented button.active {
    background: var(--surface); color: var(--label);
    box-shadow: var(--shadow-1);
}

/* ================================================================
   Modals (centered with backdrop blur)
   ================================================================ */
.modal-backdrop.show { background: rgba(0,0,0,0.35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-content {
    border-radius: var(--r-xl);
    border: 1px solid var(--hairline);
    box-shadow: var(--shadow-modal);
    overflow: hidden;
}
.modal-header { padding: var(--s-5); border-bottom: 1px solid var(--hairline); }
.modal-header.bg-navy {
    background: linear-gradient(135deg, var(--red), var(--red-pressed)) !important;
    color: #fff;
}
.modal-body { padding: var(--s-5); }
.modal-footer { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--hairline); }

/* ================================================================
   Login page — seal over the lagoon
   ================================================================ */
.login-body {
    min-height: 100vh;
    background: var(--teal-deeper);
    color: #fff;
    position: relative;
    overflow-x: hidden;
}
.login-sky {
    position: fixed; inset: 0; z-index: 0;
    background:
        radial-gradient(90% 70% at 50% -10%, rgba(14,92,99,0.95) 0%, rgba(7,46,51,0.0) 60%),
        radial-gradient(60% 40% at 85% 100%, rgba(224,99,58,0.22) 0%, transparent 60%),
        linear-gradient(180deg, #0A3F45 0%, #072E33 45%, #041D21 100%);
}
.login-sky::before {
    /* wave horizon lines */
    content: ''; position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='60' viewBox='0 0 240 60'%3E%3Cpath d='M0 30c30-14 60-14 90 0s60 14 90 0 60-14 90 0' fill='none' stroke='rgba(255,255,255,0.07)' stroke-width='1.5'/%3E%3C/svg%3E");
    background-size: 240px 60px;
    opacity: 0.9;
    mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 80%, transparent 100%);
}
.login-sky::after {
    /* grain */
    content: ''; position: absolute; inset: 0; opacity: 0.08; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.login-stage {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: grid; grid-template-rows: auto 1fr auto;
    padding: 24px;
}
.login-top {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
    color: rgba(255,255,255,0.62);
}
.login-top .flag-stripe span { height: 12px; }
.login-center { display: flex; align-items: center; justify-content: center; padding: 56px 0 32px; }

.login-card {
    width: 100%; max-width: 440px;
    background: var(--surface);
    color: var(--label);
    border-radius: 22px;
    padding: 72px 40px 32px;
    position: relative;
    box-shadow: 0 30px 80px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.06);
    animation: cardIn 700ms var(--ease-out) both;
}
.login-card::before {
    /* sand-gold hairline at the top edge */
    content: ''; position: absolute; left: 24px; right: 24px; top: 0; height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, var(--coral), var(--yellow));
}
.login-seal-float {
    position: absolute; left: 50%; top: 0;
    transform: translate(-50%, -50%);
    width: 108px; height: 108px;
    background: #fff; border-radius: 50%; padding: 5px;
    box-shadow: 0 16px 36px rgba(0,0,0,0.35), 0 0 0 6px rgba(255,255,255,0.08);
    animation: sealIn 800ms var(--ease-out) 80ms both;
}
.login-seal-float img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.login-eyebrow {
    text-align: center;
    font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--gray); font-weight: 600;
    animation: riseIn 600ms var(--ease-out) 160ms both;
}
.login-lgu {
    font-family: var(--font-display);
    text-align: center;
    font-size: 27px; font-weight: 600; letter-spacing: -0.01em;
    margin: 6px 0 2px; color: var(--teal-text); line-height: 1.1;
    animation: riseIn 600ms var(--ease-out) 220ms both;
}
.login-sys {
    text-align: center; font-size: 13.5px; color: var(--label-2); font-weight: 500;
    margin-bottom: 28px;
    animation: riseIn 600ms var(--ease-out) 280ms both;
}
.login-sys::after {
    content: ''; display: block; width: 36px; height: 2px; margin: 14px auto 0;
    background: var(--teal); border-radius: 2px; opacity: 0.6;
}
.login-card form { animation: riseIn 600ms var(--ease-out) 340ms both; }
.login-field { position: relative; margin-bottom: 14px; }
.login-field .form-control {
    background: var(--fill-input);
    border: 1px solid transparent;
    border-radius: var(--r-md);
    padding: 22px 14px 8px 44px;
    font-size: 15px; height: 56px;
}
.login-field .form-control:focus { background: #fff; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(14,92,99,0.14); }
.login-field label {
    position: absolute; left: 44px; top: 50%; transform: translateY(-50%);
    font-size: 14px; color: var(--gray); pointer-events: none;
    transition: all var(--t-fast) var(--ease);
}
.login-field .form-control:focus + label,
.login-field .form-control:not(:placeholder-shown) + label {
    top: 10px; transform: none; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; color: var(--teal-text);
}
.login-field .field-icon {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: var(--gray); font-size: 16px; pointer-events: none;
}
.login-field .pw-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: transparent; border: none; color: var(--gray);
    width: 38px; height: 38px; border-radius: 8px; cursor: pointer;
}
.login-field .pw-toggle:hover { background: var(--fill-1); color: var(--label); }
.btn-login {
    background: var(--teal); color: #fff; border: none;
    padding: 14px; border-radius: var(--r-md);
    font-weight: 700; font-size: 15px;
    width: 100%; margin-top: 6px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
    box-shadow: 0 8px 20px rgba(14,92,99,0.28);
}
.btn-login:hover { background: var(--teal-pressed); box-shadow: 0 10px 24px rgba(14,92,99,0.36); }
.btn-login:active { transform: scale(0.985); }
.login-card .alert { margin-bottom: 16px; }
.audit-strip {
    margin-top: 24px;
    padding-top: 14px;
    border-top: 1px dashed var(--hairline-strong);
    font-size: 11px; color: var(--gray);
    text-align: center;
    animation: riseIn 600ms var(--ease-out) 420ms both;
}
.audit-strip i { margin-right: 4px; }

.login-chips {
    display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
    margin-top: 28px;
    animation: riseIn 700ms var(--ease-out) 520ms both;
}
.login-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: var(--r-pill);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.78);
    font-size: 12.5px; font-weight: 500;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.login-chip i { color: var(--yellow); }
.login-bottom {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
    font-size: 11px; color: rgba(255,255,255,0.45);
}
.login-bottom a { color: rgba(255,255,255,0.7); text-decoration: none; }
.login-bottom a:hover { color: #fff; }

@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes sealIn { from { opacity: 0; transform: translate(-50%, -30%) scale(0.8); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .login-card, .login-seal-float, .login-eyebrow, .login-lgu, .login-sys, .login-card form, .audit-strip, .login-chips { animation: none; }
}
@media (max-width: 520px) {
    .login-stage { padding: 16px; }
    .login-card { padding: 64px 22px 24px; border-radius: 18px; }
    .login-lgu { font-size: 23px; }
    .login-top { font-size: 10px; }
}

/* ================================================================
   Footer (COA audit)
   ================================================================ */
.audit-footer {
    background: var(--surface);
    border-top: 1px solid var(--hairline);
    padding: var(--s-4) var(--s-5);
    margin-top: var(--s-7);
    font-size: 11.5px;
    color: var(--gray);
    display: flex; flex-wrap: wrap; gap: var(--s-4);
    justify-content: space-between;
    line-height: 1.5;
}
.audit-footer .audit-meta { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.audit-footer .audit-meta span strong { color: var(--label-2); font-weight: 600; }

/* ================================================================
   Empty states
   ================================================================ */
.empty {
    text-align: center; padding: var(--s-8) var(--s-5);
    color: var(--gray);
}
.empty .empty-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--fill-1);
    color: var(--gray);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 26px; margin-bottom: var(--s-3);
}
.empty .empty-title { font-size: 16px; font-weight: 600; color: var(--label-2); margin-bottom: 4px; }
.empty .empty-sub { font-size: 13px; color: var(--gray); margin-bottom: var(--s-4); }

/* ================================================================
   Skeleton loaders
   ================================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--fill-1) 25%, var(--fill-2) 50%, var(--fill-1) 75%);
    background-size: 200% 100%;
    animation: skel 1.4s ease-in-out infinite;
    border-radius: 6px;
    height: 14px;
}
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ================================================================
   Timeline (document detail)
   ================================================================ */
.timeline-container { padding: var(--s-3) 0; }
.timeline-item {
    position: relative; padding-left: 28px; padding-bottom: 16px;
    border-left: 2px solid var(--hairline-strong);
    margin-left: 8px;
}
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item.active { border-left-color: var(--red); }
.timeline-dot {
    position: absolute; left: -7px; top: 4px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--gray-3);
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--hairline-strong);
}
.timeline-item.active .timeline-dot {
    background: var(--red);
    box-shadow: 0 0 0 1px var(--red), 0 0 0 4px rgba(14,92,99,0.20);
}
.timeline-content { padding-bottom: 6px; font-size: 14px; }

/* ================================================================
   Mobile bottom tab bar
   ================================================================ */
.mobile-tabbar {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--tabbar-h);
    background: rgba(255,255,255,0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--hairline);
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
}
.mobile-tabbar .tab {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--gray); text-decoration: none;
    font-size: 10px; font-weight: 600;
    gap: 2px;
    min-height: 44px;
}
.mobile-tabbar .tab i { font-size: 22px; }
.mobile-tabbar .tab.active { color: var(--red); }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 90;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 992px) {
    .sidebar {
        position: fixed; top: 0; bottom: 0; left: 0;
        height: 100vh;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform var(--t-base) var(--ease);
    }
    .sidebar.open { transform: translateX(0); }
    .topbar .menu-btn { display: inline-flex; }
    .mobile-tabbar { display: flex; }
    .content { padding-bottom: calc(var(--tabbar-h) + var(--s-6)); }
    .audit-footer { margin-bottom: var(--tabbar-h); }
    .login-shell { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .content { padding: var(--s-4); padding-bottom: calc(var(--tabbar-h) + var(--s-4)); }
    .page-head h1 { font-size: 24px; }
    .stat-tile .tile-value { font-size: 26px; }
    .table th, .table td { padding: 9px 10px; }
}

/* ================================================================
   Accessibility — focus indicators
   ================================================================ */
:focus-visible {
    outline: 3px solid rgba(14, 92, 99, 0.45);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ================================================================
   Scan input pulse
   ================================================================ */
#scanInput { font-size: 16px; padding: 14px 16px; border-radius: var(--r-md); }
#scanInput:focus {
    background: var(--surface);
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(14, 92, 99, 0.18);
}

/* ================================================================
   Print (gov-formal: keep serif for documents)
   ================================================================ */
@media print {
    .gov-topbar, .topbar, .sidebar, .mobile-tabbar, .audit-footer,
    .btn, form, .card-header, .page-head .btn { display: none !important; }
    body { background: #fff; font-family: 'Times New Roman', Times, serif; color: #000; }
    .card, .table-card { border: none !important; box-shadow: none !important; }
    .content { padding: 0; max-width: none; }
}

/* ================================================================
   Misc compatibility (Bootstrap leftovers)
   ================================================================ */
.text-navy { color: var(--red-text) !important; }
.text-muted { color: var(--gray) !important; }
.text-success { color: var(--green-text) !important; }
.text-danger { color: var(--red-status) !important; }
.text-warning { color: var(--orange-text) !important; }
.text-info { color: var(--blue-status) !important; }
.bg-navy { background: var(--red) !important; color: #fff !important; }
.bg-white { background: var(--surface) !important; }
.bg-light { background: var(--surface-2) !important; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: var(--s-4) 0; }
code {
    background: var(--fill-input);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 12.5px;
    color: var(--label);
    font-family: 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
}
.shadow-sm { box-shadow: var(--shadow-1) !important; }
.shadow { box-shadow: var(--shadow-2) !important; }
.border-0 { border: none !important; }


/* Documents list: force wrapped multi-line text in long-content cells */
.cell-wrap {
    display: block;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}
.table th.wcol-120 { min-width: 120px; max-width: 120px; }
.table th.wcol-160 { min-width: 160px; max-width: 160px; }
.table th.wcol-180 { min-width: 180px; max-width: 180px; }
.table th.wcol-240 { min-width: 240px; max-width: 240px; }


/* ================================================================
   Dashboard — scanner-first layout
   ================================================================ */
.dash-hero {
    display: flex; flex-wrap: wrap; gap: var(--s-4);
    align-items: flex-end; justify-content: space-between;
    margin-bottom: var(--s-5);
}
.dash-hero .greet-eyebrow {
    font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--gray); font-weight: 600; margin-bottom: 4px;
}
.dash-hero h1 {
    font-family: var(--font-display);
    font-size: 34px; font-weight: 600; letter-spacing: -0.01em;
    line-height: 1.1; margin: 0; color: var(--label);
}
.dash-hero h1 em { font-style: italic; color: var(--teal); font-weight: 500; }
.dash-hero .greet-sub {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin-top: 8px; font-size: 13px; color: var(--gray);
}
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: var(--r-pill);
    font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
    background: var(--teal-soft); color: var(--teal-text);
}
.chip.chip-office { background: var(--navy-soft); color: var(--navy); }
.btn-coral { background: var(--coral); color: #fff; border-color: var(--coral); box-shadow: 0 6px 16px rgba(224,99,58,0.25); }
.btn-coral:hover { background: var(--coral-pressed); border-color: var(--coral-pressed); color: #fff; }

/* Scan bar */
.scan-bar {
    display: grid; grid-template-columns: 1fr auto; gap: 10px;
    align-items: center;
    background: linear-gradient(135deg, var(--teal-deep), var(--teal));
    border-radius: var(--r-xl);
    padding: 14px 14px 14px 18px;
    margin-bottom: var(--s-6);
    box-shadow: 0 14px 34px rgba(7,46,51,0.22);
    position: relative; overflow: hidden;
}
.scan-bar::after {
    content: ''; position: absolute; right: -60px; top: -80px;
    width: 260px; height: 260px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.10), transparent 70%);
    pointer-events: none;
}
.scan-bar .scan-field { position: relative; display: flex; align-items: center; }
.scan-bar .scan-field i {
    position: absolute; left: 16px; color: rgba(255,255,255,0.75); font-size: 20px; pointer-events: none;
}
.scan-bar .scan-field .form-control {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff; font-size: 16px;
    padding: 14px 16px 14px 50px;
    border-radius: var(--r-md);
    height: 54px;
}
.scan-bar .scan-field .form-control::placeholder { color: rgba(255,255,255,0.6); }
.scan-bar .scan-field .form-control:focus {
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.45);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.12);
}
.scan-bar .btn-scan {
    background: #fff; color: var(--teal-text); border: none;
    height: 54px; padding: 0 22px; border-radius: var(--r-md);
    font-weight: 700; font-size: 14px;
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.scan-bar .btn-scan:hover { background: var(--surface-2); }
.scan-bar .btn-scan:active { transform: scale(0.98); }
.scan-bar .scan-hint {
    grid-column: 1 / -1;
    font-size: 11.5px; color: rgba(255,255,255,0.62);
    display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
}
.scan-bar .scan-hint kbd {
    background: rgba(255,255,255,0.14); color: #fff;
    padding: 1px 6px; border-radius: 5px; font-size: 10.5px; font-family: var(--font-body);
}
#quickResult:empty { display: none; }

/* Stat strip */
.stat-strip {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 12px; margin-bottom: var(--s-6);
}
.stat-strip .stat {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-1);
    position: relative; overflow: hidden;
    min-height: 112px;
    display: flex; flex-direction: column; justify-content: space-between;
}
.stat-strip .stat::before {
    content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px;
    background: var(--teal);
}
.stat-strip .stat.s-coral::before { background: var(--coral); }
.stat-strip .stat.s-palm::before  { background: var(--palm); }
.stat-strip .stat.s-gold::before  { background: var(--yellow); }
.stat-strip .stat-label {
    font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray);
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.stat-strip .stat-label i { font-size: 15px; color: var(--gray-2); }
.stat-strip .stat-value {
    font-family: var(--font-display);
    font-size: 36px; font-weight: 600; letter-spacing: -0.01em; line-height: 1; color: var(--label);
    margin: 10px 0 6px;
}
.stat-strip .stat-value.sm { font-size: 18px; line-height: 1.25; font-weight: 500; }
.stat-strip .stat-meta { font-size: 12px; color: var(--gray); }

/* Two-column body */
.dash-cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--s-5); align-items: start; }
.dash-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}
.dash-card .dash-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--hairline);
}
.dash-card .dash-card-head h3 {
    font-family: var(--font-display);
    font-size: 17px; font-weight: 600; margin: 0; letter-spacing: 0;
}
.dash-card .dash-card-head .meta { font-size: 11.5px; }
.dash-card .dash-card-body { padding: 18px; }

/* Monthly strip (single series) */
.month-chart { position: relative; }
.month-chart .bars {
    display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px;
    height: 120px; align-items: end;
    border-bottom: 1px solid var(--hairline-strong);
    padding-bottom: 0;
    position: relative;
}
.month-chart .bars::before, .month-chart .bars::after {
    content: ''; position: absolute; left: 0; right: 0; height: 1px; background: var(--hairline);
}
.month-chart .bars::before { top: 0; }
.month-chart .bars::after { top: 50%; }
.month-chart .bar {
    position: relative;
    width: 100%; min-height: 2px;
    background: rgba(14,92,99,0.45);
    border-radius: 4px 4px 0 0;
    transition: height 500ms var(--ease-out), background var(--t-fast) var(--ease);
    cursor: default;
}
.month-chart .bar.current { background: var(--teal); }
.month-chart .bar:hover { background: var(--teal-pressed); }
.month-chart .bar .bar-val {
    position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
    font-size: 11px; font-weight: 600; color: var(--label-2);
    white-space: nowrap;
}
.month-chart .bar .tip {
    display: none;
    position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
    background: #1B1A17; color: #fff; font-size: 11.5px; padding: 5px 8px; border-radius: 6px;
    white-space: nowrap; z-index: 2;
}
.month-chart .bar:hover .tip { display: block; }
.month-chart .bar:hover .bar-val { display: none; }
.month-chart .months {
    display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; margin-top: 6px;
    font-size: 10.5px; color: var(--gray); text-align: center; letter-spacing: 0.04em;
}
.month-chart .months span.current { color: var(--teal-text); font-weight: 700; }
.month-chart details { margin-top: 10px; font-size: 12px; color: var(--gray); }
.month-chart details table { width: 100%; font-size: 12px; margin-top: 6px; }
.month-chart details td { padding: 3px 6px; border-bottom: 1px solid var(--hairline); }

/* Inbox list */
.inbox-list a {
    display: flex; gap: 12px; padding: 12px 18px;
    border-bottom: 1px solid var(--hairline);
    text-decoration: none; color: var(--label);
    transition: background var(--t-fast) var(--ease);
}
.inbox-list a:last-child { border-bottom: none; }
.inbox-list a:hover { background: var(--surface-2); }
.inbox-list a.recent { background: rgba(46,158,91,0.08); }
.inbox-list .ib-icon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    background: var(--coral-soft); color: var(--coral-pressed);
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.inbox-list .ib-main { flex: 1; min-width: 0; }
.inbox-list .ib-title { font-weight: 600; font-size: 13.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inbox-list .ib-sub { font-size: 12px; color: var(--label-2); margin-top: 2px; }
.inbox-list .ib-status { font-size: 11px; color: var(--gray); margin-top: 2px; }
.inbox-list .ib-time { font-size: 11px; color: var(--gray); flex-shrink: 0; text-align: right; align-self: center; }
.inbox-empty { padding: 28px 18px; text-align: center; color: var(--gray); font-size: 13px; }
.inbox-empty i { font-size: 26px; display: block; margin-bottom: 6px; color: var(--gray-3); }
.count-pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill);
    background: var(--coral); color: #fff; font-size: 11.5px; font-weight: 700;
}
.count-pill.zero { background: var(--fill-2); color: var(--label-2); }

/* Quick action grid */
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.action-tile {
    display: flex; flex-direction: column; gap: 10px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    text-decoration: none; color: var(--label);
    box-shadow: var(--shadow-1);
    transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
    min-height: 112px;
}
.action-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: rgba(14,92,99,0.35); color: var(--label); }
.action-tile .at-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 17px;
    background: var(--teal-soft); color: var(--teal-text);
}
.action-tile.t-coral .at-icon { background: var(--coral-soft); color: var(--coral-pressed); }
.action-tile.t-palm  .at-icon { background: var(--green-soft); color: var(--green-text); }
.action-tile.t-gold  .at-icon { background: #FBF1D6; color: #8A6508; }
.action-tile.t-navy  .at-icon { background: var(--navy-soft); color: var(--navy); }
.action-tile.t-gray  .at-icon { background: var(--fill-1); color: var(--label-2); }
.action-tile .at-title { font-weight: 600; font-size: 14px; line-height: 1.2; }
.action-tile .at-sub { font-size: 11.5px; color: var(--gray); line-height: 1.35; margin-top: -4px; }

/* Dashboard load reveal */
.reveal { animation: riseIn 520ms var(--ease-out) both; }
.reveal.d1 { animation-delay: 60ms; } .reveal.d2 { animation-delay: 120ms; }
.reveal.d3 { animation-delay: 180ms; } .reveal.d4 { animation-delay: 240ms; }
.reveal.d5 { animation-delay: 300ms; }

@media (max-width: 1100px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 992px)  { .dash-cols { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
    .dash-hero h1 { font-size: 27px; }
    .stat-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-strip .stat-value { font-size: 28px; }
    .scan-bar { grid-template-columns: 1fr; padding: 12px; }
    .scan-bar .btn-scan { width: 100%; justify-content: center; }
    .action-grid { grid-template-columns: 1fr 1fr; }
    .month-chart .months span:nth-child(even) { visibility: hidden; }
}
