:root {
    --bg-color: #e0e5ec;
    --text-main: #2d3748;
    --text-muted: #4a5568;

    --shadow-light: #ffffff;
    --shadow-dark: #b8bec7;

    --primary-color: #4a90d9;
    --primary-hover: #3a7bc8;
    --primary-shadow: rgba(74, 144, 217, 0.45);

    --success-color: #38a169;
    --success-hover: #2f8a59;
    --success-shadow: rgba(56, 161, 105, 0.4);

    --danger-color: #e53e3e;
    --danger-hover: #c53030;
    --danger-shadow: rgba(229, 62, 62, 0.4);

    --ctrl-title-padding: 0 0 24px 0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    color: var(--text-muted);
    margin: 0;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
}

h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    letter-spacing: -0.3px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-color);
    color: var(--text-muted);
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    box-shadow: 3px 3px 7px var(--shadow-dark), -3px -3px 7px var(--shadow-light);
}

.btn:active {
    box-shadow: inset 3px 3px 7px rgba(0, 0, 0, 0.15), inset -3px -3px 7px rgba(255, 255, 255, 0.5);
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 4px 4px 8px var(--primary-shadow), -2px -2px 6px rgba(255, 255, 255, 0.5);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 6px 6px 12px rgba(74, 144, 217, 0.5), -3px -3px 8px rgba(255, 255, 255, 0.6);
}

.btn-primary:active {
    box-shadow: inset 3px 3px 7px rgba(0, 0, 0, 0.22), inset -2px -2px 5px rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: var(--success-color);
    color: #fff;
    box-shadow: 4px 4px 8px var(--success-shadow), -2px -2px 6px rgba(255, 255, 255, 0.5);
}

.btn-success:hover {
    background: var(--success-hover);
    box-shadow: 6px 6px 12px rgba(56, 161, 105, 0.5), -3px -3px 8px rgba(255, 255, 255, 0.6);
}

.btn-success:active {
    box-shadow: inset 3px 3px 7px rgba(0, 0, 0, 0.22), inset -2px -2px 5px rgba(255, 255, 255, 0.2);
}

