/* Themed to match the modern Justice Care booker (new-booker): light surfaces,
   Inter, indigo primary, soft shadows, rounded cards. */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-soft: #eef2ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / .04);
  --shadow: 0 1px 3px 0 rgb(15 23 42 / .06), 0 1px 2px -1px rgb(15 23 42 / .04);
  --shadow-lg: 0 10px 25px -5px rgb(15 23 42 / .1), 0 8px 10px -6px rgb(15 23 42 / .08);
  --radius: 8px;
  --radius-lg: 12px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px; margin: 0; background: var(--bg); color: var(--text);
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* ---- Login ---- */
#login { max-width: 380px; margin: 0 auto; padding: 15vh 20px 20px; }
#login .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
#login .logo-box {
  width: 44px; height: 44px; border-radius: var(--radius);
  background: #0f172a; color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 18px; flex-shrink: 0;
}
#login h1 { font-size: 18px; font-weight: 700; margin: 0; }
#login .sub { color: var(--text-subtle); font-size: 12px; margin: 2px 0 0; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px;
}
label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 12px 0 5px; }
input {
  font-size: 15px; padding: 11px 12px; width: 100%; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
button {
  font-family: inherit; font-size: 14px; font-weight: 600; padding: 11px 16px;
  border-radius: var(--radius); border: none; background: var(--primary);
  color: #fff; cursor: pointer; transition: background .15s;
}
button:hover { background: var(--primary-hover); }
button:disabled { opacity: .6; cursor: not-allowed; }
#loginBtn { width: 100%; margin-top: 18px; }
.err { color: var(--danger); font-size: 13px; margin: 10px 0 0; min-height: 18px; }

/* ---- App shell ---- */
#app { max-width: 720px; margin: 0 auto; }
.hdr {
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  position: sticky; top: 0; z-index: 10;
}
.hdr .logo-box {
  width: 36px; height: 36px; border-radius: var(--radius); background: #0f172a;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; flex-shrink: 0;
}
.hdr .who { font-weight: 700; font-size: 14px; }
.hdr .who small { display: block; font-weight: 500; color: var(--text-subtle); font-size: 11px; }
.hdr #refresh {
  margin-left: auto; background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); padding: 7px 11px; font-size: 15px; line-height: 1;
}
.hdr #refresh:hover { background: var(--primary-soft); color: var(--primary-hover); border-color: #c7d2fe; }
.hdr #logout {
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); padding: 7px 12px;
}
.hdr #logout:hover { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }

nav { display: flex; gap: 8px; padding: 14px 20px 0; }
nav button {
  flex: 1; background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
nav button.active { background: var(--primary-soft); color: var(--primary-hover); border-color: #c7d2fe; }

.tab { padding: 14px 20px 32px; }
.empty { color: var(--text-subtle); text-align: center; padding: 40px 0; font-size: 13px; }

/* ---- Route cards ---- */
.route {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); margin: 12px 0;
  overflow: hidden;
}
.route-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); background: #fbfbfe;
}
.route-badge {
  font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  color: var(--primary-hover); background: var(--primary-soft); border: 1px solid #c7d2fe;
  border-radius: 999px; padding: 4px 10px;
}
.route-meta { margin-left: auto; font-size: 12px; color: var(--text-subtle); font-weight: 600; }
.stops { list-style: none; margin: 0; padding: 0; }
.stop {
  display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--surface-2);
}
.stop:first-child { border-top: none; }
.stop .ord {
  flex: none; width: 24px; height: 24px; border-radius: 50%; background: #0f172a;
  color: #fff; font-size: 12px; font-weight: 700; display: flex;
  align-items: center; justify-content: center;
}
.stop .body { flex: 1; min-width: 0; }
.stop .t1 { font-weight: 600; }
.stop .t1 .tid { color: var(--text-subtle); font-weight: 500; font-size: 12px; }
.stop .t2 { color: var(--text-subtle); font-size: 12px; margin-top: 4px; }
.stop .when { color: var(--primary-hover); font-weight: 600; font-size: 12px; white-space: nowrap; }
.addr { display: flex; align-items: baseline; gap: 7px; font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.addr .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; transform: translateY(1px); }
.addr .dot.pu { background: var(--success); }
.addr .dot.do { background: var(--danger); }
.past-item { align-items: flex-start; }
.past-item .past-main { flex: 1; min-width: 0; }
.past-item .past-main .t1 { font-weight: 600; font-size: 13px; }

/* ---- Past list ---- */
.past-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 11px 14px; margin: 8px 0;
  display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.past-item .when { color: var(--text-muted); font-weight: 600; }
.past-item .tid { margin-left: auto; color: var(--text-subtle); font-size: 12px; }
