:root {
    --bg: #f2f6ff;
    --surface: #ffffff;
    --surface-2: #f8fbff;
    --ink: #16233a;
    --ink-soft: #4d5f7f;
    --brand: #0038a8;
    --brand-deep: #001862;
    --brand-soft: #e8eef8;
    --gold: #ffc72c;
    --red: #ce1126;
    --ok: #1f8f51;
    --warn: #bb6b14;
    --danger: #ba2636;
    --border: #dbe4f5;
    --shadow-1: 0 14px 36px -24px rgba(10, 31, 74, 0.55);
    --shadow-2: 0 30px 56px -36px rgba(3, 16, 44, 0.58);
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --transition: 220ms ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: 'Sora', 'Segoe UI', sans-serif;
    background:
        linear-gradient(90deg, transparent 0 76%, rgba(255, 199, 44, 0.06) 76% 100%),
        radial-gradient(circle at 8% -20%, #dce8ff 0%, transparent 40%),
        radial-gradient(circle at 110% 8%, #ffeec5 0%, transparent 36%),
        linear-gradient(180deg, #f6f9ff 0%, #eef3fe 100%);
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0 0 auto;
    height: 8px;
    z-index: 30;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            var(--brand-deep) 0 68%,
            var(--gold) 68% 90%,
            var(--red) 90% 100%
        );
}

h1,
h2,
h3,
h4,
h5 {
    margin: 0;
    font-family: 'Merriweather', Georgia, serif;
    letter-spacing: 0.1px;
}

p {
    margin: 0;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.app-shell {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 100vh;
}

.sidebar {
    background:
        linear-gradient(160deg, #00184f 0%, #002875 55%, #0038a8 100%);
    color: #ebf1ff;
    padding: 1.2rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    overflow-y: auto;
}

.brand-card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.brand-pill {
    display: inline-block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #17140a;
    background: var(--gold);
    padding: 0.3rem 0.54rem;
    border-radius: 999px;
    font-weight: 800;
    margin-bottom: 0.62rem;
}

.brand-card h1 {
    font-size: 1.36rem;
    margin-bottom: 0.26rem;
    color: #ffffff;
}

.brand-card p {
    color: rgba(236, 243, 255, 0.9);
    font-size: 0.85rem;
}

.nav-stack {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.64rem;
    color: #dbe6ff;
    padding: 0.6rem 0.74rem;
    border-radius: 10px;
    transition: background var(--transition), transform var(--transition), color var(--transition);
    font-size: 0.9rem;
    font-weight: 600;
}

.nav-item:hover {
    text-decoration: none;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    transform: translateX(2px);
}

.nav-item.is-active {
    background:
        linear-gradient(94deg, rgba(255, 199, 44, 0.32), rgba(255, 255, 255, 0.15));
    color: #ffffff;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.64);
    box-shadow: 0 0 0 0 rgba(255, 199, 44, 0.45);
}

.nav-item.is-active .nav-dot {
    background: var(--gold);
    animation: pulseDot 1.6s ease-out infinite;
}

.sidebar-footnote {
    margin-top: 1rem;
    padding: 0.82rem;
    background: rgba(4, 15, 41, 0.46);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 0.77rem;
    display: grid;
    gap: 0.56rem;
}

.main-panel {
    padding: 1rem 1.15rem 1.4rem;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.08rem;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(140deg, #ffffff 0%, #f4f8ff 52%, #fff8e6 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-1);
    position: relative;
    overflow: hidden;
}

.top-header::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    right: -90px;
    top: -120px;
    background: radial-gradient(circle, rgba(0, 56, 168, 0.18), transparent 72%);
    pointer-events: none;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.68rem;
    color: var(--ink-soft);
    margin-bottom: 0.26rem;
    font-weight: 700;
}

.top-header h2 {
    font-size: 1.3rem;
    margin-bottom: 0.42rem;
}

.workflow-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: 0.36rem;
}

.workflow-ribbon span {
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.26rem 0.46rem;
    border-radius: 999px;
    background: #eef3ff;
    color: #24457f;
    border: 1px solid #cfdbf7;
    font-weight: 700;
}

.header-meta {
    text-align: right;
    color: var(--ink-soft);
    font-size: 0.82rem;
    display: grid;
    gap: 0.2rem;
    min-width: 160px;
}

.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    background: #ffffff;
    border-radius: 10px;
    padding: 0.42rem 0.62rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1b2f5b;
}

.flash {
    margin-top: 0.84rem;
    border-radius: 12px;
    padding: 0.76rem 0.94rem;
    border: 1px solid transparent;
    font-weight: 600;
}

.flash-success {
    background: #e8f8ef;
    color: #155f38;
    border-color: #b9e6c9;
}

.flash-error {
    background: #fcebec;
    color: #982633;
    border-color: #f5c1c7;
}

.page-content {
    margin-top: 0.95rem;
    display: grid;
    gap: 0.95rem;
}

.panel,
.stat-card,
.official-card,
.hero-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.panel {
    padding: 1rem;
    display: grid;
    gap: 0.72rem;
}

.panel h4 {
    font-size: 1.08rem;
}

.hero-panel {
    padding: 1rem;
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 1rem;
    background:
        linear-gradient(130deg, #ffffff 0%, #f3f8ff 70%, #fff7e8 100%);
    position: relative;
    overflow: hidden;
    border-color: #cedcf8;
    box-shadow: var(--shadow-2);
}

.hero-panel::after {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    right: -70px;
    bottom: -95px;
    background: radial-gradient(circle, rgba(206, 17, 38, 0.13), transparent 70%);
    pointer-events: none;
}

.hero-kicker {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--brand);
    font-weight: 800;
    margin-bottom: 0.45rem;
}

.hero-panel h3 {
    font-size: 1.32rem;
    margin-bottom: 0.55rem;
    line-height: 1.3;
}

.hero-panel p {
    color: var(--ink-soft);
    max-width: 70ch;
}

.hero-badges {
    display: grid;
    gap: 0.56rem;
}

.hero-badges div {
    border-radius: var(--radius-md);
    padding: 0.72rem;
    border: 1px solid #d3dff7;
    background: #f7faff;
}

.hero-badges strong {
    display: block;
    font-size: 1.22rem;
    margin-bottom: 0.16rem;
    color: #123674;
}

.hero-badges span {
    color: var(--ink-soft);
    font-size: 0.79rem;
}

.grid-cards {
    display: grid;
    gap: 0.9rem;
}

.grid-cards.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cards.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cards.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    padding: 0.92rem;
    background:
        linear-gradient(165deg, #ffffff 0%, #f5f9ff 85%);
    border-color: #d3def4;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-deep), var(--brand), var(--gold));
}

.stat-card p {
    color: var(--ink-soft);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.stat-card h4 {
    font-size: 1.4rem;
    margin: 0.38rem 0 0.16rem;
}

.stat-card span {
    color: var(--ink-soft);
    font-size: 0.8rem;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.bar-stack {
    display: grid;
    gap: 0.56rem;
}

.bar-track {
    width: 100%;
    border-radius: 999px;
    background: #eaf0fa;
    height: 30px;
    overflow: hidden;
    border: 1px solid #d7e2f6;
}

.bar-track span {
    display: inline-flex;
    align-items: center;
    height: 100%;
    min-width: 95px;
    padding: 0 0.84rem;
    font-size: 0.79rem;
    font-weight: 700;
    color: #1d2f57;
    background: linear-gradient(90deg, #d2e2ff 0%, #ffe7ae 100%);
}

.meta-grid {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.66rem;
}

.meta-grid dt {
    color: var(--ink-soft);
    font-size: 0.78rem;
}

.meta-grid dd {
    margin: 0.2rem 0 0;
    font-weight: 700;
}

.stat-pairs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.stat-pairs div {
    border: 1px solid #d7e1f5;
    border-radius: 12px;
    padding: 0.6rem;
    background: #f8fbff;
}

.stat-pairs strong {
    display: block;
    font-size: 1.02rem;
    margin-bottom: 0.2rem;
}

.stat-pairs span {
    font-size: 0.74rem;
    color: var(--ink-soft);
}

.timeline {
    display: grid;
    gap: 0.64rem;
}

.timeline article {
    border-left: 4px solid var(--brand);
    padding: 0.56rem 0.7rem;
    background: var(--surface-2);
    border-radius: 8px;
}

.timeline-year {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand);
    font-weight: 800;
    display: inline-block;
    margin-bottom: 0.24rem;
}

.inline-form,
.stack-form {
    display: grid;
    gap: 0.68rem;
}

.inline-form {
    grid-template-columns: 1fr 220px auto;
    align-items: end;
}

.search-form {
    grid-template-columns: 1fr auto;
}

.search-actions {
    display: inline-flex;
    gap: 0.46rem;
    align-items: center;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cddaf2;
    border-radius: 10px;
    padding: 0.56rem 0.8rem;
    background: #f4f8ff;
    color: #203d77;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    transition: background var(--transition), transform var(--transition);
}

.button-link:hover {
    text-decoration: none;
    background: #e9f1ff;
    transform: translateY(-1px);
}

.form-row {
    display: grid;
    gap: 0.68rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.72rem;
    font-size: 0.84rem;
}

label {
    display: grid;
    gap: 0.36rem;
    font-size: 0.82rem;
    color: var(--ink-soft);
    font-weight: 700;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    border-radius: 10px;
    border: 1px solid #cfdbf4;
    padding: 0.55rem 0.66rem;
    background: #ffffff;
    color: var(--ink);
    transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #8eaee8;
    box-shadow: 0 0 0 3px rgba(0, 56, 168, 0.11);
}

textarea {
    resize: vertical;
}

button {
    border: 0;
    border-radius: 10px;
    padding: 0.58rem 0.84rem;
    background: linear-gradient(120deg, var(--brand), var(--brand-deep));
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    transition: transform var(--transition), filter var(--transition), box-shadow var(--transition);
    box-shadow: 0 8px 18px -14px rgba(0, 56, 168, 0.8);
}

button:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

button.tiny {
    padding: 0.35rem 0.58rem;
    font-size: 0.74rem;
}

.table-wrap {
    border: 1px solid #d4dff4;
    border-radius: 12px;
    overflow: auto;
    background: #ffffff;
}

.table-wrap.tall {
    max-height: 520px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

thead th {
    text-align: left;
    background: #eff4ff;
    color: #224376;
    padding: 0.62rem;
    border-bottom: 1px solid #d4e0f6;
    position: sticky;
    top: 0;
    z-index: 1;
}

tbody td {
    border-bottom: 1px solid #edf2fc;
    padding: 0.58rem 0.62rem;
    vertical-align: top;
}

tbody tr:hover {
    background: #f8fbff;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.44rem;
    border-radius: 999px;
    background: #e8effd;
    color: #19458a;
    border: 1px solid #cad8f4;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.chip-verified {
    background: #e0f7eb;
    border-color: #b9e9cc;
    color: #11653c;
}

.chip-unverified {
    background: #fff0dd;
    border-color: #f6d7ad;
    color: #8e5209;
}

.subtle {
    color: var(--ink-soft);
    font-size: 0.8rem;
}

code {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.77rem;
    background: #eef3ff;
    border: 1px solid #d2ddf5;
    border-radius: 6px;
    padding: 0.08rem 0.32rem;
}

.clean-list,
.ordered-list {
    margin: 0;
    padding-left: 1.08rem;
    display: grid;
    gap: 0.28rem;
    color: #2a4066;
}

.official-card {
    padding: 0.9rem;
    display: grid;
    gap: 0.56rem;
}

.official-card header {
    display: flex;
    justify-content: space-between;
    gap: 0.4rem;
    align-items: center;
}

.official-card h5 {
    font-size: 0.96rem;
}

.official-name {
    font-weight: 800;
    color: #173f80;
}

.panel,
.stat-card,
.hero-panel,
.official-card {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeRise 640ms ease forwards;
}

.page-content > *:nth-child(1) { animation-delay: 70ms; }
.page-content > *:nth-child(2) { animation-delay: 120ms; }
.page-content > *:nth-child(3) { animation-delay: 170ms; }
.page-content > *:nth-child(4) { animation-delay: 220ms; }
.page-content > *:nth-child(5) { animation-delay: 260ms; }
.page-content > *:nth-child(6) { animation-delay: 300ms; }
.page-content > *:nth-child(7) { animation-delay: 340ms; }

@keyframes fadeRise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(255, 199, 44, 0.44); }
    70% { box-shadow: 0 0 0 8px rgba(255, 199, 44, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 199, 44, 0); }
}

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

@media (max-width: 1200px) {
    .grid-cards.four,
    .grid-cards.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-pairs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -340px;
        top: 0;
        width: 320px;
        z-index: 40;
        transition: left var(--transition);
        box-shadow: var(--shadow-2);
    }

    .sidebar.is-open {
        left: 0;
    }

    .main-panel {
        padding: 0.84rem;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .top-header {
        padding: 0.82rem;
    }

    .header-meta {
        display: none;
    }

    .hero-panel,
    .module-grid,
    .grid-cards.two,
    .grid-cards.three,
    .grid-cards.four,
    .inline-form,
    .form-row,
    .meta-grid,
    .stat-pairs {
        grid-template-columns: 1fr;
    }

    .search-actions {
        justify-content: flex-start;
    }
}

/* ========================================
   GLOBAL SEARCH BAR
   ======================================== */

.header-search {
    flex: 0 0 280px;
}

.global-search-form {
    display: flex;
    gap: 0;
    align-items: stretch;
}

.global-search-form input[type="search"] {
    border-radius: 10px 0 0 10px;
    border-right: 0;
    padding: 0.5rem 0.7rem;
    font-size: 0.82rem;
    width: 100%;
}

.global-search-form .search-btn {
    border-radius: 0 10px 10px 0;
    padding: 0.5rem 0.7rem;
    font-size: 0.78rem;
    white-space: nowrap;
}

/* ========================================
   QUICK ACTIONS
   ======================================== */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.6rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: linear-gradient(160deg, #f8fbff, #ffffff);
    color: var(--ink);
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
    transition: all var(--transition);
}

.quick-action-btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-1);
    border-color: var(--brand);
    background: #eef4ff;
}

.qa-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}