/* Shared confirmation button for "I'm done with this step" actions */
.btn-confirm {
    background: linear-gradient(135deg, #38a169, #2f855a);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 14px 24px;
    border-radius: 14px;
    box-shadow: 4px 4px 10px rgba(56, 161, 105, 0.45), -2px -2px 6px rgba(255, 255, 255, 0.5);
    letter-spacing: 0.2px;
    transition: all 0.2s ease;
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #2f855a, #276749);
    box-shadow: 6px 6px 14px rgba(56, 161, 105, 0.55), -3px -3px 8px rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

.btn-confirm:active {
    box-shadow: inset 3px 3px 7px rgba(0, 0, 0, 0.25), inset -2px -2px 5px rgba(255, 255, 255, 0.15);
    transform: translateY(0);
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
    box-shadow: 4px 4px 8px var(--danger-shadow), -2px -2px 6px rgba(255, 255, 255, 0.5);
}

.btn-danger:hover {
    background: var(--danger-hover);
    box-shadow: 6px 6px 12px rgba(229, 62, 62, 0.5), -3px -3px 8px rgba(255, 255, 255, 0.6);
}

.btn-danger:active {
    box-shadow: inset 3px 3px 7px rgba(0, 0, 0, 0.22), inset -2px -2px 5px rgba(255, 255, 255, 0.2);
}

.btn-muted {
    color: #9aa5b4;
    font-size: 13px;
    padding: 8px 14px;
}

.btn-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-full {
    width: 100%;
    justify-content: center;
    margin-top: 20px;
}

/* ── Navigation Mode Switcher (Sleek Neumorphic Segmented Control) ── */
.nav-mode-selector {
    display: flex;
    background: var(--bg-color);
    padding: 4px;
    border-radius: 12px;
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
    margin: 4px 0 12px 0;
    width: 100%;
    box-sizing: border-box;
}

.mode-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8a95a5;
    cursor: pointer;
    border-radius: 9px;
    transition: all 0.2s ease;
    text-align: center;
}

.mode-tab.active {
    color: var(--text-main);
    background: var(--bg-color);
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}

.mode-tab:not(.active):hover {
    color: var(--text-muted);
}

/* ── Shared Navigation Bar (Option 6 Hybrid Sidebar) ── */
@media (min-width: 901px) {
    body:has(.omr-global-nav) {
        padding-left: 272px !important;
    }

    .omr-global-nav {
        position: fixed;
        top: 24px;
        left: 24px;
        bottom: 24px;
        width: 216px;
        background: var(--bg-color);
        padding: 24px 16px;
        border-radius: 24px;
        box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
        display: flex;
        flex-direction: column;
        gap: 28px;
        z-index: 1000;
        box-sizing: border-box;
        height: calc(100vh - 48px);
    }

    .nav-op6-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        white-space: normal;
        margin-bottom: 4px;
    }

    .nav-op6-brand-icon {
        width: 48px;
        height: 48px;
        background: linear-gradient(135deg, var(--primary-color), #2b6cb0);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 20px;
        box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    }


    .nav-op6-stepper {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        background: var(--bg-color);
        border-radius: 16px;
        padding: 14px 10px;
        box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
        flex-grow: 1;
        overflow-y: auto;
    }

    .nav-op6-step {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 10px;
        text-decoration: none;
        color: #8a95a5;
        font-weight: 700;
        font-size: 13px;
        transition: all 0.2s ease;
    }

    .nav-op6-step.active {
        color: var(--text-main);
        background: var(--bg-color);
        box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    }

    .nav-op6-step:not(.active):hover {
        color: #5a6578;
        background: rgba(0, 0, 0, 0.03);
    }

    .nav-op6-number {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: var(--bg-color);
        box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
        font-size: 12px;
        flex-shrink: 0;
    }

    .nav-op6-step.active .nav-op6-number {
        background: var(--primary-color);
        color: white;
        box-shadow: none;
    }

    .nav-op6-separator {
        width: 2px;
        height: 12px;
        background: #cbd5e0;
        margin: 0 auto;
        border-radius: 1px;
    }

    .nav-op6-disabled {
        opacity: 0.35;
        cursor: not-allowed;
        pointer-events: none;
    }
}

/* Fallback to Top Bar Navigation on Mobile/Tablet */
@media (max-width: 900px) {
    .omr-global-nav {
        display: grid;
        grid-template-areas: "brand stepper";
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 20px;
        background: var(--bg-color);
        padding: 8px 16px;
        border-radius: 16px;
        box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
        margin-bottom: 12px;
        flex-shrink: 0;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .nav-op6-brand {
        grid-area: brand;
        font-size: 14px;
        font-weight: 800;
        color: var(--text-main);
        display: flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
    }

    .nav-op6-brand-icon {
        width: 24px;
        height: 24px;
        background: linear-gradient(135deg, var(--primary-color), #2b6cb0);
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 12px;
    }

    .nav-op6-stepper {
        grid-area: stepper;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--bg-color);
        border-radius: 12px;
        padding: 6px 16px;
        box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    }

    .nav-op6-step {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 5px 12px;
        border-radius: 8px;
        text-decoration: none;
        color: #a0aec0;
        font-weight: 600;
        font-size: 13px;
        transition: all 0.2s ease;
    }

    .nav-op6-step.active {
        color: var(--text-main);
        background: var(--bg-color);
        box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    }

    .nav-op6-step:not(.active):hover {
        color: #718096;
    }

    .nav-op6-number {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background: var(--bg-color);
        box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
        font-size: 11px;
    }

    .nav-op6-step.active .nav-op6-number {
        background: var(--primary-color);
        color: white;
        box-shadow: none;
    }

    .nav-op6-separator {
        flex: 1;
        height: 2px;
        background: #cbd5e0;
        margin: 0 15px;
        border-radius: 2px;
    }

    .nav-op6-disabled {
        opacity: 0.35;
        cursor: not-allowed;
        pointer-events: none;
    }
}

/* ── Sticky Control Panel Actions ── */
.control-sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-color);
    padding: 8px 0 16px 0;
    margin-bottom: 8px;
    border-bottom: 2px dashed #cbd5e0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (max-width: 600px) {
    .nav-op6-step span {
        display: none;
    }

    /* hide text on tiny screens, just show numbers */
    .nav-op6-step.active span {
        display: inline;
    }

    /* except for the active one */
}

