/* =====================================================================
   OmegaStore design system — shared by customer app and partner panels
   ===================================================================== */
:root {
  --brand: #f8cb46;
  --brand-2: #ffd95a;
  --brand-ink: #3d2f00;
  --green: #0c831f;
  --green-2: #0a7019;
  --green-soft: #e9f6ec;
  --green-line: #bfe3c6;
  --ink: #1c1c1c;
  --ink-2: #3f4349;
  --muted: #6b7280;
  --muted-2: #9aa0a8;
  --line: #ececec;
  --line-2: #f3f3f3;
  --bg: #f5f7fb;
  --card: #ffffff;
  --red: #e23744;
  --red-soft: #fdecee;
  --blue: #2563eb;
  --blue-soft: #e8f0ff;
  --orange: #f08c00;
  --orange-soft: #fff4e0;
  --purple: #7c3aed;
  --purple-soft: #f2ebff;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --sh-sm: 0 1px 3px rgba(16, 24, 40, 0.06);
  --sh: 0 4px 18px rgba(16, 24, 40, 0.07);
  --sh-lg: 0 18px 50px rgba(16, 24, 40, 0.18);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --header-h: 76px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
::selection { background: var(--brand); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.bold { font-weight: 700; }
.strike { text-decoration: line-through; color: var(--muted-2); }
.green { color: var(--green); }
.red { color: var(--red); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.sm { gap: 6px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px; font-weight: 700; font-size: 14px;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease, opacity .15s;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-2); }
.btn-brand { background: var(--brand); color: var(--brand-ink); }
.btn-brand:hover { background: var(--brand-2); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-outline { border: 1.5px solid var(--line); background: #fff; color: var(--ink); }
.btn-outline:hover { border-color: #d6d6d6; background: #fafafa; }
.btn-outline-green { border: 1.5px solid var(--green); color: var(--green); background: var(--green-soft); }
.btn-outline-red { border: 1.5px solid #f5c2c7; color: var(--red); background: #fff; }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-lg { height: 52px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center;
  background: #fff; border: 1px solid var(--line); font-size: 17px; flex: none;
}
.icon-btn:hover { background: var(--line-2); }
.link { color: var(--green); font-weight: 700; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 14px; resize: vertical; }
.input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(12, 131, 31, .12); }
.input-group { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.input-group:focus-within { border-color: var(--green); }
.input-group .prefix { padding: 0 0 0 14px; color: var(--muted); font-weight: 600; }
.input-group .input { border: 0; box-shadow: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }

.switch { position: relative; width: 46px; height: 26px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #d5d8de; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch .slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 99px;
  border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: #d8d8d8; }
.chip.active { border-color: var(--green); background: var(--green-soft); color: var(--green); }

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-sm); border: 1px solid var(--line-2); }
.card-pad { padding: 18px; }
.card-title { font-size: 16px; font-weight: 800; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em; background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.orange { background: var(--orange-soft); color: #b06200; }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.dark { background: var(--ink); color: #fff; }
.badge.brand { background: var(--brand); color: var(--brand-ink); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted-2); }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .em { font-size: 56px; margin-bottom: 10px; }
.empty h3 { color: var(--ink); font-size: 18px; margin-bottom: 6px; }

.skeleton { background: linear-gradient(90deg, #eef0f3 25%, #f6f7f9 37%, #eef0f3 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 12px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(0,0,0,.12); border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255,255,255,.4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loader { display: grid; place-items: center; min-height: 50vh; }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast {
  background: #1f2329; color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--sh-lg);
  display: flex; gap: 10px; align-items: center; animation: toastIn .25s ease; pointer-events: auto; width: 100%;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }

/* ---------------------------------------------------------------- modal & drawer */
.backdrop { position: fixed; inset: 0; background: rgba(15, 18, 24, .5); z-index: 1000; display: grid; place-items: center; padding: 16px; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: var(--r-xl); width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  box-shadow: var(--sh-lg); animation: popIn .22s cubic-bezier(.2,.9,.3,1.2);
}
.modal.lg { width: min(760px, 100%); }
.modal.sm { width: min(400px, 100%); }
@keyframes popIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h3 { font-size: 18px; font-weight: 800; }
.modal-body { padding: 4px 20px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }
@media (max-width: 640px) {
  .backdrop.sheet { place-items: end center; padding: 0; }
  .backdrop.sheet .modal { border-radius: 22px 22px 0 0; width: 100%; max-height: 92vh; animation: sheetIn .25s ease; }
  @keyframes sheetIn { from { transform: translateY(40px); opacity: .6; } }
}

/* ---------------------------------------------------------------- map bits */
.leaflet-container { font-family: var(--font); background: #eef0ea; }
.map-pin { width: 44px; height: 44px; position: relative; }
.map-pin span {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 38px; height: 38px; border-radius: 50% 50% 50% 0;
  rotate: -45deg; background: #fff; border: 3px solid var(--ink); display: grid; place-items: center; box-shadow: 0 6px 14px rgba(0,0,0,.25);
}
.map-pin span i { rotate: 45deg; font-style: normal; font-size: 18px; }
.map-pin.green span { border-color: var(--green); }
.map-pin.brand span { border-color: #e0a800; background: #fff8dc; }
.map-pin.red span { border-color: var(--red); }
.rider-pin { width: 52px; height: 52px; position: relative; display: grid; place-items: center; }
.rider-pin .pulse { position: absolute; inset: 0; border-radius: 50%; background: rgba(12,131,31,.25); animation: pulse 1.8s ease-out infinite; }
.rider-pin .body { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--green); border: 3px solid #fff; display: grid; place-items: center; font-size: 20px; box-shadow: 0 6px 16px rgba(12,131,31,.45); }
.rider-pin.blue .body { background: var(--blue); box-shadow: 0 6px 16px rgba(37,99,235,.45); }
.rider-pin.blue .pulse { background: rgba(37,99,235,.25); }
@keyframes pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: var(--sh); }
.leaflet-popup-content { margin: 10px 14px; font-size: 13px; }

/* ---------------------------------------------------------------- auth screen (panels) */
.auth-screen { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-art { background: radial-gradient(1200px 500px at 0% 0%, #ffe68a, transparent), linear-gradient(135deg, var(--brand), #f5b301); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; color: var(--brand-ink); position: relative; overflow: hidden; }
.auth-art.green { background: radial-gradient(900px 500px at 0% 0%, #36b24a, transparent), linear-gradient(135deg, #0c831f, #054d11); color: #fff; }
.auth-art.dark { background: radial-gradient(900px 500px at 0% 0%, #334155, transparent), linear-gradient(135deg, #111827, #0b1220); color: #fff; }
.auth-art h1 { font-size: 44px; font-weight: 800; line-height: 1.05; max-width: 460px; }
.auth-art .big-emoji { font-size: 140px; position: absolute; right: -10px; bottom: 40px; opacity: .9; filter: drop-shadow(0 20px 30px rgba(0,0,0,.2)); }
.auth-art .feat { display: flex; gap: 10px; align-items: center; font-weight: 600; margin-top: 10px; opacity: .92; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-form .box { width: min(400px, 100%); }
.auth-form h2 { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.demo-box { border: 1.5px dashed var(--green-line); background: var(--green-soft); border-radius: 12px; padding: 12px; }
@media (max-width: 860px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 22px; min-height: 220px; }
  .auth-art h1 { font-size: 28px; }
  .auth-art .big-emoji { font-size: 90px; bottom: 10px; }
}

.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 24px; letter-spacing: -0.04em; }
.logo .mark { width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: var(--brand); display: grid; place-items: center; font-size: 19px; letter-spacing: 0; }
.logo b { color: var(--green); }

/* ---------------------------------------------------------------- panel shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.side .logo { padding: 4px 8px 16px; font-size: 21px; }
.side .logo .mark { width: 32px; height: 32px; font-size: 17px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.nav-item .ic { width: 22px; text-align: center; font-size: 17px; }
.nav-item:hover { background: var(--line-2); }
.nav-item.active { background: var(--green-soft); color: var(--green); }
.nav-item .count { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 99px; display: grid; place-items: center; padding: 0 6px; }
.side .side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 66px; display: flex; align-items: center; gap: 14px; padding: 0 26px; background: rgba(245,247,251,.85); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 20px; font-weight: 800; }
.content { padding: 24px 26px 60px; max-width: 1400px; width: 100%; }
.mobile-nav { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { padding: 0 16px; height: 58px; }
  .topbar h1 { font-size: 17px; }
  .content { padding: 16px 16px 96px; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 60;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; overflow-x: auto;
  }
  .mobile-nav .nav-item { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 8px; min-width: 60px; text-align: center; position: relative; }
  .mobile-nav .nav-item .count { position: absolute; top: 0; right: 6px; margin: 0; }
}

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; }
.kpi { background: #fff; border-radius: 16px; padding: 16px 18px; border: 1px solid var(--line-2); box-shadow: var(--sh-sm); position: relative; overflow: hidden; }
.kpi .k-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .k-val { font-size: 26px; font-weight: 800; margin-top: 4px; letter-spacing: -0.02em; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .k-ic { position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--line-2); }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #fafbfc; }
.thumb { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 22px; background: var(--line-2); flex: none; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 8px 14px; border-radius: 99px; font-weight: 700; font-size: 13px; color: var(--ink-2); background: #fff; border: 1.5px solid var(--line); white-space: nowrap; cursor: pointer; }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab .n { opacity: .7; margin-left: 4px; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar { width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #2fb344, var(--green)); min-height: 4px; position: relative; transition: height .4s ease; }
.bars .bar.today { background: linear-gradient(180deg, #ffd95a, #f0b400); }
.bars .bar-val { font-size: 11px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.bars .bar-label { font-size: 11px; color: var(--muted); font-weight: 600; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item::before { content: ''; position: absolute; left: -20px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--green); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item .t { font-size: 12px; color: var(--muted); }
