/* === Base === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; color: #333; }
.container { max-width: 900px; margin: 0 auto; padding: 20px; }

/* === Header + Nav === */
header { background: #1a365d; color: white; padding: 20px; margin-bottom: 24px; border-radius: 8px; }
header h1 { font-size: 1.5rem; margin-bottom: 4px; }
header p { font-size: 0.9rem; opacity: 0.8; }
nav { margin-top: 12px; display: flex; gap: 20px; }
nav a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem; padding-bottom: 2px; }
nav a:hover { color: white; }
nav a.active { color: white; border-bottom: 2px solid white; }

/* === Stats Bar === */
.stats-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.stat { background: white; padding: 10px 16px; border-radius: 6px; font-size: 0.85rem; border-left: 4px solid #ccc; cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; user-select: none; }
.stat:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); transform: translateY(-1px); }
.stat:active { transform: translateY(0); }
.stat.verified { border-left-color: #38a169; }
.stat.unverified { border-left-color: #d69e2e; }
.stat.flagged { border-left-color: #e53e3e; }
.stat strong { display: block; font-size: 1.2rem; }

/* === Search === */
.search-box { position: relative; margin-bottom: 20px; }
.search-box input {
    width: 100%; padding: 14px 18px 14px 44px; font-size: 1.1rem;
    border: 2px solid #ddd; border-radius: 8px; outline: none;
}
.search-box input:focus { border-color: #3182ce; }
.search-icon {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: #a0aec0; font-size: 1.1rem; pointer-events: none;
}
.search-box .clear-btn {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    background: #edf2f7; border: none; color: #718096; font-size: 1.1rem;
    cursor: pointer; display: none; padding: 2px 8px; border-radius: 50%;
    width: 28px; height: 28px; line-height: 1;
}
.search-box .clear-btn:hover { background: #e2e8f0; color: #2d3748; }

/* === Dropdown === */
.dropdown {
    position: absolute; top: 100%; left: 0; right: 0; background: white;
    border: 1px solid #ddd; border-radius: 0 0 8px 8px; max-height: 360px;
    overflow-y: auto; z-index: 10; display: none; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.dropdown-header {
    padding: 8px 18px; font-size: 0.75rem; color: #a0aec0; text-transform: uppercase;
    letter-spacing: 0.05em; font-weight: 600; background: #f7fafc; border-bottom: 1px solid #edf2f7;
    position: sticky; top: 0;
}
.dropdown-item {
    padding: 10px 18px; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #f7fafc;
}
.dropdown-item:hover, .dropdown-item.active { background: #edf2f7; }
.dropdown-item .county-info { display: flex; align-items: center; gap: 8px; }
.dropdown-item .county-name { font-weight: 600; font-size: 0.95rem; }
.dropdown-item .county-seat { color: #718096; font-size: 0.8rem; }
.dropdown-item .county-seat::before { content: '\2022'; margin-right: 6px; }
.dropdown-item .local-tag {
    font-size: 0.65rem; background: #e9d8fd; color: #553c9a; padding: 1px 6px;
    border-radius: 4px; font-weight: 600; text-transform: uppercase;
}
.dropdown-detail { display: block; font-size: 0.75rem; color: #a0aec0; margin-top: 1px; }
.dropdown-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.dropdown-tag { font-size: 0.65rem; padding: 1px 6px; border-radius: 4px; font-weight: 600; text-transform: uppercase; }
.dropdown-tag.ordinance { background: #fed7d7; color: #822727; }
.dropdown-tag.food { background: #c6f6d5; color: #22543d; }
.dropdown-empty { padding: 20px 18px; text-align: center; color: #a0aec0; font-size: 0.9rem; }
.match-highlight { background: #fefcbf; border-radius: 2px; }

/* === Badges === */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 12px;
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
}
.badge.verified { background: #c6f6d5; color: #22543d; }
.badge.unverified { background: #fefcbf; color: #744210; }
.badge.flagged { background: #fed7d7; color: #822727; }
.badge.draft { background: #fefcbf; color: #744210; }

/* === Badge & Stat Tooltips === */
.badge[data-tooltip], .stat[data-tooltip] { position: relative; cursor: help; }
.badge[data-tooltip]:hover::after, .stat[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    background: #2d3748; color: white; padding: 8px 12px; border-radius: 6px;
    font-size: 0.8rem; white-space: normal; width: 260px; z-index: 100;
    line-height: 1.4; text-align: left; font-weight: normal; text-transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2); pointer-events: none;
}
.badge[data-tooltip]:hover::before, .stat[data-tooltip]:hover::before {
    content: ''; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: #2d3748; z-index: 100; pointer-events: none;
}

/* === Cards === */
.card { background: white; border-radius: 8px; padding: 24px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.card h2 { font-size: 1.3rem; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.card .subtitle { color: #718096; margin-bottom: 16px; }

/* === Fields === */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .field-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 0.8rem; color: #718096; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.field .value { font-size: 0.95rem; }
.field .value a { color: #3182ce; text-decoration: none; }
.field .value a:hover { text-decoration: underline; }
.field-full { grid-column: 1 / -1; }
.field-full .value { white-space: pre-wrap; line-height: 1.5; }
.step-list { list-style: disc; margin: 0; padding-left: 20px; }
.step-list li { padding: 2px 0; white-space: normal; }

/* === Buttons === */
.actions { display: flex; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #eee; }
.btn {
    padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer;
    font-size: 0.9rem; font-weight: 500;
}
.btn-edit { background: #3182ce; color: white; }
.btn-edit:hover { background: #2c5282; }
.btn-flag { background: #e53e3e; color: white; }
.btn-flag:hover { background: #c53030; }
.btn-cancel { background: #edf2f7; color: #4a5568; }
.btn-cancel:hover { background: #e2e8f0; }
.btn-save { background: #38a169; color: white; }
.btn-save:hover { background: #2f855a; }

/* === Edit Modal === */
.edit-modal {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 100; align-items: center; justify-content: center;
}
.edit-modal.active { display: flex; }
.edit-modal .modal-content {
    background: white; border-radius: 8px; padding: 24px; width: 90%; max-width: 500px;
}
.edit-modal h3 { margin-bottom: 16px; }
.edit-modal textarea, .edit-modal input[type="text"] {
    width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 0.95rem; margin-bottom: 12px; font-family: inherit;
}
.edit-modal textarea { min-height: 100px; resize: vertical; }
.edit-modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* === Permit Types === */
.permit-types { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 600px) { .permit-types { grid-template-columns: 1fr; } }
.permit-type { padding: 16px; border-radius: 8px; border: 1px solid #e2e8f0; }
.permit-type h4 { font-size: 0.95rem; margin-bottom: 6px; }
.permit-type p { font-size: 0.85rem; color: #4a5568; line-height: 1.4; }
.permit-type.event { border-left: 4px solid #3182ce; }
.permit-type.unlimited { border-left: 4px solid #805ad5; }

/* === Phase Labels === */
.phase-label {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
    padding: 3px 8px; border-radius: 4px; margin-bottom: 8px; display: inline-block;
}
.phase-label.client { background: #e2e8f0; color: #4a5568; }
.phase-label.team { background: #bee3f8; color: #2a4365; }

/* === Collapsible === */
.collapsible-header {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    padding: 10px 0; user-select: none;
}
.collapsible-header:hover { opacity: 0.8; }
.collapsible-subtitle { font-size: 0.8rem; color: #718096; flex: 1; }
.collapse-arrow { font-size: 0.9rem; color: #a0aec0; transition: transform 0.2s; }
.collapse-arrow.collapsed { transform: rotate(-90deg); }
.collapsible-body { overflow: hidden; max-height: 0; transition: max-height 0.3s ease; }
.collapsible-body.open { max-height: 2000px; }

/* === Baseline Steps === */
.baseline-steps { counter-reset: step; }
#baseline-steps-team { counter-reset: step 9; }
.baseline-step {
    padding: 12px 16px 12px 48px; position: relative; border-left: 2px solid #e2e8f0; margin-left: 16px;
}
.baseline-step.team-step { border-left-color: #3182ce; }
.baseline-step::before {
    content: counter(step); counter-increment: step;
    position: absolute; left: -14px; top: 10px;
    width: 26px; height: 26px; background: #cbd5e0; color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 600;
}
.baseline-step.team-step::before { background: #3182ce; }
.baseline-step h4 { font-size: 0.95rem; margin-bottom: 4px; }
.baseline-step p { font-size: 0.85rem; color: #4a5568; }

/* === Tables === */
.history-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.history-table th, .history-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #eee; }
.history-table th { color: #718096; font-weight: 600; text-transform: uppercase; font-size: 0.75rem; }

/* === Misc === */
.confidence-note { background: #f7fafc; padding: 12px; border-radius: 6px; font-size: 0.85rem; color: #4a5568; margin-top: 12px; }
.action-banner { background: #fffff0; border: 1px solid #ecc94b; border-left: 4px solid #d69e2e; padding: 14px 16px; border-radius: 6px; font-size: 0.85rem; color: #744210; margin-top: 12px; line-height: 1.6; }
.action-banner strong { color: #5a3e00; }
.action-banner ol { margin: 8px 0 0 20px; padding: 0; }
.action-banner ol li { margin-bottom: 4px; }
#county-detail, #baseline-section, #history-section { display: none; }

/* === Toast === */
.toast {
    position: fixed; bottom: 20px; right: 20px; background: #38a169; color: white;
    padding: 12px 20px; border-radius: 8px; font-size: 0.9rem; display: none; z-index: 200;
}

/* === List Modal === */
.list-modal {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 100; align-items: flex-start; justify-content: center;
    padding-top: 60px;
}
.list-modal.active { display: flex; }
.list-modal .modal-content {
    background: white; border-radius: 8px; width: 90%; max-width: 700px;
    max-height: 80vh; display: flex; flex-direction: column;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.list-modal .modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 24px; border-bottom: 1px solid #eee;
}
.list-modal .modal-header h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.list-modal .modal-close {
    background: none; border: none; font-size: 1.5rem; cursor: pointer;
    color: #a0aec0; padding: 4px 8px; line-height: 1;
}
.list-modal .modal-close:hover { color: #4a5568; }
.list-modal .modal-body { overflow-y: auto; flex: 1; }
.list-modal .county-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 24px; border-bottom: 1px solid #f7fafc; cursor: pointer;
}
.list-modal .county-row:hover { background: #edf2f7; }
.list-modal .county-row .row-left { display: flex; flex-direction: column; }
.list-modal .county-row .row-name { font-weight: 600; font-size: 0.95rem; }
.list-modal .county-row .row-seat { font-size: 0.8rem; color: #718096; }
.list-modal .county-row .row-note { display: block; font-size: 0.8rem; margin-top: 2px; }
.list-modal .county-row .row-note.flagged { color: #e53e3e; }
.list-modal .county-row .row-note.unverified { color: #d69e2e; }
.list-modal .county-row .row-right { font-size: 0.8rem; color: #718096; text-align: right; }
.list-modal .modal-footer {
    padding: 12px 24px; border-top: 1px solid #eee; font-size: 0.8rem; color: #a0aec0; text-align: center;
}

/* === Services Page === */
.service-category { border-left: 4px solid #ccc; padding-left: 16px; margin-bottom: 20px; }
.service-category.liquor { border-left-color: #3182ce; }
.service-category.business { border-left-color: #805ad5; }
.service-category.health { border-left-color: #38a169; }
.service-category.occupancy { border-left-color: #d69e2e; }
.service-category h3 { font-size: 1.1rem; margin-bottom: 4px; }
.service-category .cat-desc { font-size: 0.85rem; color: #718096; margin-bottom: 12px; }

.jurisdiction-item { padding: 10px 0; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.jurisdiction-item:last-child { border-bottom: none; }
.jurisdiction-item .handler { color: #718096; font-size: 0.85rem; }

.doc-list { list-style: none; padding: 0; }
.doc-list li { padding: 8px 0; border-bottom: 1px solid #f7fafc; font-size: 0.9rem; }
.doc-list li:last-child { border-bottom: none; }
.doc-list li::before { content: '\2713'; color: #38a169; margin-right: 8px; font-weight: bold; }

/* ═══════════════════════════════════════════════════════════ */
/* === Data Overview Presentation Page ===                     */
/* ═══════════════════════════════════════════════════════════ */

.hero-sub { font-size: 1rem; color: #a0aec0; margin-top: 4px; line-height: 1.5; }

/* --- Slides --- */
.slide {
    background: white; border-radius: 8px; padding: 40px 32px;
    margin-bottom: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.slide-title { font-size: 1.5rem; color: #1a365d; margin: 0 0 8px 0; }
.slide-subtitle { font-size: 0.95rem; color: #718096; margin: 0 0 28px 0; line-height: 1.6; max-width: 640px; }

/* --- Section 1: Source Cards --- */
.source-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.source-card {
    border: 2px dashed #cbd5e0; border-radius: 8px; padding: 20px;
    transition: border-color 0.2s;
}
.source-card:hover { border-color: #a0aec0; }
.source-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.source-owner { padding: 2px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; }
.source-jurisdiction { font-size: 0.78rem; color: #718096; }
.source-label { font-size: 1.05rem; margin: 0 0 12px 0; color: #2d3748; }
.source-columns { list-style: none; padding: 0; margin: 0; }
.source-columns li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 8px; font-size: 0.85rem; background: #f7fafc;
    border-radius: 4px; margin-bottom: 4px;
}
.col-name { color: #4a5568; }
.inferred-badge {
    font-size: 0.6rem; background: #fefcbf; color: #975a16;
    padding: 1px 6px; border-radius: 4px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.03em;
}
.source-note { font-size: 0.75rem; color: #a0aec0; font-style: italic; margin: 10px 0 0 0; }

/* --- Section 2: Column Mapping --- */
.mapping-legend { display: flex; gap: 12px; margin-bottom: 16px; font-size: 0.8rem; flex-wrap: wrap; }
.legend-item { padding: 4px 12px; border-radius: 12px; font-weight: 500; }
.legend-high { background: #c6f6d5; color: #22543d; }
.legend-medium { background: #fefcbf; color: #744210; }
.legend-none { background: #edf2f7; color: #a0aec0; }

.feedback-counter {
    font-size: 0.8rem; color: #a0aec0; margin-bottom: 16px;
    transition: color 0.2s;
}
.feedback-counter.complete { color: #38a169; font-weight: 600; }

.mapping-header {
    display: grid;
    grid-template-columns: 3fr 40px 2fr auto;
    gap: 12px; align-items: center;
    padding: 0 0 8px 0; border-bottom: 2px solid #e2e8f0;
    margin-bottom: 4px; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em; color: #718096;
}
.mapping-sources-header { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; text-align: center; }
.mapping-arrow-header { width: 40px; }
.mapping-master-header { text-align: left; }
.mapping-feedback-header { text-align: center; min-width: 100px; }

.mapping-row {
    display: grid;
    grid-template-columns: 3fr 40px 2fr auto;
    grid-template-rows: auto auto;
    align-items: center; gap: 8px 12px;
    padding: 10px 0; border-bottom: 1px solid #f0f0f0;
}
.mapping-sources { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.mapping-cell {
    padding: 6px 10px; border-radius: 4px; font-size: 0.8rem;
    text-align: center; font-weight: 500;
}
.mapping-row[data-confidence="high"] .mapping-cell[data-has="yes"] { background: #c6f6d5; color: #22543d; }
.mapping-row[data-confidence="medium"] .mapping-cell[data-has="yes"] { background: #fefcbf; color: #744210; }
.mapping-cell[data-has="no"] { background: #f7fafc; color: #cbd5e0; }

.mapping-arrow { width: 40px; display: flex; align-items: center; justify-content: center; }
.mapping-arrow svg { width: 40px; height: 20px; }
.mapping-row[data-confidence="high"] .mapping-arrow { color: #38a169; }
.mapping-row[data-confidence="medium"] .mapping-arrow { color: #d69e2e; }

.mapping-master {
    background: #ebf8ff; border: 2px solid #3182ce; border-radius: 6px;
    padding: 8px 14px; font-size: 0.9rem;
}

.mapping-feedback { display: flex; gap: 4px; justify-content: center; min-width: 100px; }
.fb-btn {
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid #e2e8f0;
    background: white; cursor: pointer; font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.fb-btn:hover { background: #f7fafc; transform: scale(1.1); }
.fb-yes.active { background: #c6f6d5; border-color: #38a169; color: #22543d; }
.fb-no.active { background: #fed7d7; border-color: #e53e3e; color: #822727; }
.fb-diff.active { background: #fefcbf; border-color: #d69e2e; color: #744210; }

.mapping-note {
    grid-column: 1 / -1; font-size: 0.75rem; color: #a0aec0;
    padding: 0 0 4px 0; font-style: italic;
}

/* --- Section 3: Master List --- */
.callout-box {
    background: #fffff0; border-left: 4px solid #d69e2e;
    padding: 16px 20px; border-radius: 0 6px 6px 0;
    font-size: 0.95rem; color: #744210; line-height: 1.6; margin-bottom: 24px;
}
.callout-subtle {
    background: #f7fafc; border-left-color: #a0aec0; color: #4a5568;
}
.callout-warm {
    background: #f0fff4; border-left-color: #38a169; color: #22543d;
}

.sample-record {
    background: #f7fafc; border: 2px solid #3182ce; border-radius: 8px;
    padding: 24px; margin-bottom: 24px;
}
.sample-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.sample-header h3 { margin: 0; font-size: 1.2rem; }
.sample-id {
    background: #3182ce; color: white; padding: 4px 12px;
    border-radius: 6px; font-size: 0.8rem; font-weight: 700; font-family: monospace;
    white-space: nowrap;
}
.sample-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.sample-field label { display: block; font-size: 0.75rem; color: #718096; text-transform: uppercase; letter-spacing: 0.05em; }
.sample-field span { font-size: 0.95rem; color: #2d3748; }
.sample-license {
    padding: 10px 0; border-top: 1px solid #e2e8f0; font-size: 0.9rem;
}
.sample-license small { color: #718096; }

/* Hierarchy diagram */
.hierarchy {
    display: flex; align-items: center; justify-content: center;
    gap: 0; margin: 28px 0; flex-wrap: nowrap;
}
.h-node {
    padding: 14px 20px; border-radius: 8px; text-align: center;
    font-weight: 600; font-size: 0.9rem; display: flex; flex-direction: column;
}
.h-node small { font-weight: 400; color: rgba(0,0,0,0.5); font-size: 0.75rem; margin-top: 2px; }
.h-owner { background: #e9d8fd; color: #553c9a; }
.h-business { background: #bee3f8; color: #2a4365; }
.h-license { background: #c6f6d5; color: #22543d; }
.h-connector { display: flex; align-items: center; padding: 0 4px; }
.h-line { width: 36px; height: 2px; background: #cbd5e0; }
.h-branches { display: flex; gap: 10px; }

/* --- Section 4: Hub and Spoke --- */
.connect-diagram {
    display: flex; align-items: center; justify-content: center;
    gap: 0; margin: 28px 0; flex-wrap: nowrap;
}
.connect-hub {
    background: #1a365d; color: white; padding: 24px 28px;
    border-radius: 12px; font-weight: 700; text-align: center;
    font-size: 1.1rem; display: flex; flex-direction: column; align-items: center;
    min-width: 120px;
}
.connect-hub small { font-weight: 400; opacity: 0.8; font-size: 0.85rem; margin-top: 2px; }
.hub-icon { font-size: 1.6rem; margin-bottom: 4px; }
.connect-spoke {
    border: 2px solid; border-radius: 8px; padding: 16px 20px;
    text-align: center; font-size: 0.9rem; font-weight: 500;
    background: white; display: flex; flex-direction: column; align-items: center;
    min-width: 110px;
}
.connect-spoke small { display: block; font-weight: 400; color: #718096; margin-top: 4px; font-size: 0.8rem; }
.spoke-icon { font-size: 1.4rem; margin-bottom: 4px; }
.connect-line { width: 60px; display: flex; align-items: center; justify-content: center; }
.connect-line svg { width: 60px; height: 20px; }
.connect-line-right svg { transform: scaleX(-1); }

.connect-diagram-bottom {
    display: flex; flex-direction: column; align-items: center;
    margin: -12px 0 28px 0;
}
.connect-line-vertical { height: 36px; display: flex; align-items: center; justify-content: center; }
.connect-line-vertical svg { width: 20px; height: 36px; }

/* ═══════════════════════════════════════════════════════════ */
/* === Spreadsheet Upload & View                              */
/* ═══════════════════════════════════════════════════════════ */

/* --- Upload Form --- */
.upload-form { margin-top: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8rem; color: #718096; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.form-group input[type="text"],
.form-group input[type="file"],
.form-group select {
    width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 0.95rem; font-family: inherit; background: white;
}
.form-group input[type="file"] { padding: 8px; }
.form-group input:focus, .form-group select:focus { border-color: #3182ce; outline: none; }

/* --- Sheet List --- */
.sheet-list { display: flex; flex-direction: column; gap: 2px; }
.sheet-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; border-bottom: 1px solid #f0f0f0;
    text-decoration: none; color: inherit; transition: background 0.1s;
}
.sheet-item:hover { background: #f7fafc; }
.sheet-item:last-child { border-bottom: none; }
.sheet-item-left { display: flex; align-items: center; gap: 12px; }
.sheet-meta { font-size: 0.8rem; color: #a0aec0; }
.sheet-date { font-size: 0.8rem; color: #a0aec0; }
.sheet-badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.03em;
}
.sheet-badge.city-renewals { background: #bee3f8; color: #2a4365; }
.sheet-badge.county-renewals { background: #e9d8fd; color: #553c9a; }
.sheet-badge.state-renewals { background: #c6f6d5; color: #22543d; }
.sheet-badge.other { background: #edf2f7; color: #4a5568; }

/* --- Data Table --- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; white-space: nowrap; }
.data-table th {
    padding: 10px 14px; text-align: left; background: #f7fafc;
    color: #718096; font-weight: 600; text-transform: uppercase;
    font-size: 0.72rem; letter-spacing: 0.04em;
    border-bottom: 2px solid #e2e8f0; position: sticky; top: 0;
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid #f0f0f0; }
.data-table tr:hover { background: #f7fafc; }
.row-num { color: #a0aec0; font-size: 0.75rem; text-align: center; min-width: 30px; }
.cell-date { color: #805ad5; }
.cell-money { color: #38a169; }

/* --- Column Chips --- */
.column-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.column-chip {
    padding: 6px 14px; background: #edf2f7; border-radius: 20px;
    font-size: 0.82rem; color: #4a5568; font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════ */
/* === Data Overview: Mobile                                  */
/* ═══════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
    .slide { padding: 24px 16px; }
    .source-cards { grid-template-columns: 1fr; }

    .mapping-header { display: none; }
    .mapping-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 16px 0;
    }
    .mapping-sources { grid-template-columns: 1fr; gap: 4px; }
    .mapping-cell { text-align: left; }
    .mapping-cell::before { font-size: 0.65rem; color: #a0aec0; margin-right: 6px; }
    .mapping-cell.city::before { content: 'CITY: '; }
    .mapping-cell.county::before { content: 'COUNTY: '; }
    .mapping-cell.state::before { content: 'STATE: '; }
    .mapping-arrow { transform: rotate(90deg); margin: 4px auto; }
    .mapping-master { text-align: center; }
    .mapping-feedback { justify-content: center; }

    .sample-fields { grid-template-columns: 1fr; }

    .hierarchy { flex-direction: column; }
    .h-connector { padding: 4px 0; }
    .h-line { width: 2px; height: 24px; }
    .h-branches { flex-direction: column; }

    .connect-diagram { flex-direction: column; gap: 0; }
    .connect-line { transform: rotate(90deg); width: 40px; height: 40px; }
    .connect-line-right { transform: rotate(90deg); }
    .connect-line-right svg { transform: none; }

    .form-row { grid-template-columns: 1fr; }
    .sheet-item { flex-direction: column; align-items: flex-start; gap: 6px; }
}
