/* ─────────────────────────────────────────────────────────────────────────────
   پنل ادمین آریا کلینیک — استایل مستقل (به style.css سایت وابسته نیست)
   ───────────────────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Vazirmatn';
  src: url('../assets/Vazirmatn.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ink: #14261f;
  --ink-soft: #3d5347;
  --muted: #7d8f81;
  --paper: #f5f7f1;
  --card: #ffffff;
  --line: #e2e9dc;
  --line-strong: #cfdcc6;
  --deep: #0d241d;
  --deep-2: #12332a;
  --green: #1d5a49;
  --green-soft: #e8f0e0;
  --lime: #d4ef7b;
  --amber: #b4761f;
  --amber-soft: #fdf3e2;
  --red: #a33a2f;
  --red-soft: #fbeceb;
  --focus: #7ba05b;
  --radius: 14px;
  --shadow: 0 18px 40px -28px rgba(13, 36, 29, .55);
  --sidebar: 268px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.4; }
p { margin: 0 0 10px; }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; unicode-bidi: embed; }

/* ── ورود / راه‌اندازی ───────────────────────────────────────────────────── */
.auth {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  background: radial-gradient(900px 500px at 12% 8%, #17392e 0%, #0b1f19 55%, #08160f 100%);
}
.auth-art {
  padding: 56px 48px;
  color: #e8f0e0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 19px; letter-spacing: .2px; }
.auth-brand svg { width: 34px; height: 38px; color: var(--lime); }
.auth-art h1 { font-size: clamp(26px, 3vw, 38px); line-height: 1.35; max-width: 460px; }
.auth-art p { color: #a9c0b4; max-width: 440px; }
.auth-points { display: grid; gap: 12px; margin-top: 6px; }
.auth-point { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #c6d8cc; }
.auth-point i {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 9px;
  background: rgba(212, 239, 123, .14); color: var(--lime);
  display: grid; place-items: center; font-style: normal; font-size: 13px;
}
.auth-foot { font-size: 12px; color: #7e958a; }
.auth-panel {
  background: var(--paper);
  padding: 40px;
  display: grid;
  align-content: center;
  gap: 18px;
}
.auth-card { max-width: 400px; width: 100%; margin: 0 auto; }
.auth-card h2 { font-size: 22px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .field .hint { margin-top: 5px; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 8px; }

/* ── فرم‌ها ──────────────────────────────────────────────────────────────── */
label, .label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
input[type='text'], input[type='password'], input[type='number'], input[type='date'],
input[type='search'], input[type='email'], input[type='tel'], select, textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 12px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.9; }
input:focus, select:focus, textarea:focus {
  border-color: var(--focus);
  outline: none;
  box-shadow: 0 0 0 2px #cde3b8;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(0% + 14px) 52%, calc(0% + 19px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-left: 32px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.7; }
.error-text { color: var(--red); font-size: 12px; margin-top: 6px; min-height: 1px; }

/* خطای هر فیلد، درست زیر همان فیلد */
.field { position: relative; }
.field-error {
  display: block; color: var(--red); font-size: 11.8px; line-height: 1.7;
  min-height: 0; margin-top: 0; max-height: 0; overflow: hidden;
  transition: max-height .18s ease, margin-top .18s ease;
}
.field-error:not(:empty) { margin-top: 6px; max-height: 80px; }
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: #d6a29b;
  background: #fffafa;
  box-shadow: 0 0 0 2px #f7e2df;
}
.field.has-error label { color: var(--red); }
.field.has-error .hint { color: #a97167; }

/* ── دکمه‌ها ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  background: var(--green); color: #fff; cursor: pointer;
  transition: transform .12s, background .15s, box-shadow .15s;
}
.btn:hover { background: #17493b; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: #f2f6ec; }
.btn.lime { background: var(--lime); color: #17311f; }
.btn.lime:hover { background: #c6e860; }
.btn.danger { background: #fff; color: var(--red); border-color: #efd3d0; }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { padding: 5px 11px; font-size: 12px; border-radius: 8px; }
.btn.link { background: none; border: 0; color: var(--green); padding: 2px 4px; }
.btn.link:hover { text-decoration: underline; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── پوسته ───────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.side {
  background: linear-gradient(180deg, var(--deep) 0%, #0a1d17 100%);
  color: #dbe8dd; padding: 22px 16px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 6px; }
.side-brand svg { width: 26px; height: 30px; color: var(--lime); }
.side-brand strong { color: #fff; font-size: 15px; display: block; line-height: 1.3; }
.side-brand span { font-size: 11px; color: #7f9a8b; }
.side-nav { display: grid; gap: 3px; }
.side-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; color: #b9cdc0; text-align: right;
  padding: 9px 11px; border-radius: 9px; font-size: 13px; cursor: pointer;
}
.side-nav button:hover { background: rgba(212, 239, 123, .08); color: #eaf4e6; }
.side-nav button[aria-current='true'] { background: rgba(212, 239, 123, .14); color: #fff; font-weight: 600; }
.side-nav .ico { width: 17px; text-align: center; opacity: .9; font-size: 13px; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 14px; font-size: 11.5px; color: #7f9a8b; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 8px 6px; }
.avatar { width: 32px; height: 32px; border-radius: 10px; background: rgba(212, 239, 123, .16); color: var(--lime); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.side-user strong { color: #fff; font-size: 12.5px; display: block; }
.side-user span { font-size: 11px; color: #8fa79a; }

.main { padding: 26px 30px 60px; max-width: 1180px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.top h1 { font-size: 24px; }
.top p { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.chip-live { display: inline-flex; align-items: center; gap: 6px; background: var(--green-soft); color: #2c5c46; border-radius: 999px; padding: 4px 11px; font-size: 11.5px; }
.chip-live i { width: 7px; height: 7px; border-radius: 50%; background: #6aa84f; display: inline-block; }

/* ── کارت‌ها ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card > h2 { font-size: 15px; margin-bottom: 4px; }
.card > .hint { margin-top: 0; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 15px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 22px; line-height: 1.3; }
.stat span { color: var(--muted); font-size: 12px; }
.stat.lime { background: linear-gradient(160deg, #f4fae4, #fff); border-color: #dfecc4; }

/* ── جدول ────────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 12.8px; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* ── برچسب‌ها ────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; border-radius: 999px; padding: 2px 9px; background: #eef2ea; color: #4c6354; }
.badge.ok { background: var(--green-soft); color: #2c5c46; }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.off { background: #f0f0ee; color: #86867f; }
.badge.sys { background: #eaf1fb; color: #3a5f96; }

/* ── سوییچ ───────────────────────────────────────────────────────────────── */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--ink-soft); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: #d8dfd2; position: relative; transition: background .18s; flex: 0 0 38px; }
.switch .track::after { content: ''; position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(-16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ── چیپ ساعت‌ها ─────────────────────────────────────────────────────────── */
.slot-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.slot-chip { font-size: 11.5px; background: var(--green-soft); color: #2f6049; border-radius: 7px; padding: 2px 8px; }
.slot-chip.is-empty { background: var(--amber-soft); color: var(--amber); }
.day-table td { padding: 8px 6px; }
.day-table input[type='text'] { font-family: ui-monospace, monospace; direction: ltr; text-align: left; }
.day-table .day-name { font-weight: 600; white-space: nowrap; }
.day-table tr.is-closed { background: #faf9f6; }
.day-table tr.is-closed input[type='text'] { opacity: .55; }

.jdate { display: grid; grid-template-columns: 84px minmax(0, 1fr) 74px; gap: 6px; }
.jdate select { padding-left: 26px; }

/* ── فهرست مجوزها ────────────────────────────────────────────────────────── */
.perm-group { margin-bottom: 14px; }
.perm-group h4 { font-size: 12px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 6px; }
.perm {
  display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: #fcfdfa; cursor: pointer; font-size: 12.3px;
}
.perm:hover { border-color: var(--line-strong); background: #f7faf2; }
.perm input { margin: 4px 0 0; accent-color: var(--green); width: 15px; height: 15px; flex: 0 0 15px; }
.perm input:disabled { opacity: .5; }
.perm code { font-size: 10.5px; color: var(--muted); display: block; direction: ltr; text-align: right; }
.perm.is-on { border-color: #c9dcb4; background: #f6faef; }

/* ── مقاله‌ها ────────────────────────────────────────────────────────────── */
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item strong { font-size: 13.5px; display: block; }
.list-item .meta { font-size: 11.5px; color: var(--muted); }
.section-editor { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fcfdfa; }
.section-editor .row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }

/* ── توست ────────────────────────────────────────────────────────────────── */
#toast { position: fixed; inset-inline-end: 24px; bottom: 24px; display: grid; gap: 8px; z-index: 60; }
.toast {
  background: var(--deep); color: #eaf4e6; border-radius: 11px; padding: 11px 16px; font-size: 12.5px;
  box-shadow: 0 16px 36px -18px rgba(0, 0, 0, .6); display: flex; align-items: center; gap: 9px;
  animation: toast-in .22s ease both;
}
.toast.err { background: #5c1f19; }
.toast.ok::before { content: '✓'; color: var(--lime); font-weight: 700; }
.toast.err::before { content: '!'; color: #ffb4a8; font-weight: 700; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ── اخطار ───────────────────────────────────────────────────────────────── */
.alert { border-radius: 10px; padding: 11px 14px; font-size: 12.5px; margin-bottom: 14px; border: 1px solid; }
.alert.info { background: #f2f7ec; border-color: #dbe8cc; color: #38553f; }
.alert.warn { background: var(--amber-soft); border-color: #f1ddb8; color: #7a4f14; }
.alert.danger { background: var(--red-soft); border-color: #f0d2ce; color: #7d2b22; }

/* ── چیدمان دوستونی ──────────────────────────────────────────────────────── */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.sticky-col { position: sticky; top: 24px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12.3px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ── ریسپانسیو ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { min-height: 100vh; padding: 28px 20px; }
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 12px; gap: 12px; }
  .side-brand, .side-foot { display: none; }
  .side-nav { grid-auto-flow: column; grid-auto-columns: max-content; gap: 4px; }
  .side-user { margin-inline-start: auto; }
  .main { padding: 18px 16px 48px; }
  .split { grid-template-columns: 1fr; }
  .sticky-col { position: static; }
}

/* پوستهٔ شیشه‌ای هماهنگ با طیف سبز روشن صفحهٔ اصلی */
:root {
  --ink:#1b3c30; --ink-soft:#385a49; --muted:#567263;
  --paper:#eef6ef; --card:rgba(255,255,255,.78); --line:rgba(104,150,117,.22);
  --line-strong:#bdd4c3; --deep:#183f2e; --deep-2:#285b42; --green:#285f43;
  --green-soft:#e0f0e4; --lime:#c4e8ce; --focus:#32794e; --radius:18px;
  --shadow:0 16px 38px -26px rgba(33,74,56,.35); --sidebar:258px;
}
body { background:radial-gradient(ellipse at 3% 4%,#cfe9d6 0,transparent 35%),radial-gradient(ellipse at 85% 35%,#e0f2e4 0,transparent 42%),#f1f7f1; }
.shell { gap:0; }
.side { background:linear-gradient(165deg,rgba(28,72,51,.97),rgba(16,49,37,.98)); box-shadow:-8px 0 32px rgba(27,60,48,.12); padding:26px 16px; }
.side-brand { padding:2px 10px 18px; border-bottom:1px solid rgba(255,255,255,.12); }
.side-brand span,.side-user span,.side-foot { color:#b6cfc0; }
.side-nav { gap:5px; }
.side-nav button { min-height:43px; border:1px solid transparent; color:#d1e3d5; border-radius:12px; }
.side-nav button:hover { background:rgba(234,244,236,.1); }
.side-nav button[aria-current='true'] { background:rgba(226,247,230,.17); border-color:rgba(219,244,224,.18); box-shadow:inset 3px 0 #b9e7c3; }
.side-nav .ico { display:grid; place-items:center; width:27px; height:27px; border-radius:8px; background:rgba(231,249,235,.10); font-size:15px; }
.side-user { margin-top:auto; border:1px solid rgba(255,255,255,.12); border-radius:14px; padding:10px; background:rgba(255,255,255,.05); }
.side-foot { margin-top:0; }
.main { width:100%; max-width:1500px; padding:34px clamp(22px,3.3vw,52px) 65px; }
.top { align-items:center; margin-bottom:27px; }
.top h1 { font-size:clamp(23px,2.3vw,30px); }
.top p { font-size:13px; }
.chip-live { background:rgba(255,255,255,.7); border:1px solid var(--line); padding:7px 13px; font-weight:600; }
.card,.stat { background:var(--card); border:1px solid rgba(255,255,255,.95); box-shadow:var(--shadow),0 0 0 1px rgba(120,160,130,.11); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); }
.card { padding:22px; }
.card-head h2,.card > h2 { font-size:16px; }
.stat { border-radius:16px; padding:20px; min-height:106px; }
.stat b { color:#285b42; font-size:26px; }
.stat span { color:#4b6c59; }
.stat.lime { background:linear-gradient(145deg,rgba(211,239,217,.95),rgba(255,255,255,.8)); border-color:#fff; }
.btn { border-radius:11px; min-height:40px; }
.btn.small { min-height:34px; }
.btn.ghost { background:rgba(255,255,255,.78); }
input[type='text'],input[type='password'],input[type='number'],input[type='date'],input[type='search'],input[type='email'],input[type='tel'],select,textarea { background-color:rgba(255,255,255,.86); min-height:42px; }
.welcome { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:26px 30px; margin-bottom:17px; border:1px solid rgba(255,255,255,.95); border-radius:22px; background:linear-gradient(115deg,rgba(222,243,226,.95),rgba(255,255,255,.7)),#eaf4ec; box-shadow:var(--shadow); overflow:hidden; }
.welcome-kicker { color:#4d8060; font-size:12px; font-weight:700; }
.welcome h2 { font-size:clamp(20px,2vw,26px); margin:7px 0; }
.welcome p { color:#4b6c59; margin:0; }
.welcome-mark { color:#89c79b; font-size:75px; line-height:1; opacity:.6; }
.booking-notice { margin-bottom:24px; line-height:1.9; }
.section-title { display:flex; align-items:end; justify-content:space-between; margin:4px 0 13px; }
.section-title h2 { font-size:16px; }
.section-title p { margin:3px 0 0; color:var(--muted); font-size:12px; }
.quick-section { margin-bottom:27px; }
.quick-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.quick-link { text-align:right; display:flex; align-items:center; gap:12px; min-width:0; min-height:90px; padding:14px; border:1px solid rgba(255,255,255,.95); border-radius:16px; background:rgba(255,255,255,.7); box-shadow:var(--shadow); color:var(--ink); cursor:pointer; backdrop-filter:blur(12px); transition:transform .15s,background .15s; }
.quick-link:hover { transform:translateY(-2px); background:#fff; }
.quick-icon { display:grid; place-items:center; flex:0 0 42px; height:42px; border-radius:13px; background:#e2f2e5; color:#286143; font-size:20px; }
.quick-link strong,.quick-link small { display:block; }
.quick-link strong { font-size:13px; }
.quick-link small { font-size:11px; color:#567263; margin-top:3px; }
.quick-arrow { margin-inline-start:auto; color:#518465; font-size:18px; }
@media (max-width:1100px) { .quick-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:900px) {
  .side { display:flex; flex-direction:column; align-items:stretch; gap:10px; padding:12px 14px; overflow:visible; }
  .side-brand { display:flex; padding:0 4px 8px; }
  .side-nav { display:flex; overflow-x:auto; padding-bottom:4px; scrollbar-width:thin; }
  .side-nav button { width:auto; white-space:nowrap; flex:0 0 auto; }
  .side-user { margin:0; padding:6px 10px; }
  .side-foot { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-top:8px; }
  .side-foot .btn-row { margin-bottom:0 !important; }
  .main { padding:22px 16px 48px; }
}
@media (max-width:480px) {
  .welcome { padding:21px; }
  .welcome-mark { font-size:48px; }
  .quick-grid { grid-template-columns:1fr 1fr; gap:8px; }
  .quick-link { align-items:flex-start; flex-direction:column; gap:7px; padding:12px; }
  .quick-arrow { display:none; }
  .grid-3,.grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .grid-2 { grid-template-columns:1fr; }
  .stat { padding:14px; min-height:95px; }
  .card { padding:17px; }
  .side-foot { flex-wrap:wrap; }
}
@media (prefers-reduced-motion:reduce) { .quick-link,.toast { transition:none; animation:none; } }
.shell > .side, .shell > .main { min-width:0; }

/* ویرایشگرهای محتوا: گروه‌بندی روشن، کنترل‌های همیشه در دسترس، بدون تغییر داده‌ها */
.editor-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.editor-toolbar h2 { font-size:16px; }
.editor-toolbar .hint { margin:5px 0 0; }
.editor-toolbar .btn-row { margin:0; }
.editor-group h2,.editor-group h3 { color:#1c4933; font-size:15px; }
.editor-group h3 { margin-bottom:12px; }
.editor-group .hint { margin:4px 0 14px; }
.editor-field { margin-top:16px; }
.article-fields > div { min-width:0; }
.article-section { padding:16px; margin:12px 0; background:rgba(245,251,246,.8); }
.article-section label:not(:first-child) { margin-top:12px; }
.section-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.section-heading strong { color:#285f43; font-size:13px; }
.article-publish { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; }
.article-publish h2 { font-size:15px; }
.article-publish .hint { margin:5px 0 10px; }
.article-publish .btn-row { margin:0; }
.service-editor { padding:0; overflow:hidden; }
.service-editor > summary { display:flex; align-items:center; gap:12px; padding:16px 20px; cursor:pointer; list-style:none; }
.service-editor > summary::-webkit-details-marker { display:none; }
.service-editor > summary:hover { background:#e4f4e8a8; }
.service-editor > summary:focus-visible { outline:2px solid var(--focus); outline-offset:-4px; }
.service-summary-title { flex:1; min-width:0; }
.service-summary-title strong,.service-summary-title small { display:block; overflow-wrap:anywhere; }
.service-summary-title strong { color:#214d35; font-size:14px; }
.service-summary-title small { width:max-content; max-width:100%; color:var(--muted); font:11px/1.6 ui-monospace,monospace; }
.service-edit-hint { color:#2d6948; font-size:12px; white-space:nowrap; }
.service-edit-hint span { display:inline-block; transition:transform .15s; }
.service-editor[open] .service-edit-hint span { transform:rotate(180deg); }
.service-editor-body { padding:0 20px 20px; border-top:1px solid var(--line); }
.service-editor-body .editor-group { padding:16px 0; border-bottom:1px solid var(--line); }
.service-editor-body .editor-group:last-child { border:0; padding-bottom:0; }
.service-editor-body .editor-group > label:not(.switch) { margin-top:14px; }
.service-editor-body .switch { margin-top:16px; }
.field-optional { font-weight:400; color:var(--muted); }
.editor-bottom-actions { display:flex; align-items:center; justify-content:flex-end; gap:16px; flex-wrap:wrap; margin:0 0 18px; }
.calendar-toolbar { margin-bottom:16px; }
.calendar-week .card-head .hint { margin:0; }
.calendar-week .day-table input[type=text] { min-width:0; }
@media (max-width:700px) {
  .editor-toolbar { align-items:stretch; }
  .editor-toolbar .btn:not(.small) { width:100%; }
  .service-editor > summary { padding:14px; gap:8px; }
  .service-editor-body { padding:0 14px 14px; }
  .service-edit-hint { font-size:11px; }
  .calendar-week .table-wrap { overflow:visible; }
  .calendar-week .day-table,.calendar-week .day-table tbody { display:block; }
  .calendar-week .day-table thead { display:none; }
  .calendar-week .day-table tr { display:grid; grid-template-columns:1fr auto; gap:6px 10px; padding:12px; margin-bottom:10px; border:1px solid var(--line); border-radius:12px; background:#ffffffad; }
  .calendar-week .day-table tr.is-closed { background:#f2f5f1; }
  .calendar-week .day-table td { display:block; padding:0; border:0; min-width:0; }
  .calendar-week .day-table td:nth-child(3) { grid-column:1 / -1; }
  .calendar-week .day-table td:nth-child(4) { grid-column:1 / -1; }
  .calendar-week .day-table .slot-row { margin-top:6px; gap:4px; }
}
@media (prefers-reduced-motion:reduce) { .service-edit-hint span { transition:none; } }
.editor-toolbar .editor-dirty { margin:4px 0 0; color:#8a571c; font-size:12px; font-weight:600; }
.editor-toolbar .editor-dirty:empty { display:none; }

.service-editor-body .grid-2, .article-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
.service-save-row { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding-top:14px; }
.service-save-row .hint { margin:0; }
@media(max-width:600px) { .service-editor-body .grid-2, .article-fields { grid-template-columns:1fr; } }
.category-add { margin-top:10px; padding:12px; border:1px solid var(--line-strong); border-radius:12px; background:#eff8f1; }
.category-add-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.category-add-row input { flex:1 1 150px; min-width:0; }
.category-add .hint { margin:7px 0 0; }
.image-help { margin-top:10px; padding:12px 14px; background:#eaf6ed; border:1px solid #c6dfcd; border-radius:12px; color:#315943; font-size:12px; line-height:1.9; }
.image-help summary { color:#204b32; font-weight:700; cursor:pointer; }
.image-help ol { margin:4px 0; padding-inline-start:20px; }
.image-help p { margin:5px 0 0; }
.image-help code { display:inline-block; direction:ltr; unicode-bidi:isolate; font-size:11px; color:#204b32; overflow-wrap:anywhere; }

.booking-search { display:grid; grid-template-columns:minmax(130px, 190px) minmax(0, 1fr) auto; gap:10px; align-items:end; margin-bottom:16px; }
.booking-search label { min-width:0; display:grid; gap:6px; }
.booking-search input, .booking-search select { width:100%; min-width:0; }
.booking-search .hint { grid-column:1 / -1; margin:0; }
@media (max-width:600px) { .booking-search { grid-template-columns:1fr; } }

/* Booking editor: legible on both narrow and wide panels. */
.booking-edit { display: grid; gap: 12px; margin-bottom: 18px; }
.booking-edit label { display: grid; gap: 6px; }
.booking-edit input, .booking-edit select, .booking-edit textarea { width: 100%; max-width: 100%; }
.booking-edit textarea { min-height: 110px; resize: vertical; }
.booking-edit .jdate { margin-top: 6px; }

.booking-actions { align-items: center; margin-top: 14px; }
.booking-actions .btn { flex: 0 0 auto; white-space: nowrap; }

/* Booking editing mirrors the public booking sheet without changing its data flow. */
.booking-edit-dialog {
  width: min(760px, calc(100vw - 32px)); max-width: none;
  max-height: min(92dvh, 980px); padding: 0; border: 1px solid #dbe9da;
  border-radius: 24px; background: #fff; color: var(--ink);
  box-shadow: 0 24px 90px #0e302d38; overflow-y: auto;
}
.booking-edit-dialog::backdrop { background: #163f3377; backdrop-filter: blur(5px); }
.booking-edit-dialog .booking-edit { display: block; margin: 0; padding: 24px 28px 28px; }
.booking-edit-header { display: flex; align-items: center; justify-content: flex-start; gap: 14px; }
.booking-edit-header h2 { margin: 0; font-size: 18px; }
.booking-edit-close { order: -1; display: grid; place-items: center; flex: none; width: 38px; height: 38px; border: 1px solid #cfe0cf; border-radius: 12px; background: #f3f8f2; color: #285c45; font-size: 26px; cursor: pointer; }
.booking-edit-notice { margin: 15px 0 24px; padding: 12px 15px; border-radius: 11px; background: #eff7ee; color: #527565; font-size: 12px; }
.booking-edit-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px 18px; }
.booking-edit-grid label { display: grid; align-content: start; gap: 9px; font-size: 12px; font-weight: 600; color: #315c47; }
.booking-edit-grid input:not([type=hidden]), .booking-edit-grid select, .booking-edit-grid textarea { box-sizing: border-box; width: 100%; min-height: 52px; padding: 12px 14px; border: 1px solid #cfe0cf; border-radius: 11px; background: #fff; color: #244c3b; font: inherit; }
.booking-edit-grid textarea { min-height: 100px; resize: vertical; }
.booking-edit-full { grid-column: 1 / -1; min-width: 0; }
.booking-edit-label { display: block; margin-bottom: 12px; color: #315c47; font-size: 12px; font-weight: 600; }
.booking-cal-week { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
.booking-cal-strip { display: flex; flex: 1; gap: 8px; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: #bed4b5 transparent; scrollbar-width: thin; padding-bottom: 8px; }
.booking-cal-day { display: grid; place-items: center; flex: 0 0 80px; height: 90px; border: 1px solid #d8e5d3; border-radius: 12px; background: #fff; color: #466b53; cursor: pointer; }
.booking-cal-day span, .booking-cal-day small { font-size: 10px; }
.booking-cal-day strong { font-size: 19px; line-height: 1; }
.booking-cal-day.is-selected, .booking-cal-time.is-selected { background: #28684e; color: #fff; border-color: #28684e; }
.booking-cal-nav { flex: 0 0 36px; border: 1px solid #d8e5d3; border-radius: 11px; background: #fff; color: #52775f; cursor: pointer; }
.booking-cal-times { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; direction: rtl; }
.booking-cal-time { min-height: 48px; padding: 7px 4px; border: 1px solid #d8e5d3; border-radius: 10px; background: #fff; color: #345a46; cursor: pointer; font: inherit; }
.booking-cal-time small { display: block; font-size: 9px; }
.booking-cal-time.is-busy, .booking-cal-time:disabled { background: #faf8f7; border-color: #f0ecea; color: #c7c4bf; text-decoration: line-through; cursor: not-allowed; }
.booking-edit-selected { margin-top: 16px; color: #315c47; font-size: 12px; }
.booking-edit-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.booking-edit-dialog button:focus-visible, .booking-edit-dialog input:focus-visible, .booking-edit-dialog select:focus-visible, .booking-edit-dialog textarea:focus-visible { outline: 2px solid #43876a; outline-offset: 2px; }
@media (max-width: 600px) {
  .booking-edit-dialog { width: calc(100vw - 20px); max-height: 94dvh; border-radius: 18px; }
  .booking-edit-dialog .booking-edit { padding: 18px; }
  .booking-edit-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .booking-edit-full { grid-column: auto; }
  .booking-cal-day { flex-basis: 68px; height: 80px; }
  .booking-cal-nav { flex-basis: 32px; }
  .booking-cal-times { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

/* Login screen: isolated from setup and the authenticated dashboard. */
.login-page{min-height:100vh;min-height:100dvh;background:#101211;color:#f3f6f3;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;gap:42px}
.login-card{width:min(100%,440px);padding:36px 38px 30px;border-radius:26px;background:linear-gradient(135deg,#1c1e1d 0%,#171918 56%,#141615 100%);border:1px solid #ffffff08;box-shadow:0 24px 80px #0003}
.login-brand{text-align:center;display:flex;flex-direction:column;align-items:center;gap:13px;color:#d5e7d9;font-size:12px}.login-brand img{width:76px;height:76px;object-fit:contain}
.login-card h1{text-align:center;font-size:22px;margin:9px 0 5px;color:#f5f8f5}.login-card .sub{text-align:center;color:#a2aaa4;font-size:12px;margin:0 0 25px}
.login-card .field{margin-bottom:13px}.login-card label{color:#d0d7d1;font-size:12px;margin-bottom:5px}.login-card input:not([type]),.login-card input[type=password]{display:block;width:100%;min-height:52px;background:#2b2e2c;border:1px solid #ffffff0b;border-radius:14px;color:#f4f7f4;padding:12px 16px;box-shadow:none}.login-card input::placeholder{color:#adb5af;opacity:1}.login-card input:focus-visible{outline:2px solid #98d1aa;outline-offset:2px;border-color:#98d1aa;box-shadow:none}.login-card .field.has-error input{border-color:#ee8888}.login-card .field-error,.login-card .error-text{color:#ffa9a9}
.login-card form>.btn{width:100%;justify-content:center;min-height:52px;margin-top:12px;border:1px solid #ffffff0a;border-radius:999px;background:#2d3630;color:#f7fbf8;font-weight:700}.login-card form>.btn:hover{background:#3a5142}.login-card form>.btn:focus-visible,.login-card a:focus-visible,.login-card summary:focus-visible{outline:2px solid #98d1aa;outline-offset:3px}
.login-recovery{margin:18px 0 0;color:#adb7af;font-size:12px;text-align:center}.login-recovery summary{cursor:pointer;list-style:none;text-decoration:underline;text-underline-offset:4px}.login-recovery summary::-webkit-details-marker{display:none}.login-recovery p{margin:10px 0 0;line-height:1.9}
.login-back{display:block;text-align:center;color:#c5d5c9;font-size:12px;text-decoration:none;border-top:1px solid #ffffff10;margin-top:20px;padding-top:19px}.login-back:hover{color:#fff}.login-footer{text-align:center;color:#939d95;font-size:12px;margin:0}
@media(max-width:480px){.login-page{padding:24px 16px;gap:30px}.login-card{padding:30px 22px 26px;border-radius:22px}.login-card h1{font-size:20px}}

.article-image-field :is(#a-img-upload,#a-img-mobile-upload){display:block;width:100%;margin:8px 0 4px;padding:10px;border:1px solid #c6dbc9;border-radius:10px;background:#f8fcf8;color:#244b37}
.article-image-field :is(label[for="a-img-upload"],label[for="a-img-mobile-upload"]){display:block;margin-top:14px}
.article-image-preview{display:block;width:min(100%,260px);max-height:170px;object-fit:contain;border-radius:12px;margin:8px 0;background:#eef5ee}

.article-image-preview[hidden]{display:none}
