/* SP Beauty & Spa - Design System v4 (owner-approved, static/flat) */
:root {
  /* Palette */
  --ivory: #F6F7EB;
  --card: #FFFFFF;
  --charcoal: #393E41;
  --blue: #3F88C5;
  --teal: #44BBA4;
  --vermilion: #E94F37;

  --text: #393E41;
  --text-2: #6b7075;
  --border: rgba(57, 62, 65, 0.10);

  --radius: 18px;
  --radius-sm: 12px;
  /* Soft UI elevation scale (layered, subtle depth) */
  --shadow-sm: 0 1px 2px rgba(57, 62, 65, 0.05), 0 1px 3px rgba(57, 62, 65, 0.04);
  --shadow: 0 2px 6px rgba(57, 62, 65, 0.05), 0 6px 16px rgba(57, 62, 65, 0.06);
  --shadow-hover: 0 6px 14px rgba(57, 62, 65, 0.08), 0 14px 32px rgba(57, 62, 65, 0.10);
  --tap: 44px;

  /* Category accent colors */
  --cat-hair: #3F88C5;
  --cat-face: #44BBA4;
  --cat-laser: #E94F37;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --header-h: 56px;
  --tabbar-h: 64px;
  --sidenav-w: 240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--ivory);
  color: var(--text);
  font-family: "Noto Sans Lao", "Noto Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75; /* Lao script needs taller line-height */
  -webkit-font-smoothing: antialiased;
}

.num { font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-weight: 700; line-height: 1.5; color: var(--charcoal); }
button { font-family: inherit; cursor: pointer; }

/* ---- Top utility header ---- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex; align-items: center; gap: 10px;
  padding-left: 16px; padding-right: 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(57,62,65,.04);
}
#topbar .brand { font-weight: 800; letter-spacing: -.01em; color: var(--charcoal); margin-right: auto; }

.tag {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  border: 1px solid transparent;
}
.tag.active { background: rgba(68,187,164,.15); color: var(--teal); border-color: rgba(68,187,164,.35); }
.tag.locked { background: rgba(233,79,55,.12); color: var(--vermilion); border-color: rgba(233,79,55,.35); }

.sync-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2);
}
.sync-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.sync-dot.offline::before { background: var(--text-2); }
.sync-dot.pending::before { background: var(--vermilion); }

.user-badge {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue); color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}

/* ---- Layout regions ---- */
#app {
  padding-top: calc(var(--header-h) + var(--safe-top));
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  min-height: 100%;
}
.screen { display: none; padding: 16px; max-width: 1100px; margin: 0 auto; }
.screen.is-active { display: block; }

/* ---- Cards ---- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 14px;
}
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat {
  position: relative; overflow: hidden;
  border-radius: var(--radius); padding: 18px; color: #fff; box-shadow: var(--shadow-sm);
}
.stat .label { font-size: 13px; opacity: .92; font-weight: 500; }
.stat .value { font-size: 28px; font-weight: 800; margin-top: 6px; letter-spacing: -.01em; }
.stat.blue { background: var(--blue); }
.stat.teal { background: var(--teal); }
.stat.charcoal { background: var(--charcoal); }
.stat.vermilion { background: var(--vermilion); }

/* ---- Buttons ---- */
.btn {
  min-height: var(--tap); padding: 0 18px; border: none; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: transform .15s ease-out, box-shadow .2s ease, background .15s ease, opacity .15s ease-out;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--vermilion); color: #fff; box-shadow: 0 3px 10px rgba(233,79,55,.28); }
.btn.primary:hover { box-shadow: 0 5px 16px rgba(233,79,55,.36); }
.btn.blue { background: var(--blue); color: #fff; box-shadow: 0 3px 10px rgba(63,136,197,.26); }
.btn.blue:hover { box-shadow: 0 5px 16px rgba(63,136,197,.34); }
.btn.ghost { background: var(--card); color: var(--charcoal); border: 1px solid var(--border); }
.btn.ghost:hover { background: rgba(57,62,65,.04); border-color: rgba(57,62,65,.2); }
.btn.block { width: 100%; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); font-family: inherit; font-size: 16px;
}
.field input { padding: 0 14px; }
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

