.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.metric-card {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid #dbe4ef;
    border-radius: 1rem;
    padding: 1rem;
}

.sticky-action-bar {
    position: sticky;
    bottom: 1rem;
    z-index: 10;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #dbe4ef;
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    padding: 1rem;
}

.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.lookup-shell-card {
    border: 1px solid #dbe4ef;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.98));
}

.audit-feed {
    display: grid;
    gap: 0.9rem;
}

.audit-feed-item {
    border: 1px solid #dbe4ef;
    border-radius: 1rem;
    padding: 0.95rem 1rem;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.status-panel {
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid #dbe4ef;
}

.status-panel--success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.status-panel--warning {
    background: #fff7ed;
    border-color: #fed7aa;
}

.status-panel--danger {
    background: #fef2f2;
    border-color: #fecaca;
}

.terminal-row--active {
    background: rgba(220, 252, 231, 0.35);
}

.terminal-row--idle {
    background: rgba(255, 237, 213, 0.35);
}

.terminal-row--offline {
    background: rgba(226, 232, 240, 0.4);
}

.results-chart-card {
    border: 1px solid #dbe4ef;
    border-radius: 1.1rem;
    padding: 1.1rem;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 32%),
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,245,249,0.86));
    min-height: 320px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.results-chart-card--state {
    display: grid;
    align-items: center;
}

.results-position-card {
    overflow: hidden;
}

.results-chart-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.7fr);
    gap: 1rem;
    align-items: stretch;
}

.results-chart-stage {
    position: relative;
    min-height: 280px;
}

.live-results-chart {
    width: 100%;
    height: 100% !important;
    min-height: 280px;
}

.results-chart-caption {
    margin-top: 0.75rem;
    color: #64748b;
    font-size: 0.88rem;
}

.results-position-aside {
    display: grid;
    gap: 0.9rem;
}

.results-aside-card {
    border: 1px solid #dbe4ef;
    border-radius: 1rem;
    padding: 1rem 1.05rem;
    background: rgba(255, 255, 255, 0.82);
}

.results-aside-label {
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.35rem;
}

.results-aside-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #172033;
}

.results-empty-votes-note {
    margin-top: 1rem;
    border: 1px dashed #bfd3eb;
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(180deg, #f8fbff, #f1f7ff);
    color: #36537a;
    font-weight: 600;
}

.results-rank-table tbody tr td {
    vertical-align: middle;
}

.results-state-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    min-height: 220px;
}

.results-state-emphasis {
    min-width: 240px;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid #dbe4ef;
    background: linear-gradient(180deg, #ffffff, #eff6ff);
}

.results-state-emphasis__label {
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.35rem;
}

.results-state-emphasis__value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #172033;
}

.results-state-empty {
    min-width: 220px;
    text-align: center;
    padding: 1.25rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.84);
    border: 1px dashed #cbd5e1;
    color: #475569;
    font-weight: 600;
}

.polling-release-card {
    border: 1px solid #dbe4ef;
    border-radius: 1.15rem;
    padding: 1.15rem;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 32%),
        linear-gradient(180deg, #ffffff, #f8fbff);
}

.polling-release-grid {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.polling-release-item {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    border: 1px solid #dbe4ef;
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.82);
}

.polling-release-copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.polling-release-step {
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 0.1rem;
}

.polling-release-item small {
    display: block;
    margin-top: 0.2rem;
    color: #64748b;
}

.polling-release-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.polling-review-card {
    overflow: hidden;
}

.clerk-metric-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #dbe4ef;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
}

.clerk-metric-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.5), transparent 30%);
}

.clerk-metric-card--validation {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 28%),
        linear-gradient(180deg, #ffffff, #f5f9ff);
}

.clerk-metric-card--ballots {
    background:
        radial-gradient(circle at top right, rgba(22, 163, 74, 0.14), transparent 28%),
        linear-gradient(180deg, #ffffff, #f3fcf7);
}

.clerk-metric-card--turnout {
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 28%),
        linear-gradient(180deg, #ffffff, #fffaf1);
}

.clerk-metric-card__eyebrow {
    color: #5b6f8e;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.clerk-metric-card__label {
    color: #172033;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.clerk-terminal-card {
    border: 1px solid #dbe4ef;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
}

.clerk-terminal-panel {
    display: grid;
    gap: 1rem;
}

.clerk-terminal-panel__hero {
    border: 1px solid #dbe4ef;
    border-radius: 1rem;
    padding: 1rem 1.05rem;
    background: rgba(255, 255, 255, 0.82);
}

.clerk-terminal-panel__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.clerk-terminal-panel__item {
    border: 1px solid #dbe4ef;
    border-radius: 1rem;
    padding: 0.95rem 1rem;
    background: rgba(255, 255, 255, 0.88);
}

.list-group-item {
    border-color: #edf2f7;
}

.terminal-report-list {
    display: grid;
    gap: 1rem;
}

.terminal-report-card {
    border: 1px solid #dbe4ef;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.06), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.98));
}

.terminal-report-empty {
    min-height: 160px;
}

@media (max-width: 768px) {
    .management-grid,
    .quick-action-grid {
        grid-template-columns: 1fr;
    }

    .results-chart-shell {
        grid-template-columns: 1fr;
    }

    .results-chart-card {
        min-height: 0;
        padding: 0.95rem;
    }

    .results-chart-stage,
    .live-results-chart {
        min-height: 240px;
    }

    .results-position-aside {
        grid-template-columns: 1fr;
    }

    .results-aside-card,
    .polling-release-item {
        padding: 0.9rem;
    }

    .results-state-card {
        flex-direction: column;
        align-items: stretch;
    }

    .results-state-emphasis,
    .results-state-empty {
        min-width: 0;
    }

    .polling-release-footer {
        align-items: stretch;
    }

    .polling-release-item {
        gap: 0.75rem;
    }

    .polling-release-item .form-check-input {
        margin-top: 0.2rem;
        transform: scale(1.15);
    }

    .polling-release-footer > * {
        width: 100%;
    }

    .polling-release-footer .btn {
        width: 100%;
    }

    .clerk-terminal-panel__grid {
        grid-template-columns: 1fr;
    }

    .lookup-shell-card .card-body {
        padding: 1.15rem !important;
    }

    .polling-review-card .card-body {
        padding: 1.15rem !important;
    }
}

@media print {
    .topbar-shell,
    .sidebar-shell,
    .app-footer,
    .print-hidden,
    .app-alert,
    .btn,
    .messages {
        display: none !important;
    }

    body {
        background: #fff !important;
    }

    .main-shell,
    .container-fluid.app-shell,
    .row,
    [class*="col-"] {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .card,
    .terminal-report-card {
        box-shadow: none !important;
        border: 1px solid #d1d5db !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .table-responsive {
        overflow: visible !important;
    }

    .table-responsive .table {
        min-width: 0 !important;
    }
}

@media (max-width: 575px) {
    .sticky-action-bar,
    .results-chart-card,
    .results-state-emphasis,
    .results-state-empty,
    .polling-release-card,
    .polling-release-item {
        border-radius: 0.95rem;
    }

    .polling-release-step {
        width: 1.45rem;
        height: 1.45rem;
        font-size: 0.74rem;
    }

    .live-results-chart {
        min-height: 220px;
    }

    .results-chart-caption,
    .results-aside-label {
        font-size: 0.8rem;
    }
}
