/* ============================================
   USA Movers Load Board - Stylesheet
   Modern, White, PWA-Ready
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --white: #ffffff;
    --bg: #f7f8fa;
    --surface: #ffffff;
    --border: #e5e7eb;
    --border-light: #f0f1f3;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --accent: #ffd550;
    --accent-hover: #e6be00;
    --accent-light: #fff8e1;
    --accent-text: #111827;
    --blue: #2563eb;
    --blue-light: #eff6ff;
    --green: #059669;
    --green-light: #ecfdf5;
    --orange: #d97706;
    --orange-light: #fffbeb;
    --red: #dc2626;
    --red-light: #fef2f2;
    --purple: #7c3aed;
    --purple-light: #f5f3ff;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);
    --transition: 0.2s ease;
    --header-h: 60px;
    --bottom-nav-h: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    font-size: 16px;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

.hidden { display: none !important; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-text);
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.97); }

.btn-outline {
    background: var(--white);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-outline:hover { background: var(--accent-light); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 20px;
    flex-shrink: 0;
}

.btn-icon:hover { background: var(--accent-light); color: var(--text-primary); }
.btn-icon.active { background: var(--accent-light); color: var(--accent); }

/* --- Header --- */
.header {
    position: sticky;
    top: 0;
    /* Must exceed filter-bar (1100) so header dropdowns (notifications,
       search, settings) paint above it. gps-banner sits at 1050 and is
       below the header vertically so no conflict there. */
    z-index: 1200;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 12px;
}

.header-left { flex-shrink: 0; }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.logo-icon img {
    display: block;
    width: auto;
    height: 38px;
}

.logo-text h1 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.logo-tagline {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Search --- */
.search-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.search-input-wrap {
    display: none;
    position: relative;
}

.search-wrapper.open .search-input-wrap {
    display: flex;
}

.search-wrapper.open .search-toggle { display: none; }

.search-input {
    width: 200px;
    height: 36px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    background: var(--white);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition);
}

.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }

.search-clear {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    font-size: 16px;
}

/* --- Stats Bar --- */
.stats-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: var(--bg);
    border-radius: var(--radius);
    gap: 2px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* --- Tabs Navigation --- */
.tabs-nav {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: var(--header-h);
    z-index: 900;
}

.tabs-scroll {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 0;
}

.tabs-scroll::-webkit-scrollbar { display: none; }

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.tab:hover { background: var(--accent-light); color: var(--text-primary); }

.tab.active {
    background: var(--accent);
    color: var(--accent-text);
}

.tab.active .tab-count {
    background: rgba(0,0,0,0.12);
    color: var(--accent-text);
}

.tab-count {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--text-secondary);
}

/* --- Filter Bar --- */
.filter-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    position: relative;   /* establishes stacking context so dropdowns */
    z-index: 1100;        /* paint above the Leaflet map canvas below    */
}

.filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.filter-select {
    height: 36px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--white) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    min-width: 120px;
}

.filter-select:focus { border-color: var(--accent); }

.view-toggle {
    display: flex;
    gap: 2px;
    background: var(--bg);
    padding: 3px;
    border-radius: var(--radius-sm);
}

/* --- Main Content --- */
.main-content {
    padding: 16px 0 24px;
    min-height: 50vh;
}

/* --- Job views (.jobs-grid, .jobs-grid.list-view, .jobs-board-wrap) live in
       css/views/grid-view.css, list-view.css, table-view.css --- */

/* --- Skeleton Loading --- */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}

.skeleton-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, var(--bg) 25%, var(--border-light) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s infinite;
}

.skeleton-line.w40 { width: 40%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Empty State --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    text-align: center;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
}

/* --- Load More --- */
.load-more {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

/* --- Trackpost Panel --- */
.trackpost-panel {
    padding: 16px 0 24px;
}

/* --- Truck Post Board --- */
.tp-board-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0 16px;
    flex-wrap: wrap;
}
.tp-board-header h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.tp-board-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.tp-board-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 10-column grid: ☐ | Posted | Time Left | Truck Type | From | To | Space | Loading | Note | Actions */
.tp-board-head,
.tp-board-row {
    display: grid;
    grid-template-columns: 34px 70px 68px 120px 48px minmax(90px,1fr) 80px 110px minmax(80px,1fr) 110px;
    min-width: 794px;
    gap: 0 8px;
    align-items: center;
    padding: 10px 16px;
}