/* ---- Bottom tab bar (mobile/tablet) ---- */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex; background: var(--card); border-top: 1px solid var(--border);
}
#tabbar button {
  flex: 1; background: none; border: none; color: var(--text-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; min-height: var(--tap);
}
#tabbar button svg { width: 22px; height: 22px; }
#tabbar button.is-active { color: var(--vermilion); }

/* Desktop side nav (>=1024px) */
#sidenav { display: none; }
@media (min-width: 1024px) {
  #tabbar { display: none; }
  #sidenav {
    display: flex; flex-direction: column; gap: 4px;
    position: fixed; top: calc(var(--header-h) + var(--safe-top)); bottom: 0; left: 0;
    width: var(--sidenav-w); background: var(--card);
    border-right: 1px solid var(--border); padding: 12px;
  }
  #sidenav button {
    position: relative;
    display: flex; align-items: center; gap: 12px; width: 100%;
    background: none; border: none; color: var(--text-2);
    padding: 11px 14px; border-radius: var(--radius-sm); font-size: 15px; text-align: left;
    transition: background .15s ease, color .15s ease;
  }
  #sidenav button:hover { background: rgba(57,62,65,.04); color: var(--charcoal); }
  #sidenav button svg { width: 20px; height: 20px; }
  #sidenav button.is-active { background: rgba(63,136,197,.12); color: var(--blue); font-weight: 600; }
  #sidenav button.is-active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); }
  #app { padding-left: var(--sidenav-w); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Sheet-style modal ---- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(57,62,65,.45);
  display: flex; align-items: flex-end; justify-content: center;
  visibility: hidden; pointer-events: none;
}
.sheet-backdrop.open { visibility: visible; pointer-events: auto; }
.sheet {
  background: var(--card); width: 100%; max-width: 560px;
  border-radius: 22px 22px 0 0; padding: 22px;
  padding-bottom: calc(22px + var(--safe-bottom));
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(57,62,65,.18);
}
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 999px; background: rgba(57,62,65,.16); margin: -4px auto 16px; }
.sheet h2 { font-size: 20px; letter-spacing: -.01em; }
@media (min-width: 1024px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 22px; box-shadow: var(--shadow-hover); }
  .sheet::before { display: none; }
}

/* ---- Auth / PIN ---- */
#auth-screen {
  position: fixed; inset: 0; z-index: 80; background: var(--ivory);
  display: none; flex-direction: column; align-items: center; justify-content: center; padding: 24px;
}
#auth-screen.show { display: flex; }
#auth-screen .card { width: 100%; max-width: 380px; }
.pin-row { display: flex; gap: 10px; justify-content: center; margin: 12px 0; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); }
.pin-dot.filled { background: var(--charcoal); border-color: var(--charcoal); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { min-height: 56px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card); font-size: 22px; font-weight: 600; }

.muted { color: var(--text-2); font-size: 14px; }
.hidden { display: none !important; }

.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.screen-head h1 { margin: 0; }
.head-actions { display: flex; gap: 8px; }

