/* ══════════════════════════════════════════════════════════
   FRESHCUT RECALL — Dark Jewel-Tone Stylesheet
   2026-09-29 refresh: Teal Plaster background, neumorphic surfaces,
   see-through cards at 67%, pale antique gold small text.
   Color Palette:
     Deep Purple Gradient background
     Dark Surface #1A1525  (cards, form backgrounds)
     Charcoal     #2A2438  (elevated surfaces, inputs)
     Plum         #62374E  (secondary accent)
     Teal         #007880  (primary accent, buttons)
     Gold         #FDC57B  (highlights, warmth, avatars)
   Font: Bebas Neue (headings) + Poppins (body)
   ══════════════════════════════════════════════════════════ */

:root {
  --deep-purple: #0D0818;
  --mid-purple: #1A1028;
  --dark-surface: #1A1525;
  --charcoal: #2A2438;
  --charcoal-light: #362E45;
  --plum: #62374E;
  --plum-light: #7E4A66;
  --teal: #007880;
  --teal-light: #009BA3;
  --teal-glow: rgba(0,120,128,0.2);
  --gold: #FDC57B;
  --gold-soft: rgba(253,197,123,0.15);
  --white: #FFFFFF;
  --text-bright: #F0ECE6;
  --text-mid: #A89DB8;
  --text-dim: #6B5F7E;
  --border: rgba(255,255,255,0.07);
  --border-focus: rgba(0,120,128,0.5);
  --danger: #C0392B;
  --danger-light: #E74C3C;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --radius: 14px;
  --radius-sm: 10px;

  /* Design refresh 2026-09-29 — neumorphic on Teal Plaster */
  --meta: #C8BD93;                /* pale antique gold — tagline, counts, previews, dates */
  --n-lift: #433960;              /* light side of a raised/pressed purple surface */
  --n-sink: #120D1A;              /* dark side */
  --n-raise: -5px -5px 12px var(--n-lift), 5px 5px 12px var(--n-sink);
  --n-raise-sm: -3px -3px 7px var(--n-lift), 3px 3px 7px var(--n-sink);
  --n-press: inset 4px 4px 8px var(--n-sink), inset -4px -4px 8px var(--n-lift);
  --glass: rgba(42,36,56,0.67);   /* see-through cards, 67% */
  --halo: 0 1px 2px rgba(0,0,0,.9), 0 0 10px rgba(0,0,0,.75), 0 0 18px rgba(0,0,0,.5);
  --hairline: linear-gradient(155deg, rgba(255,255,255,.32) 0%, rgba(255,255,255,.12) 35%, rgba(255,255,255,.05) 65%, rgba(255,255,255,.12) 100%);
  --well-dark: #1A1525;           /* dark purple pressed into the lighter pop-up */
}

/* ── RESET & BASE ──────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--deep-purple);
  color: var(--text-bright);
  min-height: 100dvh;
  padding-bottom: 80px;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Teal Plaster background, darkened 27%. A fixed layer (not background-attachment:fixed, which iOS ignores). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4,12,16,.27) 0%, rgba(4,12,16,.2) 50%, rgba(4,12,16,.37) 100%),
    url('teal-plaster-bg.jpg') 30% center / cover no-repeat;
  pointer-events: none;
  z-index: 0;
}

/* Skull watermark — screen blend drops its black box on the photo ground */
body::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vmin;
  height: 90vmin;
  background: url('skull-bg.jpg') center/contain no-repeat;
  mix-blend-mode: screen;
  opacity: 0.09;
  pointer-events: none;
  z-index: 0;
}

input, textarea, button, select {
  font-family: inherit;
  font-size: inherit;
}

/* ── TAB BAR ───────────────────────────────────── */

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 0.8rem;
  background: #1A1028;
  border-radius: 26px 26px 0 0;
  padding: 0.55rem 0.8rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  box-shadow: 0 -10px 26px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.6rem 0;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 16px;
  cursor: pointer;
  transition: color 0.2s, box-shadow 0.2s;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tab-btn i {
  font-size: 1.2rem;
  transition: transform 0.2s, color 0.2s;
}

