/* ==========================================================================
   DentaFlow — layout & components
   ========================================================================== */

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 22px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 22px;
  min-height: 100vh;
}

/* ---------- sidebar ---------- */
.side {
  position: sticky;
  top: 22px;
  height: fit-content;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-radius: var(--r-xl);
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #1AC6BE, #0A9397);
  box-shadow: 0 10px 22px rgba(19, 184, 178, 0.3);
  color: #fff;
  flex: none;
}

.brand-mark svg { width: 24px; height: 24px; }

.brand-text strong { display: block; font-size: 1.02rem; font-weight: 800; letter-spacing: -0.01em; }
.brand-text span { display: block; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 12px;
  margin: 6px 0 4px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav a svg { width: 18px; height: 18px; flex: none; opacity: 0.75; }
.nav a:hover { background: rgba(168, 230, 223, 0.35); color: var(--ink); }

.nav a[aria-current="page"] {
  background: linear-gradient(135deg, #D9F5F0, #BFEDE7);
  color: var(--teal-deep);
  box-shadow: inset 0 1px 0 #fff;
}
.nav a[aria-current="page"] svg { opacity: 1; }
.nav a[data-soon] { opacity: 0.45; cursor: not-allowed; }
.nav a[data-soon]::after {
  content: "SOON";
  margin-left: auto;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(19, 184, 178, 0.12);
  color: var(--teal-deep);
}

.side-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.68rem;
  color: var(--ink-3);
  line-height: 1.6;
}

/* ---------- main ---------- */
.main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: var(--r-lg);
  flex-wrap: wrap;
}

.greet { flex: 1; min-width: 180px; }
.greet h1 { font-size: 1.32rem; font-weight: 800; }
.greet p { margin: 2px 0 0; font-size: 0.8rem; color: var(--ink-2); }

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--teal-deep);
  background: linear-gradient(140deg, #D9F5F0, #A8E6DF);
  border: 2px solid #fff;
  box-shadow: var(--sh-sm);
  flex: none;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 24px 26px;
  color: #fff;
  background: linear-gradient(135deg, #16BFB8 0%, #0A9397 62%, #087F83 100%);
  box-shadow: 0 22px 48px rgba(10, 147, 151, 0.28);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.hero::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.32), transparent 62%);
  pointer-events: none;
}

.hero .tooth { width: 108px; height: 108px; flex: none; opacity: 0.95; }

.hero-body { flex: 1; min-width: 200px; position: relative; z-index: 1; }
.hero .eyebrow { color: rgba(255, 255, 255, 0.82); }
.hero h2 { color: #fff; font-size: 1.25rem; margin: 4px 0 2px; }
.hero .meta { font-size: 0.82rem; color: rgba(255, 255, 255, 0.88); }
.hero .ref { font-family: var(--font-num); font-weight: 800; letter-spacing: 0.06em; }

.hero .btn-ghost {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  backdrop-filter: blur(6px);
}

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

.tile {
  padding: 16px;
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 104px;
  justify-content: space-between;
}

.tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--mint-soft);
  color: var(--teal-deep);
}
.tile-icon svg { width: 18px; height: 18px; }
.tile:nth-child(2) .tile-icon { background: rgba(229, 221, 247, 0.6); color: #6B4FA8; }
.tile:nth-child(3) .tile-icon { background: rgba(255, 216, 194, 0.7); color: #A45C2B; }
.tile:nth-child(4) .tile-icon { background: rgba(168, 230, 223, 0.6); color: var(--teal-deep); }

.tile .label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-2); }
.tile .value { font-family: var(--font-num); font-size: 1.6rem; font-weight: 800; color: var(--ink); line-height: 1; }
.tile .value small { font-family: var(--font); font-size: 0.68rem; font-weight: 600; color: var(--ink-3); margin-left: 4px; }

/* ---------- section header ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 1.02rem; font-weight: 800; }
.section-head a, .link { font-size: 0.78rem; font-weight: 700; color: var(--teal-deep); text-decoration: none; }
.section-head a:hover, .link:hover { text-decoration: underline; }

/* ---------- service cards ---------- */
.services { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }

.svc {
  padding: 13px 14px;
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: var(--surface-strong);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--sh-sm);
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.svc:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--line-strong); }
.svc.is-selected { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(19, 184, 178, 0.16), var(--sh-md); }

.svc-ico {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--mint-soft);
  color: var(--teal-deep);
}
.svc-ico svg { width: 18px; height: 18px; }