/* ---- Filter controls (chips + search) ---- */
#menu-filter { display: none; }
@media (min-width: 1024px) { #menu-filter { display: block; } }
.filter-controls {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 14px 16px; margin-bottom: 14px;
}
.filter-group { display: flex; flex-direction: column; gap: 8px; }
.filter-label { font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--text-2); font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { border-color: rgba(57,62,65,.22); color: var(--charcoal); }
.chip.active { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.filter-search {
  min-height: 40px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px;
  font-family: inherit; font-size: 15px; min-width: 220px; background: var(--card); color: var(--text);
}
.filter-search:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
#fsheet .filter-controls { flex-direction: column; align-items: stretch; border: none; box-shadow: none; padding: 0; gap: 16px; margin: 0 0 4px; }
#fsheet .filter-search { width: 100%; }

/* ---- Data table (desktop) ---- */
.data-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.data-table thead th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .04em; padding: 13px 16px;
  background: #fbfbf5; border-bottom: 1px solid var(--border);
  position: sticky; top: calc(var(--header-h) + var(--safe-top)); z-index: 1;
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: rgba(57,62,65,.025); }
.ta-c { text-align: center !important; }
.ta-r { text-align: right !important; }
.td-name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.td-sub { font-size: 12.5px; color: var(--text-2); margin-top: 3px; max-width: 440px; line-height: 1.5; }
.td-price { font-weight: 700; color: var(--charcoal); font-size: 15px; }
.cat-tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.cat-tag[data-cat="hair"] { background: rgba(63,136,197,.12); color: var(--cat-hair); }
.cat-tag[data-cat="face"] { background: rgba(68,187,164,.15); color: var(--cat-face); }
.cat-tag[data-cat="laser"] { background: rgba(233,79,55,.12); color: var(--cat-laser); }
.data-table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---- Filter FAB (mobile, menu screen) ---- */
.fab {
  position: fixed; right: 18px; z-index: 45;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 18px);
  width: 56px; height: 56px; border-radius: 18px; border: none;
  background: var(--vermilion); color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(233,79,55,.42); transition: transform .15s ease, box-shadow .2s ease;
}
.fab svg { width: 24px; height: 24px; }
.fab:active { transform: scale(.92); }
.fab.hidden { display: none; }
@media (min-width: 1024px) { .fab { display: none !important; } }

/* Course builder summary */
.course-summary { background: rgba(57,62,65,.04); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.cs-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; font-size: 15px; }
.cs-row.savings { font-weight: 700; color: var(--teal); padding: 6px 2px 0; }
#cf-combined { color: var(--text-2); }

/* Category section header with accent dot + count */
.cat-head { display: flex; align-items: center; gap: 9px; margin: 22px 2px 10px; }
.cat-head:first-child { margin-top: 4px; }
.cat-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--text-2); }
.cat-name { font-size: 13px; font-weight: 700; color: var(--charcoal); text-transform: uppercase; letter-spacing: .05em; }
.cat-count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--text-2); background: rgba(57,62,65,.06); border-radius: 999px; padding: 2px 9px; min-width: 24px; text-align: center; }
.cat-head[data-cat="hair"] .cat-dot { background: var(--cat-hair); }
.cat-head[data-cat="face"] .cat-dot { background: var(--cat-face); }
.cat-head[data-cat="laser"] .cat-dot { background: var(--cat-laser); }

/* List rows - soft card with left category accent + hover elevation */
.list-row {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 9px; box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.list-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.list-row[data-cat="hair"]::before { background: var(--cat-hair); }
.list-row[data-cat="face"]::before { background: var(--cat-face); }
.list-row[data-cat="laser"]::before { background: var(--cat-laser); }
.list-row.is-course { background: #FDF6F4; }
@media (hover: hover) { .list-row:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); border-color: rgba(57,62,65,.16); } }
.list-row .main { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.list-row .sub { font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.list-row .price { font-weight: 700; font-size: 16px; color: var(--charcoal); white-space: nowrap; }
.price-wrap { text-align: right; }
.price-orig { font-size: 12px; color: var(--text-2); text-decoration: line-through; }
.list-row .row-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); display: grid; place-items: center; color: var(--text-2);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: rgba(57,62,65,.05); }
.icon-btn.danger { color: var(--vermilion); }
.icon-btn.danger:hover { background: rgba(233,79,55,.08); border-color: rgba(233,79,55,.3); }

