:root {
    --bg: #06172c;
    --bg-deep: #04101f;
    --nav: #061427;
    --panel: #0b2343;
    --panel-2: #0d294e;
    --border: #1b416d;
    --border-soft: rgba(93, 153, 220, .22);

    --text: #f4f8ff;
    --text-soft: #b9c8dc;
    --text-muted: #8196b1;

    --primary: #1677ff;
    --primary-hover: #3390ff;
    --primary-dark: #0c58c8;

    --success: #35d07f;

    --radius: 12px;
    --shadow: 0 12px 35px rgba(0, 0, 0, .18);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background:
        radial-gradient(circle at 70% 10%, rgba(30, 98, 180, .12), transparent 34%),
        linear-gradient(180deg, #071a31 0%, var(--bg) 55%, var(--bg-deep) 100%);

    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: inherit;
}

.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    flex: 0 0 auto;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-lg {
    width: 28px;
    height: 28px;
}

.icon-xl {
    width: 52px;
    height: 52px;
}


/* =========================================================
   APP
   ========================================================= */

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    padding: 14px;
}

.topbar {
    min-height: 84px;

    display: flex;
    align-items: center;
    gap: 24px;

    padding: 14px 24px;

    background:
        linear-gradient(180deg, rgba(9, 31, 59, .98), rgba(4, 19, 37, .98));

    border: 1px solid rgba(66, 126, 191, .12);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;

    min-width: 205px;

    color: var(--text);
    text-decoration: none;
}

.brand-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;
}

.brand-title {
    display: block;

    font-size: 22px;
    font-weight: 800;
    letter-spacing: .4px;

    line-height: 1.05;
}

.brand-subtitle {
    display: block;

    margin-top: 5px;

    color: var(--text-soft);

    font-size: 13px;
    font-weight: 500;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;

    flex: 1;

    min-width: 0;

    overflow-x: auto;

    scrollbar-width: thin;
    scrollbar-color: #244b77 transparent;
}

.main-nav::-webkit-scrollbar {
    height: 4px;
}

.main-nav::-webkit-scrollbar-thumb {
    background: #244b77;
    border-radius: 10px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    min-height: 46px;

    padding: 0 14px;

    white-space: nowrap;

    border: 1px solid rgba(86, 148, 214, .18);
    border-radius: 9px;

    background:
        linear-gradient(
            180deg,
            rgba(24, 61, 101, .76),
            rgba(12, 39, 72, .76)
        );

    color: #edf5ff;

    font-size: 14px;
    font-weight: 500;

    text-decoration: none;

    transition:
        background .16s ease,
        border-color .16s ease,
        transform .16s ease;
}

.nav-link:hover {
    background:
        linear-gradient(
            180deg,
            rgba(34, 84, 138, .9),
            rgba(15, 52, 94, .9)
        );

    border-color: rgba(86, 162, 245, .42);

    transform: translateY(-1px);
}

.nav-link.active {
    background:
        linear-gradient(
            180deg,
            rgba(31, 111, 211, .95),
            rgba(15, 80, 164, .95)
        );

    border-color: #358cf0;
}

.logout-link {
    margin-left: auto;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: #eaf3ff;

    text-decoration: none;
    white-space: nowrap;

    padding: 10px 12px;

    border-radius: 8px;

    transition: background .15s ease;
}

.logout-link:hover {
    background: rgba(255, 255, 255, .07);
}


/* =========================================================
   CONTENT
   ========================================================= */

.app-main {
    width: 100%;

    flex: 1;

    padding: 10px 30px 18px;
}

.page-container {
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
}

.dashboard-stack {
    display: grid;
    gap: 14px;
}


/* =========================================================
   CARDS
   ========================================================= */

.panel {
    position: relative;

    background:
        linear-gradient(
            135deg,
            rgba(13, 42, 79, .98),
            rgba(9, 32, 62, .98)
        );

    border: 1px solid var(--border-soft);
    border-radius: var(--radius);

    box-shadow:
        0 8px 24px rgba(0, 0, 0, .13),
        inset 0 1px 0 rgba(255, 255, 255, .018);

    overflow: hidden;
}

.panel-inner {
    min-height: 145px;

    display: flex;
    align-items: center;
    gap: 24px;

    padding: 28px 30px;
}

