: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(var(--gold-rgb, 255, 199, 44), 0.08) 76% 100%),
        radial-gradient(circle at 8% -20%, rgba(var(--brand-rgb, 0, 56, 168), 0.16) 0%, transparent 40%),
        radial-gradient(circle at 110% 8%, rgba(var(--gold-rgb, 255, 199, 44), 0.18) 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;
    position: relative;
    z-index: 2;
    isolation: isolate;
    align-items: start;
}

.sidebar {
    background:
        linear-gradient(160deg, #00184f 0%, #002875 55%, #0038a8 100%);
    color: #ebf1ff;
    padding: 1.2rem 1rem;
    grid-column: 1;
    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;
}

.brand-card p + p {
    margin-top: 0.24rem;
    color: rgba(236, 243, 255, 0.72);
    font-size: 0.76rem;
}

.brand-captain {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    display: grid;
    gap: 0.18rem;
}

.brand-captain__label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.62);
    font-weight: 700;
}

.brand-captain__name {
    color: #ffffff;
    font-weight: 800;
    line-height: 1.35;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.9rem 0 0.2rem;
    color: rgba(236, 243, 255, 0.72);
    font-size: 0.8rem;
    font-weight: 700;
}

.back-link:hover {
    color: #ffffff;
    text-decoration: none;
}

.nav-domain {
    margin-top: 0.8rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.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 {
    grid-column: 2;
    padding: 1rem 1.15rem 1.4rem;
    min-width: 0;
}

.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 > *,
.hero-panel > * {
    min-width: 0;
    position: relative;
    z-index: 2;
}

.top-header::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    right: -90px;
    top: -120px;
    background: radial-gradient(circle, rgba(var(--brand-rgb, 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;
}

.workflow-chip {
    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;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.workflow-chip:hover {
    text-decoration: none;
    transform: translateY(-1px);
    background: #f4f7ff;
}

.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;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(3, 15, 44, 0.45);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    z-index: 35;
}

.sidebar-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

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

.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(var(--red-rgb, 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: linear-gradient(180deg, #f7faff 0%, rgba(var(--brand-rgb, 0, 56, 168), 0.04) 100%);
}

.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%, rgba(var(--brand-rgb, 0, 56, 168), 0.05) 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;
}

.captain-card {
    display: grid;
    grid-template-columns: 124px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.captain-card__media {
    width: 124px;
    height: 124px;
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(var(--brand-rgb, 0, 56, 168), 0.16), rgba(var(--gold-rgb, 255, 199, 44), 0.2));
    border: 1px solid rgba(var(--brand-rgb, 0, 56, 168), 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
}

.captain-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.captain-card__fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.3rem;
    color: var(--brand);
}

.captain-card__body {
    display: grid;
    gap: 0.35rem;
}

.captain-card__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
    color: var(--brand);
    font-weight: 800;
}

.captain-card__body h4 {
    font-size: 1.35rem;
}

.captain-card__title {
    color: var(--ink-soft);
    font-weight: 700;
}

.captain-card__meta,
.captain-card__hint {
    color: var(--ink-soft);
    font-size: 0.82rem;
    line-height: 1.6;
}

.dashboard-overview,
.dashboard-history {
    margin-top: 1rem;
}

.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) {
    .hero-panel {
        grid-template-columns: 1fr;
    }

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

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

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

@media (max-width: 1280px) {
    .top-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .header-search,
    .header-meta {
        width: 100%;
    }

    .header-meta {
        text-align: left;
        display: flex;
        flex-wrap: wrap;
        gap: 0.45rem 0.9rem;
        align-items: center;
        min-width: 0;
    }

    .hero-panel {
        grid-template-columns: 1fr;
    }
}

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

    .sidebar-overlay {
        display: block;
    }

    .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 {
        grid-column: 1;
        padding: 0.84rem;
    }

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

    .top-header {
        padding: 0.82rem;
        flex-direction: column;
        align-items: stretch;
    }

    .header-meta {
        display: none;
    }

    .header-search {
        flex: 1 1 auto;
        width: 100%;
    }

    .hero-panel,
    .module-grid,
    .grid-cards.two,
    .grid-cards.three,
    .grid-cards.four,
    .purpose-grid,
    .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(auto-fit, minmax(120px, 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;
}

.purpose-selection {
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    gap: 1rem;
}

.purpose-header {
    text-align: center;
}

.purpose-header h3 {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
}

.purpose-header p {
    color: var(--ink-soft);
}

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

.purpose-grid form {
    display: contents;
}

.purpose-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 1.4rem 1.2rem;
    width: 100%;
    border: 1px solid #d7e2f6;
    border-radius: var(--radius-lg);
    background: linear-gradient(165deg, #ffffff 0%, #f5f9ff 100%);
    box-shadow: var(--shadow-1);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.purpose-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}

.purpose-icon {
    font-size: 2.4rem;
    line-height: 1;
}

.purpose-card h4 {
    font-size: 1.05rem;
}

.purpose-card p {
    color: var(--ink-soft);
    font-size: 0.84rem;
    line-height: 1.6;
}

.purpose-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: #eef3ff;
    color: #24457f;
}

.purpose-card-ops:hover {
    border-color: #0f766e;
}

.purpose-card-ops:hover .purpose-badge {
    background: #ccfbf1;
    color: #0f766e;
}

.purpose-card-political:hover {
    border-color: #7c3aed;
}

.purpose-card-political:hover .purpose-badge {
    background: #ede9fe;
    color: #7c3aed;
}

.purpose-card-assistance:hover {
    border-color: #d97706;
}

.purpose-card-assistance:hover .purpose-badge {
    background: #fef3c7;
    color: #d97706;
}

.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);
}

/* ========================================
   QUICK GATE OVERLAY (Alt+F4)
   ======================================== */

.quick-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 15, 50, 0.72);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlayFadeIn 220ms ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.quick-gate-dialog {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.6rem 2rem;
    max-width: 420px;
    width: 92%;
    box-shadow: 0 30px 60px -20px rgba(0, 10, 40, 0.6);
    animation: dialogSlideUp 320ms ease;
    border: 1px solid var(--border);
}

