/* ==========================================================================
   DentaFlow — Premium 3D Glassmorphism layer (V6)
   --------------------------------------------------------------------------
   Linked AFTER tokens.css and app.css on every page.
   Rollback = delete this one <link>. No markup contract changes: every class
   name, id and data-attribute used by js/*.js is left untouched.
   Layout (grid/flex tracks) is intentionally NOT redefined here — only colour,
   depth, radius, type and motion — so the responsive rules in app.css keep
   control at every breakpoint.
   ========================================================================== */

:root {
  /* ---- re-pointed brand tokens (names preserved for inline styles) ---- */
  --teal: #0BAEAA;
  --teal-deep: #087F83;
  --mint: #B5E8DF;
  --mint-soft: #EAF8F5;
  --warm-white: #FAFAF7;
  --ivory: #F8F6F0;
  --peach: #FFDCC8;
  --lavender: #E6DFF7;

  --ink: #163B3B;
  --ink-2: #587573;
  --ink-3: #78918F;

  --success: #16856B;
  --warning: #B7791F;
  --error: #C94C4C;

  /* ---- glass material ---- */
  --glass-hi: rgba(255, 255, 255, 0.9);
  --glass-lo: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.88);
  --glass-blur: 26px;

  --surface: linear-gradient(158deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.66) 100%);
  --surface-strong: linear-gradient(158deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.84) 100%);
  --surface-muted: rgba(255, 255, 255, 0.5);
  --line: rgba(11, 174, 170, 0.14);
  --line-strong: rgba(11, 174, 170, 0.26);

  /* ---- geometry: softer, more generous ---- */
  --r-xl: 32px;
  --r-lg: 26px;
  --r-md: 20px;
  --r-sm: 14px;

  /* ---- elevation: tinted with the brand teal, never neutral grey ---- */
  --sh-sm: 0 2px 10px -2px rgba(6, 74, 74, 0.12), 0 1px 2px rgba(6, 74, 74, 0.06);
  --sh-md: 0 18px 44px -22px rgba(6, 74, 74, 0.42), 0 4px 14px -6px rgba(6, 74, 74, 0.12);
  --sh-lg: 0 36px 80px -40px rgba(6, 74, 74, 0.5), 0 8px 24px -12px rgba(6, 74, 74, 0.14);
  --sh-teal: 0 14px 30px -10px rgba(10, 145, 149, 0.5);

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ==========================================================================
   Ambient background — three soft orbs over a mint wash
   ========================================================================== */
body {
  background: #EFF9F7;
  letter-spacing: -0.005em;
}

body::before {
  background:
    radial-gradient(1000px 680px at 86% -10%, rgba(255, 214, 190, 0.62), transparent 64%),
    radial-gradient(760px 620px at 2% 2%, rgba(168, 235, 226, 0.72), transparent 58%),
    radial-gradient(900px 720px at 50% 118%, rgba(226, 216, 247, 0.5), transparent 62%),
    linear-gradient(168deg, #E6F7F3 0%, #FAFCFA 44%, #EDF8F5 100%);
}

body::after {
  background:
    radial-gradient(circle at 76% 10%, rgba(255, 208, 182, 0.42), transparent 26%),
    radial-gradient(circle at 14% 78%, rgba(144, 226, 216, 0.4), transparent 28%),
    radial-gradient(circle at 52% 46%, rgba(255, 255, 255, 0.5), transparent 40%);
  filter: blur(56px);
}

/* ==========================================================================
   Glass material
   ========================================================================== */
.glass {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
}

.glass::after {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.45);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: #FFFFFF; border-color: rgba(11, 174, 170, 0.16); }
}

/* ==========================================================================
   Typography — Apple-like tight tracking on large text
   ========================================================================== */
h1 { font-size: 2rem; letter-spacing: -0.032em; line-height: 1.18; }
h2 { font-size: 1.2rem; letter-spacing: -0.024em; }
h3 { letter-spacing: -0.018em; }

.eyebrow { letter-spacing: 0.18em; font-size: 0.66rem; }