.panel-icon {
    width: 70px;
    height: 70px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    color: #e9f4ff;

    border: 1px solid rgba(91, 164, 244, .32);
    border-radius: 50%;

    background: rgba(10, 36, 70, .55);
}

.panel-content {
    min-width: 0;
}

.panel h2,
.panel h3 {
    margin: 0 0 10px;

    color: var(--text);
}

.panel h2 {
    font-size: 22px;
    font-weight: 700;
}

.panel h3 {
    font-size: 19px;
    font-weight: 700;
}

.info-row {
    margin: 3px 0;

    color: var(--text-soft);

    font-size: 17px;
}

.info-row strong {
    margin-left: 4px;

    color: var(--text);
    font-weight: 700;
}


/* =========================================================
   ACTIVE ELECTION
   ========================================================= */

.election-panel .panel-inner {
    min-height: 164px;
}

.election-visual {
    position: absolute;

    right: 45px;
    top: 50%;

    transform: translateY(-50%);

    color: #4694ee;

    opacity: .42;
}

.election-visual .icon {
    width: 100px;
    height: 100px;
}


/* =========================================================
   LEVEL BUTTONS
   ========================================================= */

.level-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    margin-top: 12px;
}

.level-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    min-height: 47px;

    padding: 0 18px;

    color: #f1f7ff;

    text-decoration: none;

    background:
        linear-gradient(
            180deg,
            rgba(17, 58, 104, .82),
            rgba(10, 40, 76, .82)
        );

    border: 1px solid rgba(75, 147, 226, .38);
    border-radius: 8px;

    transition:
        border-color .15s ease,
        background .15s ease,
        transform .15s ease;
}

.level-button:hover {
    border-color: #438fe6;

    background:
        linear-gradient(
            180deg,
            rgba(24, 79, 138, .95),
            rgba(11, 53, 102, .95)
        );

    transform: translateY(-1px);
}


/* =========================================================
   STATS
   ========================================================= */

.stats {
    display: flex;
    gap: 34px;
    flex-wrap: wrap;
}

.stat {
    min-width: 165px;
}

.stat-label {
    display: block;

    margin-bottom: 3px;

    color: var(--text-soft);

    font-size: 14px;
}

.stat-value {
    display: block;

    color: #fff;

    font-size: 25px;
    font-weight: 800;
}

.stats-visual {
    position: absolute;

    right: 45px;
    top: 50%;

    transform: translateY(-50%);

    display: flex;
    align-items: flex-end;
    gap: 8px;

    height: 70px;

    opacity: .65;
}

.stats-bar {
    width: 25px;

    border-radius: 5px 5px 2px 2px;

    background:
        linear-gradient(
            180deg,
            #398eff,
            rgba(22, 104, 209, .17)
        );

    box-shadow: 0 0 18px rgba(44, 130, 243, .15);
}

.stats-bar:nth-child(1) {
    height: 34px;
}

.stats-bar:nth-child(2) {
    height: 52px;
}

.stats-bar:nth-child(3) {
    height: 72px;
}


/* =========================================================
   DASHBOARD ACTION CARDS
   ========================================================= */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr)
        minmax(300px, .95fr);

    gap: 14px;
}