.tab-btn.active {
  color: var(--teal-light);
  box-shadow: inset 3px 3px 7px #0A0612, inset -3px -3px 7px #271A3A;   /* pressed well */
}

.tab-btn.active i {
  transform: scale(1.15);
  filter: drop-shadow(0 0 8px rgba(0,155,163,0.5));
}

.tab-btn:hover:not(.active) {
  color: var(--text-mid);
}

/* ── SCREENS ───────────────────────────────────── */

.screen {
  display: none;
  max-width: 500px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  animation: fadeIn 0.25s ease;
  position: relative;
  z-index: 1;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── SCREEN HEADER ─────────────────────────────── */

.screen-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.screen-header h1 {
  font-family: 'Bebas Neue', 'Montserrat', sans-serif;
  font-size: 2.8rem;
  font-weight: 400;
  color: var(--text-bright);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.screen-header h1 i {
  color: var(--teal-light);
  margin-right: 0.3rem;
  filter: drop-shadow(0 0 10px rgba(0,155,163,0.4));
}

.tagline {
  color: var(--meta);
  text-shadow: var(--halo);
  font-size: 0.85rem;
  font-weight: 400;
  margin-top: 0.15rem;
  letter-spacing: 0.02em;
}

/* ── FORM ──────────────────────────────────────── */

.entry-form {
  background: var(--glass);
  border-radius: 24px;
  padding: 1.4rem 1.2rem;
  box-shadow: 0 18px 40px rgba(0,0,0,0.35), inset 1px 1px 0 rgba(255,255,255,0.1);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-family: 'Bebas Neue', 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--gold);
  margin-bottom: 0.35rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-group label i {
  width: 18px;
  text-align: center;
  margin-right: 0.3rem;
  color: var(--teal-light);
  font-size: 0.75rem;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group textarea {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 0;
  border-radius: 14px;
  font-size: 0.95rem;
  color: var(--text-bright);
  background: var(--charcoal);
  box-shadow: var(--n-press);
  transition: box-shadow 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  box-shadow: var(--n-press), 0 0 0 2px rgba(0,155,163,0.55), 0 0 16px var(--teal-glow);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-dim);
  font-weight: 300;
}

/* ── TOGGLE BUTTONS (Yes / No) ─────────────────── */

.toggle-group label {
  margin-bottom: 0.5rem;
}

.toggle-row {
  display: flex;
  gap: 0.8rem;
}

.toggle-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 14px;
  background: var(--charcoal);
  color: var(--text-mid);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--n-raise-sm);
  transition: all 0.2s;
}

.toggle-btn:hover {
  color: var(--teal-light);
}

.toggle-btn.selected-yes {
  background: var(--teal);
  color: var(--white);
  box-shadow: inset 3px 3px 7px #004E54, inset -3px -3px 7px #00A2AC, 0 0 16px var(--teal-glow);
}

.toggle-btn.selected-no {
  background: var(--plum);
  color: var(--white);
  box-shadow: inset 3px 3px 7px #3E2232, inset -3px -3px 7px #86506C;
}

/* ── SUB-FIELDS (pet kind, kid info) ──────────── */

.sub-field {
  position: relative;
  margin-left: 1rem;
  padding-left: 0.9rem;
  transition: all 0.3s ease;
}

.sub-field::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2rem;
  bottom: 0.2rem;
  width: 4px;
  border-radius: 4px;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(253,197,123,0.45);
}

.sub-field.hidden {
  display: none;
}

.sub-field label {
  color: var(--text-mid) !important;
}

/* ── FORM ACTIONS ──────────────────────────────── */

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.4rem;
}