@keyframes dialogSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.gate-dialog-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.gate-dialog-icon {
    font-size: 1.6rem;
}

.gate-dialog-header h3 {
    flex: 1;
    font-size: 1.1rem;
    margin: 0;
    color: var(--brand-deep);
}

.gate-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: none;
    transition: background 180ms;
}

.gate-close-btn:hover {
    background: #e2e8f0;
    color: #334155;
    transform: none;
}

.gate-dialog-note {
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.gate-dialog-form {
    display: grid;
    gap: 0.6rem;
}

.gate-dialog-input {
    text-align: center;
    font-size: 1.15rem;
    letter-spacing: 0.15em;
    padding: 0.7rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 200ms, box-shadow 200ms;
}

.gate-dialog-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 56, 168, 0.14);
}

.gate-dialog-submit {
    padding: 0.65rem;
    font-size: 0.92rem;
}

.gate-dialog-hint {
    text-align: center;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 0.8rem;
}

.gate-dialog-hint kbd {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: inherit;
    font-weight: 700;
    color: #475569;
}

/* ========================================
   PROTECTION TOAST
   ======================================== */

.protection-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #f1f5f9;
    padding: 0.75rem 1.1rem;
    border-radius: 12px;
    font-size: 0.82rem;
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 300ms ease, opacity 300ms ease;
    max-width: 380px;
}

.protection-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.protection-toast strong {
    margin-right: 0.3rem;
}

/* ========================================
   ENHANCED ANIMATIONS
   ======================================== */

.stat-card,
.voter-class-card,
.kp-step {
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px -20px rgba(0, 56, 168, 0.35);
}

.voter-class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.15);
}

.kp-step:hover {
    transform: scale(1.03);
}

.is-visible {
    transition: width 800ms ease;
}

/* Shimmer effect on hero panel */
.hero-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: heroShimmer 6s ease infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes heroShimmer {
    0%, 100% { left: -100%; }
    50% { left: 150%; }
}

/* Pulse animation for pending counts */
@keyframes subtlePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.chip-status-pending {
    animation: subtlePulse 2.4s ease infinite;
}