.action-card {
    min-height: 175px;

    padding: 28px 25px;

    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.action-icon {
    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    border-radius: 50%;

    color: #eef7ff;

    background: rgba(12, 43, 82, .9);

    border: 1px solid rgba(80, 151, 231, .32);
}

.action-body {
    flex: 1;
    min-width: 0;
}

.action-body h3 {
    margin-bottom: 16px;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    min-height: 44px;

    padding: 0 18px;

    border-radius: 7px;

    color: white;

    text-decoration: none;

    background:
        linear-gradient(
            180deg,
            #2380ff,
            #1162d7
        );

    border: 1px solid #338cff;

    box-shadow:
        0 7px 18px rgba(8, 79, 180, .22);

    transition:
        background .15s ease,
        transform .15s ease;
}

.primary-button:hover {
    background:
        linear-gradient(
            180deg,
            #3990ff,
            #1970ec
        );

    transform: translateY(-1px);
}

.primary-button .icon {
    width: 17px;
    height: 17px;
}

.system-row {
    margin: 4px 0;

    color: var(--text-soft);

    font-size: 15px;
}

.system-row strong {
    color: #fff;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 35px 30px;

    color: var(--text-soft);
}

.empty-state h2 {
    margin-top: 0;
    color: white;
}


/* =========================================================
   FOOTER
   ========================================================= */

.app-footer {
    margin: 0 14px 14px;

    min-height: 52px;

    padding: 0 28px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;

    border: 1px solid rgba(65, 121, 180, .1);
    border-radius: 10px;

    background: rgba(3, 17, 32, .72);

    color: var(--text-muted);

    font-size: 13px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 26px;
}

.system-online {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: var(--success);
}

.system-dot {
    width: 9px;
    height: 9px;

    border-radius: 50%;

    background: var(--success);

    box-shadow: 0 0 10px rgba(53, 208, 127, .45);
}


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

@media (max-width: 1280px) {

    .topbar {
        gap: 15px;
    }

    .brand {
        min-width: 180px;
    }

    .nav-link {
        padding-left: 12px;
        padding-right: 12px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-grid .panel:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 850px) {

    .app-header {
        padding: 8px;
    }

    .topbar {
        flex-wrap: wrap;
        padding: 14px;
    }

    .brand {
        flex: 1;
    }

    .main-nav {
        order: 3;
        width: 100%;
    }

    .app-main {
        padding: 8px 12px 14px;
    }

    .panel-inner {
        padding: 22px 20px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid .panel:last-child {
        grid-column: auto;
    }

    .election-visual,
    .stats-visual {
        display: none;
    }

    .app-footer {
        margin: 0 8px 8px;
        padding: 14px 18px;

        flex-direction: column;
        align-items: flex-start;

        gap: 8px;
    }
}

@media (max-width: 560px) {

    .logout-link span {
        display: none;
    }

    .panel-inner {
        align-items: flex-start;
        gap: 16px;
    }

    .panel-icon {
        width: 52px;
        height: 52px;
    }

    .panel-icon .icon {
        width: 23px;
        height: 23px;
    }

    .info-row {
        font-size: 15px;
    }

    .action-card {
        padding: 22px 18px;
    }

    .stats {
        gap: 20px;
    }
}


/* =========================================================
   PAGE HEADERS
   ========================================================= */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 16px;
}

.page-title {
    margin: 0;

    font-size: 28px;
    font-weight: 800;
}

.page-description {
    margin: 4px 0 0;

    color: var(--text-soft);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 9px 13px;

    border: 1px solid var(--border-soft);
    border-radius: 8px;

    color: var(--text-soft);
    text-decoration: none;

    background: rgba(14, 42, 78, .6);
}

.back-link:hover {
    color: white;
    border-color: rgba(67, 143, 230, .65);
}


/* =========================================================
   FORMS
   ========================================================= */

.form-panel {
    margin-bottom: 16px;
}

.form-panel-header {
    padding: 22px 26px 0;
}

.form-panel-header h2 {
    margin: 0;

    font-size: 20px;
}

.form-panel-body {
    padding: 22px 26px 26px;
}

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

.form-group {
    min-width: 0;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-label {
    display: block;

    margin-bottom: 7px;

    color: #e4edf9;

    font-size: 14px;
    font-weight: 600;
}

.form-help {
    margin-top: 6px;

    color: var(--text-muted);

    font-size: 12px;
}

.form-control {
    width: 100%;
    min-height: 44px;

    padding: 10px 12px;

    border: 1px solid rgba(93, 153, 220, .30);
    border-radius: 8px;

    outline: none;

    background: rgba(4, 20, 40, .70);

    color: white;

    font: inherit;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background .15s ease;
}

.form-control:focus {
    border-color: #368cf0;

    background: rgba(6, 27, 53, .92);

    box-shadow: 0 0 0 3px rgba(35, 128, 255, .12);
}

.form-control::placeholder {
    color: #7186a0;
}

select.form-control option {
    background: #0a203d;
    color: white;
}

select[multiple].form-control {
    min-height: 180px;
    padding: 8px;
}

select[multiple].form-control option {
    padding: 7px 9px;
    border-radius: 5px;
}

select[multiple].form-control option:checked {
    background: #146bdc;
    color: white;
}

.form-section-title {
    grid-column: 1 / -1;

    margin: 4px 0 -4px;

    padding-top: 6px;

    color: #fff;

    font-size: 16px;
    font-weight: 700;
}

.form-actions {
    grid-column: 1 / -1;

    display: flex;
    align-items: center;
    gap: 10px;

    padding-top: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;

    padding: 0 16px;

    border: 1px solid transparent;
    border-radius: 7px;

    cursor: pointer;

    font: inherit;
    font-weight: 600;

    text-decoration: none;

    transition:
        background .15s ease,
        border-color .15s ease,
        transform .15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: white;

    background:
        linear-gradient(
            180deg,
            #2380ff,
            #1162d7
        );

    border-color: #338cff;
}

.btn-primary:hover {
    background:
        linear-gradient(
            180deg,
            #3990ff,
            #1970ec
        );
}

.btn-secondary {
    color: #dbe8f8;

    background: rgba(15, 46, 83, .85);

    border-color: rgba(94, 150, 211, .32);
}

.btn-secondary:hover {
    border-color: rgba(94, 160, 230, .65);
}


/* =========================================================
   TABLES
   ========================================================= */

.table-panel {
    overflow: hidden;
}

.table-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 22px 26px;

    border-bottom: 1px solid var(--border-soft);
}

.table-panel-header h2 {
    margin: 0;

    font-size: 20px;
}

.table-responsive {
    width: 100%;

    overflow-x: auto;
}

.data-table {
    width: 100%;

    border-collapse: collapse;

    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 14px 18px;

    border-bottom: 1px solid rgba(93, 153, 220, .14);

    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: #9eb1c9;

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: .45px;

    background: rgba(4, 21, 42, .45);
}

.data-table tbody tr {
    transition: background .12s ease;
}

.data-table tbody tr:hover {
    background: rgba(26, 76, 128, .18);
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 6px 10px;

    border: 1px solid rgba(87, 151, 218, .32);
    border-radius: 6px;

    color: #dcecff;

    text-decoration: none;

    background: rgba(13, 49, 88, .65);
}

.table-action:hover {
    border-color: #368cf0;
    background: rgba(27, 84, 145, .75);
}

.table-action.danger {
    color: #ffb5b5;

    border-color: rgba(231, 85, 85, .25);

    background: rgba(110, 28, 36, .25);
}

.table-action.danger:hover {
    border-color: rgba(255, 100, 100, .65);
    background: rgba(135, 35, 44, .45);
}


/* =========================================================
   BADGES
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    color: #70e7a6;
    background: rgba(35, 159, 94, .14);
    border: 1px solid rgba(53, 208, 127, .25);
}

.badge-danger {
    color: #ff9c9c;
    background: rgba(206, 61, 71, .13);
    border: 1px solid rgba(240, 85, 95, .25);
}

.badge-role {
    color: #aecdff;
    background: rgba(35, 113, 212, .16);
    border: 1px solid rgba(68, 139, 231, .25);
}


/* =========================================================
   RESPONSIVE FORMS / TABLES
   ========================================================= */

@media (max-width: 800px) {

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

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

    .form-group.full,
    .form-section-title,
    .form-actions {
        grid-column: auto;
    }

    .form-panel-header,
    .form-panel-body,
    .table-panel-header {
        padding-left: 18px;
        padding-right: 18px;
    }

    .data-table th,
    .data-table td {
        padding: 12px 13px;
    }
}


/* =========================================================
   CHECKBOX OPTIONS
   ========================================================= */

.checkbox-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.checkbox-option {
    position: relative;

    display: flex;
    align-items: center;
    gap: 11px;

    min-height: 52px;

    padding: 0 15px;

    border: 1px solid rgba(93, 153, 220, .28);
    border-radius: 8px;

    background: rgba(4, 20, 40, .55);

    color: #e8f1fc;

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease;
}

.checkbox-option:hover {
    border-color: rgba(64, 143, 235, .65);
    background: rgba(14, 48, 87, .72);
}

.checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;

    accent-color: #2380ff;

    cursor: pointer;
}

.checkbox-option:has(input:checked) {
    border-color: #368cf0;
    background: rgba(25, 92, 170, .22);
}


/* =========================================================
   ELECTION STATUS
   ========================================================= */

.data-table tr.row-active {
    background: rgba(34, 147, 91, .09);
}

.data-table tr.row-active:hover {
    background: rgba(34, 147, 91, .15);
}

.badge-active-election {
    color: #73eaaa;
    background: rgba(38, 166, 96, .16);
    border: 1px solid rgba(53, 208, 127, .30);
}

.badge-inactive-election {
    color: #9fb0c5;
    background: rgba(116, 137, 161, .10);
    border: 1px solid rgba(137, 157, 181, .18);
}

.table-action.activate {
    color: #8ceab5;
    border-color: rgba(53, 208, 127, .26);
    background: rgba(30, 119, 72, .18);
}

.table-action.activate:hover {
    border-color: rgba(53, 208, 127, .65);
    background: rgba(30, 119, 72, .35);
}


/* =========================================================
   RESPONSIVE CHECKBOX OPTIONS
   ========================================================= */

@media (max-width: 800px) {

    .checkbox-options {
        grid-template-columns: 1fr;
    }

}


/* =========================================================
   REGISTERED VOTERS
   ========================================================= */

.table-number-input {
    width: 120px;
    min-height: 38px;

    padding: 7px 10px;

    border: 1px solid rgba(93, 153, 220, .30);
    border-radius: 7px;

    outline: none;

    background: rgba(4, 20, 40, .78);
    color: white;

    font: inherit;
    font-weight: 700;

    text-align: right;

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.table-number-input:focus {
    border-color: #368cf0;
    box-shadow: 0 0 0 3px rgba(35, 128, 255, .12);
}

.save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-top: 14px;
    padding: 16px 20px;

    border: 1px solid var(--border-soft);
    border-radius: 10px;

    background: rgba(7, 28, 54, .92);
}

.save-bar-text {
    color: var(--text-soft);
    font-size: 14px;
}

.election-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-top: 8px;

    color: var(--text-soft);
}