.btn-save {
  flex: 2;
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, var(--plum) 0%, var(--teal) 100%);
  color: var(--white);
  border: none;
  border-radius: 14px;
  font-family: 'Bebas Neue', 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--n-raise), 0 0 18px rgba(0,120,128,0.25);
}

.btn-save:hover {
  background: linear-gradient(135deg, var(--plum-light) 0%, var(--teal-light) 100%);
  box-shadow: 0 0 30px rgba(0,120,128,0.35);
}

.btn-save:active {
  transform: scale(0.97);
  box-shadow: var(--n-press);
}

.btn-save.editing {
  background: var(--plum);
  box-shadow: 0 0 20px rgba(98,55,78,0.3);
}

.btn-save.editing:hover {
  background: var(--plum-light);
}

.btn-clear {
  flex: 1;
  padding: 0.8rem 1rem;
  background: var(--charcoal);
  border: 0;
  border-radius: 14px;
  box-shadow: var(--n-raise);
  color: var(--text-mid);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear:hover {
  color: var(--danger-light);
}

.btn-clear:active {
  box-shadow: var(--n-press);
}

/* ── SEARCH BAR ────────────────────────────────── */

.search-bar {
  display: flex;
  align-items: center;
  background: var(--charcoal);
  border: 0;
  border-radius: 14px;
  padding: 0.45rem 0.4rem 0.45rem 0.9rem;
  margin-top: 1rem;
  box-shadow: var(--n-press);
  transition: box-shadow 0.2s;
}

.search-bar:focus-within {
  box-shadow: var(--n-press), 0 0 0 2px rgba(0,155,163,0.55);
}

.search-bar > i {
  color: var(--teal-light);
  margin-right: 0.5rem;
  font-size: 0.9rem;
}

.search-bar input {
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--text-bright);
  background: transparent;
}

.search-bar input::placeholder {
  color: var(--text-dim);
  font-weight: 300;
}

.client-count {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--meta);
  text-shadow: var(--halo);
  font-weight: 400;
}

/* ── EMPTY STATE ───────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--gold);
  filter: drop-shadow(0 0 12px var(--gold-soft));
}

.empty-state p {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--meta);
  text-shadow: var(--halo);
}

/* ── CLIENT LIST ───────────────────────────────── */

.client-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.client-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--glass);
  padding: 0.9rem 1rem;
  border-radius: 18px;
  box-shadow: -5px -5px 12px rgba(190,215,215,0.07), 6px 6px 14px rgba(0,0,0,0.55),
              inset 1px 1px 0 rgba(255,255,255,0.1), inset -1px -1px 0 rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

/* Apple-style hairline: light catches the top-left edge and fades around the card.
   See-through cards use a masked ::before; solid cards (pop-up, calendar) use a border-box gradient. */
.entry-form { position: relative; }
.entry-form::before,
.client-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 0.5pt;
  pointer-events: none;
  background: var(--hairline);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

@media (hover: hover) and (pointer: fine) {
  .client-card:hover {
    transform: translateY(-1px);
  }
}

.client-card:active {
  transform: scale(0.98);
}

.client-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--plum) 0%, var(--teal) 100%);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 1.1rem;
  flex-shrink: 0;
  letter-spacing: 0.05em;
  box-shadow: inset 3px 3px 7px #004E54, inset -3px -3px 7px #00A2AC, 0 0 12px var(--teal-glow);   /* pressed, like Yes */
}

.client-info {
  flex: 1;
  min-width: 0;
}