/* ── Shared Answer Block Table (030 + 050) ── */
.block-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.block-wrap {
    background: var(--bg-color);
    border-radius: 9px;
    padding: 6px 4px;
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

.block-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.block-table th {
    font-size: 9px;
    color: #b0bac8;
    text-align: center;
    padding: 6px 2px;
    font-weight: 700;
    text-transform: uppercase;
}

.block-table td {
    padding: 6px 2px;
    text-align: center;
    vertical-align: middle;
}

.bq {
    font-size: 10px;
    color: #9aa5b4;
    font-weight: 600;
}

.bauto {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
}

.bans {
    font-size: 13px;
    font-weight: 800;
    display: inline-block;
    min-width: 16px;
    text-align: center;
}

.bans.correct {
    color: var(--success-color);
}

.bans.wrong {
    color: var(--danger-color);
}

.bans.blank {
    color: #a0aec0;
}

.bgt {
    font-size: 12px;
    font-weight: 700;
    color: #9aa5b4;
}

.mismatch {
    background: rgba(255, 220, 60, 0.5);
}

/* ══════════════════════════════════════════════════════════════════
   Dashboard (010-landing-page.php)
   ══════════════════════════════════════════════════════════════════ */

/* ── Status Summary Panel ── */
.status-panel {
    background: var(--bg-color);
    border-radius: 24px;
    padding: 32px 36px;
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    margin-bottom: 32px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.panel-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-key-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 12px;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    background: var(--bg-color);
    color: var(--primary-color);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    transition: all 0.2s ease;
}

.view-key-btn:hover {
    box-shadow: 2px 2px 5px var(--shadow-dark), -2px -2px 5px var(--shadow-light);
}

.view-key-btn:active {
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 40px;
    margin-bottom: 24px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9aa5b4;
    min-width: 100px;
    flex-shrink: 0;
}

.info-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.info-value .pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
}

.pill-ok { background: #e6f4ee; color: var(--success-color); }
.pill-warn { background: #fef3e2; color: #dd6b20; }
.pill-muted { background: #edf0f4; color: #9aa5b4; }

/* ── Pipeline Stepper ── */
.pipeline {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 16px;
    background: var(--bg-color);
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.pipe-step {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.pipe-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.pipe-dot.done {
    background: var(--success-color);
    color: white;
    box-shadow: 0 2px 6px rgba(56, 161, 105, 0.4);
}

.pipe-dot.pending {
    background: var(--bg-color);
    color: #b0bac8;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}

.pipe-dot.current {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 6px rgba(74, 144, 217, 0.4);
    animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 2px 6px rgba(74, 144, 217, 0.4); }
    50% { box-shadow: 0 2px 12px rgba(74, 144, 217, 0.7); }
}

.pipe-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.pipe-label.done-label { color: var(--success-color); }
.pipe-label.pending-label { color: #b0bac8; }

.pipe-sep {
    flex: 1;
    height: 2px;
    margin: 0 12px;
    border-radius: 2px;
    min-width: 20px;
}

.pipe-sep.done-sep { background: var(--success-color); }
.pipe-sep.pending-sep { background: #cbd5e0; }



/* ── Dashboard Empty State ── */
.empty-state-banner {
    background: var(--bg-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    margin-bottom: 32px;
    text-align: center;
}

.empty-state-banner .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-banner .title { font-size: 20px; font-weight: 800; color: var(--text-main); margin-bottom: 8px; }
.empty-state-banner .subtitle { font-size: 15px; color: var(--text-muted); }

/* ── Dashboard Responsive ── */
@media (max-width: 900px) {
    .info-grid { grid-template-columns: 1fr; }
    .pipeline { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 800px) {
    .ak-modal-split { grid-template-columns: 1fr; }
}

/* ── HTML Table Rules (Shared) ── */
.results-table-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
    background: #edf2f7;
}

.summary-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.summary-table-wrap {
    overflow: auto;
    max-height: 65vh;
    border-radius: 12px;
    background: #e0e5ec;
    box-shadow: inset 3px 3px 7px #b8bec7, inset -3px -3px 7px #ffffff;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-table th,
.summary-table td {
    padding: 6px 4px;
    border-bottom: 1px solid #cbd5e0;
    text-align: center;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    max-width: 70px;
}

.summary-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #dbe3ed;
    color: #4a5568;
    font-weight: 800;
}

.summary-table td:first-child,
.summary-table th:first-child {
    position: sticky;
    left: 0;
    background: #e0e5ec;
    z-index: 2;
}

.summary-table td:nth-child(2),
.summary-table th:nth-child(2) {
    text-align: right;
    font-weight: 800;
    color: #2d3748;
    position: sticky;
    left: 45px;
    background: #e0e5ec;
    z-index: 2;
    max-width: none;
    white-space: nowrap;
}

.summary-table th:first-child,
.summary-table th:nth-child(2) {
    z-index: 3;
}

.summary-table .col-index {
    text-align: right !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: #8a95a5 !important;
    font-weight: 600 !important;
    min-width: 45px;
    box-sizing: border-box;
}