@media (max-width: 600px) {

    .save-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .save-bar .btn {
        width: 100%;
    }

}


/* =========================================================
   RESULT ENTRY OVERVIEW
   ========================================================= */

.results-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    margin-top: 14px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    padding: 6px 10px;

    border-radius: 7px;

    color: var(--text-soft);

    font-size: 12px;

    background: rgba(6, 25, 48, .55);

    border: 1px solid var(--border-soft);
}

.legend-dot {
    width: 9px;
    height: 9px;

    border-radius: 50%;
}

.legend-dot.empty {
    background: #60758e;
}

.legend-dot.ok {
    background: #35d07f;
}

.legend-dot.warning {
    background: #f1b94c;
}

.legend-dot.error {
    background: #f05d68;
}

.result-station-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 50px;

    padding: 5px 9px;

    border-radius: 7px;

    font-weight: 800;

    color: #ddebff;

    background: rgba(19, 67, 118, .55);

    border: 1px solid rgba(72, 144, 222, .28);
}

.result-station-code.allowed {
    color: #83efb3;

    background: rgba(36, 145, 86, .14);

    border-color: rgba(53, 208, 127, .28);
}

.result-cell {
    min-width: 130px;

    transition:
        background .15s ease,
        border-color .15s ease;
}

.result-cell.status-empty {
    background: rgba(50, 76, 106, .07);
}

