:root {
    --bg-dark: #070913;
    --sidebar-bg: rgba(15, 23, 42, 0.75);
    --card-bg: rgba(22, 30, 52, 0.65);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent: #0ea5e9;
    --accent-glow: rgba(14, 165, 233, 0.6);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.15), var(--bg-dark) 40%),
                radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.05), var(--bg-dark) 50%);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.dashboard-wrapper {
    display: flex;
    flex: 1;
    width: 100vw;
    overflow: hidden;
}

/* ===== GOV HEADER STYLING ===== */
.gov-header {
    background: linear-gradient(90deg, #020617, #0f172a, #020617);
    padding: 12px 30px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid rgba(14, 165, 233, 0.4);
    box-shadow: 0 4px 25px rgba(0,0,0,0.8);
    z-index: 100;
}
.gov-header img {
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}
.gov-header .title {
    flex-grow: 1;
    text-align: center;
    color: #e2e8f0;
    margin: 0 20px;
}
.gov-header .title h5 {
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
    color: #94a3b8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.gov-header .title h6 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 4px 0;
    color: #cbd5e1;
}
.gov-header .title h3.mc-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2px 0 6px;
    color: #f8fafc;
}
.gov-header .title h3.system-title {
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 1.55rem;
    margin: 0;
    text-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.logo h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 3rem;
}

nav ul {
    list-style: none;
    flex-grow: 1;
}

nav ul li {
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

nav ul li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

nav ul li.active {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.15), transparent);
    color: var(--accent);
    border-left: 3px solid var(--accent);
}

.taf-type-selector {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.selector-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.selector-dropdown {
    width: 100%;
    padding: 0.75rem;
    border-radius: 6px;
    background: var(--bg-dark);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.selector-dropdown:focus {
    border-color: var(--accent);
}

.btn-verify {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.85rem;
    border-radius: 6px;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    color: #fff;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-verify:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

.btn-verify:active {
    transform: translateY(0);
}

.btn-verify:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* Main Content Area */
.content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.app-header h1 {
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: -0.5px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.status-indicator .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.status-indicator.connected .dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-indicator.connected .text {
    color: var(--success);
}

.status-indicator.error .dot {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

.status-indicator.error .text {
    color: var(--danger);
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.4s ease-in-out forwards;
}

.view.active {
    display: block;
}

/* KPI Cards */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

.kpi-card h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-card .value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
}

.kpi-card .value.good {
    color: var(--success);
}

.kpi-card .value.warn {
    color: var(--warning);
}

.kpi-card .value.bad {
    color: var(--danger);
}

/* Chart Containers */
.chart-container-row {
    margin-bottom: 2rem;
}

.chart-container-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.chart-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.chart-wrapper {
    position: relative;
    height: 350px;
    width: 100%;
}

.wide-card .chart-wrapper {
    height: 400px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Data Table Styling */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    font-weight: 700;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.08);
}

.td-number {
    font-family: monospace;
    font-size: 0.95rem;
}

.btn-small {
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    border: none;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(56, 189, 248, 0.4);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 1000px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--danger);
    text-decoration: none;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.modal-image-container {
    width: 100%;
    margin-top: 1rem;
}

#modalImage {
    max-width: 100%;
    height: auto;
}

/* Progress Bar */
.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    border-radius: 99px;
    transition: width 0.4s ease;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* Modal KPI mini cards */
.modal-kpi {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    text-align: center;
}

.modal-kpi small {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.modal-kpi .mv {
    font-size: 1.3rem;
    font-weight: 800;
}

/* ============================================================
   RAW TAF / METAR VIEWER
   ============================================================ */

/* Controls card top row */
.raw-viewer-controls-card {
    margin-bottom: 1.5rem;
}

.raw-viewer-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-top: 0.5rem;
}

.rv-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    min-width: 140px;
}

.rv-toi-field {
    flex: 2.5;
    min-width: 240px;
}

.rv-btn-wrap {
    flex: 0 0 auto;
    min-width: 110px;
}

.rv-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.rv-label small {
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: none;
    opacity: 0.7;
    margin-left: 4px;
}

/* Status message */
.rv-status-msg {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
}

.rv-status-msg.rv-ok {
    color: var(--success);
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.rv-status-msg.rv-warn {
    color: var(--warning);
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Two boxes side-by-side */
.raw-boxes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

.raw-box-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 520px;
}

.raw-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.raw-box-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.3px;
}

/* Copy button */
.btn-copy {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--accent);
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    font-family: inherit;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: rgba(56, 189, 248, 0.25);
    transform: translateY(-1px);
}

