:root {
    --navy: #16253a;
    --navy-soft: #223754;
    --blue: #2878d0;
    --green: #19a66a;
    --amber: #e9a23b;
    --surface: #ffffff;
    --background: #f3f6fa;
    --border: #dde4ec;
    --text: #263442;
    --muted: #718096;
    --sidebar-width: 244px;
    --sidebar-collapsed-width: 76px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--text);
    background: var(--background);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 12% 18%, rgba(51, 133, 219, .22), transparent 28%),
        linear-gradient(135deg, #132136 0%, #24476d 100%);
}
.login-card {
    width: min(430px, 100%);
    padding: 38px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
}
.login-page.register-mode {
    align-items: start;
    padding-block: 34px;
}
.login-page.register-mode .login-card {
    width: min(860px, 100%);
}
.login-card h1 { font-size: 1.7rem; font-weight: 750; line-height: 1.25; }
.login-register-link {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    text-align: center;
    font-size: .9rem;
}
.register-heading {
    margin-bottom: 18px;
}
.register-heading h2 {
    margin: 0;
    color: var(--navy);
    font-size: 1.28rem;
    font-weight: 750;
}
.register-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.4;
}
.register-form {
    padding-top: 2px;
}
.register-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 16px;
}
.register-field-wide {
    grid-column: 1 / -1;
}
.register-field .form-label {
    margin-bottom: 6px;
    color: var(--navy);
    font-weight: 650;
    font-size: .88rem;
}
.register-field .form-label span {
    color: #dc3545;
}
.password-guide {
    display: grid;
    gap: 2px;
    margin: 16px 0 18px;
    padding: 12px 14px;
    border: 1px solid rgba(40, 120, 208, .18);
    border-radius: 12px;
    color: var(--navy);
    background: #f4f8fd;
    font-size: .84rem;
}
.password-guide span {
    color: var(--muted);
}
.brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    margin-bottom: 20px;
    color: #fff;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--blue), #54a4ef);
}

.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1040;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
    color: #fff;
    background: var(--navy);
    box-shadow: 0 2px 12px rgba(15, 31, 49, .22);
}
.sidebar-toggle {
    width: 40px;
    height: 40px;
    display: grid;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 8px;
    text-decoration: none;
}
.sidebar-toggle:hover { background: rgba(255, 255, 255, .1); }
.app-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}
.app-brand i { color: #68b6ff; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.user-menu small { display: block; color: #b8c5d4; font-size: .72rem; letter-spacing: .08em; }
.profile-menu-button {
    width: 38px;
    height: 34px;
    padding: 0;
    font-size: 1rem;
}
.profile-dropdown { min-width: 245px; padding: 8px; }
.profile-dropdown .dropdown-header { padding: 8px 10px; }
.profile-dropdown .dropdown-header strong {
    display: block;
    color: var(--text);
    font-size: .9rem;
}
.profile-dropdown .dropdown-header small {
    margin-top: 2px;
    color: var(--muted);
    letter-spacing: normal;
}
.profile-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 7px;
    font-size: .88rem;
}
.profile-dropdown .dropdown-item i {
    width: 18px;
    color: var(--blue);
    text-align: center;
}

