        :root { 
            --bg-body: #eef3f8; --bg-card: #ffffff; 
            --primary: #243447; --accent: #2f7fd1; 
            --danger: #e74c3c; --success: #27ae60; 
            --warning: #f1c40f; --paused: #95a5a6; 
            --grey-btn: #7f8c8d; --border: #e2e8f0;
            --chat-other: #f8f9fa; --chat-me: #ffffff;
        }
        * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        body { font-family: 'Segoe UI', Tahoma, sans-serif; background: radial-gradient(circle at top, #f8fbff 0%, var(--bg-body) 45%, #e9eff6 100%); color: var(--primary); margin: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
        
        /* HEADER */
        header { 
            background: linear-gradient(135deg, #16202a 0%, #23384d 100%); color: white; padding: 8px 14px; 
            display: flex; justify-content: space-between; align-items: center; gap: 18px;
            min-height: 62px; flex-shrink: 0; box-shadow: 0 12px 24px rgba(10,20,30,0.12); z-index: 100;
        }
        header h1 { margin: 0; font-size: 1.02rem; letter-spacing: 0.3px; font-weight: 800;}
        .site-header { position: relative; }
        .brand-block { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
        .brand-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
        .header-nav-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
        .user-display { font-size: 0.75rem; color: rgba(255,255,255,0.7); font-style: italic; }
        .nav-items { display: flex; align-items: center; gap: 6px; }
        #connectionStatus { font-size: 0.74rem; font-weight: bold; color: #f1c40f; display: flex; align-items: center; gap: 4px; margin-right: 4px;}
        .status-online { color: #2ecc71 !important; }
        .status-error { color: #e74c3c !important; }
        .status-loading { color: #f1c40f !important; }
        
        .btn-nav { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.14); color: white; padding: 7px 10px; border-radius: 999px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; font-size: 0.78rem; backdrop-filter: blur(10px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08); }
        .btn-nav:hover { background: rgba(255,255,255,0.18); transform: translateY(-1px); }
        .btn-icon { font-size: 1rem; padding: 7px; line-height: 1; }
        .page-tabs { display: flex; align-items: center; gap: 8px; flex-shrink: 0; min-width: 0; }
        .page-tab-group { display: flex; gap: 6px; padding: 4px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); backdrop-filter: blur(10px); }
        .page-tab-group-overview { background: rgba(255,255,255,0.1); box-shadow: inset 0 1px 0 rgba(255,255,255,0.05); order: -1; }
        .page-tab-group-primary { background: rgba(255,255,255,0.16); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 18px rgba(10,20,30,0.12); order: 0; }
        .page-tab-group-secondary { background: rgba(255,255,255,0.06); order: 1; }
        .page-tab { background: transparent; color: rgba(255,255,255,0.76); border: 1px solid transparent; border-radius: 999px; padding: 7px 11px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
        .page-tab:hover { color: white; background: rgba(255,255,255,0.08); }
        .page-tab.active { background: white; color: #1f3142; border-color: rgba(255,255,255,0.5); box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
        .page-shell { flex: 1; min-height: 0; position: relative; }
        .page-view { display: none; height: 100%; min-height: 0; }
        .page-view.active { display: flex; flex-direction: column; }
        .page-scroll { flex: 1; overflow-y: auto; padding: 22px; }
        .page-scroll-home { overflow: hidden; padding-top: 16px; padding-bottom: 14px; }
        .page-scroll-narrow { max-width: 1100px; width: 100%; margin: 0 auto; }
        .page-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
        .page-title-row h2 { margin: 4px 0 0 0; font-size: 1.35rem; }
        .hero-panel { background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(246,250,255,0.98) 100%); border: 1px solid #dbe5ef; border-radius: 22px; padding: 18px 20px; display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 12px; box-shadow: 0 18px 34px rgba(30,39,46,0.05); }
        .hero-eyebrow { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: #7c8da0; font-weight: 800; }
        .overview-welcome { margin-top: 8px; font-size: 0.84rem; color: #58728d; font-weight: 600; }
        .hero-panel h2 { margin: 4px 0 6px 0; font-size: 1.36rem; }
        .hero-panel p { margin: 0; max-width: 620px; color: #617182; line-height: 1.4; font-size: 0.9rem; }
        .hero-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
        .overview-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
        .overview-card { background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%); border: 1px solid #dde5ee; border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 10px 22px rgba(15, 23, 42, 0.035); min-height: 98px; }
        .planning-summary-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
        .planning-summary-card { background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%); border: 1px solid #dde5ee; border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 10px 22px rgba(15, 23, 42, 0.035); min-height: 94px; }
        .overview-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: #7a8795; font-weight: 800; }
        .overview-value { font-size: 1.55rem; line-height: 1; font-weight: 800; color: #23384d; }
        .overview-meta { font-size: 0.72rem; color: #7a8795; }
        .dashboard-grid, .stats-page-grid, .settings-grid { display: grid; gap: 14px; }
        .dashboard-grid { grid-template-columns: 1.15fr 1.15fr 0.9fr 0.9fr; gap: 10px; }
        .stats-page-grid { grid-template-columns: 1.1fr 0.9fr; }
        .settings-grid { grid-template-columns: 1fr 1fr; }
        .planning-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
        .dashboard-panel { background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%); border: 1px solid #dde5ee; border-radius: 16px; padding: 13px 14px; box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04); min-height: 0; }
        .planning-panel { padding: 12px; }
        .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
        .panel-head h3 { margin: 0; font-size: 0.9rem; color: #223548; }
        .panel-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: #eef5fb; border: 1px solid #d7e5f2; border-radius: 999px; margin-right: 8px; font-size: 0.9rem; }
        .stack-list { display: flex; flex-direction: column; gap: 8px; }
        .stack-item { border: 1px solid #e3e8ef; border-radius: 12px; padding: 9px 10px; background: #fbfcfe; }
        .stack-item strong { display: block; color: #24374a; margin-bottom: 2px; font-size: 0.8rem; }
        .stack-item span { color: #6b7785; font-size: 0.74rem; line-height: 1.32; }
        .stack-item.empty { color: #91a0af; font-style: italic; text-align: center; padding: 12px 10px; }
        .stack-item.warning { border-left: 3px solid #f59e0b; }
        .stack-item.danger { border-left: 3px solid #e74c3c; }
        .stack-item.success { border-left: 3px solid #27ae60; }
        .metric-list { display: flex; flex-direction: column; gap: 8px; }
        .metric-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; background: #f8fafc; border: 1px solid #e5ebf2; }
        .metric-row-label { color: #4f5d6b; font-size: 0.78rem; }
        .metric-row-value { color: #223548; font-size: 0.9rem; font-weight: 800; }
        .planning-list { display: flex; flex-direction: column; gap: 8px; }
        .planning-item { border: 1px solid #dfe6ef; border-radius: 14px; padding: 8px 9px; background: #fcfdff; box-shadow: 0 8px 16px rgba(15, 23, 42, 0.03); }
        .planning-item-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 5px; }
        .planning-item-title { font-size: 0.9rem; font-weight: 800; color: #243447; }
        .planning-item-type { font-size: 0.7rem; color: #7b8794; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 800; }
        .planning-status-badge { padding: 3px 7px; border-radius: 999px; font-size: 0.68rem; font-weight: 800; background: #eef3f8; color: #5b6d7f; }
        .planning-status-badge.active { background: #e7f6ec; color: #1f7a46; }
        .planning-status-badge.done { background: #edf2f7; color: #64748b; }
        .planning-status-badge.not_started { background: #fff7e6; color: #b45309; }
        .planning-controls { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 4px; align-items: center; }
        .planning-slot-select { font-size: 0.8rem; }
        .planning-static-copy { font-size: 0.76rem; color: #718096; padding: 0 2px; }
        .planning-action-row { display: flex; gap: 6px; }
        .planning-supply-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
        .planning-supply-card { border: 1px solid #e4ebf2; border-radius: 12px; padding: 8px; background: #f8fafc; display: flex; flex-direction: column; gap: 6px; min-height: 92px; }
        .planning-supply-title { font-size: 0.73rem; font-weight: 800; color: #4a5c6f; text-transform: uppercase; letter-spacing: 0.04em; }
        .planning-supply-state { font-size: 0.72rem; color: #6b7785; }
        .planning-supply-card.pending { border-color: #f8d7a6; background: #fffaf0; }
        .planning-supply-card.delivered { border-color: #bee3cb; background: #f3fbf5; }
        .planning-supply-card.not_needed { opacity: 0.72; }
        .planning-supply-card.food.pending { border-color: #f3d6ab; background: #fff7ec; }
        .planning-supply-card.food.delivered { border-color: #d7e8bf; background: #f6fbef; }
        .planning-supply-card.drink_morning.pending,
        .planning-supply-card.drink_afternoon.pending { border-color: #cfe0ef; background: #f5f9fd; }
        .planning-supply-card.drink_morning.delivered,
        .planning-supply-card.drink_afternoon.delivered { border-color: #cfe5df; background: #f2faf7; }
        .planning-supply-actions { display: flex; gap: 5px; margin-top: auto; }
        .planning-btn { padding: 6px 8px; font-size: 0.72rem; border-radius: 10px; }
        .planning-btn.secondary { background: #eef3f8; color: #4a5568; border: 1px solid #d9e2ec; }
        .planning-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
        .planning-empty { color: #91a0af; font-style: italic; text-align: center; padding: 16px 12px; border: 1px dashed #d7e1ec; border-radius: 12px; }
        .startup-form-panel { display: block; margin-bottom: 10px; padding: 12px; border-radius: 12px; border: 1px solid #d8e3ef; background: linear-gradient(180deg, #f7fbff 0%, #eef5fb 100%); }
        .startup-form-title { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b; font-weight: 800; margin-bottom: 8px; }
        .startup-item { background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%); }
        .startup-item.ready { border-color: #dbe8db; }
        .startup-item.pending { border-color: #e4e9f0; }
        .startup-link { cursor: pointer; }
        .startup-link:hover { color: #2f7fd1; }
        .startup-meta-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
        .startup-meta-row span { font-size: 0.68rem; color: #6b7785; background: #f6f8fb; border: 1px solid #e6edf5; border-radius: 999px; padding: 2px 6px; }
        .startup-controls { margin-bottom: 0; }
        .settings-card-content { display: flex; flex-direction: column; gap: 10px; }
        .settings-panel { position: relative; overflow: hidden; }
        .settings-panel::after { content: ""; position: absolute; inset: auto -40px -40px auto; width: 120px; height: 120px; background: radial-gradient(circle, rgba(47,127,209,0.09) 0%, rgba(47,127,209,0) 70%); pointer-events: none; }
        .settings-hero { background: linear-gradient(135deg, #223548 0%, #2f4f6b 100%); color: white; border-radius: 22px; padding: 22px 24px; display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; box-shadow: 0 18px 36px rgba(28, 44, 61, 0.18); margin-bottom: 16px; }
        .settings-kicker { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.68); font-weight: 800; margin-bottom: 6px; }
        .settings-hero h3 { margin: 0 0 8px 0; font-size: 1.35rem; }
        .settings-hero p { margin: 0; color: rgba(255,255,255,0.82); max-width: 580px; line-height: 1.5; }
        .settings-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
        .settings-hero .btn-subtle { background: rgba(255,255,255,0.12); color: white; }
        .settings-copy { margin: 0; color: #6a7886; font-size: 0.84rem; line-height: 1.5; }
        .settings-label { font-size: 0.82rem; font-weight: 700; color: #4f5d6b; }
        .settings-inline-row { display: flex; gap: 8px; align-items: stretch; }
        .settings-eye-btn { width: 42px; height: auto; background: white; border: 1px solid #cbd5e0; box-shadow: inset 0 1px 0 rgba(255,255,255,0.9); }
        .settings-save-btn { width: auto; margin-top: 0; min-width: 54px; }
        .settings-actions { display: flex; flex-direction: column; gap: 10px; }

        /* LAYOUT */
        .main-container { display: flex; flex: 1; overflow: hidden; padding: 18px; gap: 15px; }
        .column { background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%); border-radius: 16px; box-shadow: 0 12px 28px rgba(0,0,0,0.05); display: flex; flex-direction: column; overflow: hidden; padding: 0; height: 100%; border: 1px solid var(--border); }
        .col-routes { flex: 1.4; } 
        .col-shops { flex: 1.4; } 
        .col-drivers { flex: 1.0; } 
        .col-logs { flex: 1.2; background: #ffffff; display: flex; flex-direction: column; border-left: 1px solid var(--border); } 
        .mobile-nav-bar { display: none; }

        /* MOBILE (< 900px) */
        @media (max-width: 900px) {
            body.dispatch-page-active { padding-bottom: 60px; }
            header { padding: 10px; min-height: auto; align-items: flex-start; flex-direction: column; }
            header h1 { font-size: 0.98rem; }
            .brand-meta { gap: 8px; }
            .user-display { display: none; }
            .header-nav-wrap { width: 100%; flex-direction: column; align-items: stretch; gap: 10px; }
            .nav-items { width: 100%; justify-content: space-between; }
            .btn-nav { flex: 1; }
            .page-tabs { flex-direction: column; align-items: stretch; }
            .page-tab-group { width: 100%; overflow-x: auto; }
            .page-tab { padding: 7px 12px; font-size: 0.78rem; }
            .page-scroll, .page-scroll-home { padding: 12px; overflow-y: auto; }
            .hero-panel { padding: 16px; flex-direction: column; }
            .hero-panel h2 { font-size: 1.25rem; }
            .hero-actions { width: 100%; justify-content: flex-start; }
            .settings-hero { padding: 18px; flex-direction: column; }
            .settings-hero-actions { width: 100%; }
            .overview-grid, .dashboard-grid, .stats-page-grid, .settings-grid, .planning-grid, .planning-summary-row { grid-template-columns: 1fr; }
            .main-container { padding: 0; gap: 0; }
            .column { border-radius: 0; border: none; width: 100%; display: none; } 
            .column.active-tab { display: flex; } 
            .mobile-nav-bar { display: none; position: fixed; bottom: 0; left: 0; width: 100%; height: 60px; background: white; border-top: 1px solid #ddd; z-index: 999; justify-content: space-around; align-items: center; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
            body.dispatch-page-active .mobile-nav-bar { display: flex; }
            .mob-nav-btn { background: none; border: none; flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #95a5a6; font-size: 0.65rem; cursor: pointer; } 
            .mob-nav-btn i { font-size: 1.2rem; margin-bottom: 2px; font-style: normal; }
            .mob-nav-btn.active { color: var(--accent); font-weight: bold; }
            .chat-input-area { padding-bottom: 20px; } 
        }

        /* HEADERS */
        .col-header { padding: 12px 12px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.88); backdrop-filter: blur(10px); gap: 5px; flex-shrink: 0; }
        .col-header h2 { margin: 0; font-size: 0.95rem; color: #2d3748; white-space: nowrap; }
        .sort-select { padding: 6px 8px; border-radius: 10px; border: 1px solid #d7e1ec; font-size: 0.75rem; background-color: #f8fbfe; cursor: pointer; max-width: 110px; color: #44515f; }
        .list-wrapper { flex: 1; overflow-y: auto; padding: 12px; -webkit-overflow-scrolling: touch; }
        
        /* CHAT */
        .chat-input-area { padding: 10px; border-top: 1px solid #e2e8f0; background: #fff; display: flex; gap: 8px; flex-shrink: 0; }
        .chat-input { padding: 8px 12px; border: 1px solid #cbd5e0; border-radius: 20px; background: #f8fafc; flex-grow: 1; outline: none; font-size: 0.9rem; }
        .chat-input:focus { border-color: var(--accent); background: #fff; }
        .btn-send { background: var(--primary); color: white; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-weight: bold; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
        .btn-send:hover { background: var(--accent); transform: scale(1.05); }

        /* LOGS */
        .log-item { margin-bottom: 8px; font-size: 0.85rem; clear: both; max-width: 90%; word-wrap: break-word; line-height: 1.3;}
        .log-item.auto { text-align: center; color: #95a5a6; font-size: 0.7rem; margin: 8px auto; width: 100%; font-style: italic;}
        .log-item.auto.phone { text-align: left; color: #44515f; font-size: 0.74rem; font-style: normal; background: #f6f7fb; border: 1px solid #dde3ec; border-left: 3px solid #90a4bd; border-radius: 10px; padding: 8px 10px; max-width: 100%; }
        .phone-log-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #4d6278; margin-bottom: 2px; }
        .phone-log-target { font-weight: 600; color: #2f3f51; margin-bottom: 2px; }
        .phone-log-details { color: #66717d; line-height: 1.35; }
        .phone-log-meta { color: #6b7280; font-size: 0.7rem; }
        .log-item.chat { padding: 8px 12px; border-radius: 12px; position: relative; display: flex; flex-direction: column; }
        .log-item.chat.other { background-color: var(--chat-other); color: #2c3e50; float: left; border-bottom-left-radius: 2px; margin-right: auto; }
        .log-item.chat.me { background-color: var(--chat-me); color: #2c3e50; border: 1px solid #e2e8f0; float: right; border-bottom-right-radius: 2px; margin-left: auto; text-align: right; }
        .chat-user { font-weight: 700; font-size: 0.7rem; color: var(--accent); margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.5px;}
        .me .chat-user { display: none; }
        .log-time { font-size: 0.65rem; color: #bdc3c7; align-self: flex-end; margin-top: 3px;}
        .me .log-time { align-self: flex-start; }
        .toast-stack { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 2500; pointer-events: none; }
        .toast { background: rgba(30, 39, 46, 0.96); color: white; padding: 10px 14px; border-radius: 10px; font-size: 0.82rem; box-shadow: 0 10px 18px rgba(0,0,0,0.18); border-left: 4px solid #94a3b8; opacity: 0; transform: translateY(8px); transition: opacity 0.2s ease, transform 0.2s ease; }
        .toast.show { opacity: 1; transform: translateY(0); }
        .toast.success { border-left-color: #22c55e; }
        .toast.info { border-left-color: #38bdf8; }

        /* GENERAL UI */
        .form-panel { background: #ebf8ff; padding: 10px; border-bottom: 1px solid #bee3f8; display: none; animation: slideDown 0.3s ease-out; }
        @keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
        .row { display: flex; gap: 5px; margin-bottom: 5px; }
        .driver-form-row { flex-wrap: wrap; gap: 6px; }
        .driver-form-field { min-width: 0; }
        .driver-form-phone { flex: 0.9; min-width: 110px; }
        .driver-form-seats { flex: 0 0 74px; min-width: 74px; }
        .driver-form-trunk { flex: 1 1 130px; min-width: 0; }
        .driver-form-submit { flex: 1 0 100%; }
        input, select { padding: 8px 10px; border: 1px solid #cbd5e0; border-radius: 10px; flex: 1; font-size: 0.85rem; background: rgba(255,255,255,0.95); }
        input:focus, select:focus, textarea:focus { outline: none; border-color: #9ec0e4; box-shadow: 0 0 0 4px rgba(47,127,209,0.08); }
        button { padding: 8px 12px; border: none; border-radius: 10px; cursor: pointer; font-weight: bold; transition: 0.2s; font-size: 0.8rem; }
        .btn-plus { background: var(--bg-body); color: var(--accent); border: 1px solid var(--border); width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; padding-bottom: 3px; flex-shrink: 0; box-shadow: 0 8px 14px rgba(47,127,209,0.08); }
        .btn-plus:hover { background: var(--accent); color: white; border-color: var(--accent); }
        .btn-primary { background: linear-gradient(135deg, #2f7fd1 0%, #5aa0df 100%); color: white; box-shadow: 0 10px 18px rgba(47,127,209,0.2); } 
        .btn-danger { background: var(--danger); color: white; } 
        .btn-success { background: var(--success); color: white; } 
        .btn-warning { background: var(--warning); color: #333; } 
        .btn-action { background: #e67e22; color: white; } 
        .btn-pause { background: #95a5a6; color: white; } 
        .btn-cancel { background: var(--grey-btn); color: white; }
        .btn-small { padding: 4px 8px; font-size: 0.75rem; margin-left: 2px; }
        .dispatch-btn { width: 100%; border-radius: 9px; padding: 4px 8px; min-height: 27px; font-size: 0.69rem; font-weight: 700; line-height: 1.1; box-shadow: none; }
        .dispatch-btn + .dispatch-btn { margin-top: 4px; }
        .dispatch-btn-primary { background: #edf4fb; color: #2f5f8a; border: 1px solid #d7e6f4; }
        .dispatch-btn-primary:hover { background: #e5eef8; }
        .dispatch-btn-neutral { background: #f5f7fa; color: #556476; border: 1px solid #dbe3ec; }
        .dispatch-btn-neutral:hover { background: #eef3f8; }
        .dispatch-btn-accent { background: #fff5ea; color: #9a632f; border: 1px solid #f0dcc4; }
        .dispatch-btn-accent:hover { background: #fdf0e2; }
        .dispatch-btn-success { background: #eef8f1; color: #2d7a4d; border: 1px solid #d7eadc; }
        .dispatch-btn-success:hover { background: #e7f5eb; }
        .dispatch-btn-warning { background: #f7f8fa; color: #687789; border: 1px solid #e0e5eb; }
        .dispatch-btn-warning:hover { background: #f1f4f7; }
        .dispatch-type-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 4px 0; }
        .dispatch-type-row .dispatch-btn { margin-top: 0; }
        .dispatch-btn-type-supply { background: #fff5ea; color: #7b5a36; border: 1px solid #f0dcc4; }
        .dispatch-btn-type-supply:hover { background: #fdf0e2; }
        .dispatch-btn-type-pickup { background: #eef6fb; color: #356783; border: 1px solid #d7e7f1; }
        .dispatch-btn-type-pickup:hover { background: #e6f1f8; }
        .dispatch-btn-type-drop { background: #eef8f4; color: #2f6b54; border: 1px solid #d8ebe2; }
        .dispatch-btn-type-drop:hover { background: #e6f3ed; }
        .dispatch-state-copy { font-size: 0.74rem; font-weight: 700; color: #516171; margin-bottom: 4px; }
        .dispatch-note-input { width: 100%; margin-bottom: 4px; font-size: 0.76rem; padding: 5px 8px; }
        .dispatch-select { width: 100%; margin: 4px 0 4px; font-size: 0.76rem; padding: 5px 8px; }
        .dispatch-driver-copy { font-size: 0.74rem; color: #516171; margin-bottom: 4px; }
        
        /* CARDS */
        .card { background: white; border: 1px solid var(--border); border-left: 4px solid transparent; padding: 10px 12px; margin-bottom: 10px; border-radius: 14px; box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04); transition: transform 0.1s, box-shadow 0.15s ease; }
        .card:hover { box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06); }
        .card-header { display: flex; justify-content: space-between; align-items: center; }
        .card-title-group { display: flex; align-items: center; gap: 6px; overflow: hidden; height: 26px; }
        .card-title { font-weight: 700; font-size: 0.95rem; color: #2d3748; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; }
        .header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
        
        .collapse-icon { 
            cursor: pointer; color: #cbd5e0; font-size: 1.2rem; font-weight: bold; 
            transition: transform 0.3s ease; display: flex; align-items: center; justify-content: center; 
            width: 20px; height: 20px; transform: rotate(90deg); line-height: 1; padding-bottom: 3px;
        }
        .collapse-icon.disabled { cursor: default; color: #e2e8f0; transform: rotate(0deg); padding-bottom: 0; }
        .card.collapsed .collapse-icon { transform: rotate(0deg); padding-bottom: 0; }
        .card.collapsed .route-body { display: none; }
        
        /* LABEL COUNT BADGE */
        .count-badge { display: none; background: #edf2f7; color: #4a5568; font-size: 0.7rem; padding: 2px 8px; border-radius: 12px; margin-left: 5px; font-weight: 600;}
        .card.collapsed .count-badge { display: inline-block; }

        /* ACTION BUTTONS */
        .btn-icon-action { width: 24px; height: 24px; border-radius: 4px; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; transition: 0.2s;}
        .btn-icon-action:hover { opacity: 0.8; }
        
        .btn-play { background: var(--success); color: white; }
        .btn-pause-sm { background: var(--paused); color: white; }
        
        /* SUBTLE CHECKMARK */
        .btn-check-subtle { 
            background: transparent; border: 1px solid transparent; 
            color: #bdc3c7; font-size: 1rem;
        }
        .btn-check-subtle:hover { color: var(--success); background: #f0fdf4; border-color: #dcfce7; }

        .status-chip { font-size: 0.65rem; padding: 2px 5px; border-radius: 4px; font-weight: bold; margin-left: 4px; display: inline-block; white-space: nowrap; }
        .chip-green { background: #dcfce7; color: #166534; }
        .chip-orange { background: #ffedd5; color: #9a3412; }
        .chip-grey { background: #f3f4f6; color: #4b5563; }
        .status-time { font-weight: normal; font-size: 0.65rem; margin-left: 3px; opacity: 0.8; }
        
        .btn-hulp { background: white; color: #64748b; font-size: 0.8rem; width: 20px; height: 20px; border-radius: 999px; border: 1px solid #d7dee7; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; line-height: 1; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
        .btn-hulp:hover { background: #f8fafc; border-color: #94a3b8; color: #334155; transform: scale(1.05); }
        @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
        
        /* PARTICIPANTS */
        .route-body { margin-top: 8px; }
        .participants-container { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 0; align-items: center; }
        .tag { background: #f6f8fb; color: #4a5568; font-size: 0.68rem; padding: 2px 6px; border-radius: 999px; display: flex; align-items: center; border: 1px solid #e2e8f0; }
        .tag-name { cursor: pointer; font-weight: 600; margin-right: 4px;}
        .tag-name:hover { color: var(--accent); text-decoration: underline; }
        .tag-close { cursor: pointer; color: #a0aec0; font-weight: bold; font-size: 0.9rem; line-height: 0.8; padding-left: 3px; border-left: 1px solid #ccc; }
        .tag-close:hover { color: var(--danger); }
        .btn-part-add { width: 20px; height: 20px; border-radius: 50%; border: 1px dashed #bbb; color: #bbb; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; line-height: 1; transition: 0.2s; padding-bottom: 2px; }
        .btn-part-add:hover { border-color: var(--accent); color: var(--accent); background: #f0f9ff; }
        .add-part-row { display: flex; gap: 0; margin-top: 1px; width: 100%; max-width: 250px; }
        .add-part-row input { font-size: 0.74rem; padding: 4px 7px; border-radius: 8px 0 0 8px; border-right: none;}
        .add-part-row button { font-size: 0.74rem; padding: 4px 8px; border-radius: 0 8px 8px 0; }
        .startup-members-box { margin-bottom: 5px; padding: 6px 7px; border-radius: 10px; border: 1px solid #e7edf4; background: linear-gradient(180deg, #fbfdff 0%, #f7fafc 100%); }
        .startup-members-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
        .startup-members-label { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.07em; color: #7b8794; font-weight: 800; }
        .startup-members-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #edf2f7; color: #526172; font-size: 0.66rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
        .startup-slot-wrap { display: inline-flex; align-items: center; gap: 6px; }
        .startup-slot-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: #7b8794; font-weight: 800; }
        .startup-slot-select { min-width: 118px; max-width: 138px; width: auto; font-size: 0.74rem; padding: 5px 24px 5px 8px; border-radius: 999px; background-color: #f8fbfe; }
        
        .status-ok { border-left-color: var(--success); }
        .status-not-started { border-left-color: #cbd5e1; background: #f8fafc; }
        .status-not-started .card-title { color: #64748b; }
        .status-help { border-left-color: var(--danger); background: #fff5f5; }
        .status-busy { border-left-color: var(--warning); background: #fffcf0; }
        .status-paused { border-left-color: var(--paused); background: #f2f4f6; color: #7f8c8d; }
        .status-free { border-left-color: var(--success); background: #f0fdf4; }
        .status-archived { border-left-color: #bdc3c7; background: #f8f9fa; opacity: 0.7; }
        .status-archived .card-title { color: #95a5a6; text-decoration: line-through; }
        .archive-block { margin-top: 12px; padding-top: 4px; }
        .archive-toggle { font-size: 0.76rem; color: #94a3b8; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
        .archive-toggle:hover { color: #64748b; }
        .archive-toggle summary { list-style: none; }
        .archive-toggle::-webkit-details-marker { display: none; }
        
        .dispatch-area { background: rgba(255,255,255,0.5); border-top: 1px dashed #cbd5e0; padding-top: 8px; margin-top: 8px; }
        .comment-display { background: #fff3cd; color: #856404; padding: 4px; border-radius: 4px; font-size: 0.8rem; margin-bottom: 6px; border: 1px solid #ffeeba; }
        .req-info { font-weight: bold; color: var(--danger); font-size: 0.85rem; margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center; }
        .delete-x { background: none; color: #cbd5e0; font-size: 1.3rem; padding: 0 4px; line-height: 1; cursor: pointer; border: none;}
        .delete-x:hover { color: var(--danger); }
        .notes-preview { margin-top: 8px; padding-top: 6px; border-top: 1px solid #e5e7eb; font-size: 0.76rem; color: #8b95a1; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .btn-subtle { background: #eef3f8; color: #4a5568; border: 1px solid #d7e1ec; }
        .btn-restore { background: #e8f7ed; color: #1f7a3e; border: 1px solid #bfe6cb; }

        /* MODALS */
        .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; display: none; justify-content: center; align-items: center; }
        .map-modal-content { background: white; width: 90%; height: 90%; max-width: 1200px; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
        .modal-header { padding: 15px 20px; background: #f8f9fa; border-bottom: 1px solid #ddd; display: flex; justify-content: space-between; align-items: center; }
        .close-modal { font-size: 1.8rem; cursor: pointer; color: #333; line-height: 0.8; }
        iframe { width: 100%; height: 100%; border: none; }
        .std-modal-content { background: white; width: 90%; max-width: 450px; border-radius: 12px; padding: 0; box-shadow: 0 10px 25px rgba(0,0,0,0.2); overflow: hidden; display: flex; flex-direction: column; max-height: 85vh;}
        .std-modal-body { padding: 20px; overflow-y: auto; }
        .menu-btn { display: flex; align-items: center; width: 100%; padding: 14px 15px; margin-bottom: 0; border: 1px solid #e2e8f0; border-radius: 14px; background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%); cursor: pointer; text-align: left; font-size: 0.95rem; color: #2c3e50; transition: 0.2s; box-shadow: 0 8px 16px rgba(15, 23, 42, 0.03); }
        .menu-btn:hover { background: #f8fbfe; border-color: #cfd9e5; transform: translateY(-1px); }
        .menu-btn i { font-size: 1.2rem; margin-right: 12px; width: 24px; text-align: center; }
        .menu-btn.danger { color: #e74c3c; border-color: #fadbd8; }
        .menu-btn.danger:hover { background: #fdedec; }
        .stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
        .stat-box { background: #f8f9fa; padding: 10px 12px; border-radius: 8px; text-align: center; border: 1px solid #e2e8f0; }
        .stat-val { font-size: 1.35rem; font-weight: bold; color: var(--accent); display: block; line-height: 1.1; }
        .stat-label { font-size: 0.72rem; color: #7f8c8d; text-transform: uppercase; letter-spacing: 0.4px; }
        .detail-edit-panel { padding-bottom: 14px; border-bottom: 1px solid #eee; margin-bottom: 14px; background: #f9f9f9; padding: 14px; border-radius: 8px; }
        .detail-inline-note { margin-bottom: 14px; padding: 12px; background: #fbfbfc; border: 1px solid #e5e7eb; border-radius: 8px; }
        .detail-inline-note h4 { margin: 0 0 8px 0; font-size: 0.9rem; color: #2c3e50; }
        .detail-inline-note textarea { width: 100%; min-height: 88px; resize: vertical; border: 1px solid #cbd5e0; border-radius: 8px; padding: 9px 10px; font-size: 0.9rem; background: white; }
        .detail-inline-note .btn-save { margin-top: 10px; }
        .phone-form { display: flex; flex-direction: column; gap: 12px; }
        .phone-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
        .phone-chip { background: #f4f7fb; color: #3b4b5c; border: 1px solid #d4dde8; border-radius: 999px; padding: 7px 12px; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
        .phone-chip.active { background: #e8f2ff; border-color: #90bdf4; color: #1e5fa8; }
        .phone-textarea { width: 100%; min-height: 92px; resize: vertical; border: 1px solid #cbd5e0; border-radius: 8px; padding: 10px; font-size: 0.9rem; font-family: inherit; }
        .phone-textarea::placeholder { font-family: inherit; }
        .phone-helper { font-size: 0.76rem; color: #7f8c8d; margin-top: 4px; }
        .phone-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
        .phone-context { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 9px 10px; font-size: 0.8rem; color: #4a5568; line-height: 1.4; }
        .phone-save-btn { padding: 9px 16px; font-size: 0.88rem; }
        .mem-name { font-size: 1.4rem; font-weight: bold; color: var(--primary); margin-bottom: 5px; text-align: center;}
        .mem-tak { font-size: 1rem; color: #7f8c8d; margin-bottom: 20px; font-weight: 500; text-align: center;}
        .mem-phone { font-size: 1.5rem; color: var(--accent); font-weight: bold; background: #ebf8ff; padding: 10px; border-radius: 8px; margin-bottom: 20px; display: block; text-decoration: none; text-align: center;}
        .detail-log-item { font-size: 0.85rem; padding: 10px 0; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; }
        .detail-log-time { color: #888; font-size: 0.75rem; margin-left: 10px;}

        /* Search styling */
        .search-bar { width: 100%; padding: 12px 15px; border: 2px solid #ddd; border-radius: 12px; font-size: 1rem; margin-bottom: 15px; outline: none; transition: 0.3s; }
        .search-bar:focus { border-color: var(--accent); }
        .search-results { max-height: 200px; overflow-y: auto; }
        .search-item { padding: 10px; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; color: #333; }
        .search-item strong { color: var(--accent); }

        /* EDIT FORM */
        .edit-form-group { margin-bottom: 10px; text-align: left; }
        .edit-label { font-size: 0.8rem; font-weight: bold; color: #555; display: block; margin-bottom: 3px; }
        .edit-input { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 6px; font-size: 0.9rem; }
        
        /* CLEAN SAVE BUTTON */
        .btn-save { 
            background: white; border: 1px solid #cbd5e0; color: #333;
            padding: 10px 15px; border-radius: 6px; font-weight: bold; 
            cursor: pointer; width: 100%; margin-top: 5px; transition: 0.2s; box-shadow: 0 6px 12px rgba(15, 23, 42, 0.04);
        }
        .btn-save:hover { background: #f8f9fa; border-color: #aaa; }

        /* AUTH MODALS */
        #authModal { z-index: 2000; background: linear-gradient(135deg, #1e272e 0%, #34495e 100%); }
        .auth-container { background: white; padding: 40px; border-radius: 20px; width: 90%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); text-align: center; position: relative; overflow: hidden; min-height: 300px; display: flex; flex-direction: column; justify-content: center; }
        .auth-title { font-size: 1.8rem; color: #2c3e50; margin-bottom: 10px; font-weight: 800; }
        .auth-sub { color: #7f8c8d; margin-bottom: 25px; font-size: 1rem; }
        .auth-input { padding: 15px; width: 100%; font-size: 1.1rem; border: 2px solid #e0e6ed; border-radius: 12px; margin-bottom: 15px; text-align: left; transition: 0.3s; outline: none; background: #f8f9fa; }
        .auth-input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1); }
        .btn-auth-lg { background: var(--accent); color: white; width: 100%; padding: 15px; font-size: 1.1rem; border-radius: 12px; border:none; cursor: pointer; font-weight: bold; transition:0.2s; box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2); margin-top: 10px; }
        .btn-auth-lg:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(52, 152, 219, 0.3); }
        .btn-auth-lg:disabled { background: #bdc3c7; cursor: not-allowed; transform: none; box-shadow: none; }
        .loading-spinner { border: 3px solid rgba(255,255,255,0.3); border-top: 3px solid #fff; border-radius: 50%; width: 20px; height: 20px; animation: spin 1s linear infinite; display: inline-block; vertical-align: middle; margin-right: 8px;}
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