.btn-copy:active {
    transform: translateY(0);
}

/* Monospace scrollable text box */
.raw-text-box {
    flex: 1;
    overflow: auto;
    margin: 0;
    padding: 1rem 1.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    line-height: 1.65;
    color: #c8d8f0;
    white-space: pre;
    word-break: normal;
    background: transparent;
    border: none;
    outline: none;
    /* subtle inner highlight for very long lines */
    scrollbar-width: thin;
    scrollbar-color: rgba(56,189,248,0.3) transparent;
}

.raw-text-box::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.raw-text-box::-webkit-scrollbar-track {
    background: transparent;
}

.raw-text-box::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 4px;
}

/* Responsive: stack on small screens */
@media (max-width: 900px) {
    .raw-boxes-grid {
        grid-template-columns: 1fr;
    }
    .raw-viewer-controls {
        flex-direction: column;
    }
}

/* ============================================================
   LIVE TODAY VIEW
   ============================================================ */

/* === Nav highlight === */
.live-nav-item {
    background: linear-gradient(90deg, rgba(52,211,153,0.12), transparent);
    border-left: 3px solid var(--success) !important;
    color: var(--success) !important;
    animation: livePulseNav 2.5s ease-in-out infinite;
}
@keyframes livePulseNav {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: inset 0 0 10px rgba(52,211,153,0.12); }
}

/* === Live Header Bar === */
.live-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(52,211,153,0.06);
    border: 1px solid rgba(52,211,153,0.2);
    border-radius: 12px;
    padding: 0.85rem 1.4rem;
    margin-bottom: 1.6rem;
}
.live-header-left { display: flex; align-items: center; gap: 0.7rem; }
.live-pulse-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%,100% { box-shadow: 0 0 4px var(--success); transform: scale(1); }
    50%      { box-shadow: 0 0 14px var(--success); transform: scale(1.25); }
}
.live-date-txt { font-size: 1rem; font-weight: 700; color: var(--text-main); }
.live-header-right { display: flex; align-items: center; gap: 1rem; }
.live-clock {
    font-size: 1.3rem; font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
    letter-spacing: 1px;
}
.live-metar-badge {
    background: rgba(251,191,36,0.12);
    border: 1px solid rgba(251,191,36,0.35);
    color: var(--warning);
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
}

/* === Latest TAF Cards Row === */
.live-taf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.live-taf-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.live-taf-card:hover {
    border-color: rgba(56,189,248,0.3);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.live-taf-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.18);
    border-radius: 14px 14px 0 0;
}
.ltc-badge {
    font-size: 0.75rem; font-weight: 800;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.ltc-badge-long {
    background: rgba(56,189,248,0.15);
    color: var(--accent);
    border: 1px solid rgba(56,189,248,0.35);
}
.ltc-badge-short {
    background: rgba(129,140,248,0.15);
    color: #818cf8;
    border: 1px solid rgba(129,140,248,0.35);
}
.ltc-ts {
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.ltc-body {
    flex: 1;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    color: #c8e0f4;
    padding: 1rem 1.2rem;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    max-height: 220px;
    overflow-y: auto;
}
.ltc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1.2rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0,0,0,0.12);
    border-radius: 0 0 14px 14px;
}
.ltc-validity { font-size: 0.78rem; color: var(--text-muted); }
.btn-ltc-all {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.btn-ltc-all:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-main);
    border-color: var(--accent);
}