.empty-state { color: var(--text-2); font-size: 14px; padding: 14px 16px; background: rgba(57,62,65,.03); border: 1px dashed var(--border); border-radius: var(--radius-sm); margin-bottom: 9px; }

.pill { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; line-height: 1.4; white-space: nowrap; }
.pill.vip { background: rgba(233,79,55,.12); color: var(--vermilion); }
.pill.regular { background: rgba(63,136,197,.12); color: var(--blue); }
.pill.first, .pill.save { background: rgba(68,187,164,.15); color: var(--teal); }
.pill.bundle { background: rgba(57,62,65,.08); color: var(--charcoal); }

/* Arrival / check-in layout */
.arrival { display: block; }
.arrival-pane { display: none; }
@media (min-width: 1024px) {
  .arrival { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
  .arrival-pane {
    display: block; position: sticky; top: calc(var(--header-h) + 16px);
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-height: 200px;
  }
  .arrival-pane:empty::before { content: attr(data-empty); color: var(--text-2); font-size: 14px; }
}
.checkin-total { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 0 14px; }
.checkin-total .amt { font-size: 28px; font-weight: 700; color: var(--charcoal); }
.seg { display: flex; gap: 6px; background: rgba(57,62,65,.06); padding: 4px; border-radius: 12px; margin-bottom: 14px; }
.seg button { flex: 1; min-height: 38px; border: none; background: transparent; border-radius: 9px; font-family: inherit; font-weight: 600; color: var(--text-2); transition: background .15s ease, color .15s ease; }
.seg button.active { background: var(--card); color: var(--charcoal); box-shadow: 0 1px 3px rgba(57,62,65,.12); }
.course-pick { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.course-pick.sel { border-color: var(--vermilion); background: rgba(233,79,55,.05); }
.sess-bar { height: 6px; border-radius: 999px; background: rgba(57,62,65,.10); overflow: hidden; margin-top: 6px; }
.sess-bar > i { display: block; height: 100%; background: var(--teal); }

/* Remove native number spinners everywhere; use design-system styling */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.bundle-line { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.bundle-line select { flex: 1; }
.bundle-line input {
  width: 66px; min-height: var(--tap); padding: 0 10px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); font-family: inherit; font-size: 16px;
}
.bundle-line input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.sheet h2 { margin-bottom: 14px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 8px; }
.sheet-actions .btn { flex: 1; }

/* ============================================================
   Animated components (sp-ui): select, calendar, skeleton
   Body-portaled panels so they never clip inside scroll areas.
   ============================================================ */

/* ---- Custom select / calendar trigger ---- */
.sp-select { position: relative; width: 100%; }
.sp-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%;
  min-height: var(--tap); padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); font-family: inherit; font-size: 16px;
  cursor: pointer; text-align: left; transition: border-color .15s ease, box-shadow .15s ease;
}
.sp-trigger:hover { border-color: rgba(57,62,65,.22); }
.sp-trigger.is-open, .sp-trigger:focus-visible {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(63,136,197,.15); outline: none;
}
.sp-trigger .sp-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-trigger .sp-val.placeholder { color: var(--text-2); }
.sp-trigger .sp-arrow { flex-shrink: 0; width: 18px; height: 18px; color: var(--text-2); transition: transform .2s ease; }
.sp-trigger.is-open .sp-arrow { transform: rotate(180deg); }
.sp-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ---- Portaled panel (fixed, positioned by JS) ---- */
.sp-panel {
  position: fixed; z-index: 9999;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 30px rgba(57,62,65,.16), 0 3px 8px rgba(57,62,65,.08);
  overflow: hidden; transform-origin: top center;
  animation: sp-drop-in .16s cubic-bezier(.2,.8,.2,1);
}
.sp-panel.flip-up { transform-origin: bottom center; animation-name: sp-drop-up; }
@keyframes sp-drop-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sp-drop-up { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.sp-search-wrap { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.sp-search-wrap svg { width: 18px; height: 18px; color: var(--text-2); flex-shrink: 0; }
.sp-search { flex: 1; border: none; outline: none; font-family: inherit; font-size: 15px; background: transparent; color: var(--text); }
.sp-scroll { max-height: 260px; overflow-y: auto; padding: 6px; -webkit-overflow-scrolling: touch; }
.sp-opt {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 44px; padding: 8px 12px; border: none; border-radius: 10px;
  background: transparent; font-family: inherit; font-size: 15px; color: var(--text);
  cursor: pointer; text-align: left; transition: background .12s ease;
}
.sp-opt:hover, .sp-opt.active { background: rgba(57,62,65,.05); }
.sp-opt.is-selected { background: rgba(63,136,197,.10); font-weight: 600; }
.sp-opt .sp-check { margin-left: auto; width: 18px; height: 18px; color: var(--blue); }
.sp-opt .sp-empty { color: var(--text-2); }

/* ---- Calendar ---- */
.sp-cal { width: 300px; padding: 14px; }
.sp-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sp-cal-title { font-weight: 700; font-size: 15px; color: var(--charcoal); }
.sp-cal-nav { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--card); display: grid; place-items: center; color: var(--charcoal); transition: background .12s ease; }
.sp-cal-nav:hover { background: rgba(57,62,65,.05); }
.sp-cal-nav:active { transform: scale(.94); }
.sp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.sp-cal-dow { display: grid; place-items: center; height: 28px; font-size: 11px; color: var(--text-2); font-weight: 600; }
.sp-cal-day {
  width: 100%; aspect-ratio: 1; border: none; background: transparent; border-radius: 9px;
  font-family: inherit; font-size: 13.5px; color: var(--text); cursor: pointer;
  display: grid; place-items: center;
  transition: background .12s ease, transform .1s ease;
}
.sp-cal-day:hover { background: rgba(57,62,65,.06); }
.sp-cal-day.other { color: var(--text-2); opacity: .4; }
.sp-cal-day.today { box-shadow: inset 0 0 0 1.5px var(--teal); font-weight: 700; }
.sp-cal-day.selected { background: var(--vermilion); color: #fff; font-weight: 700; box-shadow: none; }
.sp-cal-day:active { transform: scale(.9); }

/* ---- Skeleton loaders ---- */
.skeleton { position: relative; overflow: hidden; background: rgba(57,62,65,.07); border-radius: 8px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: sp-shimmer 1.2s infinite;
}
@keyframes sp-shimmer { 100% { transform: translateX(100%); } }
.skel-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; }
.skel-row .skel-main { flex: 1; }
.skel-line { height: 12px; margin: 4px 0; }
.skel-line.w60 { width: 60%; } .skel-line.w40 { width: 40%; } .skel-line.w30 { width: 30%; }
.skel-pill { width: 56px; height: 22px; border-radius: 999px; }

/* ---- Motion: screens, lists, sheet ---- */
.screen.is-active { animation: sp-screen-in .28s ease-out; }
@keyframes sp-screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.list-row, .cat-title { animation: sp-row-in .3s ease-out both; }
@keyframes sp-row-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.sheet-backdrop { transition: opacity .22s ease, visibility .22s ease; opacity: 0; }
.sheet-backdrop.open { opacity: 1; }
.sheet { transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.9,.25,1); will-change: transform; }
.sheet-backdrop.open .sheet { transform: none; }
@media (min-width: 1024px) {
  .sheet { transform: translateY(24px) scale(.97); opacity: .6; transition: transform .28s cubic-bezier(.2,.9,.25,1), opacity .28s ease; }
  .sheet-backdrop.open .sheet { transform: none; opacity: 1; }
}

#tabbar button, #sidenav button { transition: color .15s ease, background .15s ease; }
#tabbar button:active svg { transform: scale(.88); transition: transform .1s ease; }

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