.client-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-preview {
  font-size: 0.78rem;
  color: var(--meta);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

.client-date {
  color: var(--meta);
  font-size: 0.8rem;
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  background: var(--charcoal);
  border-radius: 10px;
  padding: 0.35rem 0.5rem;
  box-shadow: inset 3px 3px 6px var(--n-sink), inset -3px -3px 6px var(--n-lift);   /* pressed-in well */
}

/* ── EXPORT BUTTON ─────────────────────────────── */

.export-row {
  text-align: center;
  margin-top: 1.5rem;
  padding-bottom: 1rem;
}

.btn-export {
  padding: 0.7rem 1.3rem;
  background: var(--charcoal);
  border: 0;
  border-radius: 14px;
  box-shadow: var(--n-raise);
  color: var(--text-mid);
  font-size: 0.8rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-export i {
  margin-right: 0.3rem;
  color: var(--teal-light);
}

.btn-export:hover {
  color: var(--teal-light);
}

/* ── PROFILE MODAL ─────────────────────────────── */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13,8,24,0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  animation: overlayIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: linear-gradient(var(--charcoal), var(--charcoal)) padding-box, var(--hairline) border-box;
  border: 0.5pt solid transparent;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem 1.25rem 2rem;
  position: relative;
  animation: slideUp 0.3s ease;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.55);
}

@keyframes slideUp {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--charcoal);
  border: 0;
  box-shadow: var(--n-raise-sm);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover {
  color: var(--danger-light);
}

.modal-close:active {
  box-shadow: var(--n-press);
}

/* ── PROFILE CONTENT ───────────────────────────── */

.profile-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--plum) 0%, var(--teal) 100%);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 1.6rem;
  margin: 0 auto 0.6rem;
  letter-spacing: 0.05em;
  box-shadow: inset 4px 4px 9px #004E54, inset -4px -4px 9px #00A2AC, 0 0 22px var(--teal-glow);   /* pressed, like Yes */
}

.profile-name {
  font-family: 'Bebas Neue', 'Montserrat', sans-serif;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text-bright);
}

.profile-date {
  font-size: 0.75rem;
  color: var(--text-mid);
  margin-top: 0.2rem;
}

.profile-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-field {
  background: var(--well-dark);
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
  box-shadow: inset 4px 4px 9px #0B0810, inset -3px -3px 8px #3A3150;   /* pressed in */
}

.profile-field-label {
  font-family: 'Bebas Neue', 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--teal-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.2rem;
}

.profile-field-value {
  font-size: 0.93rem;
  color: var(--text-bright);
  line-height: 1.4;
}

.profile-field-value.empty {
  color: var(--text-dim);
  font-style: italic;
}

.profile-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.btn-edit {
  flex: 2;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--plum) 0%, var(--teal) 100%);
  color: var(--white);
  border: none;
  border-radius: 14px;
  font-family: 'Bebas Neue', 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--n-raise), 0 0 18px rgba(0,120,128,0.25);
}

.btn-edit:hover {
  background: linear-gradient(135deg, var(--plum-light) 0%, var(--teal-light) 100%);
}

.btn-edit:active {
  transform: scale(0.97);
  box-shadow: var(--n-press);
}

.btn-delete {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--charcoal);
  border: 0;
  border-radius: 14px;
  box-shadow: var(--n-raise);
  color: var(--text-mid);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete:hover {
  color: var(--danger-light);
}

.btn-delete:active {
  box-shadow: var(--n-press);
}

/* ── TOAST NOTIFICATION ────────────────────────── */

.toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(135deg, var(--teal) 0%, var(--plum) 100%);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: 'Bebas Neue', 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 4px 25px rgba(0,120,128,0.3);
  z-index: 300;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ── CONFIRM DELETE ────────────────────────────── */

.confirm-delete {
  text-align: center;
  padding: 0.5rem 0;
}

.confirm-delete p {
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-bottom: 0.75rem;
}