/* Nav hover ripple effect */
.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: rgba(255, 199, 44, 0.12);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 220ms, transform 220ms;
    pointer-events: none;
}

.nav-item {
    position: relative;
}

.nav-item:hover::before {
    opacity: 1;
    transform: scale(1);
}

/* Table row slide-in animation */
tbody tr {
    animation: rowSlideIn 400ms ease both;
}

tbody tr:nth-child(1) { animation-delay: 30ms; }
tbody tr:nth-child(2) { animation-delay: 50ms; }
tbody tr:nth-child(3) { animation-delay: 70ms; }
tbody tr:nth-child(4) { animation-delay: 90ms; }
tbody tr:nth-child(5) { animation-delay: 110ms; }
tbody tr:nth-child(6) { animation-delay: 130ms; }
tbody tr:nth-child(7) { animation-delay: 150ms; }
tbody tr:nth-child(8) { animation-delay: 170ms; }
tbody tr:nth-child(9) { animation-delay: 190ms; }
tbody tr:nth-child(10) { animation-delay: 210ms; }

@keyframes rowSlideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Chip hover */
.chip {
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.chip:hover {
    transform: scale(1.06);
    box-shadow: 0 2px 8px -2px rgba(0, 56, 168, 0.2);
}

/* Button press effect */
button:active {
    transform: scale(0.97);
}

/* ========================================
   RESIDENT CLASSIFICATION FILTER TABS
   ======================================== */

.classification-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
}

.classification-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-soft);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.classification-tab:hover {
    text-decoration: none;
    background: var(--brand-soft);
    color: var(--brand);
    border-color: var(--brand);
}

.classification-tab.active {
    background: var(--brand);
    color: #ffffff;
    border-color: var(--brand);
    box-shadow: 0 4px 12px -4px rgba(0, 56, 168, 0.4);
}

.classification-tab .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 0.68rem;
}

.classification-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
}

/* ========================================
   HOUSEHOLD ORG TREE
   ======================================== */

.household-org-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: 0.8rem;
    transition: box-shadow var(--transition);
}

.household-org-card:hover {
    box-shadow: var(--shadow-1);
}

.hh-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.hh-purok-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #ffffff;
}

.hh-members-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.3rem;
}

.hh-member-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    transition: background 180ms;
}

.hh-member-item:hover {
    background: #f0f5ff;
}

.hh-member-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    flex-shrink: 0;
}

.hh-member-name {
    flex: 1;
    font-weight: 600;
}

.hh-member-age {
    color: var(--ink-soft);
    font-size: 0.74rem;
}

.household-expand-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #475569;
    padding: 0;
    box-shadow: none;
    transition: background 180ms;
}

.household-expand-btn:hover {
    background: #e2e8f0;
    transform: none;
}

.household-detail-row {
    display: none;
}

.household-detail-row.expanded {
    display: table-row;
}

/* ========================================
   KEYBOARD SHORTCUT HINT BAR
   ======================================== */

.shortcut-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.45rem 0.8rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.5rem;
}

.shortcut-bar kbd {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

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

    .captain-card {
        grid-template-columns: 1fr;
    }

    .captain-card__media {
        width: 110px;
        height: 110px;
    }

    .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);
    }

    .quick-gate-dialog {
        padding: 1.2rem;
    }

    .protection-toast {
        right: 12px;
        bottom: 12px;
        max-width: 300px;
        font-size: 0.76rem;
    }

    .shortcut-bar {
        display: none;
    }

    .classification-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }

    .leaflet-map-container {
        height: 260px !important;
    }
}

/* ─── Leaflet Map Styles ─── */
.leaflet-map-container {
    border: 2px solid var(--border);
    z-index: 1;
}

.resident-map-marker,
.resident-cluster-marker {
    background: transparent !important;
    border: none !important;
}