.result-cell.status-ok {
    background: rgba(37, 160, 90, .10);
}

.result-cell.status-warning {
    background: rgba(201, 143, 31, .12);
}

.result-cell.status-error {
    background: rgba(196, 62, 73, .13);
}

.result-cell.no-access {
    background: rgba(84, 97, 113, .08);

    color: #657990;
}

.result-entry-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    min-height: 34px;

    padding: 0 11px;

    border-radius: 6px;

    color: #dcebff;

    text-decoration: none;

    font-size: 13px;
    font-weight: 700;

    border: 1px solid rgba(77, 145, 220, .30);

    background: rgba(15, 56, 100, .65);

    transition:
        background .15s ease,
        border-color .15s ease,
        transform .15s ease;
}

.result-entry-link:hover {
    color: white;

    border-color: #368cf0;

    background: rgba(26, 91, 161, .78);

    transform: translateY(-1px);
}

.result-cell.status-ok .result-entry-link {
    border-color: rgba(53, 208, 127, .32);
}

.result-cell.status-warning .result-entry-link {
    border-color: rgba(241, 185, 76, .38);
}

.result-cell.status-error .result-entry-link {
    border-color: rgba(240, 93, 104, .42);
}

.no-access-text {
    color: #657990;

    font-size: 12px;
    font-weight: 500;
}