/* ========================================
   RESIDENT PROFILE
   ======================================== */

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.profile-avatar {
    flex-shrink: 0;
}

.avatar-initials {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.profile-info {
    flex: 1;
    min-width: 200px;
}

.profile-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--brand-deep);
    margin-bottom: 0.3rem;
    font-family: 'Merriweather', Georgia, serif;
}

.tag-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

.profile-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ========================================
   CLICKABLE TABLE ROWS
   ======================================== */

.clickable-row {
    cursor: pointer;
    transition: background var(--transition);
}

.clickable-row:hover {
    background: #eef4ff !important;
}

.chip-sm {
    font-size: 0.64rem;
    padding: 0.14rem 0.34rem;
}

/* ========================================
   OFFICIAL PHOTO CARDS
   ======================================== */

.official-photo-area {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.3rem;
}

.official-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.official-avatar span {
    color: #ffffff;
}

.avatar-verified {
    background: linear-gradient(135deg, #1f8f51, #0d6937);
    box-shadow: 0 0 0 3px rgba(31, 143, 81, 0.2);
}

.avatar-pending {
    background: linear-gradient(135deg, #bb6b14, #8e5209);
    box-shadow: 0 0 0 3px rgba(187, 107, 20, 0.2);
}

.official-badge {
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ffffff;
    background: linear-gradient(90deg, var(--brand-deep), var(--brand));
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
}

.official-card-lead {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(0, 56, 168, 0.12), var(--shadow-1);
    background: linear-gradient(165deg, #ffffff 0%, #f0f5ff 100%);
}

/* ========================================
   WORKFLOW STEPS
   ======================================== */

.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.workflow-step {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.7rem 0;
    border-left: 3px solid #d7e2f6;
    margin-left: 14px;
    padding-left: 1rem;
    position: relative;
}

.workflow-step.step-active {
    border-left-color: var(--brand);
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #d7e2f6;
    color: #4d5f7f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    font-weight: 800;
    flex-shrink: 0;
    position: absolute;
    left: -16px;
}

.step-active .step-number {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #ffffff;
}

.step-content {
    padding-left: 0.6rem;
}

.step-content strong {
    font-size: 0.88rem;
    display: block;
    margin-bottom: 0.2rem;
}

/* ========================================
   SESSION WORKFLOW
   ======================================== */

.session-workflow {
    display: flex;
    align-items: flex-start;
    gap: 0;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.sw-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 120px;
    padding: 0.5rem;
}

.sw-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #d7e2f6;
    color: #4d5f7f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.sw-active .sw-icon {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #ffffff;
    box-shadow: 0 4px 12px -4px rgba(0, 56, 168, 0.4);
}

.sw-label {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.sw-step .subtle {
    font-size: 0.7rem;
}

.sw-connector {
    width: 40px;
    height: 2px;
    background: #d7e2f6;
    margin-top: 20px;
    flex-shrink: 0;
}

/* ========================================
   KP (KATARUNGANG PAMBARANGAY) FLOW
   ======================================== */

.kp-flow {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.8rem 0;
    overflow-x: auto;
}

.kp-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    min-width: 140px;
}

.kp-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kp-pending .kp-dot { background: #f59e0b; }
.kp-mediation .kp-dot { background: #3b82f6; }
.kp-settled .kp-dot { background: #10b981; }
.kp-referred .kp-dot { background: #ef4444; }

.kp-pending { border-color: #fcd34d; background: #fffbeb; }
.kp-mediation { border-color: #93c5fd; background: #eff6ff; }
.kp-settled { border-color: #6ee7b7; background: #ecfdf5; }
.kp-referred { border-color: #fca5a5; background: #fef2f2; }

.kp-info strong {
    display: block;
    font-size: 0.82rem;
}

.kp-info span {
    font-size: 0.72rem;
    color: var(--ink-soft);
}

.kp-arrow {
    width: 24px;
    height: 2px;
    background: #d7e2f6;
    flex-shrink: 0;
    position: relative;
}

.kp-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    width: 0;
    height: 0;
    border-left: 6px solid #d7e2f6;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

/* ========================================
   STATUS CHIPS (Colored)
   ======================================== */

.chip-status-pending { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.chip-status-approved, .chip-status-settled { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.chip-status-released { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.chip-status-mediation { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.chip-status-referred { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.chip-status-draft, .chip-status-for_review { background: #f5f3ff; border-color: #ddd6fe; color: #5b21b6; }
.chip-status-issued { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.chip-status-reset { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.chip-special { background: #fef3c7; border-color: #fcd34d; color: #92400e; }

/* ========================================
   FINANCIAL CHARTS
   ======================================== */

.chart-bars {
    display: grid;
    gap: 0.55rem;
}

.chart-bar-group {
    display: grid;
    gap: 0.25rem;
}

.chart-bar-track {
    width: 100%;
    height: 32px;
    border-radius: 8px;
    background: #eef3fd;
    border: 1px solid #d7e2f6;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand) 0%, #3b82f6 100%);
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    min-width: 80px;
    transition: width 600ms ease;
}

.chart-bar-value {
    padding: 0 0.6rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

.chart-bar-label {
    font-size: 0.72rem;
    color: var(--ink-soft);
    font-weight: 600;
}

.source-breakdown {
    display: grid;
    gap: 0.6rem;
}

.source-row {
    display: grid;
    grid-template-columns: 120px 1fr 90px;
    gap: 0.5rem;
    align-items: center;
}

.source-info strong {
    font-size: 0.8rem;
    display: block;
}

.source-bar-track {
    height: 10px;
    border-radius: 999px;
    background: #eef3fd;
    overflow: hidden;
}

.source-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 600ms ease;
}

.source-documents { background: var(--brand); }
.source-business { background: var(--gold); }
.source-other { background: var(--ok); }

.source-amount {
    text-align: right;
    font-weight: 700;
    font-size: 0.82rem;
}

/* ========================================
   RESPONSIVE UPDATES
   ======================================== */

@media (max-width: 640px) {
    body::before {
        height: 6px;
    }

    .brand-card h1 {
        font-size: 1.2rem;
    }

    .top-header h2 {
        font-size: 1.1rem;
    }

    .workflow-ribbon {
        display: none;
    }

    .header-search {
        display: none;
    }

    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .session-workflow {
        flex-direction: column;
        align-items: stretch;
    }

    .sw-connector {
        width: 2px;
        height: 20px;
        margin: 0 auto;
    }

    .kp-flow {
        flex-direction: column;
        align-items: stretch;
    }

    .kp-arrow {
        width: 2px;
        height: 16px;
        margin: 0 auto;
    }

    .kp-arrow::after {
        right: -3px;
        top: auto;
        bottom: 0;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-top: 6px solid #d7e2f6;
    }

    .source-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   DATA PRIVACY GATE
   ======================================== */

.privacy-gate {
    max-width: 540px;
    margin: 2rem auto;
    text-align: center;
}

.gate-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.gate-form {
    max-width: 360px;
    margin: 1.5rem auto;
    text-align: left;
}

.gate-form input[type="password"] {
    text-align: center;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
}

.privacy-notice {
    margin-top: 1.5rem;
    padding: 1rem 1.2rem;
    background: #fdf8f0;
    border: 1px solid #f0ddb8;
    border-radius: 10px;
    text-align: left;
    font-size: 0.82rem;
    color: #6b5a3e;
}

.privacy-notice strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #8b6914;
}

.privacy-notice ul {
    margin: 0;
    padding-left: 1.2rem;
}

.privacy-notice li {
    margin-bottom: 0.3rem;
}

.privacy-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: #fef9ee;
    border: 1px solid #f0ddb8;
    border-radius: 8px;
    font-size: 0.82rem;
    color: #6b5a3e;
    margin-bottom: 0.5rem;
}

.privacy-banner strong {
    color: #8b6914;
}

.lock-btn {
    margin-left: auto;
    padding: 0.3rem 0.8rem;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    text-decoration: none;
    white-space: nowrap;
}

.lock-btn:hover {
    background: #b91c1c;
}

.masked {
    color: #94a3b8;
    letter-spacing: 0.1em;
}

/* ========================================
   VOTER CLASSIFICATION (PROTECTED)
   ======================================== */

.protected-section {
    border: 2px dashed #f0ddb8;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    background: #fefcf8;
}

.protected-section h4 {
    color: #8b6914;
}

.voter-class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.voter-class-card {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    text-align: center;
}

.voter-class-card h5 {
    margin: 0 0 0.25rem;
    font-size: 0.85rem;
    color: #475569;
}

.voter-class-card .vc-count {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--brand);
}

.biometric-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    background: #eef3fd;
    border: 1px solid #c7d9f5;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--brand);
}

@media (max-width: 980px) {
    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }

    .session-workflow {
        flex-wrap: wrap;
    }

    .header-search {
        flex: 0 0 200px;
    }

    .privacy-gate {
        margin: 1rem auto;
    }

    .voter-class-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
