/* Components carried over from reference/index.html (unchanged), minus fake payment-method buttons and the reference's own media queries (those live in layout.css). */
    body {
      font-family: Inter, system-ui, sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      display: flex;
    }
    .sidebar {
      width: 220px;
      background: var(--sidebar);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      position: fixed;
      top: 0; left: 0; bottom: 0;
      z-index: 50;
      transition: transform 0.2s;
    }
    .sidebar-brand {
      padding: 20px 18px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .logo-mark {
      width: 36px; height: 36px;
      background: var(--accent);
      border-radius: 10px;
      display: flex; align-items: center; justify-content: center;
      font-size: 1.1rem;
    }
    .sidebar-brand h1 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
    .sidebar-brand h1 span { color: var(--accent2); }
    .sidebar-brand small { display: block; font-size: 0.65rem; color: var(--muted); font-weight: 500; margin-top: 1px; }
    .nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
    .nav-item {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 12px;
      border-radius: 8px;
      color: var(--muted);
      cursor: pointer;
      font-size: 0.9rem;
      font-weight: 500;
      border: none;
      background: none;
      width: 100%;
      text-align: left;
      font-family: inherit;
      margin-bottom: 2px;
    }
    .nav-item:hover { background: rgba(var(--accent-rgb),0.1); color: var(--text); }
    .nav-item.active { background: rgba(var(--accent-rgb),0.18); color: var(--accent2); }
    .nav-item .icon { width: 20px; text-align: center; }
    .sidebar-foot {
      padding: 14px 16px;
      border-top: 1px solid var(--border);
      font-size: 0.75rem;
      color: var(--muted);
    }
    .main {
      margin-left: 220px;
      flex: 1;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }
    .topbar {
      height: 60px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 24px;
      background: rgba(255,255,255,0.9);
      position: sticky;
      top: 0;
      z-index: 40;
    }
    .topbar h2 { font-size: 1.15rem; font-weight: 700; }
    .topbar-actions { display: flex; align-items: center; gap: 10px; }
    .live-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 10px;
      border-radius: 999px;
      background: rgba(34, 197, 94, 0.12);
      border: 1px solid rgba(34, 197, 94, 0.4);
      color: var(--ok-text);
      font-size: 0.75rem;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
    }
    .live-pill .pulse {
      width: 7px; height: 7px;
      border-radius: 50%;
      background: #22c55e;
      animation: livePulse 1.4s infinite;
    }
    @keyframes livePulse {
      0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
      70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
      100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
    }
    .live-pill.off {
      background: rgba(var(--ink-rgb), 0.06);
      border-color: var(--border);
      color: var(--muted);
    }
    .live-pill.off .pulse { background: var(--muted); animation: none; }
    .activity-item {
      display: flex;
      gap: 10px;
      padding: 10px 0;
      border-bottom: 1px solid var(--hairline);
      font-size: 0.85rem;
    }
    .activity-item:last-child { border-bottom: none; }
    .activity-time {
      color: var(--muted);
      font-size: 0.72rem;
      width: 54px;
      flex-shrink: 0;
      padding-top: 2px;
    }
    .activity-text { flex: 1; line-height: 1.35; }
    #live-updated { font-size: 0.72rem; color: var(--muted); font-weight: 500; }
    .btn {
      padding: 8px 14px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--card);
      color: var(--text);
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
    }
    .btn:hover { border-color: var(--accent); }
    .btn-primary {
      background: var(--accent);
      border: none;
      color: var(--on-accent);
      font-weight: 700;
    }
    .btn-primary:hover { background: #2a343b; }
    .btn-success { background: var(--success); border: none; color: #052e16; }
    .btn-sm { padding: 6px 10px; font-size: 0.8rem; }
    .content { padding: 24px; flex: 1; }
    .view { display: none; }
    .view.active { display: block; }
    .stats {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 14px;
      margin-bottom: 20px;
    }
    .stat-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 16px 18px;
    }
    .stat-card .label {
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--muted);
      font-weight: 600;
      margin-bottom: 6px;
    }
    .stat-card .value {
      font-family: var(--display);
      font-size: 2.2rem;
      font-weight: 700;
      line-height: 1.1;
      letter-spacing: 0;
    }
    .stat-card .delta { font-size: 0.75rem; margin-top: 6px; color: var(--ok-text); }
    .grid-2 {
      display: grid;
      grid-template-columns: 1.2fr 1fr;
      gap: 16px;
      margin-bottom: 16px;
    }
    .panel {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      overflow: hidden;
    }
    .panel-h {
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .panel-h h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.02em; }
    .panel-b { padding: 12px 16px; }
    .schedule-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 0;
      border-bottom: 1px solid var(--hairline);
    }
    .schedule-item:last-child { border-bottom: none; }
    .schedule-time {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--accent2);
      width: 64px;
      flex-shrink: 0;
    }
    .schedule-info { flex: 1; min-width: 0; }
    .schedule-info .name {
      font-weight: 600;
      font-size: 0.9rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .schedule-info .meta { font-size: 0.75rem; color: var(--muted); }
    .badge {
      display: inline-flex;
      padding: 3px 8px;
      border-radius: 999px;
      font-size: 0.7rem;
      font-weight: 600;
      white-space: nowrap;
    }
    .badge-progress { background: rgba(44,84,112,0.12); color: var(--accent2); }
    .badge-pending { background: rgba(245,158,11,0.16); color: var(--warn-text); }
    .badge-done { background: rgba(34,197,94,0.16); color: var(--ok-text); }
    .badge-cancel { background: rgba(239,68,68,0.14); color: var(--bad-text); }
    .badge-paid { background: rgba(34,197,94,0.16); color: var(--ok-text); }
    .badge-unpaid { background: rgba(245,158,11,0.16); color: var(--warn-text); }
    #dash-map, #routes-map, #track-map {
      height: 280px;
      width: 100%;
      background: var(--deep);
    }
    #track-map { height: 360px; }
    #all-jobs-map {
      height: calc(100vh - 220px);
      min-height: 420px;
      width: 100%;
      background: var(--deep);
      border-radius: 0 0 var(--radius) var(--radius);
    }
    .map-layout {
      display: grid;
      grid-template-columns: 280px 1fr;
      gap: 0;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      overflow: hidden;
      background: var(--card);
    }
    .map-sidebar {
      border-right: 1px solid var(--border);
      max-height: calc(100vh - 160px);
      overflow-y: auto;
      background: var(--card);
    }
    .map-sidebar-h {
      padding: 12px 14px;
      border-bottom: 1px solid var(--border);
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--muted);
      position: sticky;
      top: 0;
      background: var(--card);
      z-index: 2;
    }
    .map-job-item {
      padding: 12px 14px;
      border-bottom: 1px solid var(--hairline);
      cursor: pointer;
      transition: background 0.15s;
    }
    .map-job-item:hover { background: rgba(var(--accent-rgb),0.08); }
    .map-job-item.active { background: rgba(var(--accent-rgb),0.15); }
    .map-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 10px 16px;
      padding: 10px 14px;
      border-bottom: 1px solid var(--border);
      font-size: 0.75rem;
      color: var(--muted);
    }
    .map-legend span { display: flex; align-items: center; gap: 6px; }
    .leg-dot {
      width: 10px; height: 10px; border-radius: 50%;
      display: inline-block;
    }
    .marker-pin {
      width: 28px; height: 28px;
      border-radius: 50% 50% 50% 0;
      transform: rotate(-45deg);
      border: 2px solid #fff;
      box-shadow: 0 2px 6px rgba(0,0,0,0.4);
      display: flex; align-items: center; justify-content: center;
    }
    .marker-pin span {
      transform: rotate(45deg);
      font-size: 0.65rem;
      font-weight: 800;
      color: #fff;
    }
    .status-bars { display: flex; flex-direction: column; gap: 10px; }
    .status-row { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
    .status-row .bar-label { width: 90px; color: var(--muted); }
    .status-row .bar-track {
      flex: 1; height: 8px; background: var(--deep); border-radius: 4px; overflow: hidden;
    }
    .status-row .bar-fill { height: 100%; border-radius: 4px; }
    .status-row .bar-n { width: 36px; text-align: right; font-weight: 600; }
    table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
    th {
      text-align: left;
      padding: 10px 12px;
      color: var(--muted);
      font-weight: 600;
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      border-bottom: 1px solid var(--border);
    }
    td {
      padding: 12px;
      border-bottom: 1px solid var(--hairline);
      vertical-align: middle;
    }
    tr:hover td { background: rgba(var(--accent-rgb),0.05); }
    .filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
    .filter-chip {
      padding: 6px 12px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: transparent;
      color: var(--muted);
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
    }
    .filter-chip.active {
      background: rgba(var(--accent-rgb),0.2);
      color: var(--accent2);
      border-color: var(--accent);
    }
    .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .form-group { margin-bottom: 14px; }
    .form-group label {
      display: block;
      font-size: 0.8rem;
      color: var(--muted);
      font-weight: 500;
      margin-bottom: 6px;
    }
    input, select, textarea {
      width: 100%;
      padding: 10px 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--deep);
      color: var(--text);
      font-size: 0.9rem;
      font-family: inherit;
    }
    input:focus, select:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.2);
    }
    .modal-bg {
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.6);
      z-index: 100;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }
    .modal-bg.show { display: flex; }
    .modal {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 16px;
      width: 100%;
      max-width: 480px;
      max-height: 90vh;
      overflow-y: auto;
      padding: 24px;
    }
    .modal h3 { font-size: 1.15rem; margin-bottom: 16px; }
    .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
    .empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 0.9rem; }
    .toast {
      position: fixed;
      bottom: 24px;
      right: 24px;
      background: #166534;
      color: #dcfce7;
      padding: 12px 18px;
      border-radius: 10px;
      font-size: 0.9rem;
      font-weight: 600;
      z-index: 200;
      opacity: 0;
      transform: translateY(12px);
      transition: opacity 0.25s, transform 0.25s;
      pointer-events: none;
    }
    .toast.show { opacity: 1; transform: translateY(0); }
    .menu-btn {
      display: none;
      background: none;
      border: 1px solid var(--border);
      color: var(--text);
      padding: 8px 10px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 1.1rem;
    }
    .route-stop {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 0;
      border-bottom: 1px solid var(--hairline);
    }
    .route-num {
      width: 28px; height: 28px;
      border-radius: 50%;
      background: var(--accent);
      color: white;
      display: flex; align-items: center; justify-content: center;
      font-size: 0.8rem; font-weight: 700;
      flex-shrink: 0;
    }
    .customer-card {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 14px;
      border-bottom: 1px solid var(--hairline);
    }
    .avatar {
      width: 42px; height: 42px;
      border-radius: 50%;
      background: var(--accent);
      display: flex; align-items: center; justify-content: center;
      font-weight: 700; font-size: 0.95rem;
      flex-shrink: 0;
    }
    .price-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
    .price-opt {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 14px;
      border: 1.5px solid var(--border);
      border-radius: 10px;
      background: var(--deep);
      cursor: pointer;
    }
    .price-opt.selected { border-color: var(--accent); background: rgba(var(--accent-rgb),0.1); }
    .price-opt .p { font-weight: 700; color: var(--accent2); }
    .sec-label {
      font-size: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--muted);
      margin-bottom: 8px;
    }