/* === All-today panels === */
.live-all-tafs-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.25s ease;
}
.atp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.9rem;
}
.atp-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1rem; cursor: pointer; transition: color 0.2s;
}
.atp-close:hover { color: var(--danger); }
.atp-list {
    padding: 0.75rem 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.atp-item {
    background: rgba(56,189,248,0.08);
    border: 1px solid rgba(56,189,248,0.25);
    color: var(--accent);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.2s;
}
.atp-item:hover {
    background: rgba(56,189,248,0.2);
    transform: translateY(-1px);
}
.atp-item.atp-selected {
    background: var(--accent);
    color: #0f172a;
    font-weight: 700;
}

/* === Live METAR Section === */
.live-metar-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
}
.lms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.3rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.18);
    font-weight: 700;
    font-size: 0.95rem;
}
.lms-count {
    font-size: 0.8rem;
    color: var(--warning);
    font-weight: 600;
    background: rgba(251,191,36,0.1);
    border: 1px solid rgba(251,191,36,0.25);
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
}
.lms-scroll {
    max-height: 220px;
    overflow-y: auto;
    padding: 0.8rem 1.3rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(56,189,248,0.3) transparent;
}
.lms-line {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #c8e0f4;
    padding: 0.28rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
    cursor: default;
}
.lms-line:hover { background: rgba(56,189,248,0.06); border-radius: 4px; }
.lms-line:last-child { border-bottom: none; }
.lms-line .lms-ts {
    color: var(--text-muted);
    margin-right: 0.5rem;
    font-size: 0.75rem;
}
.lms-placeholder {
    color: var(--text-muted);
    font-size: 0.88rem;
    padding: 1rem 0;
    text-align: center;
}

/* === Verification Status Section === */
.live-verif-section {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}
.lvs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.3rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.18);
    font-weight: 700;
    font-size: 0.95rem;
}
.lvs-controls { display: flex; gap: 0.6rem; }
.btn-run-verif {
    background: linear-gradient(90deg, #34d399, #38bdf8);
    border: none;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-run-verif:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52,211,153,0.4);
}
.btn-run-verif-short {
    background: linear-gradient(90deg, #818cf8, #c084fc);
}
.btn-run-verif-short:hover { box-shadow: 0 4px 12px rgba(129,140,248,0.4); }
.btn-run-verif:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.lvs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.lvs-col {
    padding: 1rem 1.3rem;
    border-right: 1px solid var(--border-color);
}
.lvs-col:last-child { border-right: none; }
.lvs-col-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.85rem;
}
.lvs-list { display: flex; flex-direction: column; gap: 0.7rem; }

/* Individual TAF status item */
.lvs-item {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    transition: border-color 0.2s;
    cursor: pointer;
}
.lvs-item:hover { border-color: rgba(56,189,248,0.3); }
.lvs-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
}
.lvs-ts {
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}
.lvs-acc {
    font-size: 0.85rem;
    font-weight: 800;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
}
.lvs-acc-pending {
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.78rem;
}
.lvs-acc-ok { color: var(--success); background: rgba(52,211,153,0.12); }
.lvs-acc-warn { color: var(--warning); background: rgba(251,191,36,0.12); }
.lvs-acc-bad { color: var(--danger); background: rgba(239,68,68,0.12); }

/* Progress bar inside each item */
.lvs-bar-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.lvs-bar-track {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.07);
    border-radius: 99px;
    overflow: hidden;
}
.lvs-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s ease;
}
.lvs-bar-fill-time { background: linear-gradient(90deg, #38bdf8, #818cf8); }
.lvs-bar-pct {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 32px;
    text-align: right;
}
.lvs-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.5rem;
    text-align: center;
}

/* Inline progress block for running verification */
.lvs-verif-overlay {
    margin-top: 1.5rem;
    padding: 1.5rem 1rem;
    background: rgba(15,23,42,0.5);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 14px 14px;
    animation: fadeIn 0.25s ease;
}
.lvs-overlay-inner {
    width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.lvs-overlay-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}
.lvs-overlay-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 99px;
    overflow: hidden;
}
.lvs-overlay-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #34d399, #38bdf8);
    border-radius: 99px;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(52,211,153,0.5);
}
.lvs-overlay-pct {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--success);
}

/* "View Result" button on verified items */
.btn-view-result {
    background: none;
    border: 1px solid rgba(56,189,248,0.3);
    color: var(--accent);
    font-size: 0.72rem;
    font-family: inherit;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-view-result:hover {
    background: rgba(56,189,248,0.1);
}

@media (max-width: 960px) {
    .live-taf-row, .lvs-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   MOBILE HAMBURGER MENU
   ============================================================ */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 999;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    backdrop-filter: blur(10px);
}
.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: all 0.3s;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 500;
    backdrop-filter: blur(2px);
}

