/* ================================================================
   SaluVista Admin — one design system, matched to the public site.
   Brand: Lora (headings) + Inter (body), SaluVista blues, soft cards.
   ================================================================ */

:root {
  --blue: #273ED4;
  --blue-hover: #3550E0;
  --blue-light: #5B72F0;
  --navy: #16205C;
  --navy-deep: #10184A;
  --tint: #F3F4FD;
  --tint-2: #E4E8FB;
  --border: #C7CDF0;
  --border-soft: #DDE2F8;
  --ink: #16205C;
  --muted: #404A82;
  --faint: #7A83B3;
  --surface: #FFFFFF;
  --bg: #F6F7FE;
  --green: #0E7C4F;
  --green-tint: #E4F6EE;
  --amber: #9A6200;
  --amber-tint: #FCF1DC;
  --red: #C0313D;
  --red-tint: #FCE9EB;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 74, .06), 0 2px 8px rgba(16, 24, 74, .05);
  --shadow-md: 0 4px 14px rgba(16, 24, 74, .08), 0 1px 3px rgba(16, 24, 74, .06);
  --shadow-lg: 0 18px 50px rgba(16, 24, 74, .18);
  --sidebar-w: 258px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 66px;
  --ease: cubic-bezier(.33, 1, .5, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Lora', Georgia, serif; color: var(--ink); margin: 0; }
p { margin: 0; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--tint-2); }

.ico { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3.5px; }

/* ================= App shell ================= */

.app { display: flex; min-height: 100vh; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ================= Sidebar ================= */

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #E7EAFB;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: width .28s var(--ease);
}

.sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 14px 14px 18px;
  gap: 8px;
}

.salu-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  min-width: 0;
}
.salu-mark { flex: none; }
.salu-logo__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.salu-logo__word {
  font-family: 'Lora', Georgia, serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
}
.salu-logo__word b { font-weight: 700; }
.salu-logo__tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #9FB0F5;
  margin-top: 1px;
}

/* gentle wave drift in the lens mark */
.salu-wave path { transform: translateX(0); }
@media (prefers-reduced-motion: no-preference) {
  .salu-wave--front path { animation: svDrift 9s linear infinite; }
  .salu-wave--back path { animation: svDrift 14s linear infinite reverse; }
  @keyframes svDrift { to { transform: translateX(32px); } }
}