.tp-board-head {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.tp-board-row {
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
    font-size: 13px;
}
.tp-board-row:last-child { border-bottom: none; }
.tp-board-row:hover { background: var(--bg); }

.tp-col { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-posted    { color: var(--text-muted); font-size: 12px; }
.tp-time-left { color: var(--text-secondary); font-size: 12px; }
.tp-truck-type { font-weight: 600; color: var(--text-primary); }
.tp-from { font-weight: 700; color: var(--text-primary); font-size: 14px; }
.tp-to   { color: var(--text-secondary); }
.tp-space { font-weight: 600; color: var(--text-primary); }
.tp-loading { color: var(--text-secondary); font-size: 12px; }
.tp-note { color: var(--text-muted); font-size: 12px; }
.tp-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    overflow: visible;
    white-space: nowrap;
}

/* --- My Jobs panel: job rows --- */
.tp-job-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition);
}
.tp-job-row:last-child { border-bottom: none; }
.tp-job-row:hover { background: var(--bg); border-radius: var(--radius-sm); padding-left: 8px; padding-right: 8px; }

.tp-job-route {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    color: var(--text-muted);
}

.tp-city {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.tp-job-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tp-status {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tp-status.status-open       { background: #ecfdf5; color: #047857; }
.tp-status.status-pending    { background: #fff7ed; color: #c2410c; }
.tp-status.status-requested  { background: #eff6ff; color: #1d4ed8; }
.tp-status.status-accepted   { background: #ecfeff; color: #0e7490; }
.tp-status.status-in-transit { background: #eef2ff; color: #4338ca; }
.tp-status.status-completed  { background: #f0fdf4; color: #15803d; }
.tp-status.status-cancelled  { background: #fef2f2; color: #b91c1c; }

.tp-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 56px;
    text-align: right;
}

/* --- Trackpost header (My Jobs page) --- */
.trackpost-header { margin-bottom: 24px; padding-top: 20px; }
.trackpost-header h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.trackpost-header p  { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* Empty state inside truck board / my jobs */
.tp-empty-state {
    text-align: center;
    padding: 24px 0 8px;
    color: var(--text-muted);
}
.tp-empty-state svg { margin: 0 auto 10px; display: block; opacity: 0.4; }
.tp-empty-state p { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.tp-empty-state span { font-size: 12.5px; line-height: 1.5; }
.tp-empty-state strong { color: var(--text-primary); }

/* --- Post Job Modal Popup --- */
.post-panel {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: postPanelIn .2s ease;
}

@keyframes postPanelIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.post-panel.hidden {
    display: none;
}

.post-panel-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
    overflow: hidden;
    animation: postDialogIn .22s cubic-bezier(.2,.9,.3,1);
}

@keyframes postDialogIn {
    from { transform: scale(.96) translateY(12px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

.post-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.post-panel-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    flex-shrink: 0;
    transition: background var(--transition);
}

.post-panel-back:hover { background: var(--accent); }

.post-panel-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.post-panel-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px 20px 32px;
}

.trackpost-header {
    margin-bottom: 24px;
}

.trackpost-header h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.trackpost-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.trackpost-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

/* --- Form Styles --- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.form-row.align-end { align-items: flex-end; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group.flex-grow { flex: 1; }

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--white);
    outline: none;
    transition: border-color var(--transition);
    width: 100%;
}

.form-group textarea {
    height: auto;
    padding: 10px 12px;
    resize: vertical;
}

.form-group select {
    -webkit-appearance: none;
    appearance: none;
    background: var(--white) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    padding-right: 32px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

.post-form .btn-block { margin-top: 8px; height: 44px; font-size: 15px; }

/* --- Tracking Result --- */
.tracking-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 16px;
}

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

.tracking-job-id {
    font-size: 16px;
    font-weight: 700;
}

.tracking-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.tracking-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
}

.timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    position: relative;
}

.timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 11px;
    top: 36px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-step.completed::after { background: var(--green); }

.timeline-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--white);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-step.completed .timeline-dot {
    border-color: var(--green);
    background: var(--green);
}

.timeline-step.completed .timeline-dot::after {
    content: '';
    width: 8px;
    height: 5px;
    border-left: 2px solid var(--white);
    border-bottom: 2px solid var(--white);
    transform: rotate(-45deg) translateY(-1px);
}

.timeline-step.current .timeline-dot {
    border-color: var(--blue);
    background: var(--blue-light);
}

.timeline-step.current .timeline-dot::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blue);
}

.timeline-info { flex: 1; }

.timeline-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.tracking-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.track-detail {
    padding: 10px 12px;
    background: var(--white);
    border-radius: var(--radius-sm);
}

.track-detail-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.track-detail-value {
    font-size: 14px;
    font-weight: 600;
    margin-top: 2px;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.25s ease;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    font-size: 24px;
    width: 36px;
    height: 36px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-detail-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.modal-detail-value {
    font-size: 15px;
    font-weight: 600;
}

.modal-route-display {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.modal-route-point {
    flex: 1;
    text-align: center;
}

.modal-route-city {
    font-size: 18px;
    font-weight: 700;
}

.modal-route-state {
    font-size: 13px;
    color: var(--text-secondary);
}

.modal-route-zip {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}

.modal-route-arrow {
    color: var(--text-muted);
}

.modal-notes {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
}

.modal-notes-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.modal-notes-text {
    font-size: 14px;
    line-height: 1.6;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* --- Modal Tabs --- */
.modal-tabs {
    display: flex;
    gap: 4px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.modal-tabs::-webkit-scrollbar { display: none; }

.modal-tab {
    appearance: none;
    background: transparent;
    border: none;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
    font-family: inherit;
}
.modal-tab:hover { color: var(--text-primary); }
.modal-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

/* --- Modal Footer dynamic --- */
.modal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}
.modal-footer-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 22px;
}
.modal-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.footer-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.footer-status-pill.status-open       { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.footer-status-pill.status-pending    { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.footer-status-pill.status-requested  { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.footer-status-pill.status-accepted   { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.footer-status-pill.status-in-transit { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.footer-status-pill.status-completed  { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.footer-status-pill.status-cancelled  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.footer-status-note {
    font-size: 12.5px;
    color: var(--text-muted);
}

/* --- Card status modifiers (effective status) — moved to grid-view.css --- */

/* --- Danger button --- */
.btn-danger {
    background: #dc2626;
    color: #fff;
    border: 1px solid #dc2626;
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

/* --- Customer tab --- */
.modal-customer-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.modal-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--text-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.modal-customer-name {
    font-size: 16px;
    font-weight: 700;
}
.modal-customer-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.modal-detail-value a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--border);
}
.modal-detail-value a:hover { border-bottom-style: solid; }

/* --- Logistics tab --- */
.modal-logistics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.logistics-card {
    padding: 14px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.logistics-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.logistics-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-origin { background: #10b981; }
.dot-dest   { background: #ef4444; }
.logistics-card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
}
.logistics-addr {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.logistics-meta {
    font-size: 12.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.logistics-meta svg { vertical-align: -2px; }

/* --- Activity timeline --- */
.activity-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}
.activity-timeline::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-left: 40px;
    padding-bottom: 18px;
    min-height: 28px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.timeline-item.state-done .timeline-dot      { background: #10b981; border-color: #10b981; color: #fff; }
.timeline-item.state-pending .timeline-dot   { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.timeline-item.state-cancelled .timeline-dot { background: #ef4444; border-color: #ef4444; color: #fff; }
.timeline-item.state-future .timeline-dot    { background: #fff; border-style: dashed; }
.timeline-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.timeline-item.state-future .timeline-label { color: var(--text-muted); font-weight: 500; }
.timeline-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- Toast --- */
.toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    background: var(--accent);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    pointer-events: auto;
    white-space: nowrap;
}

.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.info { background: var(--blue); }

.toast.removing { animation: toastOut 0.25s ease forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-10px) scale(0.9); }
}

/* --- Notifications --- */
.notif-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notif-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    padding: 0;
}

.notif-btn:hover {
    background: var(--accent-light);
    color: var(--text-primary);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--red);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--white);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    animation: notifPulse 2s infinite;
}

@keyframes notifPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 100px);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: notifPanelIn 0.2s ease;
}

@keyframes notifPanelIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-panel.hidden { display: none; }

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.notif-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.notif-mark-all {
    background: none;
    border: none;
    color: var(--blue);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: inherit;
    transition: background var(--transition);
}

.notif-mark-all:hover { background: var(--blue-light); }

.notif-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 420px;
}

.notif-list::-webkit-scrollbar { width: 6px; }
.notif-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    background: var(--blue-light);
    transition: background var(--transition);
    position: relative;
}

.notif-item:hover { background: #dbeafe; }
.notif-item:last-child { border-bottom: none; }

.notif-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.notif-icon svg { width: 16px; height: 16px; }

.notif-blue  { background: var(--blue-light);   color: var(--blue); }
.notif-green { background: var(--green-light);  color: var(--green); }
.notif-amber { background: var(--orange-light); color: var(--orange); }
.notif-red   { background: var(--red-light);    color: var(--red); }
.notif-gray  { background: var(--accent-light); color: var(--text-secondary); }

.notif-body {
    flex: 1;
    min-width: 0;
    text-align: left;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 2px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.notif-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.notif-delete {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: all var(--transition);
    opacity: 0;
}

.notif-item:hover .notif-delete { opacity: 1; }

.notif-delete:hover {
    background: var(--red-light);
    color: var(--red);
    opacity: 1;
}

.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    gap: 8px;
}

.notif-empty svg { color: var(--text-muted); opacity: 0.5; }

.notif-empty p {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.notif-empty span { font-size: 12px; color: var(--text-muted); }

.notif-panel-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
    background: var(--bg);
}

.notif-reset {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
    transition: color var(--transition);
}

.notif-reset:hover { color: var(--text-primary); }

/* Mobile: full-width drop panel */
@media (max-width: 480px) {
    .notif-panel {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - var(--header-h));
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
    }
    .notif-list { max-height: calc(100vh - var(--header-h) - 100px); }
}

/* --- Bottom Navigation --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: var(--white);
    border-top: 1px solid var(--border);
    display: none;
    justify-content: space-around;
    align-items: stretch;
    height: var(--bottom-nav-h);
    padding-bottom: var(--safe-bottom);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition);
    padding: 4px 0;
}

.bottom-nav-item.active {
    color: var(--accent-text);
    border-top: 2.5px solid var(--accent);
}

.bottom-nav-item:hover { color: var(--text-primary); }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .skeleton-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    :root { --header-h: 56px; }

    .container { padding: 0 12px; }

    .bottom-nav { display: flex; }

    .tabs-nav { display: none; }

    .filter-row { flex-direction: column; gap: 8px; }
    .filter-group { width: 100%; }
    .filter-select { flex: 1; min-width: 0; }
    .view-toggle { align-self: flex-end; }

    .btn-label { display: none; }

    .search-wrapper.open .search-input {
        width: 160px;
    }

    .stats-grid { gap: 6px; }
    .stat-item { padding: 6px 4px; }
    .stat-value { font-size: 17px; }

    .skeleton-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        max-height: 90vh;
        border-radius: var(--radius-lg);
    }

    .modal-detail-grid { grid-template-columns: 1fr; }

    .modal-route-display { flex-direction: column; gap: 8px; }

    .modal-logistics { grid-template-columns: 1fr; }

    .modal-tab { padding: 12px 12px; font-size: 13px; }
    .modal-footer-actions .btn { flex: 1; min-width: 0; }

    .form-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .trackpost-section { padding: 16px; }

    .tracking-details { grid-template-columns: 1fr; }

    .tp-filter-row .filter-select { flex: 1; }
}

@media (max-width: 380px) {
    .logo-text h1 { font-size: 15px; }
    .logo-tagline { font-size: 10px; }
    .stat-value { font-size: 15px; }
    .stat-label { font-size: 10px; }
}

/* --- Print --- */
@media print {
    .header, .tabs-nav, .filter-bar, .bottom-nav, .install-banner, .modal-overlay, .toast-container { display: none !important; }
    body { padding: 0; background: white; }
    .job-card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}

/* --- Accessibility --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* --- Scrollbar (desktop) --- */
@media (min-width: 769px) {
    ::-webkit-scrollbar { width: 6px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
}

/* ── GPS Indicator (header pill) ─────────────────────────────────────────────── */
.gps-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid var(--border);
    transition: all var(--transition);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.gps-indicator:hover { background: var(--accent-light); border-color: var(--accent); }
.gps-indicator.ok        { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.gps-indicator.acquiring { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.gps-indicator.acquiring svg { animation: gpsIndPulse 1.4s ease-in-out infinite; }
.gps-indicator.error     { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
@keyframes gpsIndPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .45; }
}
@media (max-width: 480px) {
    .gps-indicator span { display: none; }
    .gps-indicator      { padding: 6px; }
}

/* ── GPS Status Banner ───────────────────────────────────────────────────────── */
/*
 * Visibility: opacity + visibility (NOT transform).
 * z-index 1150 — above filter-bar (1100) so it is never buried on mobile
 * when filter-bar shifts upward, but below the header (1200).
 * The banner lives just below the header via top: var(--header-h).
 */
.gps-banner {
    position: fixed;
    top: var(--header-h, 60px);
    left: 0;
    right: 0;
    z-index: 1150;
    display: flex;
    justify-content: center;
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}
.gps-banner.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.gps-banner-inner {
    position: relative;           /* anchors the absolute close button */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 40px 6px 16px;  /* extra right room for the × button */
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Close (×) button inside the GPS banner */
.gps-banner-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: .65;
    font-size: 15px;
    line-height: 1;
    padding: 3px 6px;
    border-radius: var(--radius-sm, 4px);
    transition: opacity .15s, background .15s;
}
.gps-banner-close:hover { opacity: 1; background: rgba(0,0,0,.08); }
.gps-banner.ok .gps-banner-inner        { background: #dcfce7; color: #15803d; }
.gps-banner.acquiring .gps-banner-inner { background: #fff7ed; color: #c2410c; }
.gps-banner.acquiring svg { animation: gpsPulse 1.4s ease-in-out infinite; }
.gps-banner.error .gps-banner-inner     { background: #fef2f2; color: #b91c1c; }
.gps-banner-time { font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }
@keyframes gpsPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .45; transform: scale(.92); }
}
/*
 * When the GPS banner is visible, shift the sticky tabs-nav downward so
 * it isn't covered by the banner (both sit at top: var(--header-h)).
 * The banner is ~30 px tall; match the transition to the banner fade.
 */
body.gps-banner-visible .tabs-nav {
    top: calc(var(--header-h) + 30px);
    transition: top .2s ease;
}

@media (max-width: 480px) {
    /* tabs-nav is display:none on small phones — push stats bar down instead */
    body.gps-banner-visible .stats-bar {
        padding-top: 30px;
        transition: padding-top .2s ease;
    }
    .gps-banner-inner { font-size: 12px; padding: 5px 36px 5px 12px; }
}

/* ── Settings Sheet ──────────────────────────────────────────────────────────── */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.settings-sheet {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 420px;
    max-width: 92vw;
    z-index: 2001;
    background: var(--surface);
    box-shadow: -12px 0 30px rgba(0, 0, 0, .12);
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.2, .7, .3, 1);
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
}
.settings-sheet.open { transform: translateX(0); }

.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 12px;
}
.sheet-head .user-card {
    flex: 1;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: none;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.sheet-head .user-avatar { width: 40px; height: 40px; font-size: 14px; }

.sheet-close {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sheet-close:hover { background: var(--bg); color: var(--text-primary); }

.sheet-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 18px 24px;
}

/* User card (in sheet head) */
.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    letter-spacing: .5px;
}
.user-name    { font-size: 14px; font-weight: 700; }
.user-meta    { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.user-company { font-size: 10px; color: var(--text-muted); margin-top: 1px; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }

/* Settings sections */
.setting-section {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 18px 0 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light, #f0f1f3);
}
.setting-section:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light, #f0f1f3);
    gap: 12px;
}
.setting-row:last-of-type { border-bottom: none; }
.setting-info  { flex: 1; min-width: 0; }
.setting-label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.setting-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

.setting-select {
    height: 36px;
    padding: 0 30px 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-primary);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    cursor: pointer;
}
.setting-select:focus { border-color: var(--accent); }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d5db;
    border-radius: 24px;
    transition: background .2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--green, #059669); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Driver info box */
.driver-info-box {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.driver-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}
.driver-info-row span   { color: var(--text-muted); }
.driver-info-row strong { font-weight: 600; color: var(--text-primary); }

/* Sign-out / danger button */
.da-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.da-btn-danger { background: var(--red-light, #fef2f2); color: var(--red, #dc2626); border: 1px solid #fecaca; }
.da-btn-danger:hover { background: var(--red, #dc2626); color: #fff; border-color: var(--red, #dc2626); }

/* Sheet menu */
.sheet-menu-list { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 4px; }
.sheet-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: left;
    width: 100%;
    transition: background var(--transition);
}
.sheet-menu-item:hover { background: var(--bg); }
.sheet-menu-item svg { color: var(--text-muted); flex-shrink: 0; }
.sheet-menu-item .chev { margin-left: auto; transition: transform .2s; }
.sheet-menu-item.open .chev { transform: rotate(90deg); }

.sheet-submenu {
    display: none;
    flex-direction: column;
    gap: 1px;
    margin: 2px 0 6px 36px;
    padding-left: 8px;
    border-left: 2px solid var(--border-light, #f0f1f3);
}
.sheet-submenu.open { display: flex; }
.sheet-submenu .sheet-menu-item {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}
.sheet-submenu .sheet-menu-item:hover { background: var(--accent-light); color: var(--text-primary); }

/* Settings button in bottom nav */
.bottom-nav-settings { border-left: 1px solid var(--border); }

@media (max-width: 480px) {
    .settings-sheet { width: 100%; max-width: 100%; }
}
