/* Daam TeleCare — shared design system (RTL, Arabic-first, mobile-first). No build step. */
@font-face{font-family:Alexandria;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/alexandria-arabic-400-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:Alexandria;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/alexandria-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Alexandria;font-style:normal;font-weight:500;font-display:swap;src:url(/fonts/alexandria-arabic-500-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:Alexandria;font-style:normal;font-weight:500;font-display:swap;src:url(/fonts/alexandria-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Alexandria;font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/alexandria-arabic-600-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:Alexandria;font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/alexandria-latin-600-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Alexandria;font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/alexandria-arabic-700-normal.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:Alexandria;font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/alexandria-latin-700-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root {
  --brand: #0f766e; --brand-rgb: 15,118,110; --brand-dark: #0c6159; --brand-soft: #e7f1f0; --brand-softer: #f3f8f8; --on-brand: #fff;
  --bg: #f5f7fa; --surface: #ffffff; --surface-2: #f9fafb; --border: #e5e7eb; --border-strong: #d1d5db;
  --text: #111827; --text-2: #374151; --muted: #6b7280; --faint: #9ca3af;
  --success: #047857; --success-soft: #ecfdf5; --warning: #b45309; --warning-soft: #fffbeb;
  --danger: #b91c1c; --danger-soft: #fef2f2; --info: #1d4ed8; --info-soft: #eff6ff;
  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06); --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 32px -8px rgba(16,24,40,.18); --ring: 0 0 0 3px rgba(var(--brand-rgb), .28);
  --font: "IBM Plex Sans Arabic", "Segoe UI", "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  --font-display: Alexandria, var(--font);
  --daam-navy: #0E1B2E; --daam-blue: #2E5BFF; --daam-mint: #2BD9A8; --daam-paper: #F5F3EE;
  --sidebar-w: 264px; --topbar-h: 60px; --bottomnav-h: 64px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.65; color: var(--text); background: var(--bg); direction: rtl; text-align: right; }
img { max-width: 100%; height: auto; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.35; font-weight: 700; color: var(--text); font-family: var(--font-display); letter-spacing: -.005em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; direction: ltr; unicode-bidi: embed; }
.ltr { direction: ltr; unicode-bidi: isolate; text-align: left; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip-link { position: absolute; top: -40px; right: 8px; background: var(--brand); color: var(--on-brand); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: 8px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .xs { font-size: .78rem; }
.stack > * + * { margin-top: 1rem; } .stack-sm > * + * { margin-top: .5rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } .span-2 { grid-column: span 2; } .span-3 { grid-column: 1 / -1; } }
.icon { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; } .icon-lg { width: 28px; height: 28px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 42px; padding: .5rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(0,0,0,.04); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn-sm { min-height: 34px; padding: .3rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-icon { min-width: 42px; padding: .5rem; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.6); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-secondary.is-loading::after, .btn-ghost.is-loading::after { border-color: var(--muted); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1rem; }
.card-body { padding: 1.1rem; }
.card-footer { padding: .85rem 1.1rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card-flush .card-body { padding: 0; }

/* Stats */
.stat { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.1rem; }
.stat-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); }
.stat-icon.tone-success { background: var(--success-soft); color: var(--success); }
.stat-icon.tone-warning { background: var(--warning-soft); color: var(--warning); }
.stat-icon.tone-danger { background: var(--danger-soft); color: var(--danger); }
.stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.stat-label { color: var(--muted); font-size: .85rem; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .6rem; border-radius: var(--radius-full); font-size: .78rem; font-weight: 600; background: #f3f4f6; color: var(--text-2); white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); }

/* Alerts */
.alert { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius-sm); border: 1px solid; font-size: .92rem; }
.alert-info { background: var(--info-soft); border-color: #bfdbfe; color: #1e3a8a; }
.alert-success { background: var(--success-soft); border-color: #a7f3d0; color: #065f46; }
.alert-warning { background: var(--warning-soft); border-color: #fde68a; color: #78350f; }
.alert-danger { background: var(--danger-soft); border-color: #fecaca; color: #7f1d1d; }

/* Forms */
.field { display: block; }
.field + .field { margin-top: 1rem; }
.label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; color: var(--text-2); }
.label .req { color: var(--danger); margin-inline-start: 2px; }
.input, .select, .textarea { display: block; width: 100%; min-height: 44px; padding: .55rem .8rem; font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input[dir="ltr"] { text-align: left; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.hint { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.error { font-size: .82rem; color: var(--danger); margin-top: .3rem; }
.check { display: flex; gap: .55rem; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: .25rem; accent-color: var(--brand); }
.color-field { display: flex; gap: .5rem; align-items: center; }
.color-field input[type=color] { width: 48px; height: 44px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.form-actions { display: flex; gap: .6rem; justify-content: flex-start; flex-wrap: wrap; margin-top: 1.25rem; }
.secret-saved { display: inline-flex; gap: .35rem; align-items: center; color: var(--success); font-size: .85rem; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; margin-bottom: .75rem; }

/* Tables — stacked cards on mobile */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: right; font-weight: 600; color: var(--muted); font-size: .8rem; padding: .7rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--brand-softer); }
@media (max-width: 767px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: .6rem .9rem; border-bottom: 1px solid var(--border); }
  .table-stack td { border: 0; padding: .25rem 0; display: flex; justify-content: space-between; gap: 1rem; }
  .table-stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; }
  .table-stack td.cell-actions { justify-content: flex-start; padding-top: .5rem; }
}

/* Empty state */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; margin: 0 auto .75rem; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); }
.empty h3 { color: var(--text); margin-bottom: .25rem; }

/* App shell */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset-block: 0; right: 0; width: var(--sidebar-w); background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; z-index: 40; transform: translateX(100%); transition: transform .22s ease; }
.sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
.sidebar-brand { display: flex; align-items: center; gap: .65rem; padding: 1rem 1.1rem; min-height: var(--topbar-h); border-bottom: 1px solid var(--border); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand-name { font-weight: 700; line-height: 1.3; font-size: .95rem; }
.brand-sub { font-size: .75rem; color: var(--muted); }
.nav { flex: 1; overflow-y: auto; padding: .75rem; }
.nav-link { display: flex; align-items: center; gap: .7rem; padding: .62rem .8rem; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; text-decoration: none !important; }
.nav-link:hover { background: var(--surface-2); }
.nav-link.is-active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.nav-group { font-size: .72rem; color: var(--faint); font-weight: 700; padding: .9rem .8rem .3rem; }
.sidebar-foot { padding: .75rem; border-top: 1px solid var(--border); }
.backdrop { position: fixed; inset: 0; background: rgba(17,24,39,.45); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
.backdrop.is-open { opacity: 1; pointer-events: auto; }
.main { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: var(--bottomnav-h); }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: .6rem; padding: 0 1rem; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.topbar-title { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.content { flex: 1; padding: 1rem; width: 100%; max-width: 1200px; margin: 0 auto; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-header h1 { margin: 0; font-size: 1.35rem; }
.page-header p { margin: .2rem 0 0; color: var(--muted); }
.bottom-nav { position: fixed; bottom: 0; inset-inline: 0; height: var(--bottomnav-h); background: var(--surface); border-top: 1px solid var(--border); display: flex; z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .72rem; color: var(--muted); text-decoration: none !important; background: none; border: 0; font-family: inherit; cursor: pointer; }
.bottom-nav .is-active { color: var(--brand-dark); font-weight: 600; }
.only-mobile { display: initial; } .only-desktop { display: none !important; }
@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .backdrop { display: none; }
  .main { margin-right: var(--sidebar-w); padding-bottom: 0; }
  .bottom-nav, .only-mobile { display: none !important; }
  .only-desktop { display: initial !important; }
  .content { padding: 1.5rem 2rem; }
}
.banner-impersonation { background: #7c2d12; color: #fff; padding: .55rem 1rem; display: flex; gap: .75rem; align-items: center; justify-content: center; flex-wrap: wrap; font-size: .9rem; position: relative; z-index: 31; }
.banner-impersonation .btn { min-height: 32px; background: #fff; color: #7c2d12; }

/* Bare (auth / error / installer) */
.bare { min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--brand-softer), var(--bg) 320px); }
.bare-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.bare-card { width: 100%; max-width: 420px; }
.bare-card.wide { max-width: 760px; }
.bare-brand { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-bottom: 1.25rem; text-align: center; }
.bare-brand .brand-mark { width: 52px; height: 52px; border-radius: 14px; font-size: 1.2rem; }
.status-code { font-size: 3rem; font-weight: 700; color: var(--brand); line-height: 1; margin-bottom: .5rem; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: flex-end; justify-content: center; }
.modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17,24,39,.5); }
.modal-panel { position: relative; background: var(--surface); width: 100%; max-height: 90vh; overflow-y: auto; border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-lg); animation: up .2s ease; }
@media (min-width: 640px) { .modal { align-items: center; padding: 1rem; } .modal-panel { max-width: 520px; border-radius: var(--radius-lg); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.1rem; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 1.1rem; }
.modal-foot { padding: .9rem 1.1rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; justify-content: flex-start; flex-wrap: wrap; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Toasts */
.toasts { position: fixed; z-index: 70; bottom: calc(var(--bottomnav-h) + 12px); inset-inline: 12px; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
@media (min-width: 1024px) { .toasts { bottom: 20px; inset-inline-start: auto; inset-inline-end: 20px; width: 380px; left: 20px; right: auto; } }
.toast { pointer-events: auto; display: flex; gap: .6rem; align-items: flex-start; background: #111827; color: #fff; padding: .75rem .9rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: .9rem; animation: up .2s ease; }
.toast-success .icon { color: #6ee7b7; } .toast-error { background: #7f1d1d; } .toast-error .icon { color: #fecaca; }
.toast button { margin-inline-start: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 0 .25rem; font-size: 1.1rem; }

/* Tabs (settings) */
.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 1rem; scrollbar-width: none; }
.tab { display: inline-flex; gap: .4rem; align-items: center; padding: .6rem .9rem; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none !important; }
.tab.is-active { color: var(--brand-dark); border-bottom-color: var(--brand); }
@media (min-width: 1024px) {
  .settings-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1.25rem; align-items: start; }
  .settings-layout .tabs { flex-direction: column; border: 0; margin: 0; }
  .settings-layout .tab { border-bottom: 0; border-radius: var(--radius-sm); }
  .settings-layout .tab.is-active { background: var(--brand-soft); }
}

/* Definition list */
.dl { display: grid; grid-template-columns: 1fr; gap: .2rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .82rem; } .dl dd { margin: 0 0 .6rem; font-weight: 500; word-break: break-word; }
@media (min-width: 640px) { .dl { grid-template-columns: 160px 1fr; } .dl dd { margin: 0; } .dl > * { padding: .35rem 0; } }

/* Credentials box */
.secret-box { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: .75rem .9rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.secret-box code { font-size: 1rem; font-weight: 600; word-break: break-all; }

/* Pagination */
.pagination { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: center; padding: .9rem; }
.pagination a, .pagination span { min-width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0 .6rem; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: .88rem; color: var(--text-2); background: var(--surface); text-decoration: none !important; }
.pagination .is-current { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.pagination .is-disabled { opacity: .5; }

/* Dev footer */
.dev-footer { padding: 1rem; text-align: center; font-size: .78rem; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.dev-footer img { height: 24px; width: auto; }
.dev-footer .df-link { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none !important; }
.dev-footer .df-sep { width: 1px; height: 16px; background: var(--border-strong); }
.nav-badge { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.setup-steps li a { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none !important; background: var(--surface); }
.setup-steps li a:hover { border-color: var(--brand); }
.setup-steps .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: .75rem; color: var(--muted); }
.setup-steps .is-done .dot { background: var(--success); border-color: var(--success); color: #fff; }
.setup-steps .is-done .t { color: var(--muted); text-decoration: line-through; }
.setup-steps .go { margin-inline-start: auto; color: var(--brand); font-size: .85rem; }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--daam-mint), var(--brand)); border-radius: 999px; }
.dev-footer a { color: var(--muted); }

/* Landing */
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: 1rem; max-width: 1140px; margin: 0 auto; }
.hero { padding: 3rem 1rem 2.5rem; text-align: center; max-width: 820px; margin: 0 auto; }
.hero h1 { font-size: 1.9rem; margin-bottom: .75rem; }
.hero p { font-size: 1.08rem; color: var(--text-2); }
@media (min-width: 768px) { .hero { padding: 5rem 1rem 3.5rem; } .hero h1 { font-size: 2.6rem; } }
.section { max-width: 1140px; margin: 0 auto; padding: 2rem 1rem; }
.feature { padding: 1.25rem; }
.feature .stat-icon { margin-bottom: .75rem; }
.price { font-size: 1.8rem; font-weight: 700; }
.plan-card.is-featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.checklist { list-style: none; padding: 0; margin: 0; } .checklist li { display: flex; gap: .5rem; padding: .25rem 0; } .checklist .icon { color: var(--success); }
.req-list { list-style: none; padding: 0; margin: 0; }
.req-list li { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.ok { color: var(--success); font-weight: 600; } .bad { color: var(--danger); font-weight: 600; }
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }
.logo-preview { width: 72px; height: 72px; border: 1px solid var(--border); border-radius: var(--radius-sm); display: grid; place-items: center; background: #fff; overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; border: 1px solid rgba(0,0,0,.1); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: .6rem; padding: .45rem 0; font-size: .88rem; border-bottom: 1px dashed var(--border); }
.timeline li:last-child { border-bottom: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* =====================================================================
   Telecare (Stage 2A): public booking / room / summary, staff drawer,
   day-slots popup, doctor panel, bell. Same tokens as above.
   ===================================================================== */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; }
.bk-loading { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 2rem 1rem; color: var(--muted); }
.hp { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; opacity: 0; }
.no-scroll, .no-scroll body { overflow: hidden; }
.card-pad { padding: .75rem 1rem; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand-dark); font: inherit; cursor: pointer; text-decoration: underline; }
.btn-lg { min-height: 52px; padding: .7rem 1.4rem; font-size: 1rem; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: .3rem .9rem; border-radius: var(--radius-full); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.chip.is-on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button, .seg a { min-height: 40px; padding: .3rem .9rem; border: 0; background: transparent; border-radius: 6px; font: inherit; font-size: .88rem; font-weight: 600; color: var(--text-2); cursor: pointer; text-decoration: none !important; display: inline-flex; align-items: center; }
.seg .is-on { background: var(--surface); color: var(--brand-dark); box-shadow: var(--shadow-sm); }
.seg-sm button, .seg-sm a { min-height: 34px; font-size: .82rem; }
.ticket { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem 1rem; margin: 0; }
.ticket > div { padding: .45rem 0; border-bottom: 1px dashed var(--border); min-width: 0; }
.ticket dt { font-size: .76rem; color: var(--muted); }
.ticket dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.note-priv, .note-priv-field textarea { background: #fffbeb; border-color: #fde68a; }
p.note-priv { padding: .5rem .7rem; border: 1px solid #fde68a; border-radius: var(--radius-sm); }
.hist { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem .75rem; margin-top: .5rem; background: var(--surface); }
.hist summary { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; cursor: pointer; font-size: .88rem; }
.hist p { margin: .5rem 0 0; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.4rem; }

/* Public layout */
.pub { background: linear-gradient(180deg, var(--brand-softer), var(--bg) 360px); min-height: 100vh; display: flex; flex-direction: column; }
.pub-top { background: rgba(255,255,255,.94); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.4) blur(6px); }
.pub-top-in { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; min-height: 60px; }
.pub-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--text); text-decoration: none !important; min-width: 0; }
.pub-brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-brand small { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; }
.pub-help { margin-inline-start: auto; display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--text-2); }
.pub-main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1rem; }
.pub-main.is-narrow { max-width: 760px; }
@media (min-width: 768px) { .pub-main { padding: 1.5rem 1.25rem 2.5rem; } }

/* Booking */
.bk-hero { text-align: center; padding: .75rem .5rem 1.25rem; }
.bk-hero h1 { font-size: 1.55rem; margin-bottom: .3rem; }
.bk-hero p { color: var(--muted); margin-bottom: .75rem; }
.bk-feats { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem .9rem; font-size: .82rem; color: var(--text-2); }
.bk-feats li { display: inline-flex; gap: .35rem; align-items: center; }
.bk-panel { padding: 1rem; }
@media (min-width: 768px) { .bk-panel { padding: 1.5rem; } .bk-hero h1 { font-size: 1.9rem; } }
.bk-steps { list-style: none; display: flex; gap: .4rem; padding: 0; margin: 0 0 1.25rem; counter-reset: s; }
.bk-steps li { flex: 1; display: flex; align-items: center; gap: .45rem; font-size: .82rem; color: var(--muted); min-width: 0; }
.bk-steps li b { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: .8rem; }
.bk-steps li.is-on { color: var(--text); font-weight: 600; }
.bk-steps li.is-on b { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.bk-steps li.is-done b { background: var(--brand-soft); color: var(--brand-dark); border-color: transparent; }
.bk-steps li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .bk-steps li:not(.is-on) span { display: none; } .bk-steps li.is-on { flex: 3; } }
.bk-head { margin-bottom: .9rem; } .bk-head h2 { margin-bottom: .1rem; } .bk-head p { margin: 0; }
.bk-search { position: relative; display: block; margin-bottom: .75rem; }
.bk-search .icon { position: absolute; top: 50%; transform: translateY(-50%); right: .8rem; color: var(--muted); }
.bk-search .input { padding-right: 2.4rem; }
.bk-chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: .75rem; scrollbar-width: thin; }
.bk-chips .chip { flex-shrink: 0; }
.bk-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .bk-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .bk-grid { grid-template-columns: repeat(3, 1fr); } }
.bk-doc { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.bk-doc-ph { position: relative; aspect-ratio: 16 / 10; background: var(--brand-soft); }
.bk-doc-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bk-doc-img.is-initial { display: grid; place-items: center; font-size: 2.4rem; font-weight: 700; color: var(--brand-dark); }
.bk-doc-ph .badge { position: absolute; bottom: .6rem; right: .6rem; background: rgba(255,255,255,.95); }
.bk-doc-b { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.bk-doc-b h3 { margin: 0; font-size: 1.02rem; } .bk-doc-b p { margin: .1rem 0 .5rem; }
.bk-meta { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); }
.bk-meta span { display: inline-flex; gap: .3rem; align-items: center; } .bk-meta b { color: var(--brand-dark); font-size: .95rem; }
.bk-next { font-size: .8rem; color: var(--success); margin-top: .35rem; } .bk-next.is-none { color: var(--muted); }
.bk-doc-act { display: flex; gap: .5rem; margin-top: auto; padding-top: .8rem; } .bk-doc-act .btn-primary { flex: 1; }
.bk-sel { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; background: var(--brand-softer); border: 1px solid var(--brand-soft); border-radius: var(--radius); margin-bottom: 1rem; }
.bk-sel.is-plain { background: transparent; border: 0; padding: 0; }
.bk-av { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--brand-soft); }
.bk-av.is-initial { display: grid; place-items: center; font-weight: 700; color: var(--brand-dark); }
.bk-sel-i { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bk-dates { display: flex; gap: .5rem; overflow-x: auto; padding: .2rem .1rem .6rem; scroll-snap-type: x proximity; }
.bk-date { flex: 0 0 auto; width: 74px; min-height: 92px; scroll-snap-align: start; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font: inherit; cursor: pointer; padding: .4rem .2rem; color: var(--text); }
.bk-date b { font-size: 1.3rem; line-height: 1.2; } .bk-date small { font-size: .72rem; color: var(--muted); }
.bk-date em { font-style: normal; font-size: .68rem; margin-top: 2px; color: var(--success); font-weight: 600; }
.bk-date em.is-few { color: var(--warning); } .bk-date em.is-full { color: var(--danger); } .bk-date em.is-off { color: var(--faint); }
.bk-date.is-on { border-color: var(--brand); background: var(--brand); color: var(--on-brand); } .bk-date.is-on small, .bk-date.is-on em { color: inherit; }
.bk-date:disabled { opacity: .55; cursor: not-allowed; background: var(--surface-2); }
.bk-slots-note { margin: .5rem 0 .25rem; }
.bk-slots-h { font-size: .8rem; font-weight: 700; color: var(--muted); margin: .9rem 0 .4rem; }
.bk-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
@media (min-width: 600px) { .bk-slots { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 960px) { .bk-slots { grid-template-columns: repeat(7, 1fr); } }
.bk-slot { min-height: 48px; border: 1px solid var(--brand); border-radius: var(--radius-sm); background: var(--surface); color: var(--brand-dark); font: inherit; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.bk-slot:hover { background: var(--brand-softer); } .bk-slot.is-on { background: var(--brand); color: var(--on-brand); }
.bk-slot.is-booked { border-color: var(--border); color: var(--faint); background: var(--surface-2); text-decoration: line-through; cursor: not-allowed; }
.bk-slot.is-booked small { text-decoration: none; font-size: .68rem; font-weight: 500; }
.bk-bar { display: flex; justify-content: space-between; gap: .6rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
@media (max-width: 640px) { .bk-bar { position: sticky; bottom: 0; background: var(--surface); margin-inline: -1rem; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); z-index: 5; box-shadow: 0 -4px 12px rgba(0,0,0,.05); } .bk-bar .btn { flex: 1; } }
.bk-form-wrap { display: grid; gap: 1.25rem; }
@media (min-width: 900px) { .bk-form-wrap { grid-template-columns: 1fr 300px; align-items: start; } .bk-sum { position: sticky; top: 80px; } }
.bk-form .span-full { grid-column: 1 / -1; }
.bk-form .grid .field + .field { margin-top: 0; }
.bk-agree { margin-top: 1rem; font-size: .9rem; }
.bk-sum { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; background: var(--surface-2); }
.bk-sum h3 { font-size: .95rem; }
.bk-dl { margin: .75rem 0; } .bk-dl > div { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.bk-dl dt { color: var(--muted); } .bk-dl dd { margin: 0; font-weight: 600; } .bk-price { color: var(--brand-dark); }
.bk-services { padding-inline-start: 1.1rem; margin: 0; } .bk-services li { margin-bottom: .2rem; }
.seg[role=radiogroup] button { min-width: 80px; }

/* Confirmation */
.cf-icon { width: 64px; height: 64px; border-radius: 50%; margin: .25rem auto 0; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.cf-icon .icon { width: 30px; height: 30px; } .cf-icon.is-pay { background: var(--brand-soft); color: var(--brand-dark); }
.cf-icon.is-wait { background: var(--warning-soft); color: var(--warning); } .cf-icon.is-bad { background: #f3f4f6; color: var(--muted); }
.cf-title { text-align: center; font-size: 1.4rem; margin: .5rem 0 0; } .cf-lead { text-align: center; color: var(--text-2); }
.cf-actions { display: flex; flex-wrap: wrap; gap: .5rem; } .cf-actions .btn-primary { flex: 1 1 100%; }
@media (min-width: 640px) { .cf-actions .btn-primary { flex: 0 1 auto; } }
.paybox { border: 1px solid var(--brand-soft); background: var(--brand-softer); border-radius: var(--radius); padding: 1rem; display: grid; gap: .75rem; }
.paybox-amt { font-size: 1.4rem; color: var(--brand-dark); }

/* Room */
.room-card { overflow: hidden; }
.room-top { display: flex; gap: .9rem; align-items: center; padding: 1.1rem; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: var(--on-brand); }
.room-top h1 { color: inherit; font-size: 1.2rem; margin: .1rem 0; } .room-top p { margin: 0; opacity: .9; font-size: .88rem; } .room-top small { opacity: .85; font-size: .76rem; }
.room-when { font-weight: 700; opacity: 1 !important; margin-top: .2rem !important; }
.room-av { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255,255,255,.5); flex-shrink: 0; background: rgba(255,255,255,.2); }
.room-av.is-initial { display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; }
.room-state { text-align: center; } .room-state h2 { margin: .5rem 0 .25rem; font-size: 1.2rem; } .room-state p { margin: 0; }
.room-act { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; }
.room-act .btn-lg { min-width: min(100%, 320px); }
.room-count-h { text-align: center; font-weight: 700; margin: 0; }
.room-count { display: flex; justify-content: center; gap: .5rem; direction: rtl; }
.room-count span { min-width: 68px; background: var(--brand-softer); border: 1px solid var(--brand-soft); border-radius: var(--radius); padding: .5rem; text-align: center; font-size: .72rem; color: var(--muted); display: flex; flex-direction: column; }
.room-count b { font-size: 1.6rem; color: var(--brand-dark); line-height: 1.2; font-variant-numeric: tabular-nums; }
.room-box { border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; }
.room-box h3 { font-size: .95rem; } .room-box .label { margin-top: .6rem; }
.room-dev { display: flex; gap: .9rem; align-items: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: .75rem; }
.room-dev video { width: 120px; height: 90px; border-radius: var(--radius-sm); background: #111827; object-fit: cover; flex-shrink: 0; transform: scaleX(-1); }
.room-tips { font-size: .88rem; } .room-tips summary { cursor: pointer; font-weight: 600; } .room-tips ul { margin: .5rem 0 0; padding-inline-start: 1.2rem; }
.room-foot { text-align: center; margin: 0; }
.call { position: fixed; inset: 0; z-index: 100; background: #0b1220; display: flex; flex-direction: column; }
.call-top { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; color: #fff; background: #111827; padding-top: calc(.5rem + env(safe-area-inset-top)); }
.call-tt { flex: 1; min-width: 0; font-weight: 700; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .call-tt small { display: block; font-weight: 400; opacity: .7; font-size: .72rem; }
.call-timer { font-variant-numeric: tabular-nums; opacity: .85; font-size: .85rem; }
.call-btn { background: rgba(255,255,255,.12); color: #fff; }
.call-main { flex: 1; display: flex; min-height: 0; position: relative; }
.call-frame { flex: 1; min-width: 0; } .call-frame iframe { width: 100%; height: 100%; border: 0; }
.call-side { width: 360px; background: var(--surface); overflow-y: auto; padding: .9rem; display: none; flex-direction: column; gap: .5rem; }
.call-side.is-open { display: flex; } .call-side .room-box { border: 0; padding: 0; }
@media (max-width: 760px) { .call-side { position: absolute; inset: auto 0 0 0; width: auto; max-height: 70%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-lg); } }

/* Summary (printable) */
.sumdoc { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.sumdoc-head { display: flex; align-items: center; gap: .75rem; padding-bottom: 1rem; border-bottom: 2px solid var(--brand); }
.sumdoc-head .brand-mark { width: 52px; height: 52px; } .sumdoc-head small { display: block; color: var(--muted); }
.sumdoc-ref { margin-inline-start: auto; font-weight: 700; color: var(--brand-dark); }
.sumdoc-doc { display: flex; gap: 1rem; align-items: center; padding: 1rem 0; }
.sumdoc-doc img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; } .sumdoc-doc h2 { margin: 0; } .sumdoc-doc p { margin: 0 0 .3rem; }
.sumdoc-grid { margin-bottom: 1rem; }
.sumdoc-h { margin-top: .5rem; color: var(--brand-dark); }
.sumdoc-notes { white-space: normal; line-height: 1.9; padding: .9rem 1rem; background: var(--brand-softer); border-radius: var(--radius-sm); border-inline-start: 4px solid var(--brand); }
.sumdoc-notes.is-empty { color: var(--muted); }
.sumdoc-foot { margin-top: 1.25rem; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: .75rem; }
@media print {
  @page { size: A4; margin: 14mm; }
  .no-print, .toasts, .pub-top, .dev-footer, .skip-link { display: none !important; }
  .pub { background: #fff; } .pub-main { padding: 0; max-width: none; }
  .sumdoc { border: 0; box-shadow: none; padding: 0; }
  .sumdoc-notes { background: #f7f7f7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Staff — filters, list, drawer */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; width: 100%; }
.filters .input { flex: 1 1 200px; } .filters .select { width: auto; flex: 0 1 170px; }
.appt-row { cursor: pointer; } .appt-row.is-updated { background: var(--brand-softer); }
.appt-when b { font-weight: 700; }
.dlv { display: inline-flex; align-items: center; gap: 2px; font-size: .78rem; padding: .1rem .4rem; border-radius: var(--radius-full); background: #f3f4f6; color: var(--muted); margin-inline-end: 3px; }
.dlv.is-ok { background: var(--success-soft); color: var(--success); } .dlv.is-bad { background: var(--danger-soft); color: var(--danger); } .dlv.is-log { background: var(--info-soft); color: var(--info); }
.drawer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(17,24,39,.45); opacity: 0; transition: opacity .2s; }
.drawer-panel { position: absolute; inset-block: 0; left: 0; width: min(560px, 100%); background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(-100%); transition: transform .22s ease; overflow-y: auto; overscroll-behavior: contain; }
.drawer.is-open { pointer-events: auto; } .drawer.is-open .drawer-backdrop { opacity: 1; } .drawer.is-open .drawer-panel { transform: none; }
.drawer-inline { padding: 0; }
.dw-head { position: sticky; top: 0; z-index: 2; background: var(--surface); display: flex; justify-content: space-between; gap: .75rem; padding: 1rem 1.1rem .8rem; border-bottom: 1px solid var(--border); }
.dw-head h2 { margin: .1rem 0 .35rem; font-size: 1.15rem; }
.dw-actions { display: flex; flex-wrap: wrap; gap: .4rem; padding: .75rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.dw-actions form { margin: 0; }
.dw-sec { padding: 1rem 1.1rem; border-bottom: 1px solid var(--border); }
.dw-sec h3 { font-size: .95rem; margin-bottom: .6rem; }
.dw-more { margin-top: .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .8rem; }
.dw-more summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--brand-dark); }
.dw-more[open] summary { margin-bottom: .6rem; }
.dw .secret-box code { font-size: .74rem; }
.slot-pick { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; min-height: 40px; }
.slot-tile { min-width: 76px; min-height: 40px; border: 1px solid var(--brand); color: var(--brand-dark); background: var(--surface); border-radius: var(--radius-sm); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; padding: .2rem .4rem; }
.slot-tile small { font-size: .64rem; font-weight: 500; } .slot-tile.is-on { background: var(--brand); color: var(--on-brand); }
.slot-tile.is-booked, .slot-tile.is-busy { border-color: var(--border-strong); color: var(--faint); background: var(--surface-2); }
.timeline.small li { font-size: .85rem; }
.sticky-actions { position: sticky; bottom: calc(var(--bottomnav-h) + .5rem); background: rgba(255,255,255,.95); padding: .6rem; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 5; }
@media (min-width: 1024px) { .sticky-actions { bottom: .75rem; } }

/* Doctors */
.doc-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .doc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .doc-grid { grid-template-columns: repeat(3, 1fr); } }
.doc-card { padding: 1rem; display: flex; flex-direction: column; gap: .6rem; } .doc-card.is-off { opacity: .75; }
.doc-card-h { display: flex; gap: .8rem; align-items: center; } .doc-card-h h3 { margin: 0; font-size: 1rem; }
.doc-ph { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--brand-soft); }
.doc-ph.is-initial { display: grid; place-items: center; font-weight: 700; color: var(--brand-dark); font-size: 1.2rem; }
.doc-ph-lg { width: 80px; height: 80px; }
.doc-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin: 0; text-align: center; }
.doc-facts > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: .4rem; } .doc-facts dt { font-size: .72rem; color: var(--muted); } .doc-facts dd { margin: 0; font-weight: 700; font-size: .9rem; }
.doc-days { margin: 0; } .doc-card-act { margin-top: auto; gap: .4rem; }
.hours { display: grid; gap: .5rem; }
.hours-day { display: grid; grid-template-columns: 76px 1fr auto; gap: .5rem; align-items: start; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.hours-name { font-weight: 600; padding-top: .55rem; font-size: .9rem; }
.hours-ranges { display: grid; gap: .35rem; }
.hours-range { display: flex; gap: .35rem; align-items: center; } .hours-range .input { max-width: 130px; min-height: 40px; padding: .3rem .5rem; }
@media (max-width: 520px) { .hours-day { grid-template-columns: minmax(0, 1fr); } .hours-name { padding: 0; } .hours-ranges { min-width: 0; } .hours-range .input { max-width: none; flex: 1 1 0; min-width: 0; width: 0; } .hours-day > [data-hours-add] { justify-self: start; } }
.ex-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .35rem; }
.ex-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .88rem; }
.ds-cta { display: grid; gap: .5rem; justify-items: start; }

/* Day-slots popup */
.ds .ds-panel { max-width: 860px; width: 100%; display: flex; flex-direction: column; max-height: 92vh; }
.ds-nav { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .6rem 1.1rem; border-bottom: 1px solid var(--border); }
.ds-date { max-width: 170px; min-height: 36px; padding: .25rem .5rem; } .ds-label { font-weight: 700; font-size: .92rem; }
.ds-legend { display: flex; flex-wrap: wrap; gap: .4rem; padding: .5rem 1.1rem; border-bottom: 1px solid var(--border); }
.ds-chip { display: inline-flex; gap: .25rem; align-items: center; padding: .15rem .55rem; border-radius: var(--radius-full); font-size: .76rem; font-weight: 600; }
.ds-chip.is-free { background: var(--success-soft); color: var(--success); } .ds-chip.is-busy { background: #ede9fe; color: #5b21b6; } .ds-chip.is-booked { background: #f3f4f6; color: var(--text-2); }
.ds-body { overflow-y: auto; flex: 1; }
.ds-counts { display: flex; flex-wrap: wrap; gap: .4rem; } .ds-effect { margin: .5rem 0; }
.ds-quick { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.ds-group-h { font-size: .8rem; font-weight: 700; color: var(--muted); margin: .9rem 0 .4rem; }
.ds-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
@media (min-width: 640px) { .ds-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 860px) { .ds-grid { grid-template-columns: repeat(6, 1fr); } }
.ds-tile { min-height: 58px; border-radius: var(--radius-sm); border: 2px solid; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.ds-tile b { font-size: .92rem; } .ds-tile small { font-size: .7rem; }
.ds-tile.is-free { border-color: #6ee7b7; background: var(--success-soft); color: var(--success); }
.ds-tile.is-busy { border-color: #c4b5fd; background: #ede9fe; color: #5b21b6; }
.ds-tile.is-booked { border-color: var(--border); background: #f3f4f6; color: var(--muted); cursor: not-allowed; }
.ds-tile.is-past { opacity: .5; cursor: not-allowed; }
.ds-copy { margin-top: 1rem; border: 1px solid var(--brand-soft); background: var(--brand-softer); border-radius: var(--radius); padding: .9rem; display: grid; gap: .5rem; }
.ds-copy h4 { margin: 0; }
.ds-wds { display: flex; flex-wrap: wrap; gap: .35rem; padding-inline-start: 1.6rem; }
.chip-check { display: inline-flex; } .chip-check input { position: absolute; opacity: 0; }
.chip-check span { min-height: 36px; padding: .3rem .8rem; border-radius: var(--radius-full); border: 1px solid var(--border-strong); background: var(--surface); font-size: .82rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; }
.chip-check input:checked + span { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.chip-check input:focus-visible + span { box-shadow: var(--ring); }
.ds-foot { flex-wrap: wrap; } .ds-dirty { color: var(--warning); font-weight: 600; align-self: center; }
.ds-result ul { padding-inline-start: 1.1rem; font-size: .88rem; }
@media (max-width: 640px) { .ds .ds-panel { max-height: 100vh; height: 100%; border-radius: 0; } .ds .modal-foot { position: sticky; bottom: 0; background: var(--surface); padding-bottom: calc(.75rem + env(safe-area-inset-bottom)); } }

/* Notifications */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.notif-list li.is-unread { background: var(--brand-softer); }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: .55rem; background: transparent; flex-shrink: 0; }
.is-unread .notif-dot { background: var(--brand); }
.notif-b { flex: 1 1 260px; min-width: 0; }
.bell { position: relative; }
.bell-count { position: absolute; top: 4px; left: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.bell-panel { position: absolute; top: calc(100% + 6px); left: 0; width: min(360px, calc(100vw - 1.5rem)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: .6rem .8rem; border-bottom: 1px solid var(--border); }
.bell-list { max-height: 60vh; overflow-y: auto; }
.bell-item { display: block; padding: .65rem .85rem; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none !important; font-size: .85rem; }
.bell-item:hover { background: var(--surface-2); } .bell-item.is-unread { background: var(--brand-softer); }
.bell-item b { display: block; } .bell-item span { display: block; color: var(--text-2); font-size: .8rem; } .bell-item small { color: var(--muted); font-size: .72rem; }
.bell-empty { padding: 1.5rem; text-align: center; color: var(--muted); font-size: .88rem; }
.bell-foot { display: block; text-align: center; padding: .6rem; font-size: .85rem; font-weight: 600; background: var(--surface-2); }

/* Dashboard widgets */
.tl, .att { list-style: none; margin: 0; padding: 0; }
.tl li a, .att li a { display: flex; align-items: center; gap: .75rem; padding: .55rem .2rem; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.tl li:last-child a, .att li:last-child a { border-bottom: 0; }
.tl-time { min-width: 68px; font-weight: 700; color: var(--brand-dark); font-size: .9rem; }
.tl-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.att li a { justify-content: space-between; }

/* Doctor panel */
.doc { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.doc-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem; min-height: 58px; background: var(--surface); border-bottom: 1px solid var(--border); }
.doc-brand-name { display: block; max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 1rem; }
.doc-hello h1 { font-size: 1.3rem; margin-bottom: .1rem; } .doc-hello p { margin: 0 0 1rem; }
.doc-h { font-size: 1rem; color: var(--text-2); }
.doc-item { overflow: hidden; } .doc-item.is-live { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.doc-item-b { display: flex; gap: .75rem; align-items: center; padding: .85rem 1rem; color: var(--text); text-decoration: none !important; }
.doc-time { min-width: 66px; display: flex; flex-direction: column; } .doc-time b { color: var(--brand-dark); } .doc-time small { font-size: .72rem; color: var(--muted); }
.doc-item-act { padding: 0 1rem .9rem; }

/* ---------------- Stage 2B ---------------- */
.stat-icon.tone-danger { background: var(--danger-soft); color: var(--danger); }
.input-sm { padding: .35rem .55rem; font-size: .9rem; min-height: 34px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .35rem .9rem; }
/* booking: coupon + price breakdown */
.bk-coupon { margin: .5rem 0 .75rem; }
.bk-coupon.is-open { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: .65rem .75rem; }
.bk-coupon .input { text-transform: uppercase; letter-spacing: .04em; }
.bk-coupon #bk-cp-msg { min-height: 1.2rem; margin-top: .35rem; }
.bk-total .is-discount dd { color: var(--success); }
.bk-total .is-total { border-top: 1px solid var(--border); padding-top: .4rem; margin-top: .2rem; }
.bk-total .is-total dt { font-weight: 700; color: var(--text, #111827); }
/* receipt */
.receipt-amt { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: 1rem; margin: .5rem 0 1rem; background: var(--success-soft); border-radius: var(--radius); }
.receipt-amt small { color: var(--success); }
.receipt-amt b { font-size: 2rem; color: var(--success); }
/* WhatsApp templates */
.wa-body { white-space: pre-wrap; direction: rtl; text-align: right; font-family: inherit; font-size: .95rem; line-height: 1.8; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius-sm); padding: .75rem .9rem; margin: .75rem 0 .5rem; }
.wa-vars { columns: 2; margin: 0; padding-inline-start: 1.2rem; }
@media (max-width: 640px) { .wa-vars { columns: 1; } }
/* reports */
.rp-filters .field { margin: 0; }
/* calendar */
.cal-bar { flex-wrap: wrap; }
.cal-bar .seg a { padding: .35rem .8rem; text-decoration: none; color: inherit; border-radius: 999px; }
.cal-bar .seg a.is-on { background: var(--brand); color: var(--on-brand); }
.cal-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.cal { --cal-gut: 64px; min-width: 100%; }
.cal.is-week { min-width: 920px; }
.cal-head, .cal-body { display: grid; grid-template-columns: var(--cal-gut) repeat(var(--cal-cols), 1fr); }
.cal-head { position: sticky; top: 0; z-index: 2; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-day-h { padding: .5rem; text-align: center; border-inline-start: 1px solid var(--border); display: flex; gap: .35rem; justify-content: center; align-items: baseline; }
.cal-day-h span { color: var(--muted); font-size: .85rem; }
.cal-day-h.is-today { background: var(--brand-soft); color: var(--brand-dark); }
.cal-gutter { position: relative; }
.cal-hour { position: relative; border-top: 1px solid transparent; }
.cal-hour span { position: absolute; top: -.6rem; inset-inline-end: .35rem; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.cal-col { position: relative; height: var(--cal-h); border-inline-start: 1px solid var(--border); }
.cal-col.is-today { background: var(--brand-softer); }
.cal-line { position: absolute; inset-inline: 0; border-top: 1px solid var(--border); }
.cal-ev { position: absolute; inset-inline: 3px; z-index: 1; overflow: hidden; border-radius: 8px; padding: .2rem .4rem; font-size: .78rem; line-height: 1.3; text-decoration: none; color: #0f172a;
  background: var(--info-soft); border-inline-start: 3px solid var(--info); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.cal-ev:hover, .cal-ev:focus-visible { z-index: 3; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.cal-ev small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.is-pending_payment, .cal-ev.is-pending { background: var(--warning-soft); border-color: var(--warning); }
.cal-ev.is-in_progress { background: var(--brand-soft); border-color: var(--brand); }
.cal-ev.is-completed { background: var(--success-soft); border-color: var(--success); }
.cal-ev.is-no_show { background: var(--danger-soft); border-color: var(--danger); }
.cal-ev.is-cancelled { background: #f3f4f6; border-color: #9ca3af; color: #6b7280; text-decoration: line-through; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; margin-top: .6rem; }
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--info); margin-inline-end: .25rem; vertical-align: middle; }
.cal-dot.is-pending_payment, .cal-dot.is-pending { background: var(--warning); }
.cal-dot.is-in_progress { background: var(--brand); }
.cal-dot.is-completed { background: var(--success); }
.cal-dot.is-no_show { background: var(--danger); }
.cal-dot.is-cancelled { background: #9ca3af; }