.sidebar__collapse, .topbar__menu, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  transition: background .15s ease, transform .1s ease;
}
.sidebar__collapse:hover { background: rgba(255, 255, 255, .1); }
.sidebar__collapse:active { transform: scale(.93); }
.sidebar__collapse .ico { width: 19px; height: 19px; }

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10.5px 12px;
  border-radius: 11px;
  color: #C3CBF2;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  position: relative;
  transition: background .16s ease, color .16s ease;
}
.nav-item .ico { width: 19px; height: 19px; }
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.is-active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 16px rgba(39, 62, 212, .4);
}
.nav-item.is-active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--blue-light);
}
.nav-item__badge {
  margin-left: auto;
  background: rgba(255, 255, 255, .14);
  color: #DDE3FB;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 99px;
}
.nav-item.is-active .nav-item__badge { background: rgba(255, 255, 255, .22); color: #fff; }

.sidebar__foot {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar__reset {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px dashed rgba(255, 255, 255, .25);
  border-radius: 10px;
  background: transparent;
  color: #AEB8EA;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.sidebar__reset:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar__reset .ico { width: 16px; height: 16px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 12px;
}
.user-chip__avatar {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-chip__meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-chip__name { font-weight: 600; font-size: 13.5px; color: #fff; }
.user-chip__role { font-size: 11.5px; color: #9FB0F5; }

/* --- collapsed sidebar (desktop) --- */
.app.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.app.sidebar-collapsed .salu-logo__text,
.app.sidebar-collapsed .nav-item span,
.app.sidebar-collapsed .nav-item__badge,
.app.sidebar-collapsed .user-chip__meta,
.app.sidebar-collapsed .sidebar__reset span { display: none; }
.app.sidebar-collapsed .sidebar__head { flex-direction: column; padding: 16px 0 8px; gap: 12px; }
.app.sidebar-collapsed .nav-item { justify-content: center; padding: 11px; }
.app.sidebar-collapsed .sidebar__reset { justify-content: center; padding: 9px; }
.app.sidebar-collapsed .user-chip { justify-content: center; padding: 4px; }
.app.sidebar-collapsed .sidebar__collapse .ico { transform: rotate(180deg); }

.sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 74, .45);
  z-index: 35;
  opacity: 0;
  transition: opacity .25s ease;
}
.sidebar-scrim.is-in { opacity: 1; }

/* ================= Topbar ================= */

.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 26px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar__menu { display: none; color: var(--ink); }
.topbar__menu:hover { background: var(--tint); }

.topbar__title-wrap { min-width: 0; }
.topbar__crumb {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.topbar__title { font-size: 19.5px; font-weight: 600; white-space: nowrap; }

.topbar__search {
  flex: 1;
  max-width: 460px;
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
}
.topbar__search-icon {
  position: absolute;
  left: 12px;
  color: var(--faint);
  display: flex;
  pointer-events: none;
}
.topbar__search-icon .ico { width: 16px; height: 16px; }
.topbar__search input {
  width: 100%;
  padding: 9px 40px 9px 38px;
  border: 1.5px solid var(--border-soft);
  border-radius: 11px;
  background: var(--tint);
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.topbar__search input::placeholder { color: var(--faint); }
.topbar__search input:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(39, 62, 212, .12);
}
.topbar__kbd {
  position: absolute;
  right: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--faint);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 1px 6px;
  background: #fff;
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  max-height: 380px;
  overflow-y: auto;
  z-index: 60;
}
.search-results__group {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 8px 10px 4px;
}
.search-results__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: none;
  border-radius: 9px;
  color: var(--ink);
  font-size: 13.5px;
}
.search-results__item:hover, .search-results__item.is-hl { background: var(--tint); }
.search-results__item .ico { width: 16px; height: 16px; color: var(--blue); }
.search-results__item small { margin-left: auto; color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.search-results__none { padding: 16px; text-align: center; color: var(--faint); font-size: 13px; }

/* ================= Buttons ================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9.5px 17px;
  border: none;
  border-radius: 11px;
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  transition: background .16s ease, transform .1s ease, box-shadow .16s ease, color .16s ease;
}
.btn:active { transform: scale(.965); }
.btn .ico { width: 16px; height: 16px; }

.btn--primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(39, 62, 212, .28);
}
.btn--primary:hover { background: var(--blue-hover); box-shadow: 0 6px 18px rgba(39, 62, 212, .35); }

.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border-soft);
}
.btn--ghost:hover { background: var(--tint); color: var(--ink); border-color: var(--border); }

.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover { background: #A82833; }

.btn--soft { background: var(--tint-2); color: var(--blue); }
.btn--soft:hover { background: #D6DCF9; }

.icon-btn { color: var(--muted); }
.icon-btn:hover { background: var(--tint); color: var(--blue); }
.icon-btn:active { transform: scale(.9); }
.icon-btn--danger:hover { background: var(--red-tint); color: var(--red); }
.icon-btn .ico { width: 17px; height: 17px; }

/* ================= Content area ================= */

.content {
  flex: 1;
  padding: 26px;
  max-width: 1340px;
  width: 100%;
  margin: 0 auto;
  outline: none;
}

.view { animation: viewIn .3s var(--ease); }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
}

.view__intro { margin-bottom: 20px; max-width: 720px; }
.view__intro p { color: var(--muted); font-size: 13.5px; }

/* ================= Cards / panels ================= */

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--tint-2);
}
.card__head h3 { font-size: 16px; font-weight: 600; }
.card__head .ico { color: var(--blue); }
.card__head-note { margin-left: auto; font-size: 12px; color: var(--faint); font-family: 'Inter', sans-serif; font-weight: 500; }

