:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --line: #e6ebef;
  --line-strong: #d5dde3;
  --text: #16232b;
  --muted: #6b7c88;
  --faint: #9aa9b3;
  --primary: #0e9f8f;
  --primary-dark: #0b8074;
  --primary-soft: #e3f6f3;
  --accent: #ff7a59;
  --accent-soft: #ffe9e2;
  --ok: #1aa06d;
  --ok-soft: #e2f5ec;
  --warn: #d98a00;
  --warn-soft: #fbf0d8;
  --danger: #d64545;
  --danger-soft: #fbe4e4;
  --info: #3b7ddd;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,35,43,.05), 0 8px 24px rgba(16,35,43,.06);
  --shadow-sm: 0 1px 2px rgba(16,35,43,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-dark); }

.shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }

/* Sidebar --------------------------------------------------------------- */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 14px; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--primary), #26c2ad);
  display: grid; place-items: center; color: #fff; font-size: 22px;
  box-shadow: 0 6px 16px rgba(14,159,143,.35);
}
.brand b { display: block; font-size: 15px; letter-spacing: -.2px; }
.brand span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 14px 10px 6px; font-weight: 700; }
.nav button {
  display: flex; align-items: center; gap: 11px;
  background: none; border: 0; width: 100%;
  padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--muted); cursor: pointer;
  font-weight: 500; text-align: left; font-family: var(--font);
  transition: background .12s, color .12s;
}
.nav button .ic { width: 18px; text-align: center; font-size: 15px; }
.nav button:hover { background: var(--surface-2); color: var(--text); }
.nav button.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }

.side-foot { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.side-foot b { display: flex; align-items: center; gap: 7px; color: var(--text); font-weight: 600; font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.status-dot.ok { background: var(--ok); }
.side-foot span { display: block; margin-top: 3px; }

/* Main ------------------------------------------------------------------ */
.main { padding: 26px 30px 60px; max-width: 1240px; width: 100%; }
.view.hide { display: none; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.4px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font);
  transition: all .12s; white-space: nowrap;
}
.btn:hover { border-color: var(--faint); background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(14,159,143,.28); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); }
.btn.danger:hover { background: var(--danger-soft); }

/* Cards / metrics ------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.card .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.card .v { font-size: 27px; font-weight: 700; margin: 8px 0 2px; letter-spacing: -.6px; }
.card .s { font-size: 12px; color: var(--faint); }
.card .v small { font-size: 14px; color: var(--muted); font-weight: 600; }

.grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
@media (max-width: 900px){ .grid { grid-template-columns: 1fr; } .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; } .nav { flex-direction: row; flex-wrap: wrap; } .nav .nav-label { display:none; } .side-foot { display:none; } }

/* Panels / tables ------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 14px; margin: 0; }
.panel-head p { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.panel-body { padding: 6px 18px 16px; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table .strong { font-weight: 600; }
.table .sub { font-size: 11.5px; color: var(--muted); }

/* Chips / badges -------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.info { background: #e7f0fc; color: var(--info); border-color: transparent; }
.badge.primary { background: var(--primary-soft); color: var(--primary-dark); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: #d1502f; border-color: transparent; }
.seg { font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; }
.seg.PG { background: var(--primary-soft); color: var(--primary-dark); }
.seg.JL { background: var(--accent-soft); color: #d1502f; }
.seg.OTHER { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* Tabs / filters -------------------------------------------------------- */
.tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.tabs button { border: 0; background: none; padding: 6px 13px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: var(--font); }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 13px; font-family: var(--font); background: var(--surface); color: var(--text); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input.inline { width: 240px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.empty { text-align: center; color: var(--faint); padding: 40px 20px; font-size: 13px; }

/* Bars ------------------------------------------------------------------ */
.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; background: var(--primary); border-radius: 999px; }
.list-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item b { font-size: 13px; }
.list-item span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.list-item strong { font-size: 16px; font-weight: 700; }

/* Modal ----------------------------------------------------------------- */
.modal { position: fixed; inset: 0; background: rgba(16,35,43,.42); display: none; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.modal.open { display: flex; }
/* Pet + payment modals can open on top of the detail/booking modals */
#petModal, #paymentModal { z-index: 70; }

/* Remove number-input spinner arrows for a cleaner look */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.modal-card { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: 0 24px 64px rgba(16,35,43,.3); }
.modal-card.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.modal-head b { font-size: 15px; }
.modal-body { padding: 20px; }
.close { border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; }
.notice { background: var(--primary-soft); color: var(--primary-dark); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 12.5px; margin-bottom: 16px; }

/* Wizard ---------------------------------------------------------------- */
.steps { display: flex; gap: 6px; margin-bottom: 20px; }
.steps .step { flex: 1; text-align: center; font-size: 11px; font-weight: 600; color: var(--faint); padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.steps .step.active { color: var(--primary-dark); border-color: var(--primary); }
.steps .step.done { color: var(--ok); border-color: var(--ok); }
.pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.pick { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.pick:hover { border-color: var(--primary); background: var(--primary-soft); }
.pick.selected { border-color: var(--primary); background: var(--primary-soft); }
.pick b { font-size: 13px; display: block; margin-bottom: 2px; }
.pick span { font-size: 11.5px; color: var(--muted); }
.wizard-foot { display: flex; justify-content: space-between; margin-top: 20px; }

/* Toast ----------------------------------------------------------------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; box-shadow: 0 12px 32px rgba(0,0,0,.25); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Calendar -------------------------------------------------------------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 108px; padding: 8px; }
.cal-day .d { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.cal-day.today { border-color: var(--primary); background: var(--primary-soft); }
.cal-ev { font-size: 10.5px; padding: 3px 6px; border-radius: 6px; margin-bottom: 4px; background: var(--surface-2); border-left: 3px solid var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Login ----------------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); width: 100%; max-width: 380px; padding: 30px 28px; text-align: center; }
.login-card .logo { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 16px; background: linear-gradient(135deg, var(--primary), #26c2ad); display: grid; place-items: center; color: #fff; font-size: 30px; box-shadow: 0 10px 24px rgba(14,159,143,.4); }
.login-card h1 { font-size: 19px; margin: 0 0 2px; }
.login-card p { color: var(--muted); font-size: 12.5px; margin: 0 0 20px; }
.login-card .field { text-align: left; }