.results-election {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: 9px;
}

.result-status-dot {
    width: 8px;
    height: 8px;

    display: inline-block;

    border-radius: 50%;

    background: #62778f;
}

.status-ok .result-status-dot {
    background: #35d07f;
}

.status-warning .result-status-dot {
    background: #f1b94c;
}

.status-error .result-status-dot {
    background: #f05d68;
}


/* =========================================================
   RESULT ENTRY
   ========================================================= */

.entry-header-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;

    margin-top: 10px;
}

.entry-section {
    margin-bottom: 15px;
}

.entry-section-header {
    padding: 20px 24px;

    border-bottom: 1px solid var(--border-soft);
}

.entry-section-header h2 {
    margin: 0;

    font-size: 19px;
}

.entry-section-body {
    padding: 22px 24px;
}

.entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}

.entry-field {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) 150px;
    align-items: center;
    gap: 15px;

    min-height: 54px;

    padding: 9px 12px;

    border: 1px solid rgba(93, 153, 220, .14);
    border-radius: 8px;

    background: rgba(4, 20, 40, .28);
}

.entry-field-label {
    color: #dce8f7;
    font-size: 14px;
    font-weight: 600;
}

.entry-input {
    width: 100%;
    min-height: 40px;

    padding: 7px 10px;

    border: 1px solid rgba(93, 153, 220, .32);
    border-radius: 7px;

    outline: none;

    color: white;
    background: rgba(3, 18, 36, .82);

    font: inherit;
    font-weight: 700;

    text-align: right;

    transition:
        border-color .15s ease,
        background .15s ease,
        box-shadow .15s ease;
}

.entry-input:focus {
    border-color: #368cf0;

    box-shadow:
        0 0 0 3px rgba(35, 128, 255, .12);
}

.entry-input[readonly] {
    color: white;
    background: rgba(3, 18, 36, .82);
    border-color: rgba(93, 153, 220, .32);
    cursor: default;
}

.entry-input.error {
    color: #ffd9dc;

    background: rgba(179, 43, 55, .30);

    border-color: #e65f68;

    box-shadow:
        0 0 0 2px rgba(230, 95, 104, .08);
}

.entry-input.warning {
    color: #ffe7ae;

    background: rgba(170, 116, 19, .25);

    border-color: #e3ae42;

    box-shadow:
        0 0 0 2px rgba(227, 174, 66, .08);
}


/* SUMMARY */

.entry-calculation-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    margin-bottom: 16px;
}

.entry-summary-item {
    min-width: 160px;

    padding: 11px 14px;

    border: 1px solid var(--border-soft);
    border-radius: 8px;

    background: rgba(5, 24, 47, .55);
}

.entry-summary-label {
    display: block;

    color: var(--text-muted);

    font-size: 12px;
}

.entry-summary-value {
    display: block;

    margin-top: 2px;

    color: white;

    font-size: 19px;
    font-weight: 800;
}


/* VOTES TABLE */

.votes-table .vote-number {
    width: 90px;

    color: #9eb7d4;

    font-weight: 700;
}

.votes-table .vote-input-cell {
    width: 180px;
}


/* NOTE */

.entry-notes {
    width: 100%;
    min-height: 110px;

    resize: vertical;

    padding: 12px 14px;

    border: 1px solid rgba(93, 153, 220, .30);
    border-radius: 8px;

    outline: none;

    background: rgba(4, 20, 40, .72);
    color: white;

    font: inherit;
}

.entry-notes:focus {
    border-color: #368cf0;

    box-shadow:
        0 0 0 3px rgba(35, 128, 255, .12);
}


/* SAVE */

.entry-save-bar {
    position: sticky;
    bottom: 10px;
    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-top: 16px;

    padding: 14px 18px;

    border: 1px solid rgba(75, 147, 226, .32);
    border-radius: 10px;

    background: rgba(5, 22, 43, .96);

    box-shadow:
        0 12px 30px rgba(0, 0, 0, .30);
}