/* ================= Dashboard ================= */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-card__label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stat-card__ico {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--tint);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-card__ico .ico { width: 17px; height: 17px; }
.stat-card__value {
  font-family: 'Lora', Georgia, serif;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.stat-card__delta { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.stat-card__delta .ico { width: 14px; height: 14px; }
.stat-card__delta--up { color: var(--green); }
.stat-card__delta--down { color: var(--red); }
.stat-card__delta small { color: var(--faint); font-weight: 500; }

.dash-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
  align-items: start;
}

.chart-wrap { padding: 8px 14px 14px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-tip {
  position: absolute;
  pointer-events: none;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  transform: translate(-50%, -130%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .12s ease;
  z-index: 5;
}
.chart-tip.is-on { opacity: 1; }
.chart-tip small { display: block; font-weight: 500; color: #B9C3F1; font-size: 10.5px; }

.activity-list { list-style: none; margin: 0; padding: 6px 0; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 11px 20px;
  align-items: flex-start;
}
.activity-item + .activity-item { border-top: 1px solid var(--tint); }
.activity-item__ico {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: var(--tint);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.activity-item__ico .ico { width: 15px; height: 15px; }
.activity-item p { font-size: 13px; color: var(--ink); line-height: 1.45; }
.activity-item time { font-size: 11.5px; color: var(--faint); }

/* ================= Sub-tabs (in-page tabs inside a section) ================= */

.subtabs {
  display: flex;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: thin;
}
.subtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.subtab .ico { width: 16px; height: 16px; }
.subtab:hover { background: var(--tint); color: var(--blue); }
.subtab.is-active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(39, 62, 212, .28);
}
.subtab__count {
  font-size: 11px;
  font-weight: 700;
  background: var(--tint-2);
  color: var(--blue);
  border-radius: 99px;
  padding: 0 7px;
  min-width: 20px;
  text-align: center;
}
.subtab.is-active .subtab__count { background: rgba(255, 255, 255, .22); color: #fff; }

/* ================= Toolbar (search/filter row above lists) ================= */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar__search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
  display: flex;
  align-items: center;
}
.toolbar__search .ico {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--faint);
  pointer-events: none;
}
.toolbar__search input {
  width: 100%;
  padding: 8.5px 12px 8.5px 34px;
  border: 1.5px solid var(--border-soft);
  border-radius: 10px;
  background: #fff;
  font-size: 13.5px;
}
.toolbar__search input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(39, 62, 212, .12);
}
.toolbar__spacer { flex: 1; }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6.5px 13px;
  border: 1.5px solid var(--border-soft);
  border-radius: 99px;
  background: #fff;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--blue-light); color: var(--blue); }
.chip.is-on {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 3px 8px rgba(39, 62, 212, .25);
}

/* ================= Tables ================= */

.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.sv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sv-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 12px 16px;
  border-bottom: 1px solid var(--tint-2);
  background: var(--tint);
  white-space: nowrap;
}
.sv-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--tint);
  vertical-align: middle;
}
.sv-table tbody tr { transition: background .12s ease; }
.sv-table tbody tr:hover { background: var(--tint); }
.sv-table tbody tr:last-child td { border-bottom: none; }
.sv-table .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.sv-table .row-actions { display: flex; gap: 2px; justify-content: flex-end; opacity: .55; transition: opacity .12s ease; }
.sv-table tbody tr:hover .row-actions { opacity: 1; }

.cell-person { display: flex; align-items: center; gap: 11px; }
.cell-person__avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tint-2), var(--tint));
  color: var(--blue);
  font-weight: 700;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-soft);
  overflow: hidden;
}
.cell-person__avatar img { width: 100%; height: 100%; object-fit: cover; }
.cell-person__name { font-weight: 600; }
.cell-person__sub { font-size: 12px; color: var(--faint); display: block; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge--dept { background: var(--tint-2); color: var(--blue); margin-right: 4px; }
.badge--on { background: var(--green-tint); color: var(--green); }
.badge--off { background: #EEF0F7; color: var(--faint); }
.badge--review { background: var(--amber-tint); color: var(--amber); }
.badge--no { background: var(--red-tint); color: var(--red); }
.badge--edit { background: var(--tint-2); color: var(--blue); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* badges that are also cross-links (e.g. doctor departments → Procedures) */
button.badge--link {
  border: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
button.badge--link:hover {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 3px 8px rgba(39, 62, 212, .3);
}

/* toggle switch */
.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
  display: inline-block;
}
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: #CDD3EE;
  transition: background .18s ease;
  pointer-events: none;
}
.switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 74, .25);
  transition: transform .18s var(--ease);
}
.switch input:checked + .switch__track { background: var(--blue); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ================= Empty state ================= */

.empty-state {
  text-align: center;
  padding: 54px 24px;
  color: var(--muted);
}
.empty-state__ico {
  display: inline-flex;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--tint);
  color: var(--blue-light);
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.empty-state__ico .ico { width: 26px; height: 26px; }
.empty-state h3 { font-size: 17px; margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; color: var(--faint); margin-bottom: 16px; }

/* ================= Dialogs (modal + slide-over) ================= */

.modal-root, .slideover-root { position: fixed; inset: 0; z-index: 100; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 74, .45);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .24s ease;
}
.is-open .modal-backdrop { opacity: 1; }