.sidebar {
    position: fixed;
    z-index: 1030;
    top: 64px;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    padding: 20px 12px;
    background: var(--navy);
    overflow-x: hidden;
    transition: width .2s ease, transform .2s ease;
}
.sidebar-label {
    padding: 8px 13px;
    color: #8193aa;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
}
.sidebar-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 3px 0;
    padding: 12px 14px;
    border: 0;
    border-radius: 9px;
    color: #c9d4e1;
    background: transparent;
    text-align: left;
    white-space: nowrap;
}
.sidebar-link:hover, .sidebar-link.active { color: #fff; background: var(--navy-soft); }
.sidebar-link.active { box-shadow: inset 3px 0 #4da2f0; }
.sidebar-link i { width: 20px; text-align: center; }
.sidebar-link span, .sidebar-label { transition: opacity .12s ease; }
.sidebar-module-link { position: relative; }
.sidebar-module-link[data-module-toggle="skt"] {
    align-items: flex-start;
    white-space: normal;
}
.sidebar-module-link[data-module-toggle="skt"] span {
    min-width: 0;
    font-size: .82rem;
    line-height: 1.35;
}
.sidebar-module-link[data-module-toggle="skt"] .sidebar-module-arrow {
    margin-top: 4px;
}
.sidebar-module-arrow {
    width: auto !important;
    margin-left: auto;
    font-size: .72rem;
    transition: transform .18s ease;
}
.sidebar-module-link.open .sidebar-module-arrow { transform: rotate(180deg); }
.sidebar-submenu {
    display: none;
    padding: 3px 0 7px 14px;
}
.sidebar-submenu.open { display: block; }
.sidebar-sublink {
    width: 100%;
    padding-block: 9px;
    font-size: .88rem;
}
.sidebar-sublink::before {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    content: "";
    background: #6e87a2;
}
.sidebar-empty {
    padding: 12px 14px;
    color: #91a6ba;
    font-size: .78rem;
    line-height: 1.45;
}

.main-content {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding: 88px 24px 24px;
    transition: margin-left .2s ease;
}
.app-shell.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); padding-inline: 10px; }
.app-shell.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed-width); }
.app-shell.sidebar-collapsed .sidebar-label {
    height: 32px;
    padding-inline: 0;
    overflow: hidden;
    opacity: 0;
}
.app-shell.sidebar-collapsed .sidebar-link {
    justify-content: center;
    gap: 0;
    padding-inline: 0;
}
.app-shell.sidebar-collapsed .sidebar-module-link[data-module-toggle="skt"] {
    align-items: center;
}
.app-shell.sidebar-collapsed .sidebar-link span {
    width: 0;
    overflow: hidden;
    opacity: 0;
}
.app-shell.sidebar-collapsed .sidebar-submenu { padding-left: 0; }
.app-shell.sidebar-collapsed .sidebar-module-arrow,
.app-shell.sidebar-collapsed .sidebar-sublink::before { display: none; }
.app-shell.sidebar-collapsed .sidebar-link i { width: 24px; font-size: 1.05rem; }
.sidebar-backdrop {
    position: fixed;
    z-index: 1025;
    inset: 64px 0 0;
    display: none;
    border: 0;
    background: rgba(10, 20, 32, .48);
}
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.page-header h2 { margin: 0; font-size: 1.55rem; font-weight: 720; }
.page-loading { min-height: 55vh; display: grid; place-items: center; }

.panel, .stat-card {
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: 0 3px 15px rgba(28, 49, 73, .06);
}
.stat-card { padding: 22px; height: 100%; }
.stat-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    margin-bottom: 18px;
    color: #fff;
    font-size: 1.15rem;
}
.stat-card .number { font-size: 1.8rem; font-weight: 750; line-height: 1; }
.stat-card .label { color: var(--muted); margin-top: 8px; }
.bg-soft-blue { background: var(--blue); }
.bg-soft-green { background: var(--green); }
.bg-soft-amber { background: var(--amber); }
.bg-soft-navy { background: var(--navy-soft); }