/* ============================================================
   MOBILE: ≤ 768px
   ============================================================ */
@media (max-width: 768px) {

    /* Body: allow vertical scroll */
    body {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
    }

    /* Gov Header — compact */
    .gov-header {
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 6px;
    }
    .gov-header img {
        height: 40px;
    }
    .gov-header .title h5 { font-size: 0.65rem; }
    .gov-header .title h6 { font-size: 0.78rem; margin: 2px 0; }
    .gov-header .title h3.mc-title { font-size: 0.85rem; margin: 2px 0 4px; }
    .gov-header .title h3.system-title { font-size: 0.9rem; letter-spacing: 0.5px; }

    /* Show hamburger */
    .hamburger-btn { display: flex; }

    /* Sidebar — slide-in drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 260px;
        height: 100%;
        z-index: 600;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 4rem 1.25rem 1.5rem;
        border-right: 1px solid var(--accent);
    }
    .sidebar.open {
        left: 0;
    }
    .sidebar-overlay.open {
        display: block;
    }

    /* Dashboard wrapper — full width */
    .dashboard-wrapper {
        flex-direction: column;
        width: 100%;
        overflow: visible;
    }

    /* Content — full width, smaller padding */
    .content {
        padding: 1rem;
        overflow-y: visible;
        width: 100%;
    }

    /* App header */
    .app-header {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 1rem;
    }
    .app-header h1 {
        font-size: 1.3rem;
    }

    /* KPI cards — 2 per row on phone */
    .kpi-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    .kpi-card {
        padding: 1rem;
    }
    .kpi-card .value {
        font-size: 1.6rem;
    }

    /* Charts — single column */
    .chart-container-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .chart-container-row {
        margin-bottom: 1rem;
    }
    .chart-card {
        padding: 1rem;
    }
    .chart-wrapper {
        height: 220px !important;
    }

    /* Live TAF row */
    .live-taf-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .live-header-bar {
        flex-wrap: wrap;
        gap: 6px;
    }
    .live-clock {
        font-size: 1rem;
    }

    /* Scored METAR grids */
    .scored-metar-grids {
        grid-template-columns: 1fr !important;
    }

    /* Batch verification */
    .lvs-grid {
        grid-template-columns: 1fr;
    }
    .lvs-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    .lvs-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Tables — horizontal scroll */
    .data-table {
        font-size: 0.72rem;
        min-width: 600px;
    }
    .chart-card[style*="overflow-x"] { overflow-x: auto !important; }

    /* Modal — full screen */
    .modal-content {
        width: 98vw;
        max-height: 90vh;
        overflow-y: auto;
        padding: 1rem;
    }
    #modalKPIs {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .modal-content > div[style*="grid-template-columns:1fr 1fr"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    /* Past Data filters */
    .pd-filter-row {
        flex-direction: column;
    }
    .pd-field { min-width: 100%; }

    /* Raw viewer */
    .raw-boxes-grid {
        grid-template-columns: 1fr !important;
    }
    .raw-text-box {
        font-size: 0.7rem;
        max-height: 220px;
    }

    /* Charts Explorer filter */
    #chartsExplorerView .chart-card > div[style*="display:flex"] {
        flex-direction: column;
    }

    /* Sidebar controls at bottom */
    .taf-type-selector {
        margin-top: 1rem;
    }

    /* Progress track */
    .progress-track {
        height: 6px;
    }
}

/* ============================================================
   TABLET: 769px – 1024px
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {

    .sidebar {
        width: 220px;
        padding: 1.5rem 1rem;
    }
    .content {
        padding: 1.5rem;
    }
    .chart-container-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .gov-header .title h3.system-title {
        font-size: 1.1rem;
    }
    .kpi-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ============================================================
   PAST DATA TAB
   ============================================================ */
.pd-filter-card {
    margin-bottom: 1.5rem;
}
.pd-filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-top: 0.75rem;
}
.pd-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    min-width: 140px;
}
.pd-btn-wrap {
    flex: 0 0 auto;
    min-width: 110px;
}