.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(.97);
  width: min(520px, calc(100vw - 32px));
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .24s var(--ease), transform .24s var(--ease);
}
.is-open .modal { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.slideover {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100vw);
  background: #fff;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(103%);
  transition: transform .3s var(--ease);
  border-radius: 0;
}
.is-open .slideover { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .modal, .slideover, .modal-backdrop { transition: none; }
}

.dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--tint-2);
  flex: none;
}
.dialog__eyebrow {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 2px;
}
.dialog__title { font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.dialog__title-ico { color: var(--blue); width: 20px; height: 20px; }
.dialog__body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.dialog__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--tint-2);
  background: var(--tint);
  flex: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.slideover .dialog__foot { border-radius: 0; }

.confirm-text { font-size: 14px; color: var(--muted); line-height: 1.6; }
.confirm-text b { color: var(--ink); }

/* ================= Forms ================= */

.form-grid { display: flex; flex-wrap: wrap; gap: 14px 12px; }
.field { flex: 1 1 100%; display: flex; flex-direction: column; gap: 5px; }
.field--half { flex: 1 1 calc(50% - 6px); min-width: 150px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field__req { color: var(--red); }
.field__error { font-size: 11.5px; color: var(--red); min-height: 0; font-weight: 500; }
.field__error:empty { display: none; }
.field__hint { font-size: 11.5px; color: var(--faint); }

.input {
  padding: 9px 12px;
  border: 1.5px solid var(--border-soft);
  border-radius: 10px;
  background: #fff;
  font-size: 13.5px;
  color: var(--ink);
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(39, 62, 212, .12);
}
.input--invalid { border-color: var(--red); }
.input--invalid:focus { box-shadow: 0 0 0 3px rgba(192, 49, 61, .12); }
textarea.input { resize: vertical; min-height: 70px; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23404A82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
  padding-right: 32px;
}

/* multi-select chips (departments) */
.dept-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.dept-chip {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--border-soft);
  background: #fff;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s ease;
}
.dept-chip .ico { width: 13px; height: 13px; display: none; }
.dept-chip:hover { border-color: var(--blue-light); color: var(--blue); }
.dept-chip[aria-pressed="true"] {
  background: var(--tint-2);
  border-color: var(--blue);
  color: var(--blue);
}
.dept-chip[aria-pressed="true"] .ico { display: inline-block; }

.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: var(--tint);
  border-radius: 11px;
}
.toggle-field__label { font-size: 13px; font-weight: 600; color: var(--ink); }
.toggle-field__hint { display: block; font-size: 11.5px; font-weight: 400; color: var(--faint); }

/* ================= Toasts ================= */

