/* LDW design system — shared by the customer app, rider app and management console.
   Principles: neutral surfaces, one brand colour, small radii, quiet shadows, clear type hierarchy. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+Devanagari:wght@400;600&display=swap');

:root {
  --brand: #7a1f3d;
  --brand-hover: #621832;
  --brand-50: #f8eef1;
  --brand-100: #efd7de;
  --accent: #a8690d;
  --accent-50: #fbf3e1;
  --bg: #f6f5f3;
  --surface: #ffffff;
  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #6f6a65;
  --line: #e7e5e4;
  --line-2: #d6d3d1;
  --green: #15803d;
  --green-50: #ebf6ee;
  --red: #b42318;
  --red-50: #fdeceb;
  --blue: #1d4ed8;
  --blue-50: #eaf0fd;
  --amber: #92580a;
  --amber-50: #fdf4df;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, .06);
  --shadow: 0 4px 16px rgba(28, 25, 23, .08);
  --font: 'Inter', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.icon { flex: none; vertical-align: middle; }

/* ---- utilities ---- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.bold { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.hide { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.green-text { color: var(--green); }
.red-text { color: var(--red); }
.nowrap { white-space: nowrap; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--brand); cursor: pointer; border-radius: var(--radius-sm); padding: 9px 16px; min-height: 40px; font-weight: 600; font-size: 14px; background: var(--brand); color: #fff; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--bg); border-color: var(--ink-2); }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.accent:hover { background: #8a560a; border-color: #8a560a; }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn.sm { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.btn.lg { min-height: 48px; padding: 12px 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.icon-only { padding: 0; width: 40px; }
.btn.sm.icon-only { width: 32px; }

/* ---- surfaces ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.card.flat { box-shadow: none; }
.card.pad-sm { padding: 12px 14px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sep { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 4px 0; }

/* ---- tags & chips ---- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--amber-50); color: var(--amber); white-space: nowrap; }
.tag.green { background: var(--green-50); color: var(--green); }
.tag.red { background: var(--red-50); color: var(--red); }
.tag.blue { background: var(--blue-50); color: var(--blue); }
.tag.maroon { background: var(--brand-50); color: var(--brand); }
.tag.amber { background: var(--accent-50); color: var(--accent); }
.tag.gray { background: #efedeb; color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 500; font-size: 13.5px; white-space: nowrap; color: var(--ink-2); }
.chip:hover { border-color: var(--ink-2); text-decoration: none; }
.chip.on { background: var(--brand-50); color: var(--brand); border-color: var(--brand); font-weight: 600; }
.segmented { display: inline-flex; background: #ebe9e6; padding: 3px; border-radius: 10px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---- forms ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input { width: 100%; padding: 10px 12px; min-height: 42px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); }
.input:focus { border-color: var(--brand); outline: 2px solid var(--brand-100); outline-offset: 0; }
textarea.input { min-height: 80px; resize: vertical; }
select.input { appearance: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.error-text { color: var(--red); font-size: 13px; }
.notice { display: flex; gap: 10px; background: var(--amber-50); border: 1px solid #f0dcaa; color: #6f4707; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; }
.notice.info { background: var(--blue-50); border-color: #c9d8f8; color: #1e3a8a; }
.notice.success { background: var(--green-50); border-color: #bfe3cb; color: #14532d; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #faf9f8; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: #fcfbfa; }
.table tr:last-child td { border-bottom: 0; }

/* ---- feedback ---- */
.toasts { position: fixed; left: 0; right: 0; bottom: 88px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 14px; max-width: 440px; animation: pop .18s ease-out; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.overlay { position: fixed; inset: 0; background: rgba(28, 25, 23, .5); z-index: 150; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; padding: 20px; animation: slide .2s ease-out; }
.sheet.wide { max-width: 820px; }
@media (min-width: 700px) { .overlay { align-items: center; padding: 20px; } .sheet { border-radius: 14px; } }
@keyframes slide { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.skeleton { background: linear-gradient(90deg, #eeecea 25%, #f6f5f3 50%, #eeecea 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); min-height: 84px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.meter { height: 8px; background: #ebe9e6; border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .4s; }
.meter.warn > i { background: var(--accent); }
.meter.full > i { background: var(--red); }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .icon { color: var(--line-2); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