.entry-save-info {
    color: var(--text-soft);

    font-size: 13px;
}


/* VALIDATION LEGEND */

.validation-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    margin-top: 10px;
}

.validation-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    color: var(--text-muted);

    font-size: 12px;
}

.validation-mark {
    width: 9px;
    height: 9px;

    border-radius: 50%;
}

.validation-mark.normal {
    background: #368cf0;
}

.validation-mark.warning {
    background: #e3ae42;
}

.validation-mark.error {
    background: #e65f68;
}


@media (max-width: 900px) {

    .entry-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 600px) {

    .entry-field {
        grid-template-columns: 1fr;
    }

    .entry-input {
        text-align: left;
    }

    .entry-save-bar {
        position: static;

        flex-direction: column;
        align-items: stretch;
    }

    .entry-save-bar .btn {
        width: 100%;
    }

}


/* =========================================================
   LIVE DASHBOARD
   ========================================================= */

.live-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;

    margin-top: 10px;
}

.live-refresh {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    color: var(--text-muted);

    font-size: 12px;
}

.live-refresh-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--success);

    box-shadow: 0 0 8px rgba(53, 208, 127, .5);
}


/* SUMMARY CARDS */

.live-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;

    margin-bottom: 14px;
}

.live-stat-card {
    min-height: 135px;

    padding: 22px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.live-stat-label {
    color: var(--text-soft);

    font-size: 13px;
    font-weight: 600;
}

.live-stat-value {
    margin-top: 5px;

    color: white;

    font-size: 31px;
    font-weight: 800;

    letter-spacing: -.5px;
}

.live-stat-sub {
    margin-top: 3px;

    color: var(--text-muted);

    font-size: 12px;
}


/* PROGRESS */

.live-progress {
    width: 100%;
    height: 10px;

    margin-top: 11px;

    overflow: hidden;

    border-radius: 999px;

    background: rgba(3, 16, 32, .8);

    border: 1px solid rgba(74, 133, 198, .15);
}

.live-progress-bar {
    height: 100%;

    min-width: 0;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            #1167da,
            #3995ff
        );

    box-shadow:
        0 0 13px rgba(45, 137, 255, .25);

    transition: width .4s ease;
}

.live-progress-bar.success {
    background:
        linear-gradient(
            90deg,
            #199356,
            #35d07f
        );
}


/* PARTY SECTIONS */

.live-section {
    margin-bottom: 14px;
}

.live-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.live-section-title-main {
    min-width: 0;
}

.live-section-subtitle {
    margin-top: 3px;

    color: var(--text-muted);

    font-size: 12px;
}

.party-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    border-radius: 50%;

    color: #d9eaff;

    background: rgba(21, 72, 128, .55);

    border: 1px solid rgba(75, 147, 226, .25);

    font-size: 12px;
    font-weight: 800;
}

.party-name-cell {
    min-width: 260px;
}

.party-name {
    color: white;
    font-weight: 700;
}

.party-order {
    margin-right: 8px;

    color: #7fa2cb;

    font-weight: 800;
}

.live-number {
    white-space: nowrap;

    font-variant-numeric: tabular-nums;

    font-weight: 700;
}

.live-percent {
    min-width: 72px;

    white-space: nowrap;

    color: #d7e9ff;

    font-weight: 800;
}


/* LOW THRESHOLD */

.data-table tr.low-result {
    background: rgba(161, 53, 64, .06);
}

.data-table tr.low-result:hover {
    background: rgba(161, 53, 64, .12);
}

.low-result .live-percent {
    color: #ffaaaF;
}


/* MUNICIPALITIES */

.municipality-name {
    color: white;
    font-weight: 700;
}

.processed-small {
    color: var(--text-muted);

    font-size: 12px;

    white-space: nowrap;
}


/* RESPONSIVE */

@media (max-width: 1100px) {

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

}

@media (max-width: 600px) {

    .live-stats {
        grid-template-columns: 1fr;
    }

    .live-stat-card {
        min-height: 110px;
    }

    .live-stat-value {
        font-size: 27px;
    }

}