.toast-stack {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy);
  color: #fff;
  padding: 11px 18px 11px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  max-width: 380px;
}
.toast.is-in { opacity: 1; transform: none; }
.toast .ico { width: 17px; height: 17px; color: #7DE8B2; }
.toast--danger .ico { color: #FF9DA6; }
.toast--info .ico { color: #9FB0F5; }
@media (prefers-reduced-motion: reduce) { .toast { transition: opacity .15s ease; transform: none; } }

/* ================= Procedures ================= */

.dept-section { margin-bottom: 20px; }
.dept-section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.dept-section__head .ico { color: var(--blue); width: 19px; height: 19px; }
.dept-section__head h3 { font-size: 16.5px; }
.dept-section__count { font-size: 12px; color: var(--faint); font-weight: 500; }

.proc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
}
.proc-row + .proc-row { border-top: 1px solid var(--tint); }
.proc-row__name { font-weight: 600; flex: 1; min-width: 0; }
.proc-row__name small { display: block; color: var(--faint); font-weight: 400; font-size: 11.5px; }
.proc-row__price {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--navy);
  font-size: 14.5px;
  min-width: 84px;
  text-align: right;
}
.proc-row__price small { color: var(--faint); font-weight: 500; font-size: 11px; display: block; }
.price-edit {
  width: 108px;
  padding: 6px 10px;
  border: 1.5px solid var(--blue);
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: right;
}
.price-edit:focus { outline: none; box-shadow: 0 0 0 3px rgba(39, 62, 212, .12); }
.proc-row.is-off .proc-row__name, .proc-row.is-off .proc-row__price { opacity: .45; }

/* ================= Rules ================= */

.rule-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  flex-wrap: wrap;
}
.rule-card + .rule-card { border-top: 1px solid var(--tint); }
.rule-card__sentence { flex: 1; min-width: 220px; font-size: 14px; line-height: 1.9; }
.rule-kw {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--faint);
  margin: 0 6px 0 2px;
  vertical-align: 1px;
}
.rule-kw:first-child { margin-left: 0; }
.rule-pill {
  display: inline-block;
  background: var(--tint-2);
  color: var(--navy);
  border-radius: 8px;
  padding: 2.5px 10px;
  font-weight: 600;
  font-size: 12.5px;
  margin-right: 6px;
}
.rule-pill--op { background: var(--tint); color: var(--blue); font-family: ui-monospace, 'Cascadia Code', monospace; }

.rule-builder-preview {
  background: var(--tint);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 13.5px;
  line-height: 1.9;
  margin-bottom: 16px;
}
.rule-builder-preview__label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}

/* ================= Kanban ================= */

.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 264px;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 18px;
  align-items: start;
  scrollbar-width: thin;
}

.kanban-col {
  background: var(--tint);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar-h) - 160px);
  min-height: 220px;
  transition: background .15s ease, border-color .15s ease;
}
.kanban-col.is-over {
  background: var(--tint-2);
  border-color: var(--blue-light);
  border-style: dashed;
}
.kanban-col__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 14px 10px;
  flex: none;
}
.kanban-col__head .ico { width: 16px; height: 16px; color: var(--blue); }
.kanban-col__title { font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700; color: var(--ink); }
.kanban-col__count {
  margin-left: auto;
  background: #fff;
  border: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 99px;
  padding: 0 8px;
  min-width: 22px;
  text-align: center;
}
.kanban-col__sum { padding: 0 14px 8px; font-size: 11.5px; color: var(--faint); font-weight: 600; flex: none; }
.kanban-col__body {
  padding: 4px 10px 12px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
}
.kanban-col__empty {
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  padding: 18px 10px;
  text-align: center;
  color: var(--faint);
  font-size: 12px;
}