.num, .value, .tile .value {
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Sidebar rail
   ========================================================================== */
.side {
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
}

.side .brand-mark {
  background: linear-gradient(155deg, #1AC6BE, #07888C);
  box-shadow:
    0 10px 22px -8px rgba(10, 145, 149, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.nav a {
  border-radius: 14px;
  transition: background 0.22s var(--ease), color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.nav a[aria-current="page"] {
  background: #FFFFFF;
  color: var(--teal-deep);
  box-shadow:
    0 8px 20px -10px rgba(6, 74, 74, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.nav a[aria-current="page"] svg { color: var(--teal); }

.nav a:not([aria-current="page"]):hover {
  background: rgba(255, 255, 255, 0.66);
}

.side-foot { color: var(--ink-2); font-size: 0.7rem; line-height: 1.5; }

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
}

.topbar h1 { font-size: 1.6rem; }

.avatar {
  background: linear-gradient(150deg, #FFFFFF, #D8F3EC);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 18px -10px rgba(6, 74, 74, 0.5), inset 0 1px 0 #fff;
  color: var(--teal-deep);
}

/* ==========================================================================
   Hero — glossy teal panel with a floating enamel tooth
   ========================================================================== */
.hero {
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 140% at 12% 0%, rgba(255, 255, 255, 0.34), transparent 52%),
    radial-gradient(90% 120% at 92% 108%, rgba(255, 214, 190, 0.4), transparent 58%),
    linear-gradient(140deg, #12C3BA 0%, #0A9EA2 46%, #077F86 100%);
  box-shadow:
    0 30px 60px -30px rgba(6, 100, 100, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

/* soft light bloom behind the illustration (hero::before belongs to app.css) */
.hero::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 50%;
  width: 170px;
  height: 170px;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.34), transparent 64%);
  filter: blur(18px);
  opacity: 0.7;
  border-radius: 50%;
  pointer-events: none;
}

/* the illustration sits on a faint glass disc so enamel keeps its edges on teal */
.hero .tooth {
  width: 120px;
  height: 120px;
  padding: 6px;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 34% 22%, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.04) 72%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 18px 30px -18px rgba(3, 60, 60, 0.65);
}

.hero h2 {
  font-size: 1.7rem;
  letter-spacing: -0.035em;
  line-height: 1.14;
  text-shadow: 0 1px 0 rgba(0, 60, 60, 0.18);
}

.hero .meta { font-size: 0.84rem; max-width: 46ch; }

.hero .tooth {
  width: 120px;
  height: 120px;
  opacity: 1;
  filter:
    drop-shadow(0 20px 28px rgba(3, 60, 60, 0.45))
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.9));
  animation: toothFloat 7s ease-in-out infinite;
}

.hero .btn-ghost {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 26px -12px rgba(4, 60, 60, 0.7), inset 0 1px 0 #fff;
  color: #076A6E;
  font-weight: 800;
}

@keyframes toothFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(-1.4deg); }
}

/* ==========================================================================
   Quick tiles
   ========================================================================== */
.tile {
  border-radius: var(--r-lg);
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 13px;
  min-height: 84px;
  padding: 15px 16px;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.tile:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }

.tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  flex: none;
  background:
    radial-gradient(120% 120% at 30% 20%, #FFFFFF 0%, #D9F4EE 60%, #BFEDE4 100%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 10px 18px -10px rgba(6, 74, 74, 0.45),
    inset 0 1px 0 #fff;
  color: var(--teal-deep);
}

.tile .value {
  font-size: 1.6rem;
  line-height: 1.3;
  padding-bottom: 1px;
  display: block;
  background: linear-gradient(160deg, #0E5A5C 0%, #0BAEAA 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tile .value small {
  font-size: 0.62rem;
  -webkit-text-fill-color: var(--ink-3);
  color: var(--ink-3);
  margin-left: 4px;
  font-weight: 700;
  letter-spacing: 0;
}

.tile .label {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  font-weight: 600;
}

/* ==========================================================================
   Service cards
   ========================================================================== */
.svc {
  border-radius: var(--r-md);
  background: var(--surface-strong);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: var(--sh-sm);
  transition: transform 0.26s var(--ease), box-shadow 0.26s var(--ease), border-color 0.26s var(--ease);
}

.svc:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-md);
  border-color: rgba(255, 255, 255, 1);
}

