/* ============================================
   MESSSTELLEN MANAGER PRO - Professional UI
   Commercial-Grade Design System
   ============================================ */

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --bg-hover: rgba(59, 130, 246, 0.08);

    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border: rgba(51, 65, 85, 0.8);
    --border-light: rgba(51, 65, 85, 0.4);

    --depth-08: #e879f9;
    --depth-16: #fbbf24;
    --depth-32: #22d3ee;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;

    --header-h: 56px;
    --tab-h: 44px;
    --toolbar-h: 48px;
}

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

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* ─── LOADING OVERLAY ─── */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: none;
    align-items: center; justify-content: center;
    flex-direction: column; gap: 16px;
    color: var(--text-secondary);
}
.loading-overlay p { font-size: 13px; letter-spacing: 0.5px; }
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── WELCOME SCREEN ─── */
.welcome-overlay {
    position: fixed; inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    z-index: 100000;
    display: flex; align-items: center; justify-content: center;
}
.welcome-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    width: 440px;
    max-width: 90vw;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.welcome-logo {
    height: 56px;
    margin-bottom: 24px;
    border-radius: var(--radius-sm);
}
.welcome-content h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}
.welcome-content h1 span { color: var(--accent); }
.welcome-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 32px;
}
.welcome-actions { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.welcome-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: all 0.2s;
}
.welcome-btn:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}
.divider {
    display: flex; align-items: center; gap: 12px;
    color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.file-status {
    font-size: 12px; color: var(--accent);
    font-family: var(--font-mono);
    background: var(--bg-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}
.btn-start-main {
    width: 100%; padding: 16px;
    background: var(--accent);
    color: white; border: none;
    border-radius: var(--radius-md);
    font-weight: 700; font-size: 14px;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-start-main:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(59,130,246,0.3); }
.btn-start-main:disabled { background: var(--bg-tertiary); color: var(--text-muted); cursor: not-allowed; transform: none; box-shadow: none; }
.welcome-footer { margin-top: 32px; font-size: 11px; color: var(--text-muted); }

/* ─── APP LAYOUT ─── */
.app-layout {
    display: flex; flex-direction: column;
    height: 100vh; overflow: hidden;
}

/* ─── HEADER ─── */
.header-top {
    height: var(--header-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.header-left, .header-right { display: flex; align-items: center; gap: 4px; }
.header-center { flex: 1; display: flex; justify-content: center; padding: 0 24px; }
.header-divider { width: 1px; height: 24px; background: var(--border); margin: 0 8px; }
.project-name-input {
    width: 320px; max-width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    color: var(--text-primary);
    font-size: 13px; font-weight: 600;
    text-align: center;
    outline: none; transition: border-color 0.2s;
}
.project-name-input:focus { border-color: var(--accent); }

.btn-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer; transition: all 0.15s;
    font-size: 14px;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--accent); border-color: var(--border); }
.btn-icon.btn-save:hover { color: var(--success); }
.btn-icon.btn-export:hover { color: var(--success); }

/* ─── TAB BAR ─── */
.tab-bar {
    height: var(--tab-h);
    display: flex; align-items: center;
    padding: 0 16px; gap: 4px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.tab-btn {
    padding: 8px 20px;
    background: transparent;
    border: none; border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
    display: flex; align-items: center; gap: 8px;
}
.tab-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.tab-btn.active { background: var(--accent); color: white; }

/* ─── TOOLBAR ─── */
.toolbar {
    height: var(--toolbar-h);
    display: flex; align-items: center;
    padding: 0 16px; gap: 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow-x: auto;
}
.toolbar-group { display: flex; align-items: center; gap: 8px; }
.toolbar-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.toolbar-actions { display: flex; align-items: center; gap: 2px; }
.toolbar-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer; transition: all 0.15s;
    font-size: 12px;
}
.toolbar-btn:hover { background: var(--bg-hover); color: var(--accent); border-color: var(--border); }
.toolbar-btn.active { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.zoom-display { font-size: 11px; font-weight: 700; color: var(--text-primary); min-width: 40px; text-align: center; font-family: var(--font-mono); }

/* ─── CONTENT AREA ─── */
.content-area {
    flex: 1; overflow: hidden;
    position: relative;
}
.tab-panel { display: none; width: 100%; height: 100%; overflow: hidden; }
.tab-panel.active { display: flex; flex-direction: column; }

/* ─── TABLE ─── */
.table-wrapper { flex: 1; overflow: auto; position: relative; }
.data-table {
    width: max-content; min-width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.data-table th {
    position: sticky; top: 0; z-index: 10;
    background: var(--bg-secondary);
    padding: 10px 8px;
    border: 1px solid var(--border);
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.data-table td {
    border: 1px solid var(--border-light);
    padding: 0;
    background: var(--bg-primary);
}
.cell-input {
    width: 100%; height: 34px;
    border: none; background: transparent;
    color: var(--text-primary);
    padding: 0 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    outline: none; transition: background 0.15s;
}
.cell-input:focus { background: var(--accent-light); }
.cell-input[readonly] { color: var(--text-muted); font-weight: 600; }

.header-filter-input {
    display: block; width: 100%;
    margin-top: 4px; padding: 4px 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text-primary);
    font-size: 10px; outline: none;
}
.header-filter-input:focus { border-color: var(--accent); }

.empty-state {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: var(--text-muted); gap: 12px;
}
.empty-state i { font-size: 48px; opacity: 0.3; }
.empty-state h2 { font-size: 18px; font-weight: 600; }
.empty-state p { font-size: 13px; }

/* ─── PLOT ─── */
.plot-container { padding: 24px; height: 100%; overflow-y: auto; }
.plot-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.plot-header h3 { font-size: 14px; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.plot-controls { display: flex; gap: 4px; }
.plot-toggle {
    padding: 6px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
}
.plot-toggle.active { background: var(--accent); color: white; border-color: var(--accent); }
.plot-canvas {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-height: 300px; padding: 16px;
}

/* ─── MAP ─── */
.map-layout {
    position: fixed; inset: 0;
    display: none; z-index: 99999;
    background: var(--bg-primary);
}
.map-layout.show { display: flex; }
.map-view { flex: 1; height: 100%; }

.gps-bar {
    position: absolute; top: 16px; left: 16px;
    z-index: 100001;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    display: flex; align-items: center; gap: 16px;
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary);
    pointer-events: none;
}
.gps-info { display: flex; align-items: center; gap: 8px; }
.gps-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.gps-dot.pulse { animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.distance-badge {
    display: flex; align-items: center; gap: 6px;
    background: var(--accent);
    color: white; padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 700; font-size: 11px;
}

.map-compass {
    position: absolute; left: 16px; bottom: 80px;
    width: 64px; height: 64px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 50%;
    z-index: 100001;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.compass-needle {
    width: 2px; height: 36px;
    background: linear-gradient(to bottom, var(--danger) 50%, var(--text-muted) 50%);
}
.compass-n, .compass-s, .compass-e, .compass-w {
    position: absolute; font-size: 8px; font-weight: 800; color: var(--text-muted);
}
.compass-n { top: 6px; color: var(--danger); }
.compass-s { bottom: 6px; }
.compass-e { right: 8px; }
.compass-w { left: 8px; }

.map-sidebar {
    width: 320px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    overflow-y: auto;
    z-index: 100001;
}
.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.sidebar-header h3 { font-size: 13px; font-weight: 700; }
.sidebar-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex; flex-direction: column; gap: 8px;
}
.section-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-input {
    width: 100%; padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px; outline: none;
}
.sidebar-input:focus { border-color: var(--accent); }
.sidebar-btn {
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    flex: 1;
}
.sidebar-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.sidebar-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.sidebar-btn.full { flex: none; width: 100%; }
.sidebar-btn.danger { border-color: var(--danger); color: var(--danger); }
.sidebar-btn.danger:hover { background: rgba(239,68,68,0.1); }
.btn-row { display: flex; gap: 6px; }
.btn-row.thirds { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }

.depth-08 { border-color: var(--depth-08); color: var(--depth-08); }
.depth-08:hover { background: rgba(232,121,249,0.1); }
.depth-16 { border-color: var(--depth-16); color: var(--depth-16); }
.depth-16:hover { background: rgba(251,191,36,0.1); }
.depth-32 { border-color: var(--depth-32); color: var(--depth-32); }
.depth-32:hover { background: rgba(34,211,238,0.1); }

.num-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.num-btn {
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px; font-weight: 700;
    cursor: pointer; transition: all 0.15s;
}
.num-btn:hover { border-color: var(--accent); color: var(--accent); }

.sidebar-footer { padding: 16px 20px; margin-top: auto; }

/* ─── MODALS ─── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 200000;
    display: none; align-items: center; justify-content: center;
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 560px; max-width: 90vw;
    max-height: 80vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-content.modal-sm { width: 400px; }
.modal-content.modal-lg { width: 720px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

.btn-primary {
    padding: 10px 20px;
    background: var(--accent);
    border: none; border-radius: var(--radius-sm);
    color: white; font-weight: 600; font-size: 13px;
    cursor: pointer; transition: all 0.15s;
    display: flex; align-items: center; gap: 6px;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary); font-weight: 600; font-size: 13px;
    cursor: pointer; transition: all 0.15s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* Export Options */
.export-options { display: flex; flex-direction: column; gap: 8px; }
.export-option {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer; transition: all 0.15s;
}
.export-option:hover { border-color: var(--accent); }
.export-option input { width: 16px; height: 16px; accent-color: var(--accent); }
.depth-dot { width: 12px; height: 12px; border-radius: 50%; }

/* Column Manager Grid */
.col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Project Grid */
.project-grid { display: flex; flex-direction: column; gap: 8px; }

/* ─── SNIP EDITOR ─── */
.snip-editor { background: var(--bg-primary); border-radius: var(--radius-md); padding: 12px; margin-bottom: 16px; overflow: auto; max-height: 400px; max-width: 100%; }
.snip-editor canvas { display: block; height: auto; border-radius: var(--radius-sm); max-width: none; }
.snip-options { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.snip-color-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); }
.snip-controls { display: flex; gap: 4px; }
.color-input { width: 32px; height: 32px; border: none; border-radius: var(--radius-sm); cursor: pointer; }

/* ─── TOAST ─── */
.toast {
    position: fixed; top: 20px; left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 13px; font-weight: 500;
    color: var(--text-primary);
    z-index: 9999999;
    opacity: 0; pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    display: flex; align-items: center; gap: 10px;
    max-width: 400px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast i { color: var(--accent); }

/* Legacy toast class support */
.modern-toast { 
    position: fixed; top: 20px; left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 13px; font-weight: 500;
    color: var(--text-primary);
    z-index: 9999999;
    opacity: 0; pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    display: flex; align-items: center; gap: 10px;
}
.modern-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── ROW HIGHLIGHT ─── */
.row-highlight-pulse { animation: rowPulse 0.5s ease 3; }
@keyframes rowPulse {
    0%, 100% { background: transparent; }
    50% { background: var(--accent-light); }
}

/* ─── RESPONSIVE ─── */

/* iPad Landscape (1024px - 1366px) */
@media (min-width: 768px) and (max-width: 1366px) {
    .header-top { padding: 0 12px; height: 50px; }
    .header-center { padding: 0 12px; }
    .project-name-input { width: 240px; font-size: 13px; }
    .toolbar { padding: 0 12px; gap: 16px; }
    .tab-bar { padding: 0 12px; }
    .map-sidebar { width: 300px; }
    .modal-content { width: 500px; }
}

/* iPad Portrait (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .header-top { height: 52px; padding: 0 10px; }
    .header-left, .header-right { gap: 2px; }
    .project-name-input { width: 200px; }
    .toolbar { gap: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .toolbar-label { font-size: 9px; }
    .tab-btn { padding: 8px 14px; font-size: 12px; }
    .map-sidebar { width: 280px; }
    .sidebar-section { padding: 12px 16px; }
    .content-area { min-height: 0; }
}

/* Small tablets and large phones */
@media (max-width: 768px) {
    .header-top { padding: 0 8px; height: 48px; }
    .header-center { display: none; }
    .project-name-input { width: 160px; font-size: 12px; }
    .toolbar { gap: 8px; padding: 0 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .toolbar-label { display: none; }
    .toolbar-group { flex-shrink: 0; }
    .tab-btn { padding: 6px 12px; font-size: 11px; }
    .map-sidebar { width: 260px; }
    .modal-content { margin: 12px; width: calc(100vw - 24px); max-height: 90vh; }
    .col-grid { grid-template-columns: 1fr; }
}

/* Phone portrait */
@media (max-width: 480px) {
    .header-top { height: 44px; }
    .btn-icon { width: 36px; height: 36px; font-size: 13px; }
    .tab-btn { padding: 6px 10px; font-size: 11px; gap: 4px; }
    .map-sidebar { width: 100%; position: absolute; right: 0; top: 0; bottom: 0; }
    .sidebar-section { padding: 10px 12px; gap: 6px; }
    .plot-container { padding: 12px; }
}

/* ─── TOUCH OPTIMIZATION (iPad + Tablet) ─── */
@media (pointer: coarse) {
    .btn-icon { width: 44px; height: 44px; font-size: 16px; }
    .toolbar-btn { width: 42px; height: 42px; font-size: 14px; }
    .cell-input { height: 42px; font-size: 14px; padding: 0 10px; }
    .sidebar-btn { padding: 14px 12px; min-height: 46px; font-size: 13px; }
    .num-btn { padding: 14px; min-height: 46px; font-size: 14px; }
    .tab-btn { padding: 10px 18px; font-size: 13px; }
    .header-filter-input { padding: 6px 8px; font-size: 12px; }
    .data-table th { padding: 12px 10px; font-size: 11px; }
    .welcome-btn { padding: 16px 20px; font-size: 14px; }
    .btn-start-main { padding: 18px; font-size: 15px; }
    .sidebar-input { padding: 12px 14px; font-size: 14px; }
    .export-option { padding: 16px; }
    .modal-header h3 { font-size: 16px; }
}

/* ─── ORIENTATION HANDLING ─── */
@media (orientation: landscape) and (max-height: 500px) {
    /* Landscape on smaller devices - compact header */
    .header-top { height: 40px; }
    .tab-bar { height: 36px; }
    .toolbar { height: 40px; }
    .welcome-content { padding: 24px; }
    .welcome-content h1 { font-size: 18px; }
}

/* iPad Pro landscape */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    .map-sidebar { width: 320px; }
    .table-wrapper { font-size: 13px; }
}

/* Safe area for notch devices */
@supports (padding: env(safe-area-inset-top)) {
    .header-top { padding-top: env(safe-area-inset-top); }
    .app-layout { padding-bottom: env(safe-area-inset-bottom); }
    .map-layout { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) env(safe-area-inset-left); }
}

/* ─── CUSTOM SCROLLBAR ─── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── LEAFLET OVERRIDES ─── */
.leaflet-container { background: var(--bg-primary); }
.custom-marker-icon, .numbered-marker, .start-marker, .user-icon { background: none !important; border: none !important; }