.kcard {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  padding: 12px 13px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), opacity .16s ease;
  position: relative;
}
.kcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border); }
.kcard:active { cursor: grabbing; }
.kcard.is-dragging { opacity: .35; transform: scale(.98); }
.kcard__top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.kcard__name { font-weight: 700; font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard__grip { color: var(--border); display: flex; }
.kcard__grip .ico { width: 14px; height: 14px; }
.kcard__proc { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.kcard__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kcard__country { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--faint); }
.kcard__country .ico { width: 13px; height: 13px; }
.kcard__value { font-size: 12.5px; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }

.drop-slot {
  height: 3px;
  border-radius: 3px;
  background: var(--blue-light);
  margin: -4px 2px;
  opacity: 0;
  transition: opacity .1s ease;
}
.drop-slot.is-on { opacity: 1; }

/* patient detail slide-over */
.detail-rows { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.detail-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--tint); align-items: flex-start; font-size: 13.5px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .ico { width: 16px; height: 16px; color: var(--blue); margin-top: 2px; flex: none; }
.detail-row__label { color: var(--faint); font-size: 12px; width: 84px; flex: none; padding-top: 1px; }
.detail-row__value { font-weight: 500; }

.stage-stepper { display: flex; flex-direction: column; gap: 0; margin-bottom: 4px; }
.stage-step { display: flex; align-items: center; gap: 10px; padding: 6px 0; border: none; background: none; text-align: left; border-radius: 8px; color: var(--muted); font-size: 13px; }
.stage-step:hover { color: var(--blue); }
.stage-step__dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all .15s ease;
}
.stage-step__dot .ico { width: 12px; height: 12px; }
.stage-step.is-done .stage-step__dot { background: var(--tint-2); border-color: var(--blue-light); color: var(--blue); }
.stage-step.is-current { color: var(--ink); font-weight: 700; }
.stage-step.is-current .stage-step__dot { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ================= Content editor ================= */

.cms-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}
.cms-pages { padding: 8px; position: sticky; top: calc(var(--topbar-h) + 20px); }
.cms-page-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  transition: background .14s ease, color .14s ease;
}
.cms-page-btn .ico { width: 17px; height: 17px; }
.cms-page-btn:hover { background: var(--tint); color: var(--ink); }
.cms-page-btn.is-active { background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(39, 62, 212, .3); }
.cms-page-btn__count { margin-left: auto; font-size: 11px; font-weight: 700; opacity: .65; }

.lang-switch {
  display: inline-flex;
  background: var(--tint);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  padding: 3px;
  gap: 2px;
}
.lang-switch button {
  border: none;
  background: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  transition: all .15s ease;
}
.lang-switch button:hover { color: var(--blue); }
.lang-switch button.is-on { background: #fff; color: var(--blue); box-shadow: var(--shadow-sm); }

.cms-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--tint);
  border: 1px solid var(--tint-2);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.5;
}
.cms-note .ico { width: 16px; height: 16px; color: var(--blue); flex: none; margin-top: 1px; }
.cms-note a { color: var(--blue); font-weight: 600; }
.cms-note a:hover { text-decoration: underline; }

.cms-fields { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; }
.cms-field label { font-size: 12.5px; font-weight: 600; color: var(--muted); display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.cms-field code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 10.5px;
  color: var(--faint);
  background: var(--tint);
  padding: 1px 7px;
  border-radius: 5px;
}
.cms-field .input[dir="rtl"] { text-align: right; }
.cms-field--dirty label::after {
  content: 'edited';
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-tint);
  border-radius: 5px;
  padding: 1px 7px;
}

.cms-preview {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  margin-top: 16px;
}
.cms-preview__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--tint);
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.cms-preview__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.cms-preview__url {
  margin-left: 8px;
  flex: 1;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  font-size: 11px;
  color: var(--faint);
  padding: 3px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cms-preview__stage {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 70%, #1A2568 100%);
  color: #fff;
  padding: 34px 30px 38px;
}
.cms-preview__stage[dir="rtl"] { text-align: right; }
.cms-preview__eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #9FB0F5; margin-bottom: 10px; }
.cms-preview__h1 { font-family: 'Lora', Georgia, serif; font-size: 25px; line-height: 1.25; color: #fff; margin-bottom: 10px; font-weight: 600; }
.cms-preview__p { font-size: 13px; color: #C3CBF2; line-height: 1.6; max-width: 520px; margin-bottom: 18px; }
.cms-preview__stage[dir="rtl"] .cms-preview__p { margin-left: auto; }
.cms-preview__cta {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(39, 62, 212, .45);
}
.cms-preview__trust { margin-top: 16px; font-size: 11px; color: #8E9BDD; }

/* ================= Influencers ================= */

.copy-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--tint);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  padding: 5.5px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-family: ui-monospace, 'Cascadia Code', monospace;
  transition: all .15s ease;
  max-width: 100%;
}
.copy-link-btn .ico { width: 13px; height: 13px; color: var(--blue); }
.copy-link-btn:hover { border-color: var(--blue-light); color: var(--blue); background: var(--tint-2); }
.copy-link-btn.is-copied { background: var(--green-tint); border-color: var(--green); color: var(--green); }
.copy-link-btn.is-copied .ico { color: var(--green); }
.copy-link-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mini-bar { display: flex; align-items: center; gap: 8px; }
.mini-bar__track { flex: 1; height: 5px; border-radius: 5px; background: var(--tint-2); min-width: 50px; max-width: 90px; overflow: hidden; }
.mini-bar__fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--blue-light), var(--blue)); }

