/* Easy Pool AI — Design A "Refined Pro" (family design system)
   Light theme · white cards · hairline borders · deep navy text ·
   EasySoftware gradient ONLY on the logo, primary buttons and the active nav item. */

:root {
  --bg: #edf2f7;
  --card: #ffffff;
  --line: #e2e8f0;
  --ink: #0f2b4c;
  --muted: #64748b;
  --faint: #94a3b8;
  --grad: linear-gradient(135deg, #2563eb, #0891b2 48%, #7c3aed);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 43, 76, 0.05), 0 4px 14px rgba(15, 43, 76, 0.05);
  --green-bg: #e7f6ee; --green: #157347;
  --blue-bg: #e8f0fe;  --blue: #2563eb;
  --amber-bg: #fdf3e0; --amber: #b45309;
  --red-bg: #fdecec;   --red: #b91c1c;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.num, .money, .count { font-variant-numeric: tabular-nums; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; color: var(--ink); }

#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(237, 242, 247, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { width: 34px; height: 34px; flex: none; }
.brand { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.topbar .spacer { flex: 1; }
.lang-toggle { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.lang-toggle button { border: 0; background: transparent; padding: 6px 12px; font-weight: 600; font-size: 13px; color: var(--muted); }
.lang-toggle button.on { background: var(--ink); color: #fff; }

/* ---------- layout ---------- */
main { flex: 1; padding: 16px 16px 110px; }
.sec-label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 20px 2px 8px; }
.sec-label:first-child { margin-top: 2px; }
h1.page-title { font-size: 26px; margin: 2px 0 4px; letter-spacing: -0.02em; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 6px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px;
}
.row-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px; }
.row-card:active { transform: scale(0.995); }

.avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; flex: none; }
.grow { flex: 1; min-width: 0; }
.name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--faint); flex: none; transition: transform 0.15s; }
.chev.open { transform: rotate(90deg); }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.blue { background: var(--blue-bg); color: var(--blue); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.gray { background: #eef2f6; color: var(--muted); }

.progress { font-weight: 700; font-size: 15px; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: 15px; padding: 11px 16px; min-height: 46px; }
.btn.primary { background: var(--grad); border: 0; color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; min-height: 46px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #2563eb33; border-color: #2563eb; }
.searchbar { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; margin-bottom: 12px; }
.searchbar input { border: 0; flex: 1; padding: 12px 0; background: transparent; }
.searchbar input:focus { outline: none; }
.datebar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.datebar .btn { min-height: 42px; padding: 8px 12px; }
.datebar input[type="date"] { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); min-height: 42px; }

/* ---------- stops ---------- */
.stop { border-top: 1px solid var(--line); padding: 12px 2px 4px; }
.stop:first-child { border-top: 0; }
.stop .sname { font-weight: 600; font-size: 15px; }
.stop .saddr { color: var(--muted); font-size: 13px; margin: 2px 0 6px; }

/* ---------- bottom nav ---------- */
.bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; z-index: 40;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; padding: 6px 0 4px; border-radius: 12px;
}
.bottomnav button svg { width: 23px; height: 23px; }
.bottomnav button.active { color: var(--ink); }
.bottomnav button.active .nav-ico { background: var(--grad); color: #fff; }
.nav-ico { display: flex; align-items: center; justify-content: center; width: 44px; height: 28px; border-radius: 999px; }

/* ---------- Easy pill + panel ---------- */
.easy-pill {
  position: fixed; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 45;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--ink); font-weight: 700; font-size: 14px; border-radius: 999px; padding: 11px 16px; min-height: 48px;
}
.sheet-veil { position: fixed; inset: 0; background: rgba(15, 43, 76, 0.4); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 82dvh; overflow: auto; }
.sheet h2 { margin: 0 0 6px; font-size: 19px; }
.sheet .close { float: right; }

/* ---------- v3 format: date strip, shift clock, day map, reports ---------- */
/* Icon sizing (carried from POOL2): inline SVGs carry no width/height, so
   without a rule they render at the browser default (300x150) and blow up
   their control — the Customers search magnifier and "New customer" +
   icon did exactly that. */
.searchbar svg { width: 19px; height: 19px; flex: none; color: var(--muted); }
.btn svg { width: 18px; height: 18px; flex: none; }
.chev svg { width: 20px; height: 20px; display: block; }
.easy-pill svg { width: 19px; height: 19px; flex: none; }
.chip svg { width: 13px; height: 13px; flex: none; }

.strip-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; margin-bottom: 14px; }
.strip-month { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px 2px; }
.strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.daybtn { flex: 0 0 52px; border: 1px solid transparent; background: transparent; border-radius: 12px; padding: 7px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--ink); }
.daybtn:hover { background: #f1f5f9; }
.day-dow { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.day-num { font-size: 17px; font-weight: 800; }
.day-mon { font-size: 11px; color: var(--muted); }
.daybtn.on { background: var(--grad); color: #fff; }
.daybtn.on .day-dow, .daybtn.on .day-mon { color: rgba(255, 255, 255, 0.85); }
.daybtn.is-today:not(.on) { border-color: var(--blue); }
.daybtn.is-today:not(.on) .day-num { color: var(--blue); }
.strip-row { display: flex; gap: 8px; margin-top: 10px; }
.strip-row .btn { flex: 1; }

.clock-row { display: flex; gap: 10px; }
.clock-row .btn { flex: 1; }
.clockBtn { color: #fff; border: 0; font-weight: 700; }
.clockBtn.clockIn, .clockBtn.clockBack { background: #157347; }
.clockBtn.clockMeal { background: #b45309; }
.clockBtn.clockOut { background: #b91c1c; }
.clockBtn:active { opacity: 0.85; }

.pinRow { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line); }
.pinRow:first-child { border-top: 0; }
.pin { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }

.report-sheet { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 18px; margin-bottom: 12px; }
.report-header { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 8px; border-bottom: 2px solid var(--ink); }
.report-business { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.report-title { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.dosage-row { display: flex; gap: 8px; margin-bottom: 8px; }
.dosage-row input { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fff; min-height: 46px; }
.dosage-row .dos-rm { flex: none; padding: 11px 14px; font-size: 20px; line-height: 1; }
@media print {
  .topbar, .bottomnav, .easy-pill, #rp-back, #rp-edit, #rp-print { display: none !important; }
  main { padding: 0; }
  .report-sheet { box-shadow: none; border: 0; }
}

/* ---------- sign in ---------- */
.signin-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px 16px 60px; }
.signin-logo { width: 84px; height: 84px; margin: 0 auto 14px; display: block; }
.signin-title { text-align: center; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.signin-sub { text-align: center; color: var(--muted); margin: 6px 0 22px; font-size: 14px; }
.error { background: var(--red-bg); color: var(--red); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.demo-note { background: #fff8e6; border: 1px solid #f3dfae; color: #7c5a06; border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-top: 14px; line-height: 1.45; }

.kv { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.kv:first-child { border-top: 0; }
.kv .k { color: var(--muted); flex: none; }
.kv .v { font-weight: 600; text-align: right; word-break: break-word; }
.empty { color: var(--muted); text-align: center; padding: 26px 10px; font-size: 14px; }
.letter { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; color: var(--faint); margin: 14px 2px 6px; }
a.tel { color: var(--blue); text-decoration: none; font-weight: 600; }

/* ---------- subscribe page ---------- */
.page-wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 60px; }
.plan-price { font-size: 42px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.plan-price small { font-size: 16px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.includes { list-style: none; margin: 12px 0 0; padding: 0; }
.includes li { display: flex; gap: 9px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.includes li:first-child { border-top: 0; }
.includes svg { width: 17px; height: 17px; color: var(--green); flex: none; }
.notice-banner { background: #fff8e6; border: 1px solid #f3dfae; color: #7c5a06; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; margin-bottom: 12px; }
/* Giant clickable free-month banner on /subscribe: the whole banner is the
   CTA — it jumps to the account form below. */
.free-banner {
  display: block; text-align: center; text-decoration: none;
  background: var(--grad); color: #fff;
  font-size: 30px; font-weight: 800; letter-spacing: 0.04em;
  border-radius: var(--radius); padding: 20px 14px; margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.free-banner:active { opacity: 0.85; }
