/* ── BASE LAYOUT & RESET (Fallback if globalStyles.css is missing) ── */
:root {
    --bg-color: #f4f7f9;
    --text-main: #1a2a3a;
    --text-muted: rgba(26, 42, 58, 0.55);
    --primary: #1a3a5c;
    --accent: #C8401A;
    --accent-hover: #e04b23;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ── HEADER ── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background-color: var(--primary);
    color: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-mark {
    width: 24px;
    height: 24px;
    background-color: var(--accent);
    border-radius: 4px;
}

.header-wordmark {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 18px;
}

.header-right .back-btn {
    color: white;
    text-decoration: none;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.header-right .back-btn:hover {
    opacity: 1;
}

/* ── MAIN LAYOUT ── */
.main {
    display: flex;
    flex: 1;
    padding: 24px 32px;
    gap: 24px;
    overflow: hidden;
}

/* ── SIDEBAR CONTROLS ── */
.controls {
    width: 320px;
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.controls-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 8px;
}

.controls-sub {
    font-size: 13px;
    color: var(--text-muted);
}

.ctrl-label {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 32px;
    margin-bottom: 8px;
    display: block;
}

.city-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(100, 150, 190, 0.2);
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--text-main);
    background-color: #fafcfd;
    outline: none;
    cursor: pointer;
}

.city-select:focus {
    border-color: var(--primary);
}

/* ── LIST PANEL (Table) ── */
.list-panel {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    overflow-y: auto;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.doc-table th {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 12px 16px;
    border-bottom: 2px solid rgba(100, 150, 190, 0.1);
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
}

.doc-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(100, 150, 190, 0.1);
    vertical-align: middle;
}

.doc-table tr:hover {
    background-color: rgba(26, 58, 92, 0.02);
}

.cell-city {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: var(--primary);
    font-weight: 700;
    width: 14%;
}

.cell-name {
    font-size: 15px;
    font-weight: 500;
    width: 32%;
}

.cell-domain {
    min-width: 130px;
}

.cell-action {
    text-align: right;
    white-space: nowrap;
}

.btn-open {
    background: rgba(200, 64, 26, 0.08);
    color: var(--accent);
    border: 1px solid rgba(200, 64, 26, 0.2);
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-open:hover {
    background: rgba(200, 64, 26, 0.15);
    border-color: rgba(200, 64, 26, 0.4);
    color: var(--accent-hover);
}

.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
    font-style: italic;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(26, 42, 58, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 32px;
    width: 90%;
    max-width: 700px;
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.close-modal {
    color: #888;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    margin-top: -10px;
}

.close-modal:hover {
    color: #1a3a5c;
}

.score-card {
    border: 1px solid #e0e0e0;
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 8px;
    background: #fafafa;
}

.score-card strong {
    color: #1a3a5c;
}

.score-meta {
    font-size: 0.9em;
    margin-bottom: 8px;
    display: flex;
    gap: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.score-text {
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 8px;
}

.page-lang-bar {
    display: flex;
    gap: 4px;
    align-items: center;
}

.page-lang-btn {
    background: transparent;
    border: 1px solid #30363d;
    color: #8b949e;
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-lang-btn:hover {
    border-color: #8b949e;
    color: #c9d1d9;
}

.page-lang-btn.active {
    background: #21262d;
    border-color: #5dade2;
    color: #fff;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    height: 100%;
}