/* ================= Responsive ================= */

@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: 1fr; }
  .cms-layout { grid-template-columns: 200px 1fr; }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-104%);
    transition: transform .28s var(--ease);
    width: var(--sidebar-w) !important;
    box-shadow: var(--shadow-lg);
  }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-collapsed .salu-logo__text,
  .app.sidebar-collapsed .nav-item span,
  .app.sidebar-collapsed .nav-item__badge,
  .app.sidebar-collapsed .user-chip__meta,
  .app.sidebar-collapsed .sidebar__reset span { display: initial; }
  .app.sidebar-collapsed .sidebar__head { flex-direction: row; padding: 18px 14px 14px 18px; }
  .app.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 10.5px 12px; }
  .sidebar__collapse { display: none; }
  .topbar__menu { display: inline-flex; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar__crumb { display: none; }
  .topbar__title { font-size: 17px; }
  .topbar__search { max-width: none; }
  .topbar__kbd { display: none; }
  .topbar__action span { display: none; }
  .topbar__action { padding: 9.5px 12px; }
  .content { padding: 16px 14px 40px; }
  .cms-layout { grid-template-columns: 1fr; }
  .cms-pages { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .cms-page-btn { white-space: nowrap; width: auto; flex: none; }
  .cms-page-btn__count { display: none; }
  .kanban { grid-auto-columns: 240px; }
  .toast-stack { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: none; }
  .field--half { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ================================================================
   Auth gate — opaque full-screen overlay shown until an admin
   session is confirmed. Sits above everything else in the app.
   ================================================================ */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--navy-deep), var(--navy) 60%, var(--blue) 130%);
}
.auth-gate__box {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px 28px;
}
.auth-gate__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}
.auth-gate__brand .salu-mark { flex: none; }
.auth-gate__box h1 { font-size: 21px; margin-bottom: 6px; }
.auth-gate__sub { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0 0 20px; }
.auth-gate__error {
  background: var(--red-tint);
  color: var(--red);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}
.auth-gate__field {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
}
.auth-gate__field .input { margin-top: 6px; width: 100%; }
.auth-gate__submit { width: 100%; justify-content: center; margin-top: 4px; }
.auth-gate__link {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px;
}
.auth-gate__link:hover { text-decoration: underline; }

/* ---- Doctor photo upload + crop ---- */
.doc-photo-row { display: flex; gap: 14px; align-items: stretch; margin-top: 4px; }
.doc-photo-preview {
  width: 100px; height: 125px; border-radius: 12px; overflow: hidden; flex: 0 0 auto;
  border: 1px solid var(--border); background: var(--tint);
  display: flex; align-items: center; justify-content: center;
}
.doc-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.doc-photo-preview span { font-size: 11.5px; color: var(--faint); }
.doc-photo-drop {
  flex: 1; border: 1.5px dashed var(--border); border-radius: 12px; background: var(--tint); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; color: var(--muted); font-size: 12.5px; padding: 12px;
}
.doc-photo-drop:hover, .doc-photo-drop:focus { border-color: var(--blue); outline: none; }
.doc-photo-drop.is-over { border-color: var(--blue); background: #EEF0FD; }
.doc-photo-ico {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--blue);
}
.doc-crop-ov {
  position: fixed; inset: 0; z-index: 9999; background: rgba(16, 24, 74, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.doc-crop-box {
  width: 100%; max-width: 440px; background: var(--surface); border-radius: 18px;
  padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-lg);
}
.doc-crop-head { font-weight: 700; color: var(--ink); font-family: 'Lora', Georgia, serif; }
.doc-crop-stage { width: 100%; height: 340px; background: #EEF0FA; border-radius: 12px; overflow: hidden; }
.doc-crop-stage img { max-width: 100%; display: block; }
.doc-crop-hint { font-size: 11.5px; color: var(--faint); text-align: center; }
.doc-crop-actions { display: flex; gap: 12px; justify-content: flex-end; }
