/* Clinic admin: the same heritage feel as the website. Deep brown, antique gold, ivory paper. */
:root {
  --ink: #2a1a10;
  --brown: #3b2416;
  --deep: #241208;
  --deep-2: #331b0d;
  --gold: #b8862a;
  --gold-2: #d6ab52;
  --gold-soft: #ecd9b0;
  --paper: #f7f1e6;
  --ivory: #fbf7ef;
  --card: #fffdf9;
  --line: #e8dcc6;
  --muted: #7a6350;
  --green: #1d5b40;
  --green-soft: #e4efe8;
  --red: #a1331f;
  --red-soft: #fbece8;
  --r: 20px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", "Segoe UI", system-ui, sans-serif;
  --ml: "Noto Sans Malayalam", "Nirmala UI", sans-serif;
  --shadow: 0 1px 0 rgb(255 255 255 / .8) inset, 0 14px 34px -18px rgb(59 36 22 / .35);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 400 16px/1.55 var(--sans);
  background: radial-gradient(1200px 600px at 100% -10%, #fff6e4 0%, transparent 60%), var(--paper);
}
[lang="ml"] { font-family: var(--ml); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; flex: none; }
a { color: var(--green); text-underline-offset: 3px; }
h1, h2 { margin: 0; font-family: var(--serif); font-weight: 700; color: var(--brown); letter-spacing: .005em; }
h1 { font-size: 2.35rem; line-height: 1.05; }
h2 { font-size: 1.45rem; line-height: 1.15; }
p { margin: .35rem 0 0; }
.eyebrow { margin: 0 0 .35rem; font-size: .74rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.lede { max-width: 44rem; color: var(--muted); }

/* ---------- Sign in ---------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(900px 500px at 50% 0%, #3d2212, var(--deep)); }
.signin-card {
  width: min(100%, 420px); text-align: center; padding: 2.4rem 1.8rem 2rem; border-radius: 28px;
  background: var(--card); border: 1px solid var(--gold-soft); box-shadow: 0 30px 80px rgb(0 0 0 / .45);
}
.signin-card img { border-radius: 50%; box-shadow: 0 0 0 6px #fff, 0 0 0 7px var(--gold-soft); }
.signin-card .eyebrow { margin-top: 1.2rem; }
.signin-card h1 { font-size: 2.4rem; }
.signin-card > p:not(.eyebrow) { margin: .6rem 0 1.4rem; color: var(--muted); }
#google-button { display: flex; justify-content: center; min-height: 44px; }
#dev-login { width: 100%; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.4rem;
  padding: 1.4rem 1rem; background: linear-gradient(180deg, var(--deep) 0%, var(--deep-2) 100%); color: #f3e6cf;
  border-right: 1px solid rgb(214 171 82 / .25);
}
.side-brand { display: flex; align-items: center; gap: .75rem; padding: .3rem .5rem 1.2rem; border-bottom: 1px solid rgb(214 171 82 / .22); color: #fff; text-decoration: none; }
.side-brand img { border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--gold-2); }
.side-brand strong { display: block; font: 700 1.35rem/1 var(--serif); letter-spacing: .01em; }
.side-brand small { display: block; margin-top: .25rem; font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-2); }
.nav { display: grid; gap: .25rem; }
.nav button, .side-link {
  display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 46px; padding: 0 .9rem;
  border: 0; border-radius: 14px; background: transparent; color: #e9d9bd; font: 500 .98rem var(--sans);
  text-decoration: none; cursor: pointer; text-align: left;
}
.nav button:hover, .side-link:hover { background: rgb(255 255 255 / .06); color: #fff; }
.nav button[aria-current="page"] { background: linear-gradient(90deg, rgb(214 171 82 / .22), rgb(214 171 82 / .06)); color: #fff; box-shadow: inset 3px 0 0 var(--gold-2); }
.nav button[aria-current="page"] svg { color: var(--gold-2); }
.side-foot { margin-top: auto; display: grid; gap: .2rem; padding-top: 1rem; border-top: 1px solid rgb(214 171 82 / .22); }
.who { margin: .4rem .9rem; font-size: .8rem; color: #bfa98a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { padding: 2.2rem clamp(1rem, 3vw, 2.8rem) 5rem; max-width: 1180px; width: 100%; }
.page-head { margin-bottom: 1.6rem; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }

/* ---------- Panels & controls ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.3rem; box-shadow: var(--shadow); }
.panel + .panel, .form + * { margin-top: 1rem; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.form { display: grid; gap: .9rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
label, .field { display: grid; gap: .35rem; align-content: start; font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
.label { font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
input:not([type=file]):not([type=checkbox]), textarea, select {
  width: 100%; min-height: 46px; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); font: 400 1rem var(--sans); letter-spacing: 0;
}
textarea { resize: vertical; min-height: 76px; line-height: 1.45; }
input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgb(184 134 42 / .18); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 46px; padding: 0 1.2rem;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--brown);
  font: 600 .95rem var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--gold); }
.btn.primary { background: linear-gradient(180deg, #2a6b4d, var(--green)); border-color: var(--green); color: #fff; box-shadow: 0 8px 20px -10px rgb(29 91 64 / .7); }
.btn.danger { color: var(--red); border-color: #efcfc7; }
.btn.small { min-height: 38px; padding: 0 .85rem; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link-btn { border: 0; background: none; color: var(--green); font: 600 .9rem var(--sans); cursor: pointer; padding: .2rem; }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pick:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-start; }
.chips button {
  min-height: 38px; padding: 0 .9rem; border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--muted); font: 500 .88rem var(--sans); cursor: pointer;
}
.chips button[aria-pressed="true"] { background: var(--brown); border-color: var(--brown); color: #fff; }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--brown); cursor: pointer; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.pill { display: inline-grid; place-items: center; min-width: 1.9rem; height: 1.6rem; padding: 0 .5rem; margin-left: .3rem; border-radius: 999px; background: var(--gold-soft); font: 600 .8rem var(--sans); color: var(--brown); vertical-align: middle; }
.pill:empty { display: none; }
.switch { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 600; color: var(--brown); cursor: pointer; letter-spacing: 0; }
.switch input { width: 20px; height: 20px; accent-color: var(--green); }
.empty { padding: 2rem 1.2rem; border: 2px dashed var(--line); border-radius: var(--r); text-align: center; color: var(--muted); background: rgb(255 255 255 / .5); }
.msg { min-height: 1.4em; font-weight: 600; color: var(--green); }
.msg.err { color: var(--red); }

/* ---------- Overview ---------- */
.ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.ov-grid .panel + .panel { margin-top: 0; }
.panel-wide { grid-column: 1 / -1; }
.branch-now { display: grid; gap: .8rem; }
.branch-now article { padding: .9rem 1rem; border-radius: 16px; background: var(--ivory); border: 1px solid var(--line); }
.branch-now h3 { margin: 0; font: 700 1.2rem var(--serif); color: var(--brown); }
.status { display: inline-flex; align-items: center; gap: .4rem; margin-top: .3rem; font-size: .88rem; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.open { color: var(--green); }
.status.closed { color: var(--red); }
.branch-now p { margin: .15rem 0 0; font-size: .85rem; color: var(--muted); }
.ov-docs, .ov-notices { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.ov-docs li { display: flex; align-items: center; gap: .7rem; }
.ov-docs img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; box-shadow: 0 0 0 2px var(--gold-soft); }
.ov-docs strong { display: block; font-size: .95rem; }
.ov-docs span { font-size: .82rem; color: var(--muted); }
.ov-notices li { padding: .7rem .85rem; border-radius: 12px; font-size: .9rem; background: var(--ivory); border: 1px solid var(--line); }
.ov-empty { color: var(--muted); font-size: .9rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.metric { padding: 1rem; border-radius: 16px; background: var(--ivory); border: 1px solid var(--line); }
.metric b { display: block; font: 700 2.1rem/1 var(--serif); color: var(--brown); font-variant-numeric: tabular-nums; }
.metric span { display: block; margin-top: .35rem; font-size: .82rem; color: var(--muted); }
.chart { margin-top: 1.2rem; }
.chart svg { width: 100%; height: 150px; display: block; }
.chart .bar { fill: var(--gold-soft); }
.chart .bar.today { fill: var(--gold); }
.chart .axis { fill: var(--muted); font: 11px var(--sans); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.quick { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.3rem; }
.quick-btn {
  display: inline-flex; align-items: center; gap: .6rem; min-height: 52px; padding: 0 1.2rem; border-radius: 16px;
  border: 1px solid var(--line); background: var(--card); color: var(--brown); font: 600 .95rem var(--sans); cursor: pointer; box-shadow: var(--shadow);
}
.quick-btn svg { color: var(--gold); }
.quick-btn:hover { border-color: var(--gold); }

/* ---------- Notices ---------- */
.notice-group { margin-top: 1.6rem; }
.notice-group h2 { font-size: 1.2rem; margin-bottom: .6rem; }
.notice-item { display: grid; grid-template-columns: 6px 1fr auto; gap: .9rem; align-items: stretch; padding: .9rem 1rem .9rem .9rem; }
.notice-item + .notice-item { margin-top: .6rem; }
.notice-item .stripe { border-radius: 6px; background: var(--gold); }
.notice-item.closed .stripe { background: var(--red); }
.notice-item.doctor .stripe { background: var(--green); }
.notice-item p { margin: 0; }
.notice-item .meta { margin-top: .25rem; font-size: .8rem; color: var(--muted); }
.notice-item.past { opacity: .6; }

/* ---------- Hours ---------- */
.hours-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.hours-grid .panel + .panel { margin-top: 0; }
.day-row { display: grid; grid-template-columns: 5.5rem auto 1fr; gap: .7rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.day-row:last-of-type { border-bottom: 0; }
.day-row strong { font-weight: 600; color: var(--brown); }
.times { display: flex; align-items: center; gap: .4rem; }
.times input { min-height: 42px; padding: .4rem .5rem; }
.times.off { opacity: .35; pointer-events: none; }
.toggle { min-height: 34px; padding: 0 .75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--green-soft); color: var(--green); font: 600 .8rem var(--sans); cursor: pointer; }
.toggle.off { background: var(--red-soft); color: var(--red); border-color: #efcfc7; }

/* ---------- Doctors ---------- */
.doc-list { display: grid; gap: 1rem; }
.doc { display: grid; grid-template-columns: 170px 1fr; gap: 1.2rem; align-items: start; }
.doc.is-hidden { opacity: .6; }
.doc-photo { display: grid; gap: .5rem; }
.doc-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 16px; background: var(--ivory); box-shadow: 0 0 0 1px var(--line); }
.days-table { width: 100%; border-collapse: separate; border-spacing: 0 .35rem; }
.days-table th { font: 600 .75rem var(--sans); color: var(--muted); letter-spacing: .04em; text-align: center; }
.days-table th:first-child { text-align: left; }
.days-table td:first-child { font-size: .88rem; font-weight: 600; color: var(--brown); padding-right: .5rem; white-space: nowrap; }
.day-dot { display: block; margin: 0 auto; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--muted); font: 600 .72rem var(--sans); cursor: pointer; }
.day-dot[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- Gallery photos & therapies ---------- */
.list-head { margin-top: 1.4rem; }
.stack { display: grid; gap: 1rem; }
.stack .panel + .panel { margin-top: 0; }
.photo-card { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; padding: 0; overflow: hidden; }
.frame { position: relative; display: grid; place-items: center; background: var(--deep); }
.frame img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: cover; }
.frame[data-ratio="landscape"] img { aspect-ratio: 4 / 3; }
.frame[data-ratio="square"] img { aspect-ratio: 1; }
.frame[data-ratio="portrait"] img { aspect-ratio: 3 / 4; }
.frame[data-ratio="wide"] img { aspect-ratio: 16 / 9; }
.frame[data-focus="top"] img { object-position: 50% 15%; }
.frame[data-focus="bottom"] img { object-position: 50% 85%; }
.badge { position: absolute; top: .7rem; left: .7rem; padding: .25rem .6rem; border-radius: 999px; background: rgb(36 18 8 / .8); color: var(--gold-soft); font-size: .72rem; font-weight: 600; letter-spacing: .06em; }
.fields { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.2rem; row-gap: .8rem; padding: 1.2rem; }
.fields > .row { grid-column: 1 / -1; padding-top: .6rem; border-top: 1px solid var(--line); }
.fields.flush { padding: 0; }
.pending { margin-bottom: 1.4rem; padding: 1.2rem; border-radius: 24px; background: var(--green-soft); border: 1px solid #c9dfd2; }
.therapy-list { display: grid; gap: 1rem; }
.therapy-list .panel + .panel, .doc-list .panel + .panel { margin-top: 0; }
.therapy { display: grid; grid-template-columns: 180px 1fr; gap: 1.2rem; align-items: start; }
.therapy.is-hidden { opacity: .6; }
.t-photo { display: grid; gap: .5rem; }
.t-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 14px; background: var(--ivory); }
.therapy .fields, .doc .fields { grid-template-columns: 1fr 1fr; padding: 0; }

/* ---------- Reviews ---------- */
.nr-media { display: grid; gap: .6rem; justify-items: start; padding: 1rem; border-radius: 16px; background: var(--ivory); border: 1px dashed var(--gold-soft); }
.nr-preview:empty { display: none; }
.nr-preview img, .nr-preview video { display: block; max-width: 100%; max-height: 340px; border-radius: 14px; background: var(--deep); }
.warn { margin: .4rem 0 0; padding: .6rem .8rem; border-radius: 12px; background: var(--red-soft); color: var(--red); font-size: .88rem; font-weight: 500; }
progress { width: 100%; height: 10px; border: 0; border-radius: 999px; overflow: hidden; background: var(--ivory); accent-color: var(--green); }
progress::-webkit-progress-bar { background: var(--ivory); }
progress::-webkit-progress-value { background: var(--green); }
.review-item { display: grid; grid-template-columns: minmax(200px, 280px) 1fr; padding: 0; overflow: hidden; }
.review-item.is-hidden { opacity: .6; }
.rv-frame { position: relative; display: grid; place-items: center; min-height: 200px; background: var(--deep); }
.rv-frame img, .rv-frame video { display: block; width: 100%; height: 100%; max-height: 380px; object-fit: contain; }
.rv-frame.rv-text { background: linear-gradient(160deg, var(--ivory), var(--gold-soft)); }
.rv-quote { font: 700 7rem/1 var(--serif); color: var(--gold); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; padding: .75rem 1.2rem; border-radius: 999px; background: var(--deep); color: var(--gold-soft); font-weight: 600; box-shadow: 0 16px 40px rgb(0 0 0 / .3); max-width: calc(100vw - 2rem); }
.toast.err { background: var(--red); color: #fff; }

/* ---------- Tablet & phone ---------- */
@media (max-width: 1100px) {
  .ov-grid { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: .4rem; padding: .6rem .8rem .5rem; padding-top: calc(.6rem + env(safe-area-inset-top));
  }
  .side-brand { padding: 0; border: 0; flex: 1; }
  .side-brand img { width: 36px; height: 36px; }
  .side-brand strong { font-size: 1.15rem; }
  .side-foot { display: contents; }
  .side-foot .who, .side-foot a.side-link { display: none; }
  #logout { width: auto; min-height: 38px; padding: 0 .7rem; font-size: .85rem; }
  .nav { order: 3; width: 100%; display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; margin: 0 -.2rem; padding: .2rem; }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { width: auto; flex: none; min-height: 40px; padding: 0 .85rem; gap: .45rem; font-size: .9rem; border-radius: 999px; background: rgb(255 255 255 / .06); }
  .nav button[aria-current="page"] { box-shadow: none; background: var(--gold-2); color: var(--deep); }
  .nav button[aria-current="page"] svg { color: var(--deep); }
  .main { padding: 1.4rem 1rem 5rem; }
  h1 { font-size: 2rem; }
  .ov-grid, .hours-grid, .two, .fields, .photo-card, .review-item, .doc, .therapy, .therapy .fields, .doc .fields { grid-template-columns: 1fr; }
  .doc-photo { grid-template-columns: 110px 1fr; align-items: center; }
  .frame img { max-height: 420px; }
  .rv-frame { min-height: 140px; }
  .day-row { grid-template-columns: 4.2rem auto 1fr; }
  .day-dot { width: 32px; height: 32px; }
  .quick-btn { flex: 1 1 100%; }
}