.svc h3 { font-size: 0.84rem; line-height: 1.25; }
.svc .dur { font-size: 0.7rem; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.svc .pick { display: none; }

/* ---------- booking ---------- */
.booking { display: grid; grid-template-columns: 1.05fr 1fr; gap: 18px; align-items: start; }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head strong { font-size: 0.92rem; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button {
  width: 30px; height: 30px; padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  color: var(--teal-deep);
  font-size: 0.9rem;
  box-shadow: none;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; justify-items: center; }
.cal-dow { font-size: 0.62rem; font-weight: 700; color: var(--ink-3); text-align: center; padding: 4px 0; text-transform: uppercase; letter-spacing: 0.06em; }

.day {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
}

.day:hover:not(:disabled) { background: var(--mint-soft); }
.day.is-today { color: var(--teal-deep); font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.day.is-selected { background: linear-gradient(135deg, #1AC6BE, #0A9397); color: #fff; box-shadow: 0 8px 18px rgba(19, 184, 178, 0.32); }
.day:disabled { color: rgba(124, 148, 148, 0.45); cursor: not-allowed; }
.day.is-empty { visibility: hidden; }

/* slots */
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.slot {
  padding: 10px 8px;
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  cursor: pointer;
  box-shadow: none;
  font-family: var(--font-num);
}

.slot:hover:not(:disabled) { border-color: var(--teal); color: var(--teal-deep); }
.slot.is-active { background: linear-gradient(135deg, #1AC6BE, #0A9397); color: #fff; border-color: transparent; box-shadow: 0 8px 16px rgba(19, 184, 178, 0.28); }
.slot:disabled { background: rgba(124, 148, 148, 0.07); color: rgba(124, 148, 148, 0.5); text-decoration: line-through; }

/* summary */
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 9px 12px; margin: 0; font-size: 0.82rem; }
.summary dt { color: var(--ink-2); }
.summary dd { margin: 0; font-weight: 700; text-align: right; }
.summary .total { padding-top: 12px; border-top: 1px dashed var(--line); }

/* dentist picker */
.dentists { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.dentist {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  box-shadow: none;
}
.dentist.is-selected { border-color: var(--teal); background: var(--mint-soft); }
.dentist .face {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #D9F5F0, #A8E6DF);
  color: var(--teal-deep); font-weight: 800; font-size: 0.75rem; flex: none;
}
.dentist .who strong { display: block; font-size: 0.8rem; }
.dentist .who span { display: block; font-size: 0.68rem; color: var(--ink-3); }

/* ---------- ring ---------- */
.ring-wrap { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 118px; height: 118px; flex: none; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring circle { fill: none; stroke-linecap: round; }
.ring .track { stroke: rgba(19, 184, 178, 0.14); stroke-width: 11; }
.ring .bar { stroke: url(#ringGrad); stroke-width: 11; }
.ring .mid {
  position: absolute; inset: 0;
  display: grid; place-items: center; text-align: center;
}
.ring .mid b { font-family: var(--font-num); font-size: 1.5rem; line-height: 1; }
.ring .mid span { display: block; font-size: 0.6rem; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- list rows ---------- */
.rows { display: flex; flex-direction: column; gap: 8px; }

.row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(19, 184, 178, 0.1);
}

.row .when { text-align: center; min-width: 54px; }
.row .when b { display: block; font-family: var(--font-num); font-size: 0.95rem; }
.row .when span { display: block; font-size: 0.62rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }

.row .who strong { display: block; font-size: 0.86rem; }
.row .who span { display: block; font-size: 0.72rem; color: var(--ink-2); }

.row .acts { display: flex; gap: 6px; }
.row .acts button { padding: 7px 12px; font-size: 0.72rem; }

/* ---------- notice ---------- */
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 0.76rem;
  color: #8A5A2B;
  background: rgba(255, 216, 194, 0.5);
  border: 1px solid rgba(255, 183, 148, 0.5);
}

.notice strong { flex: none; }

@media (max-width: 620px) {
  .notice {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.5;
  }
}

/* ---------- bottom nav (mobile) ---------- */
.bottom-nav { display: none; }

/* ---------- staff extras ---------- */
.staff-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
.week { display: grid; grid-template-columns: 56px repeat(5, 1fr); gap: 6px; font-size: 0.7rem; }
.week .hd { font-weight: 700; color: var(--ink-3); text-align: center; padding: 4px 0; }
.week .hr { color: var(--ink-3); text-align: right; padding-right: 6px; font-family: var(--font-num); }
.week .cell { min-height: 46px; border-radius: 10px; background: rgba(255, 255, 255, 0.55); border: 1px dashed rgba(19, 184, 178, 0.14); } .week .cell.has {
  background: linear-gradient(135deg, rgba(26, 198, 190, 0.16), rgba(168, 230, 223, 0.35));
  border: 1px solid rgba(19, 184, 178, 0.3);
  padding: 5px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--teal-deep);
  line-height: 1.25;
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .services { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .booking { grid-template-columns: 1fr; }
  .staff-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; padding: 14px; gap: 14px; }
  .side { display: none; }
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 12px; right: 12px; bottom: 12px;
    z-index: 20;
    padding: 8px 6px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #fff;
    box-shadow: var(--sh-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    justify-content: space-around;
  }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 0.58rem; font-weight: 700; color: var(--ink-3); text-decoration: none;
    padding: 6px 10px; border-radius: 14px;
  }
  .bottom-nav a svg { width: 20px; height: 20px; }
  .bottom-nav a[aria-current="page"] { color: var(--teal-deep); background: var(--mint-soft); }
  .main { padding-bottom: 78px; }
}

@media (max-width: 720px) {
  .hero { padding: 20px; }
  .hero .tooth { width: 76px; height: 76px; }
  .hero h2 { font-size: 1.08rem; }
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .svc { padding: 13px; }
  .tiles { gap: 10px; }
  .row { grid-template-columns: auto 1fr; row-gap: 8px; }
  .row .acts { grid-column: 1 / -1; justify-content: flex-end; }
  .dentists { grid-template-columns: 1fr; }
  .slots { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 420px) {
  .services { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 12px 14px; }
  .greet { flex: 1 1 100%; }
  .greet h1 { font-size: 1.1rem; }
  .avatar { width: 36px; height: 36px; font-size: 0.8rem; }
}