.dashboard-metric-card {
    --metric-color: var(--blue);
    position: relative;
    height: 100%;
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(145deg, #fff, #f8fbff);
    box-shadow: 0 8px 28px rgba(26, 47, 71, .08);
}
.dashboard-metric-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    content: "";
    background: var(--metric-color);
}
.dashboard-metric-card.metric-navy { --metric-color: #344c6b; }
.dashboard-metric-card.metric-green { --metric-color: var(--green); }
.dashboard-metric-card.metric-amber { --metric-color: var(--amber); }
.metric-card-header { display: flex; align-items: center; gap: 11px; }
.metric-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background: var(--metric-color);
    box-shadow: 0 7px 16px color-mix(in srgb, var(--metric-color) 25%, transparent);
}
.metric-label { color: #536273; font-size: .88rem; font-weight: 700; }
.metric-total { margin-top: 20px; font-size: clamp(1.8rem, 2.5vw, 2.35rem); font-weight: 780; line-height: 1; }
.metric-total-label { margin-top: 6px; color: var(--muted); font-size: .76rem; }
.metric-breakdown {
    display: grid;
    gap: 9px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e7edf3;
}
.metric-breakdown > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric-breakdown span { color: #667587; font-size: .8rem; }
.metric-breakdown b {
    display: inline-grid;
    min-width: 25px;
    height: 22px;
    place-items: center;
    margin-right: 5px;
    border-radius: 6px;
    color: var(--metric-color);
    background: color-mix(in srgb, var(--metric-color) 11%, white);
    font-size: .7rem;
}
.metric-breakdown strong { font-size: .95rem; }
.metric-phone-summary {
    margin-top: 14px;
    padding: 12px;
    border-radius: 10px;
    color: #185d48;
    background: #eaf8f2;
}
.metric-phone-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-phone-title span { font-size: .76rem; font-weight: 700; }
.metric-phone-title strong { font-size: 1rem; }
.metric-phone-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(24, 93, 72, .15);
}
.metric-phone-breakdown span { color: #397565; font-size: .68rem; }
.metric-phone-breakdown b { display: block; margin-top: 2px; color: #164f40; font-size: .82rem; }
.metric-phone-breakdown.single-scope { grid-template-columns: 1fr; }
.dashboard-operator-summary {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 3px 15px rgba(28, 49, 73, .05);
}
.operator-icon {
    width: 38px;
    height: 38px;
    display: grid;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: var(--blue);
}
.dashboard-operator-summary span { display: block; color: var(--muted); font-size: .72rem; }
.dashboard-operator-summary strong { font-size: 1.2rem; }
.dashboard-operator-summary small { margin-left: auto; color: var(--muted); }
.dashboard-page,
.dashboard-progress-panel,
.dashboard-progress-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.dashboard-progress-scroll {
    max-height: 420px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.dashboard-progress-table { min-width: 650px; }
.ftv-progress-scroll {
    max-height: 430px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.ftv-progress-table { min-width: 860px; }
.ftv-change-row { cursor: pointer; }
.ftv-change-row:hover { background: #f5f9fd; }
.ftv-progress-scroll thead th {
    position: sticky;
    z-index: 2;
    top: 0;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    box-shadow: 0 1px 0 rgba(36, 55, 75, .08);
}
.dashboard-progress-scroll thead th {
    position: sticky;
    z-index: 2;
    top: 0;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    box-shadow: 0 1px 0 rgba(36, 55, 75, .08);
}

.three-column-layout {
    display: grid;
    grid-template-columns: minmax(260px, 28%) minmax(350px, 39%) minmax(310px, 33%);
    height: calc(100vh - 112px);
    overflow: hidden;
}
.workspace-column { min-width: 0; overflow-y: auto; border-right: 1px solid var(--border); }
.workspace-column:last-child { border-right: 0; }
.column-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .97);
}
.column-body { padding: 16px; }
.voter-list { padding: 8px; }
.voter-item {
    width: 100%;
    padding: 13px;
    border: 0;
    border-bottom: 1px solid #edf0f4;
    border-radius: 8px;
    background: #fff;
    text-align: left;
}
.voter-item:hover { background: #f5f9fd; }
.voter-item.active { background: #eaf4ff; box-shadow: inset 3px 0 var(--blue); }
.voter-item.voter-item-completed { background: #e5f6ec; }
.voter-item.voter-item-completed:hover { background: #d8f0e2; }
.voter-item.voter-item-pending { background: #fff6df; }
.voter-item.voter-item-pending:hover { background: #fbedc9; }
.voter-item.voter-item-completed.active {
    background: #d2eddd;
    box-shadow: inset 4px 0 var(--green);
}
.voter-item.voter-item-pending.active {
    background: #f9e9bd;
    box-shadow: inset 4px 0 var(--amber);
}
.voter-name { font-weight: 650; }
.voter-meta { color: var(--muted); font-size: .78rem; margin-top: 3px; }
.detail-label { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.detail-value { margin-bottom: 12px; font-weight: 550; }
.phone-candidate-list {
    display: grid;
    gap: 7px;
}
.phone-candidate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #f8fafc;
}
.phone-candidate .form-check {
    flex: 1;
    min-width: 0;
}
.phone-candidate .form-check-label {
    font-weight: 650;
    overflow-wrap: anywhere;
}
.phone-actions {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
}
.fieldset-label {
    float: none;
    width: auto;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
}
.user-role-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}
.user-role-option {
    margin: 0;
}
.mosway-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}
.mosway-option {
    min-width: 0;
    margin: 0;
}
.mosway-option .form-check-label { overflow-wrap: anywhere; }
.survey-question { padding: 15px 0; border-bottom: 1px solid var(--border); }
.survey-question:first-child { padding-top: 0; }
.survey-question h6 { line-height: 1.45; }
.survey-format-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}
.survey-format-toolbar .survey-format-toggle.active {
    color: #fff;
    border-color: var(--navy);
    background: var(--navy);
    box-shadow: 0 0 0 .16rem rgba(40, 120, 208, .16);
}
.survey-question-preview {
    padding: 11px 12px;
    border: 1px dashed #cbd8e6;
    border-radius: 10px;
    background: #fbfdff;
}
.question-text-preview {
    max-width: 430px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.survey-question-title {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 10px;
    color: var(--navy);
    font-weight: 700;
    line-height: 1.48;
}
.survey-question-number {
    flex: 0 0 auto;
    color: var(--blue);
}
.survey-question-formatted {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}
.survey-question-formatted strong { font-weight: 800; }
.survey-color-red { color: #c9364f; font-weight: 750; }
.survey-color-blue { color: #1d6fc2; font-weight: 750; }
.survey-color-green { color: #118553; font-weight: 750; }
.survey-color-amber { color: #b86c00; font-weight: 750; }

.filter-panel { padding: 18px; margin-bottom: 18px; }
.pemilih-ic-search {
    max-width: 720px;
    padding: 22px;
    margin-bottom: 18px;
}
.table-panel { overflow: hidden; }
.table-panel .table { margin: 0; }
.table-panel th { white-space: nowrap; color: #526173; font-size: .78rem; text-transform: uppercase; }
.table-responsive { max-height: calc(100vh - 340px); }
.management-page,
.management-table-panel,
.management-table-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.management-table-scroll {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.user-management-table { min-width: 720px; }
.question-management-table { min-width: 860px; }
.management-add-button {
    flex: 0 0 auto;
    white-space: nowrap;
}
.assignment-table-scroll {
    max-height: calc(100vh - 360px);
    overflow: auto;
}
.assignment-table-scroll thead th {
    position: sticky;
    z-index: 3;
    top: 0;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    box-shadow: 0 1px 0 rgba(36, 55, 75, .08);
}
.pemilih-row {
    cursor: pointer;
}
.assignment-toolbar { position: relative; z-index: 4; background: #fff; }
.assignment-pagination { background: #fff; }
.assignment-pagination .page-link { min-width: 34px; text-align: center; }
.assignment-voter-row { cursor: pointer; }
.assignment-voter-row:hover > td { background: #eef6ff; }
.assignment-voter-row:focus { outline: 2px solid var(--blue); outline-offset: -2px; }
.voter-detail-loading { min-height: 280px; display: grid; place-items: center; }
.voter-detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--navy), #315b85);
}
.voter-detail-hero h4 { margin: 5px 0; font-weight: 750; }
.voter-detail-eyebrow { color: #c7dbef; font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; }
.voter-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 16px; }
.voter-detail-section { padding: 17px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.voter-detail-section.detail-wide { grid-column: 1 / -1; }
.voter-detail-section h6 { margin-bottom: 13px; color: var(--navy); font-weight: 750; }
.voter-detail-field { display: grid; grid-template-columns: minmax(115px, 34%) 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid #edf1f5; }
.voter-detail-field span,
.voter-detail-field > label { color: var(--muted); font-size: .8rem; }
.voter-detail-field strong { min-width: 0; overflow-wrap: anywhere; font-size: .88rem; font-weight: 600; }
.house-image-camera-button { display: none; }
.address-display-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.address-display-row .btn { flex: 0 0 auto; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state i { display: block; margin-bottom: 12px; font-size: 2rem; color: #a8b6c6; }
.assignment-filter-prompt strong { display: block; margin-bottom: 5px; color: #445568; font-size: 1rem; }
.assignment-filter-prompt span { display: block; font-size: .85rem; }
.badge-pending { color: #8a5a0a; background: #fff0cd; }
.badge-completed { color: #087344; background: #d8f4e7; }
.role-badge {
    padding: .42em .65em;
    border: 1px solid transparent;
    font-size: .72rem;
    letter-spacing: .015em;
}
.role-badge-admin { color: #fff; background: #c9364f; border-color: #c9364f; }
.role-badge-admin-ka { color: #713600; background: #ffd8a3; border-color: #f2b65f; }
.role-badge-admin-bt3 { color: #fff; background: #7548a7; border-color: #7548a7; }
.role-badge-vcc { color: #fff; background: #2878d0; border-color: #2878d0; }
.role-badge-cula { color: #075b3b; background: #ccefdc; border-color: #8ed4af; }
.role-badge-udm { color: #07566a; background: #c9edf4; border-color: #85cbd9; }
.role-badge-ftv { color: #713600; background: #ffe3b8; border-color: #efbd70; }
.role-badge-default { color: #455364; background: #e8edf2; border-color: #cbd4de; }
.skt-definition-table { min-width: 850px; }
.skt-culaan-table { min-width: 680px; }
.skt-culaan-table .form-select { min-width: 150px; }
.skt-formula-note { font-size: .88rem; }
.skt-segment-list { display: grid; gap: 20px; }
.skt-segment-card { overflow: hidden; padding: 20px; }
.skt-segment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.skt-segment-header h3 {
    margin: 8px 0 3px;
    color: var(--navy);
    font-size: 1.12rem;
    font-weight: 750;
}
.skt-segment-header small { color: var(--muted); }
.skt-metrics {
    display: grid;
    grid-template-columns: repeat(10, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 18px;
    overflow-x: auto;
    padding-bottom: 2px;
}
.skt-metric {
    min-width: 110px;
    padding: 11px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}
.skt-metric span { display: block; color: var(--muted); font-size: .7rem; }
.skt-metric strong { display: block; margin-top: 5px; font-size: 1rem; }
.skt-metric.metric-pn { color: #07566a; background: #e7f7fa; border-color: #b9e3eb; }
.skt-metric.metric-opposition { color: #74420a; background: #fff5df; border-color: #f1d39c; }
.skt-metric.metric-gap { color: #8b2638; background: #fff0f3; border-color: #efc1ca; }
.skt-metric.metric-not-surveyed { color: #495057; background: #f1f3f5; border-color: #ced4da; }
.skt-metric.metric-fence-sitter { color: #7a4c00; background: #fff3cd; border-color: #ffda6a; }
.skt-metric.metric-sufficient { color: #087344; background: #e3f7ed; border-color: #9bd8bb; }
.skt-metric.metric-insufficient { color: #9b2335; background: #fdecef; border-color: #efb6c0; }
.skt-progress-wrap { margin-top: 17px; }
.skt-progress-wrap .progress { height: 21px; }
.skt-party-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 15px 0;
    color: var(--muted);
    font-size: .8rem;
}
.skt-party-breakdown strong { color: var(--text); }
.skt-udm-scroll {
    max-height: 420px;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.skt-udm-table { min-width: 1280px; }
.skt-udm-table thead th {
    position: sticky;
    z-index: 2;
    top: 0;
    background: #f8fafc;
}
.skt-dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
}
.skt-dashboard-card {
    --card-color: var(--blue);
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    min-width: 120px;
    padding: 14px 12px;
    border: 1px solid var(--border);
    border-top: 4px solid var(--card-color);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(28, 49, 73, .07);
}
.skt-dashboard-card-icon {
    width: 35px;
    height: 35px;
    display: grid;
    flex: 0 0 35px;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background: var(--card-color);
}
.skt-dashboard-card span { display: block; color: var(--muted); font-size: .72rem; }
.skt-dashboard-card strong { display: block; margin-top: 3px; font-size: 1.15rem; }
.dashboard-card-navy { --card-color: #344c6b; }
.dashboard-card-amber { --card-color: var(--amber); }
.dashboard-card-green { --card-color: var(--green); }
.dashboard-card-purple { --card-color: #7548a7; }
.dashboard-card-teal { --card-color: #168b91; }
.dashboard-card-red { --card-color: #c9364f; }
.skt-dashboard-section { overflow: hidden; padding: 20px; }
.skt-dashboard-section-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 17px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--border);
}
.skt-dashboard-section-title strong { display: block; color: var(--navy); }
.skt-dashboard-section-title small { display: block; margin-top: 3px; color: var(--muted); }
.skt-overall-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}
.skt-overall-progress { margin-top: 18px; }
.skt-overall-progress .progress { height: 22px; }
.skt-overall-status {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 13px;
    padding: 11px 13px;
    border-radius: 9px;
    font-size: .82rem;
}
.skt-overall-status.status-sufficient { color: #087344; background: #e3f7ed; }
.skt-overall-status.status-insufficient { color: #9b2335; background: #fdecef; }
.skt-breakdown-list { display: grid; gap: 13px; }
.skt-breakdown-item {
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfcfe;
}
.skt-breakdown-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.skt-breakdown-heading strong,
.skt-breakdown-heading small { display: block; }
.skt-breakdown-heading small { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.skt-breakdown-heading > span { font-size: 1.05rem; font-weight: 750; }
.skt-breakdown-item .progress { height: 7px; margin-top: 9px; }
.skt-breakdown-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 13px;
    margin-top: 9px;
    color: var(--muted);
    font-size: .7rem;
}
.skt-breakdown-meta b { color: var(--text); }
.skt-team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.skt-team-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fbfcfe;
}
.skt-team-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.skt-team-card-header > div { display: flex; align-items: center; gap: 8px; }
.skt-team-card > small { display: block; margin-top: 7px; color: var(--muted); }
.skt-team-numbers {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 12px 0 10px;
}
.skt-team-numbers span { color: var(--muted); font-size: .66rem; }
.skt-team-numbers b { display: block; margin-top: 2px; color: var(--text); font-size: .82rem; }
.skt-team-card .progress { height: 17px; }
.skt-team-prospect { margin-top: 8px; font-size: .72rem; }
.skt-change-header {
    align-items: stretch;
    padding: 22px;
    border: 1px solid rgba(40, 120, 208, .14);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(22, 37, 58, .96), rgba(40, 120, 208, .82)),
        radial-gradient(circle at 14% 20%, rgba(255,255,255,.22), transparent 28%);
    color: #fff;
    box-shadow: 0 18px 38px rgba(22, 37, 58, .16);
}
.skt-change-header h2 { color: #fff; }
.skt-change-header .text-secondary { color: rgba(255,255,255,.78) !important; }
.skt-change-kicker {
    margin-bottom: 5px;
    color: #a9d4ff;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.skt-change-filter-card {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    max-width: 760px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 15px;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(8px);
}
.skt-change-filter-card label { color: rgba(255,255,255,.82); font-weight: 650; }
.skt-change-filter-card .form-select {
    border-color: rgba(255,255,255,.26);
    background-color: rgba(255,255,255,.96);
}
.skt-change-filter-card .btn { border-color: rgba(255,255,255,.5); color: #fff; }
.skt-change-filter-card .btn:hover { border-color: #fff; background: rgba(255,255,255,.16); }
.skt-change-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.skt-change-summary-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 96px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: 0 6px 18px rgba(28, 49, 73, .07);
}
.skt-change-summary-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), #52a6ee);
}
.skt-change-summary-card span,
.skt-change-summary-card small {
    display: block;
    color: var(--muted);
    font-size: .72rem;
}
.skt-change-summary-card strong {
    display: block;
    margin: 2px 0;
    color: var(--navy);
    font-size: 1.18rem;
    line-height: 1.1;
}
.skt-change-panel { overflow: hidden; }
.skt-change-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fff, #f8fbff);
}
.skt-change-panel-head strong { display: block; color: var(--navy); font-size: 1rem; }
.skt-change-scroll { max-height: 62vh; }
.skt-change-table { min-width: 860px; }
.skt-change-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid #d7e1ed;
    background: #f6f9fc;
}
.skt-culaan-change-row {
    cursor: pointer;
    transition: background .14s ease, box-shadow .14s ease;
}
.skt-culaan-change-row:hover {
    background: #f4f9ff;
    box-shadow: inset 4px 0 var(--blue);
}
.skt-culaan-change-row:focus {
    outline: 2px solid rgba(40,120,208,.35);
    outline-offset: -2px;
}
.skt-change-month,
.skt-change-total {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-weight: 750;
}
.skt-change-month { padding: 5px 10px; color: #07566a; background: #e7f7fa; }
.skt-change-table td:first-child small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: .68rem;
}
.skt-change-total {
    min-width: 62px;
    justify-content: center;
    padding: 6px 11px;
    color: #8b2638;
    background: #fff0f3;
}
.skt-change-open {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #cfe0f2;
    border-radius: 50%;
    color: var(--blue);
    background: #fff;
}
.skt-culaan-change-row:hover .skt-change-open {
    color: #fff;
    border-color: var(--blue);
    background: var(--blue);
}
.skt-change-hint {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    color: var(--muted);
    font-size: .82rem;
}
.skt-change-hint i { color: var(--blue); }
.map-page,
.map-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.map-filter-panel {
    padding: 14px;
    margin-bottom: 16px;
}
.map-filter-grid {
    display: grid;
    grid-template-columns: minmax(120px, .75fr) minmax(170px, 1.12fr) minmax(190px, 1.2fr) minmax(145px, .9fr) minmax(120px, .78fr) auto;
    gap: 12px;
    align-items: end;
}
.map-filter-field {
    min-width: 0;
}
.map-filter-field .form-label {
    margin-bottom: 5px;
    color: #526173;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}
.map-filter-field .form-select {
    min-height: 40px;
    border-color: #d5dee9;
    border-radius: 8px;
    color: var(--navy);
    font-size: .88rem;
    font-weight: 650;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
.map-filter-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding-right: 14px;
    padding-left: 14px;
    border-radius: 8px;
    font-weight: 800;
    white-space: nowrap;
}
.map-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #f8fafc;
}
.map-summary-strip span {
    color: var(--muted);
    font-size: .82rem;
}
.map-summary-strip strong {
    color: var(--navy);
    font-size: .98rem;
}
.map-panel {
    position: relative;
    overflow: hidden;
}
.map-fullscreen-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 650;
    border: 1px solid rgba(22, 37, 58, .14);
    border-radius: 999px;
    color: var(--navy);
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(22, 37, 58, .14);
}
.map-fullscreen-active {
    position: fixed !important;
    inset: 0;
    z-index: 3000;
    display: block;
    width: 100vw;
    max-width: none;
    height: 100vh;
    padding: 0 !important;
    border-radius: 0 !important;
    background: #eef4f8;
}
.map-fullscreen-active .shah-alam-map {
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
}
.map-fullscreen-active .map-fullscreen-btn {
    top: 18px;
    left: 18px;
}
.map-fullscreen-active .map-legend {
    right: 18px;
    bottom: 18px;
}
.shah-alam-map {
    width: 100%;
    height: calc(100vh - 285px);
    min-height: 520px;
    border-radius: 13px;
    background: #d9ecf7;
}
.map-error {
    display: grid;
    height: 100%;
    place-items: center;
    padding: 24px;
    color: var(--navy);
    font-weight: 700;
    text-align: center;
}
.map-legend {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 500;
    display: grid;
    gap: 7px;
    width: min(300px, calc(100% - 32px));
    padding: 13px 14px;
    border: 1px solid rgba(22, 37, 58, .12);
    border-radius: 12px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 10px 28px rgba(22, 37, 58, .14);
}
.map-legend strong {
    color: var(--navy);
    font-size: .86rem;
}
.map-legend span,
.map-legend small {
    color: var(--muted);
    font-size: .78rem;
}
.legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 7px;
    border-radius: 4px;
    vertical-align: -2px;
}
.legend-dun-40 { background: #79b7f2; border: 2px solid #2878d0; }
.legend-dun-41 { background: #5fcf8f; border: 2px solid #198754; }
.legend-pin {
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 7px;
    border: 2px solid #fff;
    border-radius: 50% 50% 50% 0;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .3);
    transform: rotate(-45deg);
    vertical-align: -2px;
}
.legend-pin-pn { background: #0d6efd; }
.legend-pin-ph { background: #dc3545; }
.legend-pin-bn { background: #052c65; }
.legend-pin-unknown { background: #6c757d; }
.voter-map-pin {
    background: transparent;
    border: 0;
}
.voter-map-pin span {
    display: block;
    position: relative;
    border-style: solid;
    border-color: #fff;
    border-radius: 50% 50% 50% 0;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .45), 0 0 0 2px rgba(15, 23, 42, .18);
    transform: rotate(-45deg);
    animation: voterPinBlink 1.25s ease-in-out infinite;
}
.voter-map-pin span::before {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    background: currentColor;
    opacity: .22;
    animation: voterPinPulse 1.25s ease-in-out infinite;
}
.voter-map-pin span::after {
    content: "";
    position: absolute;
    inset: var(--pin-inner-inset, 8px);
    border: var(--pin-inner-border, 3px) solid #fff;
    border-radius: 50%;
    background: rgba(17, 24, 39, .96);
}
.voter-map-pin span b {
    position: absolute;
    top: -9px;
    right: -9px;
    z-index: 5;
    display: grid;
    width: var(--pin-badge-size, 22px);
    height: var(--pin-badge-size, 22px);
    place-items: center;
    color: #fff;
    font-size: var(--pin-badge-font, 13px);
    font-weight: 500;
    line-height: 1;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #111827;
    box-shadow: 0 2px 7px rgba(15, 23, 42, .4);
    transform: rotate(45deg);
}
.voter-map-pin-pn span { background: #0d6efd; color: #0d6efd; }
.voter-map-pin-ph span { background: #dc3545; color: #dc3545; }
.voter-map-pin-bn span { background: #052c65; color: #052c65; }
.voter-map-pin-mixed span { background: #6f42c1; color: #6f42c1; }
.voter-map-pin-unknown span,
.voter-map-pin-null span,
.voter-map-pin-undefined span { background: #6c757d; color: #6c757d; }
@keyframes voterPinBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: .48; }
}
@keyframes voterPinPulse {
    0%, 100% { transform: scale(.65); opacity: .28; }
    50% { transform: scale(1.35); opacity: .04; }
}
.map-popup {
    min-width: 210px;
    color: var(--text);
    line-height: 1.45;
}
.map-popup strong {
    display: block;
    margin-bottom: 3px;
    color: var(--navy);
    font-size: .98rem;
}
.map-popup hr {
    margin: 8px 0;
}
.shah-alam-map .leaflet-control-layers {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(22, 37, 58, .14);
    font-family: inherit;
}
.shah-alam-map .leaflet-control-layers-expanded {
    padding: 10px 12px;
}
.shah-alam-map .leaflet-control-layers label {
    margin-bottom: 5px;
    color: var(--navy);
    font-size: .82rem;
}
.map-popup-household ul {
    max-height: 220px;
    margin: 0;
    padding-left: 18px;
    overflow: auto;
}
.map-popup-household li {
    margin-bottom: 7px;
}
.map-popup-household li strong {
    margin-bottom: 0;
    font-size: .9rem;
}
.map-popup-household li small {
    display: block;
    color: var(--muted);
}

@media (max-width: 1199px) {
    .skt-overall-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .skt-change-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .three-column-layout { grid-template-columns: 280px 1fr; height: auto; min-height: calc(100vh - 112px); }
    .workspace-column { max-height: calc(100vh - 112px); }
    .survey-column { grid-column: 1 / -1; max-height: none; border-top: 1px solid var(--border); }
    .map-filter-grid {
        grid-template-columns: minmax(105px, .7fr) minmax(140px, 1fr) minmax(165px, 1.15fr) minmax(120px, .86fr) minmax(105px, .72fr) auto;
        gap: 9px;
    }
}
@media (max-width: 991px) {
    .sidebar {
        width: min(var(--sidebar-width), 84vw);
        transform: translateX(-100%);
        box-shadow: 8px 0 24px rgba(0, 0, 0, .2);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open + .sidebar-backdrop { display: block; }
    .main-content { margin-left: 0; }
    .app-shell.sidebar-collapsed .sidebar {
        width: min(var(--sidebar-width), 84vw);
        padding-inline: 12px;
    }
    .app-shell.sidebar-collapsed .main-content { margin-left: 0; }
    .app-shell.sidebar-collapsed .sidebar-label {
        height: auto;
        padding: 8px 13px;
        opacity: 1;
    }
    .app-shell.sidebar-collapsed .sidebar-link {
        justify-content: flex-start;
        gap: 12px;
        padding: 12px 14px;
    }
    .app-shell.sidebar-collapsed .sidebar-link span {
        width: auto;
        overflow: visible;
        opacity: 1;
    }
    .app-shell.sidebar-collapsed .sidebar-link i { width: 20px; font-size: 1rem; }
    .management-table-scroll { max-height: calc(100vh - 210px); }
    .map-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .map-filter-reset {
        width: 100%;
    }
}
@media (max-width: 767px) {
    .topbar { padding: 0 12px; }
    .app-brand span { display: none; }
    .main-content { padding: 78px 10px 14px; }
    .three-column-layout { display: block; }
    .workspace-column { max-height: none; border-right: 0; border-bottom: 1px solid var(--border); }
    .voter-column { max-height: 390px; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .management-page-header { width: 100%; }
    .management-add-button { max-width: 100%; }
    .login-card { padding: 28px 22px; }
    .dashboard-operator-summary { align-items: flex-start; }
    .dashboard-operator-summary small { margin-left: 0; }
    .assignment-table-scroll { max-height: 62vh; }
    .assignment-toolbar > div { width: 100%; flex-wrap: wrap; }
    .assignment-toolbar #assignPetugas { width: calc(100% - 125px) !important; }
    .voter-detail-grid { grid-template-columns: 1fr; }
    .voter-detail-section.detail-wide { grid-column: auto; }
    .house-image-section .input-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .house-image-section .house-image-input {
        grid-column: 1 / -1;
        width: 100%;
        border-radius: 8px !important;
    }
    .house-image-camera-button,
    .house-image-upload-button,
    .house-image-reset-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 40px;
        border-radius: 8px !important;
        white-space: nowrap;
    }
    .house-image-reset-button {
        grid-column: 1 / -1;
    }
    .skt-team-grid { grid-template-columns: 1fr; }
    .skt-change-header { padding: 18px; }
    .skt-change-filter-card { width: 100%; max-width: none; }
    .skt-change-filter { width: 100%; }
    .skt-change-filter .form-select,
    .skt-change-filter select { width: 100%; min-width: 0 !important; }
    .skt-change-panel-head { align-items: flex-start; flex-direction: column; }
    .map-filter-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 767px) {
    .login-page.register-mode {
        padding: 16px;
    }
    .login-card {
        padding: 28px 22px;
    }
    .register-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 991px) and (orientation: landscape) {
    .main-content { padding: 76px 12px 12px; }
    .dashboard-page-header { margin-bottom: 10px; }
    .dashboard-page-header h2 {
        margin-bottom: 0;
        font-size: 1.2rem;
    }
    .dashboard-page-subtitle { display: none; }
    .dashboard-progress-panel { margin-top: 12px !important; }
    .dashboard-progress-title { padding: 10px 12px !important; }
    .dashboard-progress-scroll {
        min-height: 180px;
        max-height: 60vh;
    }
    .management-page-header {
        flex-direction: row;
        align-items: center;
        margin-bottom: 10px;
    }
    .management-page-header h2 {
        margin-bottom: 0;
        font-size: 1.2rem;
    }
    .management-page-subtitle { display: none; }
    .management-add-button {
        padding: .42rem .7rem;
        font-size: .85rem;
    }
    .management-table-scroll { max-height: calc(100vh - 132px); }
    .modal-dialog {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        margin: 10px auto;
    }
    .modal-content { max-height: calc(100vh - 20px); }
}
@media (max-width: 575px) {
    .dashboard-operator-summary { flex-wrap: wrap; }
    .dashboard-operator-summary small { width: 100%; padding-left: 51px; }
    .mosway-options { grid-template-columns: 1fr; }
    .address-display-row { align-items: flex-start; flex-direction: column; }
    .skt-segment-header { flex-direction: column; }
    .skt-overall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .skt-team-numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .skt-change-summary { grid-template-columns: 1fr; }
}
