/* Emerald Relocation — transit wayfinding.
   Relocation is arriving somewhere unfamiliar and finding your way, so the
   visual language borrows from transit signage: one confident sans, colour
   that encodes case health rather than decorating, and generous space. */

:root {
  --canvas: #F4F6F8;
  --panel: #FFFFFF;
  --ink: #16233F;
  --ink-soft: #2C3A57;
  --muted: #6B7A93;
  --line: #E2E7EE;
  --line-soft: #EDF1F5;
  --accent: #0E7C6B;
  --accent-soft: #E6F2F0;
  --accent-dark: #0A6154;
  --amber: #C77B29;
  --amber-soft: #FBF1E3;
  --alert: #C0453C;
  --alert-soft: #FBECEA;

  --radius-card: 14px;
  --radius-control: 10px;
  --shadow-rest: 0 1px 2px rgba(22,35,63,.04), 0 1px 3px rgba(22,35,63,.03);
  --shadow-lift: 0 4px 16px rgba(22,35,63,.09);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); }

/* ---------- Layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }
.wrap-narrow { max-width: 420px; margin: 0 auto; padding: 24px; }

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--ink); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 14px; }
.topnav a:hover { color: var(--accent-dark); }
.topnav a.muted { color: var(--muted); font-weight: 500; }

/* ---------- Cards & headings ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-rest);
  padding: 20px;
  margin-bottom: 18px;
}
h1 { font-size: 21px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.section-label {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); margin: 0 0 10px;
}

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--ink-soft); margin-bottom: 5px;
}
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=tel], select, textarea {
  width: 100%;
  font-family: inherit; font-size: 15px;
  color: var(--ink); background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 10px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,124,107,.12);
}
::placeholder { color: #9AA7BA; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14.5px; font-weight: 600;
  border-radius: var(--radius-control);
  padding: 11px 18px;
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #0F1A30; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-soft); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-block { width: 100%; }

/* ---------- Flash ---------- */
.flash {
  border-radius: var(--radius-control);
  padding: 11px 14px; margin-bottom: 16px;
  font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent;
}
.flash-ok { background: var(--accent-soft); color: var(--accent-dark); border-color: rgba(14,124,107,.25); }
.flash-warn { background: var(--amber-soft); color: var(--amber); border-color: rgba(199,123,41,.3); }
.flash-error { background: var(--alert-soft); color: var(--alert); border-color: rgba(192,69,60,.3); }

/* ---------- Client list ---------- */
.client-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  margin-bottom: 8px;
  text-decoration: none; color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.client-row:hover { border-color: var(--accent); box-shadow: var(--shadow-lift); }
.client-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.client-name { font-weight: 600; font-size: 15px; }
.client-meta { font-size: 12.5px; color: var(--muted); }

.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: #4E8C6A; }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--alert); }

.pill {
  display: inline-block;
  font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 3px 11px;
  background: var(--accent-soft); color: var(--accent-dark);
}
.pill-muted { background: var(--line-soft); color: var(--muted); }
.badge {
  display: inline-block; min-width: 20px; text-align: center;
  font-size: 11.5px; font-weight: 700;
  background: var(--alert); color: #fff;
  border-radius: 999px; padding: 2px 7px;
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center; padding: 44px 20px;
  color: var(--muted); font-size: 14px;
}

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar form { display: flex; gap: 8px; flex: 1; min-width: 220px; }
.tabs { display: flex; gap: 6px; }
.tabs a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 13.5px; font-weight: 600; text-decoration: none;
  color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 15px; background: var(--panel);
}
.tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Checkboxes ---------- */
/* The whole label is the tap target — at least 44px tall on a phone. */
.check {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 4px;
  font-size: 14px; cursor: pointer; user-select: none;
}
.check input[type=checkbox] {
  width: 20px; height: 20px; margin: 0;
  accent-color: var(--accent); flex-shrink: 0;
}
.check-row { display: flex; gap: 14px 22px; flex-wrap: wrap; }

details > summary { min-height: 44px; display: flex; align-items: center; }

/* Visually hidden, still read by screen readers. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Login ---------- */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; }
.login-mark {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--ink); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin: 0 auto 14px;
}

/* Wide content scrolls inside its own container — the page never scrolls
   sideways on a phone. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 480px; }

@media (max-width: 640px) {
  .wrap { padding: 16px; }
  .topbar-inner { padding: 12px 16px; }
  .toolbar form { min-width: 100%; }
  .client-row { padding: 12px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