.confirm-delete .btn-row {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.btn-confirm-delete {
  padding: 0.6rem 1.5rem;
  background: var(--danger);
  color: var(--white);
  border: none;
  border-radius: 14px;
  box-shadow: var(--n-raise-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-confirm-delete:hover {
  background: var(--danger-light);
}

.btn-cancel-delete {
  padding: 0.6rem 1.5rem;
  background: var(--charcoal);
  color: var(--text-mid);
  border: 0;
  border-radius: 14px;
  box-shadow: var(--n-raise-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-cancel-delete:hover {
  background: var(--charcoal-light);
}

/* ── KEYWORD SEARCH + DATE PICKER (2026-09-29) ─── */

.search-wrap {
  position: relative;
}

.search-bar input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.cal-btn {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--charcoal);
  color: var(--text-mid);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--n-raise-sm);
  transition: color 0.2s, box-shadow 0.2s;
}

.cal-btn::before {            /* grows the tap target to 44pt without growing the button */
  content: '';
  position: absolute;
  inset: -4px;
}

.cal-btn i { font-size: 0.95rem; }

.cal-btn.on {
  color: var(--teal-light);
  box-shadow: inset 2px 2px 5px var(--n-sink), inset -2px -2px 5px var(--n-lift), 0 0 12px var(--teal-glow);
}

.cal {
  position: absolute;
  z-index: 50;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: linear-gradient(var(--charcoal), var(--charcoal)) padding-box, var(--hairline) border-box;
  border: 0.5pt solid transparent;
  border-radius: 20px;
  padding: 0.9rem 0.8rem 0.7rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  text-align: left;
  animation: fadeIn 0.18s ease;
}

.cal.hidden { display: none; }

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.cal-title {
  font-family: 'Bebas Neue', 'Montserrat', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.cal-nav {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: var(--charcoal);
  color: var(--text-mid);
  cursor: pointer;
  box-shadow: var(--n-raise-sm);
  display: grid;
  place-items: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}

.cal-dow {
  font-family: 'Bebas Neue', 'Montserrat', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.cal-day {
  position: relative;
  aspect-ratio: 1;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-mid);
  font-size: 0.85rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.cal-day.blank { cursor: default; }
.cal-day.has { color: var(--text-bright); }
.cal-day.today { color: var(--gold); }

.cal-day.has::after,
.cal-dot {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--teal-light);
  box-shadow: 0 0 6px var(--teal-light);
  vertical-align: middle;
}

.cal-day.has::after {
  position: absolute;
  left: 50%;
  bottom: 4px;
  margin-left: -2px;
}

.cal-day.sel {
  background: var(--teal);
  color: var(--white);
  box-shadow: inset 3px 3px 7px #004E54, inset -3px -3px 7px #00A2AC, 0 0 14px var(--teal-glow);
}

.cal-day.sel::after { background: var(--white); box-shadow: none; }

@media (hover: hover) and (pointer: fine) {
  .cal-day:not(.blank):hover { color: var(--text-bright); box-shadow: var(--n-raise-sm); }
  .cal-nav:hover, .cal-btn:hover { color: var(--teal-light); }
}

.cal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.clear-link {
  background: none;
  border: 0;
  padding: 0 0 1px;
  margin-left: 0.4rem;
  font-size: inherit;
  font-weight: 500;
  color: var(--teal-light);
  border-bottom: 1px solid var(--teal-light);
  text-shadow: none;
  cursor: pointer;
}

.cal-btn:focus-visible, .cal-nav:focus-visible, .cal-day:focus-visible, .clear-link:focus-visible {
  outline: 2px solid var(--teal-light);
  outline-offset: 2px;
}

/* A keyword match: matched words in teal, and two lines so they stay visible */
.client-preview mark {
  background: none;
  color: var(--teal-light);
  font-weight: 600;
}

.client-name mark {
  background: none;
  color: var(--teal-light);
}

.client-preview .fld {
  opacity: 0.7;
  margin-right: 0.3rem;
}

.client-preview.snip {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}

/* ── RESPONSIVE ────────────────────────────────── */

@media (min-width: 600px) {
  body {
    padding-bottom: 90px;
  }
  .screen {
    padding: 2rem 1.5rem;
  }
  .modal-overlay {
    align-items: center;
  }
  .modal-card {
    border-radius: 24px;
    max-height: 80vh;
  }
}