.map-coords {
    font-family: 'Courier New', monospace;
    color: var(--brand);
    font-weight: 600;
    font-size: 0.82rem;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 3px;
    vertical-align: middle;
    border: 1.5px solid #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.map-legend {
    color: var(--ink-soft);
    padding: 0.4rem 0;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.leaflet-popup-content strong {
    color: var(--ink);
}

.leaflet-popup-content {
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    line-height: 1.5;
}

/* Coordinate Editor */
.coord-editor {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.coord-editor-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.coord-label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 120px;
}

.coord-label span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coord-input {
    padding: 0.45rem 0.6rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.coord-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
    outline: none;
}

.coord-label-paste {
    flex: 1.8;
    min-width: 180px;
}

.coord-paste-input {
    font-family: 'Sora', sans-serif;
    font-weight: 400;
    font-size: 0.82rem;
    color: var(--ink-soft);
}

.coord-paste-input::placeholder {
    color: #94a3b8;
    font-size: 0.78rem;
}

.coord-apply-btn {
    padding: 0.45rem 1rem;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
    height: fit-content;
}

.coord-apply-btn:hover {
    background: #1e3a8a;
    transform: translateY(-1px);
}

.coord-apply-btn:active {
    transform: translateY(0);
}

.coord-hint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.coord-save-ok {
    color: #059669;
    font-weight: 700;
    transition: opacity 0.5s;
}

.coord-save-error {
    color: #dc2626;
    font-weight: 700;
    transition: opacity 0.5s;
}

/* Map save indicator (floating - for residents map) */
.map-save-indicator {
    text-align: center;
    padding: 0.35rem 0;
    font-size: 0.78rem;
    font-weight: 700;
    transition: opacity 0.5s;
    min-height: 1.2rem;
}

.map-save-ok {
    color: #059669;
}

.map-save-err {
    color: #dc2626;
}

/* Responsive coord editor */
@media (max-width: 640px) {
    .coord-editor-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    .coord-label {
        min-width: 100%;
    }
    .coord-apply-btn {
        width: 100%;
        padding: 0.55rem;
    }
}

/* ========================================
   POLITICAL DATA SEPARATION SYSTEM
   ======================================== */

/* Political data toggle button in header */
.political-toggle-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #4c1d95 100%);
    color: #fff;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all var(--transition);
    animation: politicalBtnPulse 2s ease-in-out infinite;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.35);
}

.political-toggle-btn:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #3b0764 100%);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5);
    transform: translateY(-1px);
}

.political-toggle-btn.active {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    box-shadow: 0 2px 12px rgba(220, 38, 38, 0.35);
    animation: none;
}

.political-toggle-btn.active:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
}

@keyframes politicalBtnPulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(124, 58, 237, 0.35); }
    50% { box-shadow: 0 2px 20px rgba(124, 58, 237, 0.55); }
}

/* Political nav section divider */
.nav-divider {
    padding: 0.6rem 1rem 0.3rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(124, 58, 237, 0.2);
}

.nav-divider-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #7c3aed;
    font-weight: 700;
    opacity: 0.85;
}

.nav-item-political {
    border-left: 3px solid #7c3aed !important;
}

.nav-dot-political {
    background: #7c3aed !important;
}

/* Political data sections hidden by default */
.political-data-section {
    display: none;
    border: 2px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-md);
    position: relative;
}

.political-data-section::before {
    content: 'POLITICAL DATA';
    position: absolute;
    top: -10px;
    left: 16px;
    background: #7c3aed;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 2px 10px;
    border-radius: 4px;
    z-index: 1;
}

/* Inline political links (no badge, no border) */
span.political-data-section {
    border: none !important;
    position: static;
}

span.political-data-section::before {
    display: none;
}

/* When political mode is active */
body.political-mode .political-data-section {
    display: block;
}

body.political-mode .political-toggle-btn {
    display: inline-flex !important;
}

/* Political data active indicator in header */
.political-mode-indicator {
    display: none;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: #7c3aed;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    background: rgba(124, 58, 237, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

body.political-mode .political-mode-indicator {
    display: inline-flex;
}

/* Quick action buttons for political data (in residents page) */
.political-quick-actions {
    display: none;
}

body.political-mode .political-quick-actions {
    display: flex;
}

/* Search results political section */
.search-political-results {
    display: none;
}

body.political-mode .search-political-results {
    display: block;
}


@media (max-width: 640px) {
    .quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .captain-card {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .captain-card__media {
        width: 104px;
        height: 104px;
    }
}
