/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--primary); }
.login-card { width: 100%; max-width: 400px; background: var(--white); border-radius: 20px; padding: 28px 24px; box-shadow: 0 20px 50px rgba(0, 0, 0, .2); }
.login-card img { display: block; width: 130px; margin: 0 auto 16px; }
.login-card h1 { font-size: 20px; text-align: center; }
.login-card > p { color: var(--ink-2); text-align: center; margin: 4px 0 20px; font-size: 14px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.field input { width: 100%; height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
.field input:focus { border-color: var(--primary); outline: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 18px; border-radius: var(--radius-sm); font-weight: 600; }
.btn-primary { background: var(--primary); color: var(--white); width: 100%; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.error { color: var(--primary); background: var(--primary-soft); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }
.demo-link { display: block; text-align: center; margin-top: 16px; color: var(--ink-2); font-size: 14px; }

/* Shell */
.shell { min-height: 100dvh; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
.sidebar { position: fixed; inset: 0 0 0 auto; width: 280px; max-width: 84vw; background: var(--white); border-left: 1px solid var(--line); z-index: 30; transform: translateX(100%); transition: transform .2s ease; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar.open { transform: none; }
.scrim { position: fixed; inset: 0; background: rgba(21, 35, 59, .4); z-index: 25; }
.side-logo { padding: 18px 20px 10px; }
.side-logo img { width: 92px; display: block; }
.side-nav { padding: 6px 10px 16px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: var(--radius-sm); text-align: right; color: var(--ink-2); font-weight: 500; }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item svg { width: 20px; height: 20px; flex: none; }
.side-foot { padding: 12px; border-top: 1px solid var(--line); }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 14px; background: var(--white); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 17px; flex: 1; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius-sm); }
.icon-btn:hover { background: var(--bg); }
.icon-btn svg { width: 22px; height: 22px; }
.demo-banner { background: var(--amber-soft); color: var(--amber); font-size: 13px; padding: 8px 16px; text-align: center; }
.content { padding: 16px; max-width: 1180px; margin: 0 auto; }

.bottom-nav { position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--white); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav button { height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--ink-3); }
.bottom-nav button.active { color: var(--primary); font-weight: 600; }
.bottom-nav svg { width: 22px; height: 22px; }

/* Cards */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { background: var(--white); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 28px; line-height: 1.2; font-weight: 700; }
.stat span { color: var(--ink-2); font-size: 13px; }
.stat.alert b { color: var(--primary); }
.section-title { font-size: 15px; font-weight: 600; margin: 22px 0 10px; }
.panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-weight: 600; }
.row-main span { color: var(--ink-2); font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { text-align: left; font-size: 14px; font-weight: 600; white-space: nowrap; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--primary-soft); color: var(--primary); }
.badge-grey { background: var(--bg); color: var(--ink-2); }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.tab { padding: 7px 14px; border-radius: 999px; background: var(--white); color: var(--ink-2); font-size: 14px; white-space: nowrap; border: 1px solid var(--line); }
.tab.active { background: var(--ink); border-color: var(--ink); color: var(--white); }

.map { position: relative; height: min(68vh, 560px); background: #EDEFF2; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.map svg { width: 100%; height: 100%; display: block; }
.map-legend { position: absolute; inset: 10px 10px auto auto; background: var(--white); padding: 8px 12px; border-radius: var(--radius-sm); font-size: 12px; display: flex; gap: 12px; box-shadow: var(--shadow); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-left: 5px; }

.soon { background: var(--white); border-radius: var(--radius); padding: 36px 20px; text-align: center; box-shadow: var(--shadow); }
.soon svg { width: 40px; height: 40px; color: var(--ink-3); margin-bottom: 8px; }
.soon h2 { font-size: 17px; margin-bottom: 4px; }
.soon p { color: var(--ink-2); font-size: 14px; }

@media (min-width: 600px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) {
  .shell { padding: 0 260px 0 0; }
  .sidebar { width: 260px; transform: none; }
  .scrim, .bottom-nav, .menu-btn { display: none; }
  .topbar { padding: 0 24px; }
  .content { padding: 24px; }
  .stats { grid-template-columns: repeat(6, 1fr); }
}

.map .mark { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; }
.map .mark svg { width: 28px; height: 30px; }
.map .mark span { font-size: 12px; font-weight: 600; background: var(--white); border-radius: 6px; padding: 0 5px; margin-top: 1px; box-shadow: 0 1px 3px rgba(21, 35, 59, .2); }

.pad { padding: 14px; }
.clickable { cursor: pointer; }
.clickable:hover { background: var(--bg); }
.back { color: var(--ink-2); margin-bottom: 12px; font-weight: 500; }
.detail-title { font-size: 17px; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--ink-2); }
.kv b { font-weight: 500; text-align: left; }
.doc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.doc { background: var(--bg); border: 1px dashed var(--line); border-radius: var(--radius-sm); height: 96px; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; }
.actions { display: flex; gap: 10px; margin-top: 12px; }
.actions .btn { flex: 1; }
.actions.top { margin-top: 12px; }
.btn-ghost { background: var(--white); border: 1.5px solid var(--line); }
.btn-small { height: 34px; padding: 0 12px; font-size: 13px; background: var(--primary-soft); color: var(--primary); }
.topup { margin-bottom: 12px; }
.topup .doc { margin: 10px 0; }
.switch-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font-weight: 500; }
.switch-row input { width: 22px; height: 22px; accent-color: var(--primary); }
.stage { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; margin-bottom: 4px; }
.stage b { grid-column: 1 / -1; font-size: 14px; }
.section-title.first { margin-top: 4px; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.low { color: var(--primary); }
.hint { color: var(--ink-3); font-size: 13px; margin-top: 12px; }
.toast { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; max-width: 90vw; }
.field input[type="search"] { height: 44px; }
@media (min-width: 960px) { .stats.three { grid-template-columns: repeat(3, 1fr); } .toast { bottom: 24px; } }

.empty { padding: 22px 14px; text-align: center; color: var(--ink-3); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters.top { margin-top: 12px; }
.filters input, .filters select, .field select, .field textarea { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); font: inherit; }
.filters input { flex: 1 1 140px; min-width: 0; }
.field select, .field textarea { width: 100%; }
.field textarea { padding: 10px; resize: vertical; }
.field input[type="file"] { padding: 9px; height: auto; }
.row-main span + span { font-size: 12px; color: var(--ink-3); }
.row-end.sub { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.doc { padding: 0; overflow: hidden; position: relative; width: 100%; cursor: pointer; }
.doc img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc span { position: absolute; inset: auto 0 0 0; background: rgba(21, 35, 59, .6); color: var(--white); font-size: 12px; padding: 2px; }
.doc:not(:has(img)) span { position: static; background: none; color: var(--ink-3); }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .85); z-index: 60; display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; }
#live-map { position: absolute; inset: 0; }
.map .map-legend { z-index: 500; }
.driver-mark { display: flex; flex-direction: column; align-items: center; }
.driver-mark span { font-size: 12px; font-weight: 600; background: var(--white); border-radius: 6px; padding: 0 5px; box-shadow: 0 1px 3px rgba(21, 35, 59, .25); }
.leaflet-container { font-family: var(--font); }
.mini-map { height: 190px; border-radius: var(--radius-sm); margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.grid2 .actions, .grid2 > .btn { grid-column: 1 / -1; }
.gap { height: 12px; }
.thread { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.bubble { align-self: flex-end; background: var(--white); padding: 8px 12px; border-radius: 14px; max-width: 80%; box-shadow: var(--shadow); }
.bubble.mine { align-self: flex-start; background: var(--primary); color: var(--white); }
.bubble small { display: block; font-size: 11px; opacity: .7; }
.previews { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.wheel-preview { width: 100%; max-width: 280px; display: block; margin: 0 auto; font-family: var(--font); }
.stage { margin-bottom: 8px; }
@media (min-width: 720px) { .grid2 { grid-template-columns: 1fr 1fr; } }