/* 4 izborna nivoa */
.checkbox-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1000px) {
    .checkbox-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .checkbox-options {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   LOGIN
   ========================================================= */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(28, 101, 190, .17),
            transparent 37%
        ),
        linear-gradient(
            180deg,
            #071a31 0%,
            #06172c 55%,
            #04101f 100%
        );
}

.login-wrapper {
    width: 100%;
    max-width: 430px;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;

    margin-bottom: 22px;
}

.login-brand-icon {
    width: 62px;
    height: 62px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;

    border: 1px solid rgba(78, 150, 230, .30);
    border-radius: 16px;

    background:
        linear-gradient(
            180deg,
            rgba(24, 69, 119, .85),
            rgba(10, 38, 72, .85)
        );

    box-shadow:
        0 12px 30px rgba(0, 0, 0, .22);
}

.login-brand-icon svg {
    width: 36px;
    height: 36px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-brand-text {
    line-height: 1.1;
}

.login-brand-title {
    display: block;

    color: white;

    font-size: 26px;
    font-weight: 800;

    letter-spacing: .7px;
}

.login-brand-subtitle {
    display: block;

    margin-top: 5px;

    color: var(--text-soft);

    font-size: 14px;
}

.login-card {
    padding: 32px;

    border: 1px solid rgba(93, 153, 220, .22);
    border-radius: 14px;

    background:
        linear-gradient(
            145deg,
            rgba(13, 42, 79, .98),
            rgba(7, 27, 53, .98)
        );

    box-shadow:
        0 24px 60px rgba(0, 0, 0, .28),
        inset 0 1px 0 rgba(255, 255, 255, .025);
}

.login-card h1 {
    margin: 0;

    color: white;

    font-size: 24px;
    font-weight: 800;
}

.login-description {
    margin: 7px 0 25px;

    color: var(--text-soft);

    font-size: 14px;
}

.login-form-group {
    margin-bottom: 17px;
}

.login-label {
    display: block;

    margin-bottom: 7px;

    color: #dce8f7;

    font-size: 13px;
    font-weight: 600;
}

.login-input-wrap {
    position: relative;
}

.login-input-icon {
    position: absolute;

    left: 13px;
    top: 50%;

    width: 19px;
    height: 19px;

    transform: translateY(-50%);

    color: #7897b9;

    pointer-events: none;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-input {
    width: 100%;
    min-height: 48px;

    padding: 10px 13px 10px 43px;

    border: 1px solid rgba(93, 153, 220, .30);
    border-radius: 8px;

    outline: none;

    background: rgba(3, 18, 36, .80);
    color: white;

    font: inherit;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background .15s ease;
}

.login-input::placeholder {
    color: #677e98;
}

.login-input:focus {
    border-color: #368cf0;

    background: rgba(5, 25, 49, .95);

    box-shadow:
        0 0 0 3px rgba(35, 128, 255, .12);
}

.login-button {
    width: 100%;
    min-height: 48px;

    margin-top: 5px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    border: 1px solid #338cff;
    border-radius: 8px;

    cursor: pointer;

    color: white;

    background:
        linear-gradient(
            180deg,
            #2380ff,
            #1162d7
        );

    box-shadow:
        0 10px 22px rgba(8, 79, 180, .22);

    font: inherit;
    font-weight: 700;

    transition:
        background .15s ease,
        transform .15s ease,
        box-shadow .15s ease;
}

.login-button:hover {
    background:
        linear-gradient(
            180deg,
            #3990ff,
            #1970ec
        );

    transform: translateY(-1px);

    box-shadow:
        0 12px 26px rgba(8, 79, 180, .30);
}

.login-button:active {
    transform: translateY(0);
}

.login-button svg {
    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-error {
    margin-bottom: 18px;
    padding: 11px 13px;

    border: 1px solid rgba(240, 93, 104, .35);
    border-radius: 8px;

    color: #ffc1c5;

    background: rgba(153, 38, 49, .18);

    font-size: 13px;
}

.login-footer {
    margin-top: 18px;

    text-align: center;

    color: #687f99;

    font-size: 12px;
}

@media (max-width: 500px) {

    .login-page {
        padding: 16px;
    }

    .login-card {
        padding: 25px 20px;
    }

    .login-brand-title {
        font-size: 23px;
    }

}