.svc.is-selected {
  border-color: rgba(11, 174, 170, 0.55);
  box-shadow:
    0 0 0 3px rgba(11, 174, 170, 0.16),
    0 18px 34px -20px rgba(6, 100, 100, 0.55);
}

.svc-ico {
  background: radial-gradient(120% 120% at 30% 18%, #FFFFFF 0%, #DDF6F0 58%, #C2EEE5 100%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 #fff, 0 6px 14px -8px rgba(6, 74, 74, 0.5);
}

.svc.is-selected .svc-ico {
  background: linear-gradient(150deg, #1AC6BE, #078A8E);
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(10, 145, 149, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.svc h3 { letter-spacing: -0.02em; }

/* ==========================================================================
   Calendar
   ========================================================================== */
.cal-head strong { letter-spacing: -0.02em; font-size: 0.98rem; }

.cal-nav button {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--sh-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.cal-nav button:hover { transform: translateY(-1px); box-shadow: var(--sh-md); }

.cal-dow { letter-spacing: 0.1em; color: var(--ink-3); }

.day {
  border-radius: 13px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.day:hover:not(:disabled):not(.is-selected) {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.day.is-today {
  box-shadow: inset 0 0 0 1.5px rgba(11, 174, 170, 0.55);
  color: var(--teal-deep);
  font-weight: 800;
}

.day.is-selected {
  background: linear-gradient(150deg, #1AC6BE, #078A8E);
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(10, 145, 149, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* ==========================================================================
   Slots & dentist pickers
   ========================================================================== */
.slot {
  border-radius: 13px;
  min-height: 42px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--sh-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.slot:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(11, 174, 170, 0.45);
  box-shadow: var(--sh-md);
}

.slot.is-active {
  background: linear-gradient(160deg, #1AC6BE, #078A8E);
  box-shadow: 0 12px 22px -10px rgba(10, 145, 149, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.dentist {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: var(--sh-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
}

.dentist:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }

.dentist.is-selected {
  border-color: rgba(11, 174, 170, 0.5);
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.95), rgba(226, 248, 244, 0.95));
  box-shadow: 0 0 0 3px rgba(11, 174, 170, 0.14), var(--sh-md);
}

.dentist .face {
  background: linear-gradient(150deg, #FFFFFF, #D6F2EB);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 #fff, 0 6px 12px -8px rgba(6, 74, 74, 0.5);
  color: var(--teal-deep);
}

.dentist.is-selected .face {
  background: linear-gradient(150deg, #1AC6BE, #078A8E);
  color: #fff;
}

/* ==========================================================================
   Summary panel
   ========================================================================== */
.summary dl { gap: 9px 12px; }
.summary dt { color: var(--ink-2); font-size: 0.78rem; }
.summary dd { font-weight: 800; letter-spacing: -0.02em; }

.summary input[type="text"],
.summary input[type="password"],
input[type="text"], input[type="password"], input[type="datetime-local"] {
  border-radius: 14px !important;
  border-color: rgba(11, 174, 170, 0.2) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: inset 0 1px 2px rgba(6, 74, 74, 0.06);
  transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

input:focus {
  outline: none;
  border-color: rgba(11, 174, 170, 0.65) !important;
  box-shadow: 0 0 0 4px rgba(11, 174, 170, 0.14), inset 0 1px 2px rgba(6, 74, 74, 0.04);
}

/* ==========================================================================
   Buttons — pill, glossy, 46px touch target
   ========================================================================== */
button, .btn { min-height: 44px; }

.btn-primary {
  background:
    radial-gradient(120% 160% at 50% 0%, rgba(255, 255, 255, 0.42), transparent 58%),
    linear-gradient(180deg, #17C6BE 0%, #0A9A9E 58%, #078087 100%);
  box-shadow:
    0 16px 30px -14px rgba(10, 145, 149, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 0 rgba(4, 90, 92, 0.28);
  letter-spacing: 0.005em;
}

.btn-primary:not(:disabled):hover {
  filter: none;
  box-shadow:
    0 20px 36px -16px rgba(10, 145, 149, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 0 rgba(4, 90, 92, 0.28);
}

.btn-primary:active { transform: translateY(1px) scale(0.996); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--sh-sm), inset 0 1px 0 #fff;
}

.btn-soft {
  background: linear-gradient(160deg, #E8F8F3, #D3F0EA);
  border: 1px solid rgba(11, 174, 170, 0.16);
  color: var(--teal-deep);
}

.btn-soft:hover { filter: none; box-shadow: var(--sh-sm); }

button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(11, 174, 170, 0.42);
  outline-offset: 3px;
}

/* ==========================================================================
   Status chips — colour + text, never colour alone
   ========================================================================== */
.chip {
  border-radius: var(--r-pill);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.chip--confirmed { background: rgba(22, 133, 107, 0.12); color: #0F6B57; border-color: rgba(22, 133, 107, 0.28); }
.chip--done { background: rgba(11, 174, 170, 0.14); color: #076A6E; border-color: rgba(11, 174, 170, 0.28); }
.chip--pending { background: rgba(183, 121, 31, 0.14); color: #8A5A12; border-color: rgba(183, 121, 31, 0.3); }
.chip--error { background: rgba(201, 76, 76, 0.12); color: #A03838; border-color: rgba(201, 76, 76, 0.26); }

/* ==========================================================================
   Staff dashboard
   ========================================================================== */
.ring circle { filter: drop-shadow(0 6px 14px rgba(10, 145, 149, 0.28)); }

.row {
  border-radius: 16px;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.row:hover {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--sh-sm);
}

.row .when b { letter-spacing: -0.02em; }

.week .cell { border-radius: 13px; }

.week .cell.has {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(198, 240, 232, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 #fff, 0 6px 14px -10px rgba(6, 74, 74, 0.5);
  color: var(--teal-deep);
}

.notice {
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(238, 250, 247, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: var(--sh-sm), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: var(--ink-2);
}

.notice strong { color: var(--teal-deep); letter-spacing: 0.08em; }

/* the row chip already states the status — drop the raw duplicate line */
.row .when span { display: none; }

/* ==========================================================================
   Mobile bottom navigation — floating glass bar
   ========================================================================== */
.bottom-nav {
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 -2px 40px -18px rgba(6, 74, 74, 0.5),
    0 18px 40px -24px rgba(6, 74, 74, 0.6);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.bottom-nav a[aria-current="page"] { color: var(--teal-deep); }

/* ==========================================================================
   Motion — entrance only, never layout animation
   ========================================================================== */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.main > * { animation: rise 0.5s var(--ease) both; }
.main > *:nth-child(2) { animation-delay: 0.04s; }
.main > *:nth-child(3) { animation-delay: 0.08s; }
.main > *:nth-child(4) { animation-delay: 0.12s; }
.main > *:nth-child(5) { animation-delay: 0.16s; }

@media (prefers-reduced-motion: reduce) {
  .main > *, .hero .tooth { animation: none !important; }
  .tile:hover, .svc:hover, .slot:hover:not(:disabled), .dentist:hover { transform: none; }
}

/* ==========================================================================
   Small screens: keep touch targets comfortable, trim decorative blur
   ========================================================================== */
@media (max-width: 640px) {
  h1 { font-size: 1.65rem; }
  .hero h2 { font-size: 1.42rem; }
  .hero .tooth { width: 92px; height: 92px; }
  .hero::after { width: 130px; height: 130px; left: 12px; }
  .tile .value { font-size: 1.5rem; }
  .glass { --glass-blur: 18px; }
  .main { padding-bottom: 96px; }
}
