﻿/* ============================================================
   SMART HOSPITAL Â· THEME STYLESHEET  (sh-theme.css)
   Load order: Bootstrap 5 â†’ sh-tokens.css â†’ THIS FILE

   Contents:
   A. Layout Shell (mrail, topbar, content, plist sidebar)
   B. Bootstrap 5 Component Overrides (buttons, badges, tables, cards, forms)
   C. Custom Components (page-head, bcard, rellist, kpi, kanban, timeline, vswitch)
   ============================================================ */

/* ============================================================
   A. LAYOUT SHELL
   ============================================================ */

p.lead, h1, h2, h3, h4, h5, h6 { color: var(--ink) !important; }
th, td { color: var(--ink) !important; }

h1 { font-size: var(--fs-h1); font-weight: var(--fw-bold); line-height: var(--lh-snug); letter-spacing: var(--ls-tight); }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-bold); line-height: var(--lh-snug); letter-spacing: -0.005em; }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-bold); line-height: 1.4; letter-spacing: -0.005em; }
h4 { font-size: var(--fs-h4); font-weight: var(--fw-bold); line-height: 1.4; }
h5 { font-size: var(--fs-h5); font-weight: var(--fw-bold); line-height: var(--lh-snug); letter-spacing: -0.005em; }
h6 { font-size: var(--fs-h6); font-weight: var(--fw-bold); line-height: 1.4; }

/* QR/barcode always need white bg — dark mode would make them unreadable */
.sh-qr-code { background: #FFFFFF; padding: 2px; border-radius: 4px; display: inline-block; }
.sh-col-nowrap { white-space: nowrap !important; }

/* --- Module Rail (64px fixed, left 0) --- */
.mrail {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 64px;
  background: var(--rail);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 1040;
  transition: background .25s;
}
.mrail-logo {
  height: 52px;
  display: grid; place-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mrail-logo .lg {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px;
  box-shadow: var(--shadow);
  text-decoration: none;
}
.mrail-modules {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: none;
}
.mrail-modules::-webkit-scrollbar { display: none; }

.mrail-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 10px 4px; gap: 3px;
  color: var(--rail-ink);
  position: relative;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.mrail-item:hover {
  background: var(--surface-2);
  color: var(--rail-ink-active);
  text-decoration: none;
}
body.variant-c .mrail-item:hover { background: rgba(255,255,255,.08); }
.mrail-item svg { width: 18px; height: 18px; }
.mrail-item .lbl {
  font-size: 10px; font-weight: var(--fw-semibold);
  text-align: center; letter-spacing: 0;
}
.mrail-item.active {
  color: var(--accent);
  background: var(--accent-soft);
}
body.variant-c .mrail-item.active {
  color: var(--rail-ink-active);
  background: var(--accent);
}
.mrail-item.active::before {
  content: "";
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
body.variant-c .mrail-item.active::before { background: #FFFFFF; }

.mrail-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 10px;
}
.mrail-foot {
  padding: 8px 0;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
  flex-shrink: 0;
}
.mrail-user {
  display: grid; place-items: center;
  padding: 10px 4px;
}
.mrail-user .av {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-weight: 700; font-size: 11px;
  cursor: pointer;
  text-decoration: none;
}

/* ════════════════════════════════════════════════════════════
   TOPBAR — --depth token controls metallic relief per preset
   ════════════════════════════════════════════════════════════ */

body[data-preset="clinical"],
body[data-preset="slate"]      { --depth: .25; }
body[data-preset="midnight"],
body[data-preset="oled"],
body[data-preset="nightshift"] { --depth: 1; }
/* nightshift is a DARK variant-a preset — tell the browser to use dark color-scheme
   for scrollbars, form controls, autofill. variant-b gets this from sh-tokens.css. */
body[data-preset="nightshift"] { color-scheme: dark; }
body                            { --depth: 1; }

/* --- Top Bar (52px fixed, after sidebar) --- */
.topbar {
  position: fixed; top: 0; left: 220px; right: 0;
  height: 52px;
  background: var(--topbar); color: var(--topbar-ink);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
  z-index: 1039;
  transition: background .25s;
}
.topbar::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    color-mix(in srgb, var(--accent) 40%, transparent) 18%,
    var(--accent) 50%,
    color-mix(in srgb, var(--accent) 40%, transparent) 82%,
    transparent 100%);
  opacity: calc(.5 * var(--depth));
  pointer-events: none;
}

.tb-toggle {
  width: 32px; height: 32px; border-radius: 50%;
  flex-shrink: 0; border: none; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 30% 30%,
    color-mix(in srgb, var(--accent) 80%, white) 0%,
    var(--accent) 50%,
    var(--accent-dark) 100%);
  color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255, calc(.35 * var(--depth) + .1)),
    inset 0 -2px 3px rgba(0,0,0, calc(.25 * var(--depth))),
    0 2px 4px rgba(0,0,0, calc(.3 * var(--depth)));
  transition: transform .15s, filter .15s;
}
.tb-toggle:hover { transform: scale(1.06); filter: brightness(1.06); }
.tb-toggle i { font-size: 12px; }

/* tb-module font-size/family inherits from Theme Studio settings */
.tb-module {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px;
  color: var(--topbar-ink);
  flex-shrink: 0; cursor: pointer;
}
.tb-module .ic {
  width: 26px; height: 26px; border-radius: 4px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 75%, white) 0%,
    var(--accent) 60%,
    var(--accent-dark) 100%);
  color: var(--accent-ink);
  display: grid; place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255, calc(.3 * var(--depth) + .1)),
    0 1px 3px rgba(0,0,0, calc(.3 * var(--depth)));
}
.tb-module .ic svg { width: 13px; height: 13px; }
.tb-module .caret { color: var(--muted); font-size: var(--fs-micro); margin-left: 2px; }
/* Replaces inline font-size on FA icons in header.php */
.topbar .tb-module .ic i { font-size: 12px; }
.topbar .tb-btn i,
.topbar .tb-btn-flag i { font-size: 15px; }
.topbar .dropdown .fa-angle-down { font-size: var(--fs-micro); }

.tb-tabs {
  display: flex; align-items: center;
  gap: 2px; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.tb-tabs::-webkit-scrollbar { display: none; }
.tb-tabs a {
  padding: 16px 14px;
  font-size: var(--fs-h6); font-weight: var(--fw-semibold);
  color: var(--muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  margin-bottom: -1px;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.tb-tabs a:hover { color: var(--ink); text-decoration: none; }
.tb-tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tb-right {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}

.tb-search {
  display: flex; align-items: center; gap: 10px;
  height: 40px; width: 260px; padding: 0 16px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg) 60%, transparent) 0%,
    color-mix(in srgb, var(--bg) 80%, transparent) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  box-shadow:
    inset 0 2px 3px rgba(0,0,0, calc(.4 * var(--depth))),
    inset 0 1px 0 rgba(0,0,0, calc(.2 * var(--depth)));
  transition: border-color .2s, box-shadow .2s;
  margin: 0;
}
.tb-search:focus-within {
  border-color: var(--accent);
  box-shadow:
    inset 0 2px 3px rgba(0,0,0, calc(.4 * var(--depth))),
    0 0 0 3px var(--accent-soft);
}
.tb-search input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 13px;
  color: var(--topbar-ink); min-width: 0;
}
.tb-search input::placeholder { color: var(--muted); }
.tb-search-submit {
  background: none; border: none; padding: 0; cursor: pointer;
  display: flex; align-items: center; flex-shrink: 0;
  color: var(--accent);
  margin-right: 2px;
  transition: transform .15s;
}
.tb-search-submit:hover { transform: scale(1.1); }
.tb-search-submit svg { width: 14px; height: 14px; }
.tb-search kbd {
  font-family: var(--mono);
  font-size: 10px; font-weight: 600;
  padding: 1px 5px;
  background: rgba(0,0,0,.18); color: var(--accent);
  border-radius: 2px;
  border: 1px solid var(--border-strong);
}

.tb-btn {
  width: 34px; height: 34px;
  border-radius: 4px;
  display: grid; place-items: center;
  color: var(--muted);
  position: relative;
  background: none; border: none;
  transition: color .15s, transform .15s;
  cursor: pointer;
}
.tb-btn:hover { color: var(--accent); transform: scale(1.08); }
.tb-btn svg { width: 16px; height: 16px; }
.tb-btn .dot {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--topbar);
}
.tb-btn-flag { width: 38px; }
.tb-btn-flag img { display: block; }

.tb-rail {
  display: flex; align-items: center;
  height: 40px; padding: 0 14px; gap: 6px;
  position: relative;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg) 60%, transparent) 0%,
    color-mix(in srgb, var(--bg) 80%, transparent) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  box-shadow:
    inset 0 2px 3px rgba(0,0,0, calc(.4 * var(--depth))),
    inset 0 1px 0 rgba(0,0,0, calc(.2 * var(--depth)));
}
.tb-rail .sep,
.tb-rail-sep {
  width: 1px; height: 18px;
  background: linear-gradient(180deg, transparent 0%, var(--border-strong) 50%, transparent 100%);
  margin: 0 2px;
}

/* .tb-divider deprecated — signet uses its own border-left */
.tb-divider { width: 1px; height: 22px; background: var(--border-strong); margin: 0 4px; }

.tb-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 30%, #D4324D 0%, #8B1A2F 100%);
  color: #fff;
  font-size: 9.5px; font-weight: 700; line-height: 15px;
  text-align: center; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 2px rgba(0,0,0,.4);
  pointer-events: none;
  border: none;
}

.tb-signet {
  display: flex; align-items: center; gap: 10px;
  height: 100%; padding: 0 14px 0 10px; margin-left: 4px;
  border-left: 1px solid var(--border-strong);
  cursor: pointer;
  text-decoration: none !important;
  color: var(--topbar-ink) !important;
}
.tb-signet:hover { color: var(--topbar-ink); }
.tb-signet img {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--accent);
  padding: 2px;
  background: transparent;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0,0,0, calc(.4 * var(--depth)));
  flex-shrink: 0;
}
.tb-signet-initials { width:30px; height:30px; border-radius:50%; border:1.5px solid var(--accent); padding:2px; background:var(--accent); background-clip:content-box; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:11px; letter-spacing:0; line-height:1; text-transform:uppercase; user-select:none; flex-shrink:0; box-shadow:0 1px 4px rgba(0,0,0,calc(.4 * var(--depth))); }
.tb-signet-text { line-height: 1.1; }
.tb-signet-name {
  font-weight: 600; font-size: 13px;
  color: var(--topbar-ink);
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: block;
}
.tb-signet-role {
  display: block;
  font-size: 10px; font-weight: 500;
  color: var(--muted); letter-spacing: .14em; text-transform: uppercase;
  margin-top: 2px;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tb-signet .fa-angle-down { color: var(--muted); font-size: 11px; margin-left: 4px; }

/* --- Admin Sidebar (mockup-themed, rail-inspired) --- */
.sh-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 220px;
  background: var(--rail);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 1035;
  transition: background .25s, transform .25s ease, width .25s ease;
}
body.sidebar-collapsed .sh-sidebar { width: 64px; }
body.sidebar-collapsed .topbar { left: 64px; }
body.sidebar-collapsed .content { margin-left: 64px; }

/* Mobile sidebar: off-canvas at ≤768px, hamburger toggles body.sidebar-mobile-open */
@media (max-width: 768px) {
  .sh-sidebar {
    transform: translateX(-100%);
    width: 240px !important;   /* override both default 220 and collapsed 64; full-width drawer */
    z-index: 1060;             /* above topbar (1039) and modal backdrops (1040) */
    box-shadow: 2px 0 16px rgba(0,0,0,.18);
  }
  body.sidebar-mobile-open .sh-sidebar { transform: translateX(0); }
  .topbar, body.sidebar-collapsed .topbar { left: 0; }
  .content, body.sidebar-collapsed .content { margin-left: 0; }
  body.sidebar-mobile-open::before {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1055;
  }
  body.sidebar-mobile-open { overflow: hidden; }
  /* Mobile topbar: hide search/tabs, collapse tb-module to icon-only */
  .topbar { padding: 0 8px; gap: 6px; overflow: hidden; }
  .topbar .tb-search { display: none; }
  .topbar .tb-tabs { display: none; }
  .topbar .tb-module { font-size: 0; gap: 0; }
  .topbar .tb-module .ic { font-size: 14px; }
  .topbar .tb-module .caret { display: none; }
  /* Target .tb-rail DESCENDANTS — .tb-right > .tb-btn direct-child never matched tb-rail nesting */
  .topbar .tb-right { margin-left: auto; gap: 2px; flex-shrink: 0; }
  .topbar .tb-rail .tb-btn[title="Bed Status"],
  .topbar .tb-rail .tb-btn[title="Chat"],
  .topbar .tb-rail .tb-btn[title="Calendar"],
  .topbar .tb-right .tb-divider { display: none; }
  .topbar .tb-signet .tb-signet-role { display: none; }
  /* overflow:hidden on topbar clips dropdown menus — position:fixed lets them escape */
  .topbar .dropdown-menu {
    position: fixed !important;
    inset: 56px 8px auto auto !important;
    transform: none !important;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }
  html[dir="rtl"] .topbar .dropdown-menu { inset: 56px auto auto 8px !important; }
}
/* ⋮ More menu — desktop-hidden, surfaces hidden icons on mobile */
.topbar .tb-more-wrap { display: none; }
@media (max-width: 768px) {
  .topbar .tb-more-wrap { display: inline-block; }
}
/* ≤480px: drop language flag on admin bar so username fits (patient bar has room, scoped out) */
@media (max-width: 480px) {
  body:not([data-chrome="patient"]) .topbar .tb-rail > .dropdown:not(.tb-more-wrap) { display: none; }
  .topbar { padding-right: 2px; gap: 4px; }
  .topbar .tb-signet { gap: 5px; }
  .topbar .tb-rail { gap: 2px; }
  .topbar .tb-signet img,
  .topbar .tb-signet .tb-signet-avatar { width: 28px !important; height: 28px !important; }
}
.topbar, .content {
  transition: left .25s ease, margin-left .25s ease;
}

body.sidebar-collapsed .sh-sidebar-name,
body.sidebar-collapsed .sh-sidebar-search,
body.sidebar-collapsed .sh-sidebar .sh-section,
body.sidebar-collapsed .sh-sidebar .sh-subnav,
body.sidebar-collapsed .sh-sidebar .nav-link .sidebar-arrow,
body.sidebar-collapsed .sh-sidebar .nav-link span {
  display: none !important;
}

body.sidebar-collapsed .sh-sidebar-brand {
  justify-content: center;
  padding: 0;
}
body.sidebar-collapsed .sh-sidebar-logo { gap: 0; justify-content: center; }

body.sidebar-collapsed .sh-sidebar .sh-nav { padding: 6px 6px 12px; }
body.sidebar-collapsed .sh-sidebar .nav-link {
  justify-content: center;
  padding: 11px 8px;
  gap: 0;
}
body.sidebar-collapsed .sh-sidebar .nav-link i:first-child {
  width: auto;
  font-size: 16px;
}
body.sidebar-collapsed .sh-sidebar .nav-link.active::before,
body.sidebar-collapsed .sh-sidebar .nav-item.active > .nav-link::before {
  left: -6px;
  top: 8px; bottom: 8px;
}

/* Sidebar tooltip — body-attached via JS; inverted colours (ink-bg/surface-text) auto-adapt per theme */
.sh-rail-tooltip {
  position: fixed;
  background: var(--ink);
  color: var(--surface);
  border: 1px solid color-mix(in srgb, var(--surface) 14%, transparent);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: var(--fs-h6);          /* matches .sh-sidebar .nav-link */
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  z-index: 1080;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity .12s ease, transform .12s ease;
}
.sh-rail-tooltip.show {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.sh-rail-tooltip::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--ink);
  border-left: 1px solid color-mix(in srgb, var(--surface) 14%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--surface) 14%, transparent);
}

/* Collapsed sidebar flyout — body-attached (escapes overflow), shows child links on icon hover */
.sh-rail-flyout {
  position: fixed;
  min-width: 190px;
  max-width: 260px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  background: var(--ink);
  border: 1px solid color-mix(in srgb, var(--surface) 14%, transparent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 1080;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .12s ease, transform .12s ease;
  pointer-events: none;
}
.sh-rail-flyout.show { opacity: 1; transform: translateX(0); pointer-events: auto; }
.sh-rail-flyout ul { list-style: none; margin: 0; padding: 0; }
.sh-rail-flyout .sh-rail-flyout-title {
  font-size: var(--fs-micro);       /* matches .sh-sidebar .sh-section */
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: color-mix(in srgb, var(--surface) 62%, transparent);
  padding: 4px 10px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--surface) 12%, transparent);
}
.sh-rail-flyout .nav-item { width: 100%; }
.sh-rail-flyout .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: var(--fs-h6);          /* same as the hover tooltip / top-level nav label */
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  color: var(--surface);
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
}
.sh-rail-flyout .nav-link:hover { background: color-mix(in srgb, var(--surface) 10%, transparent); color: var(--accent); }
.sh-rail-flyout .nav-link.active,
.sh-rail-flyout .nav-item.active > .nav-link {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}
.sh-rail-flyout .nav-link > i { font-size: 10px; width: 12px; text-align: center; color: color-mix(in srgb, var(--surface) 45%, transparent); }
.sh-rail-flyout .nav-link:hover > i,
.sh-rail-flyout .nav-link.active > i { color: var(--accent); }
body.variant-c .sh-sidebar { background: var(--rail); }

/* Brand/logo header â€” matches mockup rail logo */
.sh-sidebar-brand {
  height: 52px;              /* match .topbar height so the bottom borders form one continuous line */
  display: flex; align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}
.sh-sidebar-logo {
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; color: var(--ink);
  font-weight: 700; font-size: 13px;
  letter-spacing: -.01em;
  width: 100%;
}
.sh-sidebar-logo:hover { color: var(--accent); text-decoration: none; }
.sh-sidebar-logo img {
  box-shadow: var(--shadow);
  border-radius: 7px;
  flex-shrink: 0;
  transition: transform .15s;
}
.sh-sidebar-logo:hover img { transform: scale(1.05); }
.sh-sidebar-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink);
  flex: 1;
  line-height: 1.2;
}
body.variant-c .sh-sidebar-name { color: #fff; }

/* Search bar */
.sh-sidebar-search {
  padding: 12px 14px 8px;
  flex-shrink: 0;
}
.sh-sidebar-search .input-group {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.sh-sidebar-search .input-group:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.sh-sidebar-search .input-group-text {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: var(--fs-sm);
  padding: 6px 0 6px 12px;
}
.sh-sidebar-search .form-control {
  font-size: var(--fs-sm);
  border: none;
  background: transparent !important;   /* beat global .form-control{background:var(--surface)!important} so the icon + input share the input-group's single bg */
  padding: 6px 10px 6px 8px;
  box-shadow: none;
}
.sh-sidebar-search .form-control:focus {
  border: none;
  box-shadow: none;
  background: transparent !important;
}
.sh-sidebar-search .sh-search-clear {
  display: none;
  align-items: center;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-sm);
  padding: 6px 12px 6px 8px;
  cursor: pointer;
  transition: color .15s;
}
.sh-sidebar-search .sh-search-clear.show { display: flex; }
.sh-sidebar-search .sh-search-clear:hover { color: var(--accent); }
body.variant-c .sh-sidebar-search .input-group-text { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color: var(--rail-ink); }
body.variant-c .sh-sidebar-search .form-control { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color: #fff; }

.sh-sidebar-scroll {
  flex: 1; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color .25s;
}
.sh-sidebar-scroll:hover { scrollbar-color: var(--border-strong) transparent; }
.sh-sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sh-sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sh-sidebar-scroll::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
  transition: background .25s;
}
.sh-sidebar-scroll:hover::-webkit-scrollbar-thumb { background: var(--border-strong); }
.sh-sidebar-scroll::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.sh-sidebar::-webkit-scrollbar { width: 4px; }
.sh-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sh-sidebar .input-group { border-radius: var(--radius); }
.sh-sidebar .form-control-sm { font-size: var(--fs-sm); }

.sh-sidebar .sh-nav { list-style: none; padding: 6px 8px 12px; margin: 0; }
.sh-sidebar .nav-item { width: 100%; margin-bottom: 2px; }
.sh-sidebar .sh-section {
  list-style: none;
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  padding: 14px 14px 6px;
  margin: 0;
  user-select: none;
  pointer-events: none;
}
.sh-sidebar .sh-section:first-child { padding-top: 6px; }
body.variant-c .sh-sidebar .sh-section { color: rgba(255,255,255,.4); }
.sh-sidebar .nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  font-size: var(--fs-h6); font-weight: var(--fw-semibold);
  color: var(--ink-2);
  border-radius: var(--radius-md);
  transition: background .15s, color .15s, transform .12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  position: relative;
}
.sh-sidebar .nav-link:hover {
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}
body.variant-c .sh-sidebar .nav-link {
  color: rgba(255,255,255,.85);
}
body.variant-c .sh-sidebar .nav-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
body.variant-c .sh-sidebar .nav-link i:first-child {
  color: rgba(255,255,255,.7);
}
body.variant-c .sh-sidebar .nav-link:hover i:first-child {
  color: #fff;
}
body.variant-c .sh-sidebar .sh-section {
  color: rgba(255,255,255,.45);
}
body.variant-c .sh-sidebar-brand {
  background: var(--rail);
  border-bottom-color: rgba(255,255,255,.08);
}
body.variant-c .sh-sidebar-logo,
body.variant-c .sh-sidebar-name {
  color: #fff;
}
body.variant-c .sh-sidebar-logo:hover { color: var(--accent); }
body.variant-c .sh-sidebar-logo img {
  background: #fff;
  padding: 2px;
}
body.variant-c .sh-sidebar-search .input-group {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.15);
}
body.variant-c .sh-sidebar-search .input-group:focus-within {
  background: rgba(255,255,255,.12);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27,115,232,.25);
}
body.variant-c .sh-sidebar-search .input-group-text { color: rgba(255,255,255,.5); }
body.variant-c .sh-sidebar-search .form-control { color: #fff; }
body.variant-c .sh-sidebar-search .form-control::placeholder { color: rgba(255,255,255,.4); }
body.variant-c .sh-sidebar .sh-subnav {
  border-left-color: rgba(255,255,255,.15);
}
body.variant-c .sh-sidebar .sh-subnav .nav-link {
  color: rgba(255,255,255,.7);
}
body.variant-c .sh-sidebar .sh-subnav .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.sh-sidebar .nav-link.active,
.sh-sidebar .nav-item.active > .nav-link {
  background: linear-gradient(90deg, var(--accent-soft) 0%, rgba(253, 231, 231, 0.4) 100%);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(228, 37, 39, 0.08);
}
body.variant-c .sh-sidebar .nav-link.active,
body.variant-c .sh-sidebar .nav-item.active > .nav-link {
  background: var(--accent);
  color: var(--rail-ink-active);
}
.sh-sidebar .nav-link.active::before,
.sh-sidebar .nav-item.active > .nav-link::before {
  content: "";
  position: absolute; left: -8px; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px var(--accent-soft);
}
body.variant-c .sh-sidebar .nav-link.active::before,
body.variant-c .sh-sidebar .nav-item.active > .nav-link::before { background: #fff; }

.sh-sidebar .nav-link i:first-child {
  width: 20px; text-align: center; font-size: 14px; flex-shrink: 0;
  color: var(--muted);
  transition: color .15s, transform .15s;
}
.sh-sidebar .nav-link:hover i:first-child {
  color: var(--ink);
  transform: scale(1.05);
}
.sh-sidebar .nav-link.active i:first-child,
.sh-sidebar .nav-item.active > .nav-link i:first-child { color: var(--accent); }
body.variant-c .sh-sidebar .nav-link.active i:first-child,
body.variant-c .sh-sidebar .nav-item.active > .nav-link i:first-child { color: #fff; }

.sh-sidebar .nav-link .sidebar-arrow { font-size: 10px; margin-left: auto; transition: transform .2s; color: var(--faint); }
.sh-sidebar .nav-link[aria-expanded="true"] .sidebar-arrow { transform: rotate(180deg); }

.sh-sidebar .sh-subnav {
  list-style: none;
  padding: 4px 0;
  margin: 0 0 0 18px;
  display: none;
  border-left: none;
}
body.variant-c .sh-sidebar .sh-subnav { border-left-color: rgba(255,255,255,.18); }
.sh-sidebar .sh-subnav.show { display: block; }
.sh-sidebar .sh-subnav .nav-item {
  position: relative;
}
/* Horizontal connector tick â€” removed (parent vertical tree-line removed) */
.sh-sidebar .sh-subnav .nav-item::before { display: none; }
.sh-sidebar .sh-subnav .nav-link {
  padding: 6px 10px 6px 8px;
  font-size: var(--fs-sm); font-weight: 400;
  color: var(--rail-ink);
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 6px;
  transition: color .15s, background .15s, padding-left .15s;
}
/* Hide the legacy chevron icon inside submenu links â€” modern dot indicator (::before) replaces it */
.sh-sidebar .sh-subnav .nav-link > i.fa-angle-right,
.sh-sidebar .sh-subnav .nav-link > i.fa-angle-double-right {
  display: none;
}

/* --- Inner page tab list (Settings / sub-page navigation) --- */
.tablists {
  list-style: none;
  padding: 8px;
  margin: 0;
  background: var(--surface);
  border-radius: var(--radius-md);
}
.tablists li {
  margin-bottom: 2px;
}
.tablists li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: var(--radius);
  position: relative;
  transition: background .15s, color .15s, padding-left .15s;
}
.tablists li a::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--faint);
  flex-shrink: 0;
  transition: background .15s, transform .15s;
}
.tablists li a:hover {
  background: var(--surface-2);
  color: var(--ink);
  padding-left: 14px;
}
.tablists li a:hover::before {
  background: var(--accent);
  transform: scale(1.3);
}
.tablists li a.active,
.tablists li.active > a {
  background: linear-gradient(90deg, var(--accent-soft) 0%, rgba(253, 231, 231, 0.4) 100%);
  color: var(--accent);
  font-weight: 600;
  padding-left: 14px;
}
.tablists li a.active::before,
.tablists li.active > a::before {
  background: var(--accent);
  transform: scale(1.4);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
body.variant-c .tablists li a.active,
body.variant-c .tablists li.active > a {
  background: linear-gradient(90deg, var(--accent-soft) 0%, rgba(220, 234, 251, 0.4) 100%);
  color: var(--accent);
}
body.variant-c .tablists li a.active::before,
body.variant-c .tablists li.active > a::before {
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
body.variant-b .tablists {
  background: var(--surface);
}
body.variant-b .tablists li a {
  color: rgba(255,255,255,.75);
}
body.variant-b .tablists li a:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
}
body.variant-b .tablists li a.active,
body.variant-b .tablists li.active > a {
  background: var(--accent);
  color: #fff;
}
body.variant-b .tablists li a.active::before,
body.variant-b .tablists li.active > a::before {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.2);
}
.sh-sidebar .sh-subnav .nav-link::before {
  content: '';
  flex-shrink: 0;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--faint);
  transition: background .15s, transform .15s;
}
.sh-sidebar .sh-subnav .nav-link:hover {
  color: var(--rail-ink-active);
  background: var(--surface-2);
  padding-left: 12px;
}
.sh-sidebar .sh-subnav .nav-link:hover::before {
  background: var(--accent);
  transform: scale(1.3);
}
body.variant-c .sh-sidebar .sh-subnav .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
body.variant-c .sh-sidebar .sh-subnav .nav-link:hover::before { background: rgba(255,255,255,.8); }
.sh-sidebar .sh-subnav .nav-item.active .nav-link {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
  padding-left: 12px;
}
.sh-sidebar .sh-subnav .nav-item.active .nav-link::before {
  background: var(--accent);
  transform: scale(1.4);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
body.variant-c .sh-sidebar .sh-subnav .nav-item.active .nav-link {
  color: #fff; background: rgba(255,255,255,.15);
}
body.variant-c .sh-sidebar .sh-subnav .nav-item.active .nav-link::before { background: #fff; }

/* --- Main content area (offset for sidebar + topbar) --- */
.content {
  margin-left: 220px;
  padding-top: 72px;    /* 52px topbar + 20px breathing room */
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 20px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  overflow-x: hidden;   /* contain wide tables/charts; inner .table-responsive provides its own scroll */
}

body.with-plist .content { margin-left: 500px; }

/* Same specificity as desktop rule above — must come after it in source order to win */
@media (max-width: 768px) {
  .content,
  body.sidebar-collapsed .content,
  body.with-plist .content { margin-left: 0; padding-left: 12px; padding-right: 12px; }
  .topbar { left: 0 !important; }
}

/* Zero first-level container-fluid padding — .content owns the gutter; px-* utilities vary per view */
body[data-chrome="patient"] main.content > .container-fluid {
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* --- Patient List Sidebar (IPD/OPD left column, after sidebar) --- */
.plist {
  position: fixed;
  top: 52px; left: 220px; bottom: 0;
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 1030;
}
.plist-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.plist-head .title {
  font-size: 13px; font-weight: 700;
  color: var(--ink);
  display: flex; align-items: center; gap: 6px;
}
.plist-head .title .n {
  font-size: 10px; font-weight: 600;
  padding: 1px 6px;
  background: var(--surface-3); color: var(--muted);
  border-radius: 10px;
}
.plist-head .add {
  width: 24px; height: 24px; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; line-height: 1;
  text-decoration: none;
}
.plist-filter { padding: 10px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.plist-search {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2);
}
.plist-search svg { width: 12px; height: 12px; color: var(--muted); }
.plist-search input { flex: 1; background: none; border: none; outline: none; font-size: 11px; color: var(--ink); }
.plist-chips {
  display: flex; gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
  flex-shrink: 0;
}
.plist-chips::-webkit-scrollbar { display: none; }
.plist-chips .pchip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px;
  font-size: 10px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--muted);
  white-space: nowrap; cursor: pointer;
}
.plist-chips .pchip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.plist-items { flex: 1; overflow-y: auto; scrollbar-width: thin; }
.plist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .12s, border-color .12s;
}
.plist-item:hover { background: var(--surface-2); }
.plist-item.active { background: var(--accent-soft); border-left-color: var(--accent); }
.plist-item .pav {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
}
.plist-item .pav.c2 { background: var(--blue-soft); color: var(--blue); }
.plist-item .pav.c3 { background: var(--red-soft); color: var(--red); }
.plist-item .pav.c4 { background: var(--green-soft); color: var(--green); }
.plist-item .pav.c5 { background: var(--violet-soft); color: var(--violet); }
.plist-item .pinfo { flex: 1; min-width: 0; }
.plist-item .nm {
  font-size: 12px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plist-item .sub {
  font-size: 10px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plist-item .sdot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.plist-item .sdot.green { background: var(--green); }
.plist-item .sdot.amber { background: var(--amber); }
.plist-item .sdot.red   { background: var(--red); }
.plist-item .sdot.blue  { background: var(--blue); }

/* ============================================================
   B. BOOTSTRAP 5 COMPONENT OVERRIDES
   These match the visual style of the sh_new_theme mockup.
   ============================================================ */

/* --- Buttons --- */
.btn { font-size: var(--fs-h6); font-weight: var(--fw-semibold); border-radius: var(--radius); }
.btn-sm { font-size: var(--fs-sm); padding: 3px 10px; }
.btn-lg { font-size: var(--fs-body); }
.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--accent-ink);
}
.btn-primary:focus { box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-outline-primary { color: var(--link); border-color: var(--link); }
.btn-outline-primary:hover { background-color: var(--blue-soft); border-color: var(--link); color: var(--link); }
/* Bootstrap's btn-outline-secondary is a fixed mid-grey (#6c757d) → muddy/near-
   invisible on dark surfaces (e.g. nightshift modals). Anchor it to neutral core
   tokens so the border/text stay legible on every preset. */
.btn-outline-secondary { background-color: transparent; color: var(--ink-2); border-color: var(--border-strong); }
.btn-outline-secondary:hover,
.btn-outline-secondary:focus { background-color: var(--surface-2); border-color: var(--border-strong); color: var(--ink); }
.btn-secondary, .btn-default {
  background-color: var(--surface); border-color: var(--border); color: var(--ink);
}
.btn-secondary:hover { background-color: var(--surface-2); border-color: var(--border-strong); color: var(--ink); }

/* .defaults-c — inline action anchor used across patient portal (timeline, etc.).
   style-main.css hardcodes #464646 which is invisible on dark surfaces. Use --link
   so the colour adapts to each preset (amber in nightshift, blue in clinical, etc.). */
.defaults-c { color: var(--link); text-decoration: none; cursor: pointer; }
.defaults-c:hover { color: var(--link-2); text-decoration: none; }

/* --- Badges --- */
.badge { border-radius: 20px; font-size: var(--fs-micro); font-weight: var(--fw-semibold); padding: 3px 9px; }
.badge.bg-success, .badge.bg-success-subtle { background-color: var(--green-soft) !important; color: var(--green) !important; }
.badge.bg-danger, .badge.bg-danger-subtle   { background-color: var(--red-soft) !important;   color: var(--red) !important; }
.badge.bg-warning, .badge.bg-warning-subtle { background-color: var(--amber-soft) !important; color: #A76C00 !important; }
.badge.bg-info, .badge.bg-info-subtle       { background-color: var(--blue-soft) !important;  color: var(--blue) !important; }
.badge.bg-secondary                         { background-color: var(--surface-3) !important;  color: var(--muted) !important; }

/* --- Legacy BS3 label aliases â†’ render as pill badges (controllers use label label-*) --- */
.label {
  display: inline-block;
  border-radius: 20px; font-size: var(--fs-micro); font-weight: var(--fw-semibold); padding: 3px 9px;
  line-height: 1.4; white-space: nowrap;
}
.label.label-success { background-color: var(--green-soft);  color: var(--green); }
.label.label-warning { background-color: var(--amber-soft);  color: #A76C00; }
.label.label-danger  { background-color: var(--red-soft);    color: var(--red); }
.label.label-info    { background-color: var(--blue-soft);   color: var(--blue); }
.label.label-default,
.label.label-primary { background-color: var(--surface-3);   color: var(--muted); }

/* --- Legacy BS3 btn-xs (aliased to btn-sm sizing) --- */
.btn-xs { padding: 3px 10px !important; font-size: var(--fs-sm) !important; font-weight: var(--fw-semibold) !important; border-radius: var(--radius) !important; }
.table .btn-xs { line-height: 1.5; }
/* 44×44 minimum tap area on touch viewports */
@media (max-width: 1024px) {
  .btn-xs, .table .btn-xs { min-height: 44px; min-width: 44px; }
}

/* --- Billing dashboard module cards --- */
.billingbox {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 18px 10px 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.billingbox:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.billingbox a {
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.billingbox-icon {
  font-size: 26px;
  color: var(--accent);
  line-height: 1;
}
.billingbox p {
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
  text-align: center;
}

/* --- OPD/IPD profile billing progress section --- */
.project-progress-bars {
  padding: 8px 10px 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 2px;
}
.topprograssstart { margin-bottom: 0; }
.topprograssstart h5 {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin-bottom: 3px; margin-top: 0;
  border-bottom: none;  /* prevent the .content h5 rule from adding a border */
}
.topprograssstart p { font-size: 11px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
/* Two-class selector â†’ higher specificity than single .progress or .progress-minibar */
.progress.progress-minibar {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  margin-bottom: 0;
}
.progress.progress-minibar .progress-bar,
.progress.progress-minibar .progress-bar-aqua {
  background: var(--accent);
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
}

/* --- Tables --- */
.table {
  font-size: var(--fs-body);
  border-color: var(--border-light);
  margin-bottom: 0;
  width: 100%;
  table-layout: auto;   /* content-based widths â€” strings get more, numbers get less */
}
/* Inside .table-responsive: let table grow as wide as content needs, scroll as fallback */
.table-responsive > .table,
.dataTables_wrapper .table {
  min-width: 100%;
  width: 100% !important;
  max-width: 100%;
}
.table thead th {
  position: relative;
  font-family: var(--font) !important;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  text-transform: none; letter-spacing: var(--ls-normal);
  color: var(--ink);
  background: var(--surface-3);
  border-bottom: 2px solid var(--border-strong) !important;
  border-top: none !important;
  white-space: nowrap;
  padding: 10px 12px;
  vertical-align: middle;
  line-height: 1.4;
  transition: color .15s, background .15s;
}
.table thead th + th::before {
  content: '';
  position: absolute;
  left: 0; top: 30%; bottom: 30%;
  width: 1px;
  background: var(--border-strong);
  opacity: .5;
}
.table thead th.sortable,
.table thead th.sorting,
.table thead th.sorting_asc,
.table thead th.sorting_desc { cursor: pointer; }
.table thead th.sortable:hover,
.table thead th.sorting:hover { color: var(--accent); }
.table thead th.sorting_asc,
.table thead th.sorting_desc {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 0 var(--accent);
}
.table thead th:first-child { padding-left: 24px; }
.table thead th:last-child  { padding-right: 24px; }
/* DataTables override â€” DT's `table.dataTable thead th` has higher specificity than `.table thead th`,
   so we must match/exceed it. Mirror all our header styling here for DT-enhanced tables. */
table.dataTable.table > thead > tr > th,
table.dataTable.table > thead > tr > td {
  position: relative;
  font-family: var(--font) !important;
  font-size: var(--fs-sm) !important;
  font-weight: var(--fw-semibold) !important;
  text-transform: none;
  letter-spacing: var(--ls-normal);
  color: var(--ink) !important;
  background: var(--surface-3) !important;
  border-bottom: 2px solid var(--border-strong) !important;
  border-top: none !important;
  padding: 10px 12px !important;
  vertical-align: middle;
  line-height: 1.4;
  white-space: normal !important;
  word-break: break-word !important;
}
table.dataTable.table > thead > tr > th:first-child,
table.dataTable.table > thead > tr > td:first-child {/* padding-left: 18px !important; */}
table.dataTable.table > thead > tr > th:last-child,
table.dataTable.table > thead > tr > td:last-child  { padding-right: 18px !important; }
table.dataTable.table,
table.dataTable {
  width: 100% !important;
  max-width: 100% !important;
}
/* Tables that need fixed-width columns: add class ambulance-call-tbl (or sh-tbl-fixed) to <table> */
table.ambulance-call-tbl,
table.sh-tbl-fixed { table-layout: fixed !important; }
table.ambulance-call-tbl thead th:nth-last-child(1),
table.ambulance-call-tbl thead th:nth-last-child(2),
table.ambulance-call-tbl thead th:nth-last-child(3) { width: 80px !important; }
/* Force DataTables scroll containers to 100% to prevent horizontal overflow where possible */
.dataTables_scrollHead, 
.dataTables_scrollBody, 
.dataTables_scrollFoot {
  width: 100% !important;
}
.dataTables_scrollBody table {
  width: 100% !important;
}
/* DT sort icons add their own padding-right â€” preserve room for the chevron but keep label-left consistent */
table.dataTable.table > thead > tr > th.sorting,
table.dataTable.table > thead > tr > th.sorting_asc,
table.dataTable.table > thead > tr > th.sorting_desc { padding-right: 30px !important; }
/* DataTables header: word-break:normal (words intact), single ::after sort glyph, ::before killed (double-icon fix) */
table.dataTable.table > thead > tr > th,
table.dataTable.table > thead > tr > td {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}
/* Kill ::before on DataTables tables ONLY — static .table tables keep their line-1258 hairline */
table.dataTable thead > tr > th::before,
table.dataTable thead > tr > td::before {
  content: none !important;
  display: none !important;
}
table.dataTable thead > tr > th.sorting::after,
table.dataTable thead > tr > th.sorting_asc::after,
table.dataTable thead > tr > th.sorting_desc::after {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  content: "\2195" !important;  /* ↕ */
  opacity: .35 !important;
  font-size: .9em !important;
  line-height: 1 !important;
}
table.dataTable thead > tr > th.sorting_asc::after {
  content: "\25B2" !important;  /* ▲ */
  opacity: 1 !important;
  color: var(--accent) !important;
}
table.dataTable thead > tr > th.sorting_desc::after {
  content: "\25BC" !important;  /* ▼ */
  opacity: 1 !important;
  color: var(--accent) !important;
}
.table tbody td {
  padding: 10px 12px;
  color: var(--ink);
  border-color: var(--border-light);
  vertical-align: middle;
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  white-space: normal !important;
  word-break: break-word !important;
}
.table tbody td:first-child { padding-left: 18px; }
.table tbody td:last-child  { padding-right: 18px; }
/* Last column (ACTION): fixed 110px fits 2-3 icon buttons */
.table > thead > tr > th:last-child,
.table > tbody > tr > td:last-child,
table.dataTable.table > thead > tr > th:last-child,
table.dataTable.table > tbody > tr > td:last-child {
  width: 110px !important;
  min-width: 110px !important;
  max-width: 110px !important;
}

/* Patient bill report: last column is financial data, not an action button — lift the 110px constraint */
#headerTable > thead > tr > th:last-child,
#headerTable > tbody > tr > td:last-child {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}
/* Front Office tables (Visitor, Postal, Complaint, Source, Reference, etc. — all use .mailbox-messages wrapper):
   last column is a 3–4 action-button cluster; 26% width matches DataTables sWidth.
   Scoped to .mailbox-messages so this 26% lock no longer leaks to non-FO tables
   (e.g. admin/patient/ipdsearch, where last col is "Credit Limit" — should be content-sized). */
.mailbox-messages table.dataTable.table.ajaxlist > thead > tr > th:last-child,
.mailbox-messages table.dataTable.table.ajaxlist > tbody > tr > td:last-child {
  width: 26% !important;
  max-width: none !important;
}
#headerTable thead th {
  white-space: nowrap !important;
  word-break: normal !important;
}

/* --- Action column buttons (last cell with noExport / text-end class) --- */
.table tbody td.noExport,
.table tbody td.text-end.noExport,
.table tbody td:last-child:has(.btn) {
  white-space: nowrap;
}
.table tbody td.noExport .btn,
.table tbody td:last-child .btn.btn-sm {
  width: 30px; height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
  margin: 0 2px;
  transition: background .15s, color .15s, border-color .15s;
}
.table tbody td.noExport .btn:hover,
.table tbody td:last-child .btn.btn-sm:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.table tbody td.noExport .btn i,
.table tbody td:last-child .btn.btn-sm i {
  font-size: 12px;
  margin: 0;
}
.table-hover tbody tr:hover .btn.btn-sm {
  background: var(--surface);
  border-color: var(--border-strong);
}

.sh-btn-start {
  height: 28px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-sm);
  line-height: 1;
  border-radius: var(--radius);
}

/* --- Hover-reveal action pattern (for tables without dedicated action column) ---
   Usage: add class="table-hover-actions" to <table>, then wrap action buttons in
   <div class="row-actions"> inside the last td. Buttons appear floating on row hover. */
.table-hover-actions tbody tr { position: relative; }
.table-hover-actions tbody .row-actions {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 2;
}
.table-hover-actions tbody tr:hover .row-actions {
  opacity: 1;
  pointer-events: auto;
}
.table tbody tr { transition: background .1s; }
.table-hover tbody tr:hover td { background-color: var(--rowhover); }
/* Single uniform row color â€” no alternating stripes. Covers Bootstrap 4/5 + DataTables. */
.table-striped > tbody > tr:nth-of-type(odd) > td,
.table-striped > tbody > tr:nth-of-type(odd) > th,
.table-striped > tbody > tr:nth-of-type(odd),
.table-striped > tbody > tr:nth-of-type(even) > td,
.table-striped > tbody > tr:nth-of-type(even) > th,
.table-striped > tbody > tr:nth-of-type(even),
table.dataTable.stripe > tbody > tr.odd > *,
table.dataTable.stripe > tbody > tr.even > *,
table.dataTable.display > tbody > tr.odd > *,
table.dataTable.display > tbody > tr.even > *,
table.dataTable > tbody > tr.odd > *,
table.dataTable > tbody > tr.even > *,
table.dataTable > tbody > tr.odd,
table.dataTable > tbody > tr.even {
  --bs-table-accent-bg: transparent;
  --bs-table-striped-bg: transparent;
  background-color: transparent !important;
  box-shadow: none !important;
}
/* Restore hover feedback (killed by the transparent override above) */
.table-hover > tbody > tr:hover > *,
.table-striped > tbody > tr:hover > *,
table.dataTable > tbody > tr:hover > *,
table.dataTable > tbody > tr.odd:hover > *,
table.dataTable > tbody > tr.even:hover > * {
  background-color: var(--rowhover) !important;
}
.table-bordered { border: 1px solid var(--border-light); }
.table-bordered td, .table-bordered th { border-color: var(--border-light) !important; }
.table a { color: var(--link); font-weight: 500; text-transform: none; }
.table a:hover { text-decoration: underline; color: var(--link-2); }

.table-responsive, .table-responsive-mobile,
.card-body > .table, .dataTables_wrapper { overflow-x: auto; }
.dataTables_wrapper .table { min-width: 100%; }
/* When DataTables wrapper is inside table-responsive, only the outer div scrolls */
.table-responsive > .dataTables_wrapper { overflow-x: visible; }
/* Legacy .mailbox-messages wrapper (Front Office, Inventory, etc.) was rendering
   overflow-x:visible, so wide tables got clipped by .content's overflow:hidden
   instead of scrolling. Force the wrapper to scroll horizontally. */
.table-responsive.mailbox-messages,
.mailbox-messages > .dataTables_wrapper { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
/* Some .table-responsive render overflow-x:visible on mobile — force inner DT wrapper to scroll */
@media (max-width: 768px) {
  .table-responsive > .dataTables_wrapper { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
}
@media (min-width: 1200px) {
  .overflow-visible-lg { overflow: visible !important; }
}

.table-sm td, .table-sm th { padding: 6px 8px; font-size: var(--fs-sm); }
.table .btn-sm { padding: 3px 10px; font-size: var(--fs-sm); }
.table .btn-link { color: var(--muted); padding: 2px 6px; }
.table .btn-link:hover { color: var(--accent); background: var(--accent-soft); border-radius: var(--radius); }
.table .badge { font-size: var(--fs-micro); padding: 2px 8px; }

.dt-body-right,
td.dt-body-right,
.table td:last-child {
  white-space: nowrap;
}
.dt-body-right a, .dt-body-right button,
.table td:last-child a.btn, .table td:last-child button.btn,
.table td a[title], .table td button[title] {
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle;
  margin: 1px;
}
.table td:first-child a, .table td:first-child button {
  display: inline-flex; vertical-align: middle; margin: 1px;
}
.table .btn-sm i { font-size: 12px; }
.table .btn-default, .table .btn-secondary {
  background: var(--surface); border-color: var(--border);
  color: var(--muted); padding: 3px 8px;
}
.table .btn-default:hover, .table .btn-secondary:hover {
  background: var(--surface-2); color: var(--ink);
}

/* ---- btn-secondary/btn-default dark-preset elevation fix ----
   In nightshift + midnight/oled, --surface equals the card background so the
   button becomes nearly invisible (only the 14%-opacity border separates it).
   Elevate to --surface-2 + --border-strong so the button shape is legible. */
body[data-preset="nightshift"] .btn-secondary,
body[data-preset="nightshift"] .btn-default,
body.variant-b .btn-secondary,
body.variant-b .btn-default {
  background-color: var(--surface-2); border-color: var(--border-strong); color: var(--ink);
}
body[data-preset="nightshift"] .btn-secondary:hover,
body[data-preset="nightshift"] .btn-default:hover,
body.variant-b .btn-secondary:hover,
body.variant-b .btn-default:hover {
  background-color: var(--surface-3); border-color: var(--border-strong); color: var(--ink);
}
/* Table-scoped dark override — higher specificity than .table .btn-secondary above */
body[data-preset="nightshift"] .table .btn-default,
body[data-preset="nightshift"] .table .btn-secondary,
body.variant-b .table .btn-default,
body.variant-b .table .btn-secondary {
  background: var(--surface-2); border-color: var(--border-strong); color: var(--muted);
}
body[data-preset="nightshift"] .table .btn-default:hover,
body[data-preset="nightshift"] .table .btn-secondary:hover,
body.variant-b .table .btn-default:hover,
body.variant-b .table .btn-secondary:hover {
  background: var(--surface-3); border-color: var(--border-strong); color: var(--ink);
}

.nav-tabs-custom { border: none; background: transparent; }
.nav-tabs-custom > .nav-tabs { border-bottom: 1px solid var(--border); }
.nav-tabs-custom > .tab-content { padding: 0; background: transparent; }

.dataTables_wrapper { padding: 0; }
.dataTables_wrapper .row:first-child {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
  align-items: center;
}
.dataTables_wrapper .row:last-child {
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--surface);
  font-size: 12px;
}
.dataTables_filter input {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 5px 12px !important;
  font-size: 12px !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  outline: none !important;
  transition: border-color .15s, box-shadow .15s;
}
.dataTables_filter input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}
.dataTables_length select {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  background: var(--surface) !important;
}
.dataTables_info { color: var(--muted); font-size: 12px; }
.dataTables_paginate .pagination { margin: 0; gap: 2px; }
.dataTables_paginate .page-link {
  font-size: 12px; padding: 4px 10px;
  background-color: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--ink) !important;
}
.dataTables_paginate .page-link:hover {
  background-color: var(--surface-3) !important;
  color: var(--ink) !important;
}
.dataTables_paginate .page-item.active .page-link {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}
.dataTables_paginate .page-item.disabled .page-link {
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--muted) !important;
  opacity: .6;
}
/* â”€â”€â”€ DataTables toolbar layout (dom: '<"top"fl>Br<t>ip') â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   .top contains filter (f) + length (l) together  â†’  LEFT (flex row)
   .dt-buttons (B) is a direct child of wrapper     â†’  RIGHT (float)
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.dataTables_wrapper > .top {
  float: left;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.dataTables_wrapper > .top .dataTables_length {
  line-height: 32px;
}
.dataTables_wrapper > div.dt-buttons {
  float: right;
  margin-bottom: 8px;
}
/* Clearfix: snap the table back under the floated toolbar */
.dataTables_wrapper > .dataTables_processing,
.dataTables_wrapper > .row.dt-row,
.dataTables_wrapper > table.dataTable {
  clear: both;
}

div.dt-buttons { margin-bottom: 0; display: flex; gap: 4px; flex-wrap: wrap; }
div.dt-buttons .dt-button {
  font-size: 11px !important; font-weight: 500;
  border: 1px solid var(--border) !important; border-radius: var(--radius) !important;
  background: var(--surface) !important; color: var(--ink) !important;
  padding: 5px 12px !important;
  transition: all .15s;
}
div.dt-buttons .dt-button:hover {
  background: var(--surface-2) !important; border-color: var(--border-strong) !important;
}
div.dt-buttons .dt-button span { font-size: 11px; }

/* 44px touch target floor for DT controls at ≤768px */
@media (max-width: 768px) {
  .dataTables_length select { min-height: 44px; padding: 8px 10px !important; font-size: 14px !important; }
  .dataTables_paginate .page-link,
  .pagination .page-link { min-width: 44px; min-height: 44px; padding: 10px 12px !important; font-size: 14px !important; display: inline-flex; align-items: center; justify-content: center; }
  div.dt-buttons .dt-button { min-height: 44px; padding: 10px 14px !important; font-size: 13px !important; }
  div.dt-buttons .dt-button span { font-size: 13px; }
}

/* --- Cards --- */
.card {
  /* Drive Bootstrap's card-radius VARIABLES (not just the final property) so
     .card-header / .card-footer / .card-img re-derive their inner corners from
     --radius-md and nest cleanly inside the card border. Without this, the card
     outer corner follows --radius-md (e.g. 12px) but the header keeps Bootstrap's
     default ~4px inner radius and its square-ish corner pokes out past the
     rounded card — visible as a nub at every data card's top corners. */
  --bs-card-border-radius: var(--radius-md);
  --bs-card-inner-border-radius: calc(var(--radius-md) - var(--bs-card-border-width, 1px));
  border-color: var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.card:last-child { margin-bottom: 0; }
.card-header {
  background: var(--surface);
  border-color: var(--border-light);
  font-size: 13px; font-weight: 700;
  color: var(--ink);
  padding: 12px 18px;
}
.card-body { padding: 16px 18px; }
.card-footer {
  background: var(--surface-2);
  border-color: var(--border-light);
  padding: 14px 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-footer .float-end,
.card-footer .ms-auto {
  margin-left: auto !important;
}
.card-footer .btn {
  min-width: 100px;
  padding: 8px 18px;
  font-weight: 600;
  font-size: 12px;
  border-radius: var(--radius-md);
}
/* .btn-info aliased to theme accent; fallbacks (#E42527) for pages without --accent (e.g. payment gateway) */
.btn.btn-info {
  --bs-btn-bg: var(--accent, #E42527);
  --bs-btn-border-color: var(--accent, #E42527);
  --bs-btn-color: var(--accent-ink, #fff);
  --bs-btn-hover-bg: var(--accent-dark, #C21E20);
  --bs-btn-hover-border-color: var(--accent-dark, #C21E20);
  --bs-btn-hover-color: var(--accent-ink, #fff);
  --bs-btn-active-bg: var(--accent-dark, #C21E20);
  --bs-btn-active-border-color: var(--accent-dark, #C21E20);
  --bs-btn-active-color: var(--accent-ink, #fff);
  background-color: var(--accent, #E42527) !important;
  border-color: var(--accent, #E42527) !important;
  color: var(--accent-ink, #fff) !important;
}
.btn.btn-info:hover, .btn.btn-info:focus, .btn.btn-info:active {
  background-color: var(--accent-dark, #C21E20) !important;
  border-color: var(--accent-dark, #C21E20) !important;
  color: var(--accent-ink, #fff) !important;
}
.card-footer .btn-info {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.card-footer .btn-info:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--accent-ink);
}

/* --- Accordion (custom field list, faq-style sections) --- */
.panel-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.panel-group > .card {
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow .15s, border-color .15s;
}
.panel-group > .card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.panel-group > .card > .card-header {
  padding: 0;
  background: var(--surface);
  border-bottom: none;
}
.panel-group .panel-title {
  margin: 0;
}
.panel-group .panel-title > a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.panel-group .panel-title > a:hover {
  background: var(--surface-2);
  color: var(--accent);
}
.panel-group .panel-title > a .more-less {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  flex-shrink: 0;
  transition: background .15s, transform .15s;
}
.panel-group .panel-title > a:not(.collapsed) .more-less {
  background: var(--accent);
  color: var(--accent-ink);
}
.panel-group .panel-collapse > .card-body {
  padding: 8px 18px 14px;
  border-top: 1px solid var(--border-light);
  background: var(--surface-2);
}

.sortable-item.list-group {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.list-group-item-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--ink);
  cursor: move;
  transition: border-color .15s, box-shadow .15s, transform .12s;
  list-style: none;
}
.list-group-item-sort:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.list-group-item-sort > .fa-arrows {
  color: var(--faint);
  font-size: 13px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  cursor: grab;
  order: -1;  /* drag handle first (leftmost) */
}
.list-group-item-sort:hover > .fa-arrows {
  color: var(--accent);
}
.list-group-item-sort .sort-action {
  margin-left: auto;
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
  float: none !important;
  order: 99;  /* action buttons last (rightmost) */
}
.list-group-item-sort .sort-action .btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
  font-size: 11px;
  transition: background .15s, color .15s, border-color .15s;
}
.list-group-item-sort .sort-action .btn:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.list-group-item-sort .sort-action .btn .fa-pencil { font-size: 11px; }
.list-group-item-sort .sort-action .btn .fa-remove { font-size: 12px; }

/* --- Forms --- */
.form-control, .form-select {
  font-size: var(--fs-body);
  border-color: var(--border);
  border-radius: var(--radius);
  background-color: var(--surface) !important;
  color: var(--ink) !important;
  padding: 7px 12px 7px 14px !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background-color: var(--surface);
  color: var(--ink);
}
.form-label {
  font-size: var(--fs-h6); font-weight: var(--fw-semibold);
  color: var(--ink-2);
  margin-bottom: 6px;
}
/* Bare <label> fallback — class-based rules (.form-label, .sh-label, etc.) override this */
label { color: var(--ink-2); }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); }
/* Bootstrap replaces native checkbox appearance with SVG backgrounds, so accent-color
   has no effect on .form-check-input. Override the checked/focus states directly. */
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--accent) 25%, transparent); }
.form-text { font-size: var(--fs-sm); color: var(--muted); }
.input-group-text {
  font-size: var(--fs-sm);
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--muted);
}
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple { border-radius: var(--radius); }
/* Select2 reads style.width at init — width:100% globally avoids inline style="width:100%" on every select */
select.select2 { width: 100%; }

/* --- Modals --- */
/* Dark mode: bridge Bootstrap CSS vars to SH design tokens */
body.variant-b {
  --bs-body-bg: #0F1419;
  --bs-body-color: #E8EDF2;
  --bs-border-color: rgba(255,255,255,.08);
  --bs-card-bg: #1A2027;
  --bs-card-cap-bg: #222A33;
  --bs-card-border-color: rgba(255,255,255,.08);
  --bs-table-bg: transparent;
  --bs-table-color: #E8EDF2;
  --bs-table-border-color: rgba(255,255,255,.08);
  --bs-table-striped-bg: transparent;
  --bs-table-striped-color: #E8EDF2;
  --bs-table-hover-bg: rgba(255,255,255,.04);
  --bs-table-hover-color: #E8EDF2;
  --bs-table-accent-bg: transparent;
  --bs-modal-bg: #1A2027;
  --bs-modal-border-color: rgba(255,255,255,.08);
  --bs-modal-header-border-color: rgba(255,255,255,.08);
  --bs-modal-footer-border-color: rgba(255,255,255,.08);
  --bs-form-control-bg: #1A2027;
  --bs-input-bg: #222A33;
  --bs-dropdown-bg: #1A2027;
  --bs-dropdown-border-color: rgba(255,255,255,.08);
  --bs-dropdown-link-color: #E8EDF2;
  --bs-dropdown-link-hover-bg: rgba(255,255,255,.05);
  --bs-nav-tabs-border-color: rgba(255,255,255,.08);
  --bs-nav-tabs-link-active-bg: #1A2027;
  --bs-pagination-bg: #1A2027;
  --bs-pagination-color: #E8EDF2;
  --bs-pagination-border-color: rgba(255,255,255,.12);
  --bs-pagination-hover-bg: #2D3640;
  --bs-pagination-hover-color: #E8EDF2;
  --bs-pagination-hover-border-color: rgba(255,255,255,.18);
  --bs-pagination-disabled-bg: #151B22;
  --bs-pagination-disabled-color: #5F6B7A;
  --bs-pagination-disabled-border-color: rgba(255,255,255,.06);
  --bs-pagination-focus-bg: #2D3640;
  /* --bs-danger softened: btn-danger is hardcoded in BS5, so this only affects utility classes */
  --bs-danger: #F87171; --bs-danger-rgb: 248,113,113;
}

/* BS5 internal vars use hardcoded defaults (#212529/#fff) — bridge them to SH tokens.
   MUST come before body.variant-b so variant-b hardcoded values win by source order. */
body[class*="variant-"] {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--ink);
  --bs-border-color: var(--border);
  --bs-card-bg: var(--surface);
  --bs-card-cap-bg: var(--surface-2);
  --bs-card-border-color: var(--border);
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--border);
  --bs-table-striped-bg: transparent;
  --bs-table-striped-color: var(--ink);
  --bs-table-hover-bg: var(--rowhover);
  --bs-table-hover-color: var(--ink);
  --bs-table-accent-bg: transparent;
  --bs-modal-bg: var(--surface);
  --bs-modal-border-color: var(--border);
  --bs-modal-header-border-color: var(--border);
  --bs-modal-footer-border-color: var(--border);
  --bs-form-control-bg: var(--surface);
  --bs-input-bg: var(--surface-2);
  --bs-link-color: var(--link);
  --bs-link-hover-color: var(--link-2);
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-border-color: var(--border);
  --bs-dropdown-link-color: var(--ink);
  --bs-dropdown-link-hover-bg: var(--rowhover);
  --bs-nav-tabs-border-color: var(--border);
  --bs-nav-tabs-link-active-bg: var(--surface);
  --bs-pagination-bg: var(--surface);
  --bs-pagination-color: var(--ink);
  --bs-pagination-border-color: var(--border-strong);
  --bs-pagination-hover-bg: var(--surface-2);
  --bs-pagination-hover-color: var(--ink);
  --bs-pagination-hover-border-color: var(--border-strong);
  --bs-pagination-disabled-bg: var(--bg);
  --bs-pagination-disabled-color: var(--muted);
  --bs-pagination-disabled-border-color: var(--border);
  --bs-pagination-focus-bg: var(--surface-2);
}
/* listnoback (legacy AdminLTE list pattern used on profile/TPA/info panels) has
   border-bottom: 1px solid #ddd !important in style-main.css — too bright on dark
   surfaces (nightshift, midnight, oled). var(--border) adapts to every preset. */
.listnoback { border-bottom-color: var(--border) !important; }

.modal-content {
  --bs-modal-border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) !important;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  /* Fill the dialog height â€” flex col so body scrolls, header/footer stay pinned */
  display: flex;
  flex-direction: column;
  height: 100%;
}
.modal-header {
  border-bottom: 1px solid var(--border);
  padding: .5rem 1rem;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  flex-shrink: 0; /* header never shrinks â€” always visible */
}
.modal-header::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark, var(--accent)) 100%);
  box-shadow: 0 0 12px 0 var(--accent-soft);
}
.modal-header .modal-title {
  font-size: var(--fs-h3); font-weight: var(--fw-bold); color: var(--accent);
  letter-spacing: -0.005em;
  line-height: var(--lh-snug);
  flex: 1;
}
.modal-header h4, .modal-header h5 {
  font-size: var(--fs-h3); font-weight: var(--fw-bold); color: var(--accent);
  letter-spacing: -0.005em;
  line-height: var(--lh-snug);
  margin: 0; flex: 1; border: none; padding: 0;
}
/* Optional subtitle â€” opt-in via <small> or <span class="subtitle"> inside title */
.modal-header .modal-title small,
.modal-header .modal-title .subtitle,
.modal-header h4 small, .modal-header h5 small {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  margin-top: 3px;
}
.modal-header .modalicon,
.modal-header #edit_delete {
  order: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.modal-header .modalicon a,
.modal-header #edit_delete a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius);
  color: var(--ink-2);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.modal-header .modalicon a:hover,
.modal-header #edit_delete a:hover {
  background: var(--surface-2);
  color: var(--accent);
}
.modal-header .modalicon a i,
.modal-header #edit_delete a i { font-size: var(--fs-sm); }

.modal-header .btn-close {
  margin: 0; padding: 0;
  width: 30px; height: 30px;
  border-radius: var(--radius);
  opacity: 0.5;
  background-size: 10px;
  transition: opacity .15s, background-color .15s;
  flex-shrink: 0;
  order: 99; /* always visually last â€” regardless of DOM position */
}
@media (max-width: 768px) {
  .modal-header .btn-close { width: 44px; height: 44px; background-size: 12px; }
}
.modal-header .btn-close:hover {
  opacity: 1;
  background-color: var(--surface-2);
}
.modal-body {
  padding: 16px 20px;
  background: var(--surface-3, #EAECF0);
  overflow-y: auto;
  flex: 1 1 auto; /* grows to fill, shrinks when needed, body scrolls */
}
.modal-body .table { font-size: var(--fs-sm); }
.modal-body .mb-3 label, .modal-body .form-label {
  font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--ink-2);
}
.modal-body .form-control, .modal-body .form-select { font-size: var(--fs-h6); }
.modal-body .form-control-sm, .modal-body .form-select-sm { font-size: var(--fs-sm); }
.modal-body label { font-size: var(--fs-micro); }
.modal-body ul { padding-left: 18px; }
.modal-body ul li { font-size: var(--fs-sm); color: var(--ink); margin-bottom: 4px; }
.modal-body .small, .modal-body small { font-size: var(--fs-micro); }
.modal-body .sh-form-card .form-label,
.modal-body .sh-form-card label { font-size: var(--fs-micro); }
.modal-body .sh-card-header-title { font-size: var(--fs-h6); }
.modal-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 20px;
  gap: 8px;
  display: flex; align-items: center; justify-content: flex-end;
  flex-shrink: 0; /* footer never shrinks â€” always visible */
}
.modal-footer .btn { font-size: var(--fs-h6); }
.modal-backdrop { background-color: var(--backdrop); }
.modal-backdrop.show { opacity: 1; }

/* â”€â”€ Modal sizing & height budget â”€â”€ */

.modal { padding: 20px 12px !important; }

/* Dialog: height-constrained here (not on .modal-content) so BS5 centering works.
   width:100% needed because display:flex shrinks to content — max-width then caps it. */
.modal-dialog {
  margin: 0 auto;
  width: 100%;
  max-width: 600px;
  max-height: 100%;           /* fills the .modal padding box */
  display: flex;
  flex-direction: column;
}

.modal-lg  { max-width: 900px; }
.modal-xl  { max-width: 1140px; }
.modal-mid { max-width: 650px; }

/* pup100 â€” full-viewport popup (pathology/radiology billing, blood bank issue modals)
   !important needed: the @media (min-width:768px) .modal-dialog rule below would
   otherwise override these values (same specificity, later declaration). */
.pup100 {
  width: 100vw !important;
  max-width: 100vw !important;
  margin: 0 !important;
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
}
.pup100 .modal-content {
  height: 100%;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

@media (min-width: 768px) {
  .modal-dialog { max-width: 560px; }
  .modal-lg     { max-width: 800px; }
  .modal-xl     { max-width: 1140px; }
  .modal-mid    { max-width: 720px; }
}

.modal-dialog-scrollable .modal-body { overflow-y: auto; }


/* Old BS3 .close button â†’ style as BS5 btn-close (don't hide, restyle!) */
.modal-header .close,
.modal-header .pupclose {
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/10px no-repeat;
  border: none; padding: 0;
  width: 30px; height: 30px;
  border-radius: var(--radius);
  opacity: 0.5;
  font-size: 0; /* hide Ã— text */
  color: transparent;
  cursor: pointer;
  flex-shrink: 0;
  order: 99;
  transition: opacity .15s, background-color .15s;
}
.modal-header .close:hover,
.modal-header .pupclose:hover {
  opacity: 1;
  background-color: var(--surface-2);
}
.modal-header .btn-close {
  order: 99; flex-shrink: 0;
}

/* â”€â”€ modal-media-header: functional header (patient search, controls) â”€â”€ */
.modal-media-header {
  background: var(--accent);
  padding: 8px 12px;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}
.modal-media-header::before { display: none; } /* no left bar â€” full accent bg instead */
.modal-media-header .btn-close {
  filter: invert(1) brightness(2);  /* white Ã— on accent background */
  opacity: 0.85;
  order: 99; /* always far right */
  margin-left: auto;
}
@media (max-width: 767px) {
  .modal-media-header .row { width: 100%; }
}
.modal-media-header .form-control,
.modal-media-header .form-select {
  font-size: 12px;
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.3);
  color: #fff;
}
.modal-media-header .form-control::placeholder { color: rgba(255,255,255,.6); }
.modal-media-header .btn-secondary,
.modal-media-header .btn-group-custom {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.3);
  color: #fff;
}
.modal-media-header .form-check-label { color: rgba(255,255,255,.9); font-size: 12px; }
.modal-media-header .form-check-input { border-color: rgba(255,255,255,.5); }
/* Patient search select2 on accent header */
.modal-media-header .select2-container--default .select2-selection--single {
  background: rgba(255,255,255,.15) !important;
  border: 1px solid rgba(255,255,255,.5) !important;
  border-radius: var(--radius) !important;
  height: 34px !important;
  display: flex;
  align-items: center;
}
.modal-media-header .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #fff !important;
  line-height: 34px !important;
  padding-left: 10px !important;
  font-size: 12px;
}
.modal-media-header .select2-container--default .select2-selection--single .select2-selection__placeholder { color: rgba(255,255,255,.65) !important; }
.modal-media-header .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: rgba(255,255,255,.8) transparent transparent transparent !important;
}
.modal-media-header .input-group .form-control {
  border-radius: var(--radius) 0 0 var(--radius) !important;
  height: 34px;
}
.modal-media-header .input-group .btn,
.modal-media-header .input-group .btn-group-custom {
  height: 34px;
  border-radius: 0 var(--radius) var(--radius) 0 !important;
  padding: 0 10px;
  background: rgba(255,255,255,.25);
  border: 1px solid rgba(255,255,255,.5);
  color: #fff;
  font-size: 13px;
}
.modal-media-header .input-group .btn:hover,
.modal-media-header .input-group .btn-group-custom:hover {
  background: rgba(255,255,255,.38);
}
.modal-media-header > .row {
  width: 100%;
  align-items: center;
  flex: 1;
  margin: 0;
}
.modal-media-header > .row > [class*="col"] { padding: 4px 6px; }
/* â”€â”€ /modal-media-header â”€â”€ */

.modal-body .row { margin-left: 0; margin-right: 0; }
.modal-body .row > [class*="col-"] { padding-left: 8px; padding-right: 8px; }
.modal-body .form-control, .modal-body .form-select {
  font-size: 12px; padding: 6px 10px;
}
.modal-body textarea.form-control { min-height: 60px; }
/* Fix bootstrap .row negative margins causing overflow */
.modal .row { --bs-gutter-x: 16px; }

.modal-content {
  max-height: calc(100vh - 80px);
  max-height: calc(100dvh - 80px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-body {
  overflow-x: hidden;
  overflow-y: auto;
}
.modal-body > *, .modal-body .row, .modal-body form,
.modal-body table, .modal-body .table-responsive {
  max-width: 100%;
}
/* .table-print-full inside modal on mobile — clipped by overflow-x:hidden; scroll on screen, unaffected on print */
@media screen and (max-width: 768px) {
  .modal-body .table-print-full {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
.modal-body .row {
  margin-left: 0; margin-right: 0;
  flex-wrap: wrap;
}
.modal-body .table-responsive { overflow-x: auto; }

/* ── Utility: sh-modal-fit — add to .modal div to let modal shrink to content ─
   Safe: only activates when both sh-modal + sh-modal-fit are present.
   ─────────────────────────────────────────────────────────────────────────── */
.sh-modal.sh-modal-fit .modal-content { height: auto; }
.sh-modal.sh-modal-fit .modal-body    { overflow-y: auto; max-height: 70vh; }

/* ── Utility: sh-modal-autoheight ─────────────────────────────────────────────
   Add to .modal-dialog when the modal should size to its content (no inner
   scroll). Overrides the global max-height cap on .modal-content and the
   overflow-y:auto on .modal-body set above.
   Usage: <div class="modal-dialog sh-modal-autoheight modal-xl ...">
   ─────────────────────────────────────────────────────────────────────────── */
.modal-dialog.sh-modal-autoheight .modal-content {
  max-height: none;
  overflow: visible;
}
.modal-dialog.sh-modal-autoheight .modal-body {
  overflow-y: visible;
  height: auto;
}

/* Force footer INSIDE modal (fix buttons outside) */
.modal-footer {
  flex-shrink: 0;
}
/* Fix: forms inside modal that have footer buttons outside modal-body.
   min-height:0 on .modal-body is critical — flex items default to
   min-height:auto (= content size), which blocks overflow-y:auto from
   ever triggering scroll. Without it, the body grows to its full content
   height and the footer (Save buttons) gets pushed below the viewport. */
.modal-content form {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0; overflow: hidden;
}
.modal-content form > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.modal-content form > .modal-footer,
.modal-content form > div:last-child > .modal-footer { flex-shrink: 0; }
/* pup-scroll-area as direct child of form: must flex-grow so footer is never clipped */
.modal-content form > .pup-scroll-area {
  flex: 1 1 auto;
  min-height: 0;
}

/* ── Print scaffolding inside modal/screen ─────────────────────────────────
   Bill detail partials (pharmacy, pathology, radiology, ambulance, ipd) are
   reused for both modal display AND print popup. They include print-only
   wrappers (header banner + page-break spacers + fixed footer). On the
   print popup these are styled by sh-print.css; on screen we restyle the
   visible footer text and hide the empty spacers so nothing leaks visually
   into the modal. The print popup loads sh-print.css instead of this file
   so its print layout stays untouched. */
.fixed-print-header,
.header-space,
.footer-space {
  display: none !important;
}
.footer-fixed {
  position: static !important;
  height: auto !important;
  width: auto !important;
  padding: 14px 20px !important;
  margin: 16px 8px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 8px);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: .02em;
  text-align: center;
  display: block !important;
  overflow: visible !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  position: relative !important;
}
.footer-fixed::before {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0 auto 10px;
  opacity: .75;
}
.footer-fixed p { margin: 0; color: var(--ink-2); }
.footer-fixed p + p { margin-top: 4px; }
.footer-fixed strong, .footer-fixed b { color: var(--ink); font-weight: 600; }
.footer-fixed a { color: var(--link); text-decoration: none; }
.footer-fixed a:hover { text-decoration: underline; }

/* --- Nav tabs (for tab panels inside pages) --- */
.nav-tabs {
  border-color: var(--border);
}
.nav-tabs .nav-link {
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
}
/* BS3 compat: <li> without .nav-item, <a> without .nav-link */
.nav-tabs > li { display: inline-block; list-style: none; }
.nav-tabs > li > a {
  display: inline-block;
  padding: 10px 14px;
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav-tabs > li > a:hover { color: var(--ink); text-decoration: none; }
.nav-tabs > li.active > a,
.nav-tabs > li > a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.nav-tabs .nav-link:hover { color: var(--ink); border-color: transparent; }
.nav-tabs .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
  font-weight: 600;
}

/* --- Dropdowns --- */
.dropdown-menu {
  font-size: 13px;
  border-color: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  background: var(--surface);
  /* Base text color so plain (non-.dropdown-item) content — e.g. the user
     dropdown's name heading <div class="fw-bold"> — stays readable on the
     themed --surface bg. .dropdown-item keeps its own --bs-dropdown-link-color. */
  color: var(--ink);
  padding: 4px;
}

/* â”€â”€ Single Module Billing dropdown â”€â”€ */
.s-bill-list {
  min-width: 230px;
  right: 0 !important;
  left: auto !important;
  padding: 0;
  overflow: hidden;
}
.s-bill-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  background: var(--surface-2, #f5f5f5);
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  cursor: default;
  user-select: none;
}
.s-bill-list .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 0;
  color: var(--ink, #333);
}
.s-bill-list .dropdown-item i {
  width: 15px;
  text-align: center;
  color: var(--accent);
  flex-shrink: 0;
}
.s-bill-list .dropdown-item:hover,
.s-bill-list .dropdown-item:focus {
  background: var(--accent);
  color: #fff;
}
.s-bill-list .dropdown-item:hover i,
.s-bill-list .dropdown-item:focus i {
  color: #fff;
}

/* â”€â”€ Bootstrap 3 Datetimepicker / Datepicker â€” BS5 compatibility fix â”€â”€ */
/* BS3 uses .collapse.in â€” BS5 uses .collapse.show. Bridge the gap: */
.bootstrap-datetimepicker-widget .collapse.in {
  display: block !important;
  height: auto !important;
  visibility: visible !important;
}
/* Modal overflow â€” let datepicker render outside modal bounds */
.modal-body,
.modal-content form > .modal-body { overflow: visible !important; }
.modal-content { overflow: visible; }

.bootstrap-datetimepicker-widget.dropdown-menu {
  width: 19em;
  padding: 8px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  z-index: 99999 !important;
  position: absolute;
}
.bootstrap-datetimepicker-widget table td,
.bootstrap-datetimepicker-widget table th {
  text-align: center;
  padding: 5px;
  font-size: 12px;
  border-radius: var(--radius);
  color: var(--ink);
}
.bootstrap-datetimepicker-widget table th {
  font-weight: 600;
  color: var(--muted);
}
.bootstrap-datetimepicker-widget table td.day:hover,
.bootstrap-datetimepicker-widget table td span:hover {
  background: var(--surface-2);
  cursor: pointer;
}
.bootstrap-datetimepicker-widget table td.active,
.bootstrap-datetimepicker-widget table td.active:hover,
.bootstrap-datetimepicker-widget table td span.active {
  background: var(--accent) !important;
  color: var(--accent-ink) !important;
  border-radius: var(--radius);
}
.bootstrap-datetimepicker-widget table td.today::before {
  border-bottom-color: var(--accent);
}
.bootstrap-datetimepicker-widget table td.old,
.bootstrap-datetimepicker-widget table td.new {
  color: var(--faint);
}
.bootstrap-datetimepicker-widget table td.disabled,
.bootstrap-datetimepicker-widget table td.disabled:hover {
  color: var(--faint);
  cursor: not-allowed;
  background: transparent;
}
.bootstrap-datetimepicker-widget a[data-action] {
  color: var(--accent);
  padding: 6px 0;
}
.bootstrap-datetimepicker-widget a[data-action]:hover {
  color: var(--accent-dark);
}
.bootstrap-datetimepicker-widget .btn {
  color: var(--accent);
}
/* AM/PM toggle â€” override btn-primary (accent-colored) with neutral button */
.bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"] {
  background: var(--surface-2) !important;
  color: var(--ink) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 2px 8px !important;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}
.bootstrap-datetimepicker-widget .picker-switch {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}
.bootstrap-datetimepicker-widget .picker-switch:hover {
  background: var(--surface-2);
}
.bootstrap-datetimepicker-widget .prev span,
.bootstrap-datetimepicker-widget .next span {
  font-size: 16px;
}
.bootstrap-datetimepicker-widget .timepicker-hour,
.bootstrap-datetimepicker-widget .timepicker-minute,
.bootstrap-datetimepicker-widget .timepicker-second {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.bootstrap-datetimepicker-widget .glyphicon {
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  -webkit-font-smoothing: antialiased;
  font-style: normal;
}
.bootstrap-datetimepicker-widget .glyphicon-chevron-up::before { content: '\f077'; }
.bootstrap-datetimepicker-widget .glyphicon-chevron-down::before { content: '\f078'; }
.bootstrap-datetimepicker-widget .glyphicon-chevron-left::before { content: '\f053'; }
.bootstrap-datetimepicker-widget .glyphicon-chevron-right::before { content: '\f054'; }
.bootstrap-datetimepicker-widget .glyphicon-time::before { content: '\f017'; }
.bootstrap-datetimepicker-widget .glyphicon-calendar::before { content: '\f073'; }
.bootstrap-datetimepicker-widget .glyphicon-screenshot::before { content: '\f073'; }
.bootstrap-datetimepicker-widget .glyphicon-trash::before { content: '\f2ed'; }
.bootstrap-datetimepicker-widget .glyphicon-remove::before { content: '\f00d'; }
/* DateTimePicker toolbar (Today/Clear) â€” rendered inside li.picker-switch, NOT tfoot */
.bootstrap-datetimepicker-widget li.picker-switch table td {
  padding: 6px 4px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}
.bootstrap-datetimepicker-widget li.picker-switch a[data-action] {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}
.bootstrap-datetimepicker-widget li.picker-switch a[data-action="today"] {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent);
}
.bootstrap-datetimepicker-widget li.picker-switch a[data-action]:hover {
  opacity: .8;
}

/* BS3 datepicker (non-datetime) â€” complete theme override */
.datepicker.dropdown-menu {
  z-index: 99999 !important;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--ink) !important;
  font-family: inherit;
  font-size: 13px;
  position: absolute;
}
/* border-separate + spacing:0 â†’ allows border-radius on cells without gaps */
.datepicker.dropdown-menu table {
  border-collapse: separate;
  border-spacing: 0;
}
.datepicker.dropdown-menu table tr td,
.datepicker.dropdown-menu table tr th {
  width: auto;
  text-align: center;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  border: none;
  text-shadow: none;
  white-space: nowrap;
}
.datepicker.dropdown-menu table tr th.dow {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  padding: 5px 8px;
}
/* Switch title â€” remove width:145px that caused SU/SA gap */
.datepicker.dropdown-menu th.datepicker-switch {
  width: auto;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.datepicker .datepicker-switch:hover,
.datepicker thead tr:first-child th:hover {
  background: var(--surface-2) !important;
  color: var(--ink);
}
.datepicker .prev,
.datepicker .next {
  color: var(--muted);
  cursor: pointer;
}
.datepicker .prev:hover,
.datepicker .next:hover {
  background: var(--surface-2) !important;
  color: var(--ink);
}
.datepicker table tr td.day:hover,
.datepicker table tr td.focused {
  background: var(--surface-2) !important;
  cursor: pointer;
}
.datepicker table tr td.today,
.datepicker table tr td.today:hover,
.datepicker table tr td.today.disabled,
.datepicker table tr td.today.disabled:hover {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  border-color: transparent !important;
  font-weight: 600;
}
.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td.active.disabled,
.datepicker table tr td.active.disabled:hover,
.datepicker table tr td.selected,
.datepicker table tr td.selected:hover {
  background: var(--accent) !important;
  color: var(--accent-ink) !important;
  border-color: transparent !important;
  text-shadow: none !important;
}
.datepicker table tr td.old,
.datepicker table tr td.new {
  color: var(--faint) !important;
}
.datepicker table tr td.disabled,
.datepicker table tr td.disabled:hover {
  color: var(--faint) !important;
  background: transparent !important;
  cursor: not-allowed;
}
.datepicker table tr td span {
  color: var(--ink);
  border-radius: var(--radius);
}
.datepicker table tr td span:hover {
  background: var(--surface-2) !important;
  cursor: pointer;
}
.datepicker table tr td span.active,
.datepicker table tr td span.active:hover {
  background: var(--accent) !important;
  color: var(--accent-ink) !important;
  border-color: transparent !important;
  text-shadow: none !important;
}
.datepicker table tr td span.old,
.datepicker table tr td span.new {
  color: var(--faint) !important;
}
.datepicker table tr td span.disabled,
.datepicker table tr td span.disabled:hover {
  color: var(--faint) !important;
  background: transparent !important;
  cursor: not-allowed;
}
.datepicker.datepicker-dropdown:before {
  border-bottom-color: var(--border) !important;
}
.datepicker.datepicker-dropdown:after {
  border-bottom-color: var(--surface) !important;
}
.datepicker.datepicker-dropdown.datepicker-orient-bottom:before {
  border-top-color: var(--border) !important;
  border-bottom-color: transparent !important;
}
.datepicker.datepicker-dropdown.datepicker-orient-bottom:after {
  border-top-color: var(--surface) !important;
  border-bottom-color: transparent !important;
}
.dropdown-item {
  border-radius: var(--radius);
  color: var(--ink);
  padding: 7px 12px;
}
.dropdown-item:hover { background-color: var(--surface-2); color: var(--ink); }
.dropdown-item.active, .dropdown-item:active {
  background-color: var(--accent-soft);
  color: var(--accent);
}
.dropdown-divider { border-color: var(--border-light); }

/* --- Alerts --- */
.alert { font-size: 13px; border-radius: var(--radius-md); border-width: 0; }
.alert-success { background: var(--green-soft); color: var(--green); }
.alert-danger   { background: var(--red-soft); color: var(--red); }
.alert-warning  { background: var(--amber-soft); color: #A76C00; }
.alert-info     { background: var(--blue-soft); color: var(--blue); }

/* --- Pagination --- */
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  font-size: 12px;
  color: var(--link);
  border-color: var(--border);
  background: var(--surface);
}
.page-link:hover { background: var(--surface-2); color: var(--link); }
.page-item.active .page-link {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Legacy CI-pagination markup (BS3 style: <ul.pagination> with bare <li><a>)
   — apply BS5 .page-link visuals so output is consistent with the rest of the app.
   Used by pages like /admin/systemnotification where markup is generated by
   CI's pagination library config. */
ul.pagination { display: flex; flex-wrap: wrap; gap: 0; padding-left: 0; list-style: none; margin: 0; }
ul.pagination > li { display: list-item; }
ul.pagination > li > a,
ul.pagination > li > span {
  position: relative;
  display: block;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1.25;
  color: var(--link);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-left: -1px;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
ul.pagination > li:first-child > a,
ul.pagination > li:first-child > span {
  margin-left: 0;
  border-top-left-radius: var(--radius-sm, 4px);
  border-bottom-left-radius: var(--radius-sm, 4px);
}
ul.pagination > li:last-child > a,
ul.pagination > li:last-child > span {
  border-top-right-radius: var(--radius-sm, 4px);
  border-bottom-right-radius: var(--radius-sm, 4px);
}
ul.pagination > li > a:hover,
ul.pagination > li > a:focus {
  background: var(--surface-2);
  color: var(--link);
  border-color: var(--border);
}
ul.pagination > li.active > a,
ul.pagination > li.active > span,
ul.pagination > li.active > a:hover,
ul.pagination > li.active > a:focus {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
  z-index: 1;
}
ul.pagination > li.disabled > a,
ul.pagination > li.disabled > span {
  color: var(--muted);
  background: var(--surface);
  border-color: var(--border);
  pointer-events: none;
  opacity: .65;
}

body.variant-b ul.pagination > li > a,
body.variant-b ul.pagination > li > span {
  background: var(--surface-2);
  color: var(--ink-2);
  border-color: var(--border);
}
body.variant-b ul.pagination > li > a:hover,
body.variant-b ul.pagination > li > a:focus {
  background: var(--surface-3);
  color: var(--ink);
  border-color: var(--border);
}
body.variant-b ul.pagination > li.active > a,
body.variant-b ul.pagination > li.active > span {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
body.variant-b ul.pagination > li.disabled > a,
body.variant-b ul.pagination > li.disabled > span {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--border);
}

/* --- Spinners --- */
.spinner-border { color: var(--accent); }

/* --- Select2 (theme match) --- */
.select2-container--default .select2-selection--single {
  border-color: var(--border); border-radius: var(--radius);
  height: 34px; font-size: 13px;
  background-color: var(--surface); color: var(--ink);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--ink); line-height: 34px; padding-left: 10px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 32px;
}
.select2-container--default .select2-selection--multiple {
  border-color: var(--border); border-radius: var(--radius);
  background-color: var(--surface); min-height: 34px;
}
/* Multi-select choice pills — anchor to CORE tokens so they read on EVERY preset
   (incl. nightshift, which is variant-a — a body.variant-b-scoped rule would miss it). */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: var(--surface-3) !important;
  border: 1px solid var(--border) !important;
  color: var(--ink) !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__display { color: var(--ink) !important; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: var(--ink-2) !important; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { color: var(--ink) !important; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.select2-dropdown { border-color: var(--border); background: var(--surface); box-shadow: var(--shadow-md); z-index: 9999 !important; }
/* Select2 search input — must be explicit; <input> never inherits background from parent. */
.select2-search--dropdown .select2-search__field {
  background: var(--surface-2) !important; color: var(--ink) !important;
  border-color: var(--border) !important; outline: none !important; box-shadow: none !important;
}
.select2-search--dropdown .select2-search__field::placeholder { color: var(--muted) !important; }
.select2-search--dropdown .select2-search__field:focus { border-color: var(--accent) !important; }
.select2-results__option { font-size: 13px; padding: 6px 10px; color: var(--ink); }
.select2-results__option--highlighted[aria-selected] {
  background-color: var(--accent-soft) !important; color: var(--accent) !important;
}
/* Already-picked dropdown options. Anchored to CORE tokens (+!important) so they
   read on EVERY preset incl. nightshift (variant-a) — the body.variant-b rule at
   ~7894 missed it, leaving select2.css's hardcoded #ddd bg / #999 disabled grey
   to win on dark presets (faint grey-on-brown, see patient-search #myModal). */
.select2-results__option[aria-selected=true] {
  background-color: var(--surface-2) !important; color: var(--ink) !important;
}
.select2-results__option[aria-disabled=true] {
  color: var(--ink-2) !important;
}

/* --- DataTables override (match theme) --- */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  font-size: 12px; color: var(--ink-2);
}
.dataTables_wrapper .dataTables_info {
  font-size: 12px; color: var(--ink-2) !important; padding-top: 10px;
}
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_length select option {
  border-color: var(--border); border-radius: var(--radius);
  font-size: 12px; padding: 3px 8px;
  background: var(--surface); color: var(--ink);
}
.dataTables_wrapper .dataTables_filter input {
  border-color: var(--border); border-radius: var(--radius);
  font-size: 12px; padding: 4px 10px;
  background: var(--surface); color: var(--ink);
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none;
}
div.dt-buttons .dt-button {
  font-size: 11px; font-weight: 500;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  padding: 4px 10px; margin-right: 4px;
}
div.dt-buttons .dt-button:hover {
  background: var(--surface-2); border-color: var(--border-strong);
}
/* DataTables paginate buttons (not Bootstrap .page-link â€” DT renders its own) */
.dataTables_wrapper .dataTables_paginate {
  padding-top: 8px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  margin: 0 2px;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--ink) !important;
  border-radius: var(--radius) !important;
  padding: 0 9px !important;
  font-size: 12px !important;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--surface-3) !important;
  border-color: var(--border-strong) !important;
  color: var(--ink) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  font-weight: 700;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--faint) !important;
  cursor: default;
}

/* BS5 DT: .paginate_button is the <li> wrapper (not the clickable <a>) — strip its own visuals */
.dataTables_paginate .paginate_button.page-item,
.dataTables_paginate .paginate_button.page-item:hover {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
.dataTables_wrapper .dataTables_paginate { padding-top: 16px !important; }
.dataTables_paginate .pagination { gap: 5px; }
.dataTables_paginate .page-item .page-link {
  border-radius: var(--radius) !important;
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 10px !important;
}

/* Nightshift active-page text: amber accent (#F59E0B) washes out white text,
   so use the dark --accent-ink (#1A0F05) here — matches the approved sample.
   Scoped to this one preset; all others keep white. data-preset is on <body>
   (header.php), so this beats the base #fff rules by specificity + !important. */
body[data-preset="nightshift"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body[data-preset="nightshift"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
body[data-preset="nightshift"] .dataTables_paginate .page-item.active .page-link,
body[data-preset="nightshift"] .page-item.active .page-link,
body[data-preset="nightshift"] ul.pagination > li.active > a,
body[data-preset="nightshift"] ul.pagination > li.active > span {
  color: var(--accent-ink) !important;
}

/* --- Toastr override --- */
.toast-success { background-color: var(--green) !important; }
.toast-error   { background-color: var(--red) !important; }
.toast-warning { background-color: var(--amber) !important; }
.toast-info    { background-color: var(--blue) !important; }

/* ── bootstrap-wysihtml5 plugin modals (Insert Link / Insert Image) ─────
   The plugin renders its own BS3-style modals with hardcoded markup
   (.modal.fade + <a class="close">×</a> + <h3>). Style them so they match
   the project's sh-modal-accent look without touching plugin source. */
.bootstrap-wysihtml5-insert-link-modal,
.bootstrap-wysihtml5-insert-image-modal {
  --whml-border: var(--border);
  --whml-bg:     var(--surface);
  --whml-bg-2:   var(--surface-2);
  --whml-ink:    var(--ink);
  --whml-ink-2:  var(--ink-2);
}
.bootstrap-wysihtml5-insert-link-modal .modal-dialog,
.bootstrap-wysihtml5-insert-image-modal .modal-dialog {
  max-width: 480px;
  margin: 1.75rem auto;
}
.bootstrap-wysihtml5-insert-link-modal .modal-content,
.bootstrap-wysihtml5-insert-image-modal .modal-content {
  border: 1px solid var(--whml-border);
  border-radius: var(--radius-lg, 8px);
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  background: var(--whml-bg);
  overflow: hidden;
}
.bootstrap-wysihtml5-insert-link-modal .modal-header,
.bootstrap-wysihtml5-insert-image-modal .modal-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--whml-border) !important;
  background: var(--whml-bg-2) !important;
  position: relative !important;
}
/* Kill the global accent ribbon on plugin modals */
.bootstrap-wysihtml5-insert-link-modal .modal-header::before,
.bootstrap-wysihtml5-insert-image-modal .modal-header::before {
  content: none !important;
  display: none !important;
}
/* Plugin renders <a class="close"> BEFORE <h3>; reverse visual order so
   title appears left and close appears right (BS5 standard). */
.bootstrap-wysihtml5-insert-link-modal .modal-header h3,
.bootstrap-wysihtml5-insert-image-modal .modal-header h3 { order: 1; }
.bootstrap-wysihtml5-insert-link-modal .modal-header .close,
.bootstrap-wysihtml5-insert-image-modal .modal-header .close { order: 2; }
.bootstrap-wysihtml5-insert-link-modal .modal-header h3,
.bootstrap-wysihtml5-insert-image-modal .modal-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--whml-ink);
  margin: 0;
  letter-spacing: .15px;
}
.bootstrap-wysihtml5-insert-link-modal .modal-header .close,
.bootstrap-wysihtml5-insert-image-modal .modal-header .close {
  position: static;
  font-size: 20px;
  line-height: 1;
  color: var(--whml-ink-2);
  background: transparent;
  border: 0;
  padding: 4px 10px;
  border-radius: var(--radius-md, 6px);
  text-decoration: none;
  opacity: .75;
  transition: opacity .15s, background .15s;
  cursor: pointer;
  margin-left: auto;
}
.bootstrap-wysihtml5-insert-link-modal .modal-header .close:hover,
.bootstrap-wysihtml5-insert-image-modal .modal-header .close:hover {
  opacity: 1;
  background: var(--surface-3, var(--whml-bg-2));
  color: var(--red, #dc3545);
}
.bootstrap-wysihtml5-insert-link-modal .modal-body,
.bootstrap-wysihtml5-insert-image-modal .modal-body {
  padding: 16px;
  background: var(--whml-bg);
  color: var(--whml-ink);
}
.bootstrap-wysihtml5-insert-link-modal .modal-body input[type="text"],
.bootstrap-wysihtml5-insert-image-modal .modal-body input[type="text"],
.bootstrap-wysihtml5-insert-link-modal .modal-body input[type="url"],
.bootstrap-wysihtml5-insert-image-modal .modal-body input[type="url"] {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--whml-border);
  border-radius: var(--radius-md, 6px);
  font-size: 13px;
  color: var(--whml-ink);
  background: var(--whml-bg);
  transition: border-color .15s, box-shadow .15s;
}
.bootstrap-wysihtml5-insert-link-modal .modal-body input:focus,
.bootstrap-wysihtml5-insert-image-modal .modal-body input:focus {
  outline: none;
  border-color: var(--link, #0d6efd);
  box-shadow: 0 0 0 3px var(--blue-soft, rgba(13,110,253,.12));
}
.bootstrap-wysihtml5-insert-link-modal .modal-body label,
.bootstrap-wysihtml5-insert-image-modal .modal-body label {
  font-size: 12px;
  font-weight: 600;
  color: var(--whml-ink-2);
  margin-bottom: 4px;
  display: block;
}
/* Plugin renders: <div class="checkbox"><label><input class="bootstrap-wysihtml5-insert-link-target"> Text</label></div>
   Style the wrapper (top margin) and inner label (inline-flex align) so
   checkbox + text sit in the same row. */
.bootstrap-wysihtml5-insert-link-modal .modal-body .checkbox {
  margin-top: 12px !important;
  margin-bottom: 0 !important;
}
.bootstrap-wysihtml5-insert-link-modal .modal-body .checkbox label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  color: var(--whml-ink) !important;
  cursor: pointer;
  line-height: 1.4;
}
.bootstrap-wysihtml5-insert-link-target {
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  vertical-align: middle !important;
  position: static !important;
}
.bootstrap-wysihtml5-insert-link-modal .modal-footer,
.bootstrap-wysihtml5-insert-image-modal .modal-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  padding: 10px 16px !important;
  border-top: 1px solid var(--whml-border) !important;
  background: var(--whml-bg-2) !important;
}
.bootstrap-wysihtml5-insert-link-modal .modal-footer .btn,
.bootstrap-wysihtml5-insert-image-modal .modal-footer .btn {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-md, 6px);
}
.bootstrap-wysihtml5-insert-link-modal .modal-footer .btn-primary,
.bootstrap-wysihtml5-insert-image-modal .modal-footer .btn-primary {
  background: var(--link, #0d6efd) !important;
  border-color: var(--link, #0d6efd) !important;
  color: #fff !important;
}
.bootstrap-wysihtml5-insert-link-modal .modal-footer .btn-default,
.bootstrap-wysihtml5-insert-image-modal .modal-footer .btn-default {
  background: var(--whml-bg) !important;
  border: 1px solid var(--whml-border) !important;
  color: var(--whml-ink) !important;
}
.bootstrap-wysihtml5-insert-link-modal .modal-footer .btn-default:hover,
.bootstrap-wysihtml5-insert-image-modal .modal-footer .btn-default:hover {
  background: var(--whml-bg-2) !important;
}

/* --- Dropify: compact single-line bar (global) --- */
.dropify-wrapper {
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  background: var(--surface-2) !important;
  height: 40px !important;
  min-height: 40px !important;
  background-image: none !important;
  animation: none !important;
  transition: border-color .15s, background .15s !important;
}
/* Tall variant — wrap a dropify input in <div class="sh-upload-tall"> to
   override the compact 40px height for image-banner uploads (e.g., print
   header image). Needs higher specificity than the global rule above. */
.sh-upload-tall .dropify-wrapper {
  height: 180px !important;
  min-height: 180px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sh-upload-tall .dropify-wrapper .dropify-message { padding: 0 16px; }
.sh-upload-tall .dropify-wrapper .dropify-message span.file-icon {
  font-size: 36px !important;
  display: block !important;
  margin: 0 auto 8px !important;
}
.sh-upload-tall .dropify-wrapper .dropify-message p {
  display: block !important;
  font-size: 13px !important;
}
.sh-upload-tall .dropify-wrapper .dropify-preview { display: flex; align-items: center; justify-content: center; padding: 0; }
.sh-upload-tall .dropify-wrapper .dropify-preview .dropify-render { width: 100%; height: 100%; }
.sh-upload-tall .dropify-wrapper .dropify-preview .dropify-render img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  max-width: none !important;
  object-fit: cover;
  display: block;
}
.dropify-wrapper:hover {
  border-color: var(--link) !important;
  background: var(--blue-soft) !important;
  background-image: none !important;
  animation: none !important;
}
.dropify-wrapper .dropify-message { padding: 0 12px; }
.dropify-wrapper .dropify-message span.file-icon {
  font-size: 13px !important;
  color: var(--muted) !important;
  display: inline-block; width: auto; float: none;
  margin: 0 5px 0 0;
  transition: color .15s;
}
.dropify-wrapper:hover .dropify-message span.file-icon { color: var(--link) !important; }
.dropify-wrapper .dropify-message p {
  display: inline !important;
  color: var(--muted) !important;
  font-size: 12px !important;
  margin: 0;
  transition: color .15s;
}
.dropify-wrapper:hover .dropify-message p { color: var(--link) !important; }
/* hide generic error text — form validation is handled via form_error() */
.dropify-wrapper .dropify-message p.dropify-error,
.dropify-wrapper .dropify-errors-container { display: none !important; }
.dropify-wrapper .dropify-clear {
  top: 5px !important; right: 5px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--muted) !important;
  border-radius: 4px !important;
  font-size: 10px !important;
  padding: 1px 7px !important;
  text-transform: none !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  transition: background .15s, color .15s, border-color .15s;
}
.dropify-wrapper .dropify-clear:hover {
  background: var(--red-soft) !important;
  color: var(--red) !important;
  border-color: var(--red) !important;
}

/* ============================================================
   C. CUSTOM COMPONENTS
   No Bootstrap 5 equivalent â€” unique to Smart Hospital design.
   ============================================================ */

/* --- Page Head (title bar + actions + tabs) --- */
.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 22px 0;
}
.ph-crumbs {
  font-size: 11px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.ph-crumbs a { color: var(--link); }
.ph-crumbs a:hover { text-decoration: underline; }
.ph-crumbs .sep { color: var(--faint); }
.ph-title-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 8px;
}
.ph-title {
  display: flex; align-items: center; gap: 14px;
  flex: 1; min-width: 0;
}
.ph-av {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-weight: 700; font-size: 22px;
  flex-shrink: 0; box-shadow: var(--shadow);
}
.ph-av.teal   { background: linear-gradient(135deg, var(--teal), var(--blue)); }
.ph-av.violet { background: linear-gradient(135deg, var(--violet), var(--purple)); }
.ph-av.amber  { background: linear-gradient(135deg, var(--amber), var(--orange)); }
.ph-title h1 {
  font-size: 22px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  line-height: 1.2;
}
.ph-title .sub {
  margin-top: 6px; font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ph-title .sub .dot-sep::before { content: "Â·"; margin: 0 4px; color: var(--faint); }
.ph-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ph-tabs-wrap { position: relative; display: flex; align-items: center; margin-top: 14px; min-width: 0; }
.ph-tabs-arrow {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer; transition: all .15s;
  padding: 0;
}
.ph-tabs-arrow:hover { background: var(--surface-3); color: var(--ink); border-color: var(--accent); }
.ph-tabs-arrow.d-none { display: none !important; }
.ph-tabs {
  display: flex; align-items: center;
  overflow-x: auto; scrollbar-width: none;
  /* min-width:0 prevents the flex container from stretching past its parent */
  min-width: 0; flex: 1;
  -webkit-overflow-scrolling: touch;
}
.ph-tabs::-webkit-scrollbar { display: none; }
.ph-tabs a {
  padding: 12px 18px;
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: -1px;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.ph-tabs a:hover { color: var(--ink); text-decoration: none; }
.ph-tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.ph-tabs a .n {
  font-size: 10px; padding: 1px 6px;
  border-radius: 10px;
  background: var(--surface-3); color: var(--muted);
  font-weight: 600;
}
.ph-tabs a.active .n { background: var(--accent); color: var(--accent-ink); }

/* --- Dashboard alert banners (inline strip: warn / danger / success) --- */
.sh-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  margin-bottom: 8px;
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.sh-alert .ic { flex-shrink: 0; font-size: 14px; }
.sh-alert .txt { flex: 1; min-width: 0; color: var(--ink); }
.sh-alert .txt strong { font-weight: var(--fw-semibold); }
.sh-alert .txt a { color: inherit; text-decoration: underline; }
.sh-alert .txt code { font-family: var(--mono); font-size: .92em; padding: 1px 4px; background: rgba(0,0,0,.05); border-radius: 3px; }
.sh-alert .x {
  flex-shrink: 0; background: transparent; border: 0; color: inherit;
  opacity: .55; font-size: 13px; cursor: pointer;
  padding: 2px 6px; border-radius: var(--radius);
  line-height: 1;
}
.sh-alert .x:hover { opacity: 1; }
.sh-alert.warn    { background: rgba(243,156,18,.10); border-color: var(--amber-soft); color: var(--amber); }
.sh-alert.danger  { background: rgba(228,37,39,.10); border-color: var(--red-soft);   color: var(--red); }
.sh-alert.success { background: rgba(34,160,107,.10); border-color: var(--green-soft); color: var(--green); }
/* Dark variant — soft tints need a bit more opacity to read */
body.variant-b .sh-alert.warn    { background: rgba(251,191,36,.14); border-color: rgba(251,191,36,.30); }
body.variant-b .sh-alert.danger  { background: rgba(248,113,113,.14); border-color: rgba(248,113,113,.30); }
body.variant-b .sh-alert.success { background: rgba(52,211,153,.14); border-color: rgba(52,211,153,.30); }

/* --- KPI Cards (dashboard metric strip) --- */
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.kpi .ic {
  width: 40px; height: 40px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
}
.kpi .ic svg { width: 20px; height: 20px; }
.kpi .ic i { font-size: 18px; }
.kpi .ic.red    { background: var(--red-soft);    color: var(--red); }
.kpi .ic.green  { background: var(--green-soft);  color: var(--green); }
.kpi .ic.blue   { background: var(--blue-soft);   color: var(--blue); }
.kpi .ic.teal   { background: var(--teal-soft);   color: var(--teal); }
.kpi .ic.amber  { background: var(--amber-soft);  color: var(--amber); }
.kpi .ic.violet { background: var(--violet-soft); color: var(--violet); }
.kpi a { min-width: 0; }
.kpi a > div:not(.ic) { min-width: 0; overflow: hidden; }
.kpi .lbl { font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .val { font-size: 18px; font-weight: 800; color: var(--ink); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .delta { font-size: 11px; font-weight: 600; margin-top: 2px; }
.kpi .delta.up   { color: var(--green); }
.kpi .delta.down { color: var(--red); }
.dash-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 16px 22px 0; }
@media (max-width: 1200px) { .dash-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .dash-kpis { grid-template-columns: repeat(2, 1fr); } }

/* --- Dashboard Grid (3-column layout) --- */
.dash-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; padding: 16px 22px 40px; }
@media (max-width: 1200px) { .dash-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px)  { .dash-grid { grid-template-columns: 1fr; } }
.dash-grid .widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.widget-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}
.widget-head .title {
  font-size: 13px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.widget-head .actions { display: flex; align-items: center; gap: 4px; }
.widget-head .actions button {
  width: 24px; height: 24px; border-radius: 3px;
  display: grid; place-items: center;
  color: var(--muted); background: none; border: none; cursor: pointer;
}
.widget-head .actions button:hover { background: var(--surface-2); color: var(--ink); }
.widget-head .actions svg { width: 12px; height: 12px; }

/* --- Kanban Board --- */
.kanban {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 12px; padding: 14px 22px 40px;
}
@media (max-width: 1400px) { .kanban { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .kanban { grid-template-columns: 1fr; } }
.kcol {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.kcol-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.kcol-head .title {
  font-size: 12px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 6px;
}
.kcol-head .ct {
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 10px;
  background: var(--surface-3); color: var(--muted);
}
.kcol-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.kcard {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.kcard:hover { box-shadow: var(--shadow); border-color: var(--border); }
.kcard .k-title {
  font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 6px;
}
.kcard .k-meta {
  font-size: 10px; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}

/* --- Business Card (Zoho-style record summary) --- */
.bcard {
  margin: 16px 22px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
}
.bcard-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface-2);
}
.bcard-head .title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.bcard-head .title::before {
  content: ""; width: 4px; height: 16px;
  background: var(--accent); border-radius: 2px;
}
.bcard-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 900px) { .bcard-grid { grid-template-columns: repeat(2, 1fr); } }
.bcard-grid .field {
  padding: 12px 18px;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  display: flex; flex-direction: column; gap: 3px;
  position: relative; transition: background .12s;
}
.bcard-grid .field:nth-child(4n) { border-right: none; }
.bcard-grid .field:hover { background: var(--surface-2); }
.bcard-grid .field .l {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); font-weight: 600;
}
.bcard-grid .field .v {
  font-size: 13px; color: var(--ink); font-weight: 500; word-break: break-word;
}
.bcard-grid .field .v a { color: var(--link); }
.bcard-grid .field .v a:hover { text-decoration: underline; }
.bcard-grid .field .v.mut { color: var(--faint); font-style: italic; font-weight: 400; }
.bcard-grid .field:nth-last-child(-n+4) { border-bottom: none; }

/* --- Related Lists --- */
.rellist-wrap { padding: 16px 22px 40px; display: flex; flex-direction: column; gap: 14px; }
.rellist {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md); overflow: hidden;
}
.rellist-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface-2);
  cursor: pointer; transition: background .12s;
}
.rellist-head:hover { background: var(--surface-2); }
.rellist-head .l { display: flex; align-items: center; gap: 10px; }
.rellist-head .ic {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.rellist-head .ic svg { width: 14px; height: 14px; }
.rellist-head .ic.teal   { background: var(--teal-soft);   color: var(--teal); }
.rellist-head .ic.blue   { background: var(--blue-soft);   color: var(--blue); }
.rellist-head .ic.amber  { background: var(--amber-soft);  color: var(--amber); }
.rellist-head .ic.violet { background: var(--violet-soft); color: var(--violet); }
.rellist-head .ic.green  { background: var(--green-soft);  color: var(--green); }
.rellist-head .ic.red    { background: var(--red);         color: #fff; font-weight: 700; font-size: 14px; }
.rellist-head .title { font-size: 13px; font-weight: 600; color: var(--ink); }
.rellist-head .count {
  font-size: 11px; padding: 2px 8px;
  border-radius: 10px; background: var(--surface-3); color: var(--muted); font-weight: 600;
}
.rellist-head .r { display: flex; align-items: center; gap: 6px; }
.rellist.collapsed .rellist-body { display: none; }
button.expand {
  background: none !important; border: none !important;
  outline: none !important; box-shadow: none !important;
  padding: 3px 5px !important; margin: 0;
  cursor: pointer; line-height: 1;
  color: var(--faint);
  font-size: 13px;
  border-radius: 3px;
  transition: color .15s, background .15s;
  display: inline-flex; align-items: center;
}
button.expand:hover { color: var(--muted); background: var(--surface-3) !important; }
button.expand .expand-open  { display: inline; }
button.expand .expand-closed { display: none; }
.rellist.collapsed button.expand .expand-open  { display: none; }
.rellist.collapsed button.expand .expand-closed { display: inline; }
.rellist.collapsed button.expand { color: var(--accent); }
.rellist-body { overflow: hidden; border-top: 1px solid var(--border-light); }
.rellist-body.pad { padding: 18px; }
/* First/last cells get horizontal padding matching rellist-head (16px) */
.rellist-body .table > thead > tr > th:first-child,
.rellist-body .table > tbody > tr > td:first-child { padding-left: 16px; }
.rellist-body .table > thead > tr > th:last-child,
.rellist-body .table > tbody > tr > td:last-child  { padding-right: 16px; }
.rellist-body .table > thead > tr > th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  padding-top: 10px; padding-bottom: 10px;
}
/* Body cells: bind to --ink so Theme Studio presets resolve correctly
   instead of falling through to Bootstrap's --bs-table-color (which stays
   light-mode dark on nightshift's brown bg, rendering near-invisible). */
.rellist-body .table > tbody > tr > td { color: var(--ink); }
.rellist-body .table > tbody > tr:hover > td { background: var(--rowhover); }
.rellist-body .table {
  table-layout: fixed;
}
.rellist-body .table > thead > tr > th:nth-child(4),
.rellist-body .table > tbody > tr > td:nth-child(4) {
  width: 40% !important;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.sec-label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px;
}

/* â”€â”€â”€ Clinical Alerts Card (Allergies/Symptoms/ICD-10) â”€â”€â”€ */
.alerts-card .alert-section {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}
.alerts-card .alert-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.alert-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.alert-section-label i {
  font-size: 13px;
  flex-shrink: 0;
}
.alert-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  border: 1.5px solid;
  transition: all 0.2s ease;
}
.badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.badge-allergy {
  background: var(--amber-soft);
  color: #A76C00;
  border-color: var(--amber);
}
.badge-allergy:hover {
  background: var(--amber);
  color: white;
}
.badge-symptom {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: var(--blue);
}
.badge-symptom:hover {
  background: var(--blue);
  color: white;
}
.badge-finding {
  background: var(--surface-3);
  color: var(--ink);
  border-color: var(--border);
}
.badge-finding:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.alert-section-icd {
  border-bottom: none;
}
.alert-icd-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.icd-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-3);
  border-left: 3px solid var(--blue);
  border-radius: 4px;
  font-size: 12px;
}
.icd-code {
  font-weight: 700;
  color: var(--blue);
  flex-shrink: 0;
  min-width: 60px;
  font-family: 'Courier New', monospace;
}
.icd-desc {
  color: var(--ink);
  line-height: 1.4;
  flex: 1;
}
.rellist-foot {
  padding: 10px 16px; border-top: 1px solid var(--border-light);
  background: var(--surface-2); font-size: var(--fs-sm);
  display: flex; align-items: center; justify-content: space-between;
}
.rellist-foot a { color: var(--link); font-weight: 600; }
/* Theme-safe colored pills for rellist-body — avoids *-soft tokens that don't adapt in nightshift */
.rellist-pill {
  padding: 8px 12px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--ink);
}
.rellist-pill.red   { border-left-color: var(--red);   color: var(--red); }
.rellist-pill.amber { border-left-color: var(--amber); color: var(--amber); }

/* --- Timeline --- */
.tl-date-head {
  padding: 10px 16px;
  background: var(--surface-2); font-size: var(--fs-micro); font-weight: var(--fw-bold);
  color: var(--muted); text-transform: uppercase; letter-spacing: var(--ls-wide);
  border-bottom: 1px solid var(--border-light);
}
.tl-item {
  display: grid; grid-template-columns: 40px 1fr;
  gap: 14px; padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}
.tl-item .tl-ic {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted);
  border: 2px solid var(--border);
}
.tl-item .tl-ic svg { width: 13px; height: 13px; }
.tl-item .tl-text { font-size: var(--fs-sm); color: var(--ink); }
.tl-item .tl-time { font-size: var(--fs-micro); color: var(--muted); margin-top: 2px; }


/* --- Misc utility classes used by views --- */
.text-muted-sh, .text-muted, .text-secondary { color: var(--muted) !important; }
.text-accent    { color: var(--accent) !important; }
.text-link      { color: var(--link) !important; }
.bg-surface     { background: var(--surface) !important; }
.bg-surface-2   { background: var(--surface-2) !important; }
.border-light   { border-color: var(--border-light) !important; }

/* --- App-specific classes (ported from style-main.css) --- */
.titlefix { position: relative; display: inline-block; }
.card-title { font-size: var(--fs-h3); font-weight: var(--fw-bold); margin: 0; color: var(--ink); line-height: 1.4; }
/* Card title in card-header should NOT inherit the .content h5 underline (OPD/IPD section header rule) */
.card-header h4.card-title, .card-header h5.card-title { border-bottom: none; padding-bottom: 0; margin: 0; }

/* Hidden label for DataTables export filename */
.download_label { display: none; }

.navlistscroll { overflow-x: auto; white-space: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.navlistscroll::-webkit-scrollbar { display: none; }

.topmius35 { position: relative; top: 0; right: 0; padding: 10px 16px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 576px) { .topmius-sm-0 { position: relative !important; top: 3px !important; left: 0; justify-content: flex-start; } }

.btnMDb2 { margin-bottom: 2px; }

.staffinfo-box { text-align: center; padding: 14px; position: relative; border: 1px solid var(--border); background: var(--surface); }
.staffinfo-box img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border); }
.staffleft-box img { background: var(--surface); }
.staffinfo-box h5 { display: block; margin: 8px 0 4px; font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--ink); }
.staffinfo-box p { margin-bottom: 1px; display: block; font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); }
.staffinfo-box p span { font-weight: var(--fw-semibold); }
body.variant-b .staffinfo-box p span { background-color: var(--surface-3); border-color: var(--border); color: var(--ink-2); }

/* Content header (legacy pages that still use section.content-header) */
.content-header { padding: 12px 22px; }
.content-header h1 { font-size: var(--fs-h1); font-weight: var(--fw-bold); line-height: var(--lh-snug); letter-spacing: var(--ls-tight); color: var(--ink); margin: 0; }
.content-header h1 small { font-size: var(--fs-sm); color: var(--muted); font-weight: var(--fw-regular); }

/* Info box (legacy dashboard widgets not yet converted to .kpi) */
.info-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
  box-shadow: var(--shadow-sm); min-height: 70px;
}
.info-box-icon {
  width: 50px; height: 50px; border-radius: 8px;
  display: grid; place-items: center; font-size: 22px; color: #fff; flex-shrink: 0;
}
.info-box-icon.bg-aqua, .info-box-icon.bg-teal { background: var(--teal); }
.info-box-icon.bg-green { background: var(--green); }
.info-box-icon.bg-yellow { background: var(--amber); }
.info-box-icon.bg-red, .info-box-icon.expenes-red { background: var(--red); }
.info-box-icon.bg-blue { background: var(--blue); }
.info-box-icon.bg-purple { background: var(--violet); }
.info-box-content { flex: 1; min-width: 0; }
.info-box-text { font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--muted); text-transform: uppercase; letter-spacing: var(--ls-wide); }
.info-box-number { font-size: var(--fs-h1); font-weight: var(--fw-bold); color: var(--ink); font-family: var(--mono); line-height: var(--lh-tight); }

/* --- Utility classes (legacy + BS5 aliases) — replicate AdminLTE/style-main.css; views use directly — do NOT remove without auditing all _bs5.php files --- */
.p0        { padding:        0 !important; }
.pt0       { padding-top:    0 !important; }
.pb0       { padding-bottom: 0 !important; }
.pl0       { padding-left:   0 !important; }
.pr0       { padding-right:  0 !important; }
.pt6       { padding-top:    6px; }
.pt8       { padding-top:    8px; }
.ptt10     { padding-top:    10px; }
.pt20      { padding-top:    20px; }
.pt25      { padding-top:    25px; }
.pb10      { padding-bottom: 10px; }
.pl-10     { padding-left:   10px; }
.pe-10     { padding-right:  10px; }
.no-padding { padding:       0 !important; }   /* alias for .p0 */

.mt0  { margin-top:    0 !important; }
.mt5  { margin-top:    5px; }
.mt10 { margin-top:    10px; }
.mb5  { margin-bottom: 5px; }
.mb10 { margin-bottom: 10px; }
.mr5  { margin-right:  5px; }
.ml5  { margin-left:   5px; }

.bolds   { font-weight: 700; }
.bmedium { font-weight: 500; }
.font14  { font-size: 14px; }
.font16  { font-size: 16px; }

.clear      { clear: both; }
.relative   { position: relative; }
.border0    { border:        0 !important; }
.border-b   { border-bottom: 1px solid var(--border-light); }
.border-r   { border-right:  1px solid var(--border-light); }
.min-h-4    { min-height: 200px; }

/* Scroll containers (modals / sidebars with overflow content) */
/* Note: when inside a max-height modal-content flex column, these enforce a second
   inner cap so the modal doesn't rely solely on the outer flex constraint */
.scroll-area     { max-height: 600px; overflow-y: auto; overflow-x: hidden; }
.pup-scroll-area { max-height: calc(100vh - 300px); max-height: calc(100dvh - 300px); overflow-y: auto; overflow-x: hidden; }

/* Charges preview table (IPD/OPD): fixed-layout forces 12 cols to share modal-xl width; removes stray horizontal scrollbar, keeps Action col visible */
.sh-charge-preview-scroll { overflow-x: hidden; }
.sh-charge-preview-scroll > table { width: 100%; table-layout: fixed; }
/* Word-wrap cell text: break at spaces first, split a word only if it can't fit */
.sh-charge-preview-scroll > table th,
.sh-charge-preview-scroll > table td { white-space: normal; overflow-wrap: break-word; word-break: normal; }
/* Keep the Action column tight so the wider data columns aren't over-squeezed */
.sh-charge-preview-scroll > table th:last-child,
.sh-charge-preview-scroll > table td:last-child { width: 56px; }

.rowoptionview { display: flex; gap: 3px; justify-content: flex-end; flex-wrap: nowrap; }
.rowview-btn-top { align-items: flex-start; }
.large-tooltip  { position: relative; }

/* tr is positioning context so absolute buttons don't affect row height */
.table tbody tr,
table.dataTable tbody tr { position: relative; }

.table tbody tr .rowoptionview,
table.dataTable tbody tr .rowoptionview {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  margin-top: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.table tbody tr:hover .rowoptionview,
table.dataTable tbody tr:hover .rowoptionview {
  opacity: 1;
  pointer-events: auto;
}
.rowview-mt-19 { margin-top: 0 !important; }

/* â”€â”€ Action button design inside rowoptionview â”€â”€ */
.rowoptionview .btn,
.rowoptionview a.btn {
  border: none !important;
  background: transparent !important;
  color: var(--muted) !important;
  width: 28px;
  height: 28px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius) !important;
  font-size: 13px !important;
  transition: background .15s, color .15s;
}
.rowoptionview .btn:hover,
.rowoptionview a.btn:hover {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
}
.rowoptionview .btn i,
.rowoptionview a.btn i {
  font-size: 13px !important;
  line-height: 1;
}
/* Action buttons (incl. delete) inherit the general .rowoptionview hover —
   var(--accent-soft) bg + var(--accent) color — so all action buttons follow
   the active theme uniformly instead of forcing red on delete. */

.table-responsive-mobile { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.dividerhr  { margin: 15px 0; clear: both; height: 0; border: 0; border-top: 1px solid var(--border, #dee2e6); }
.dividerhrmb10 { margin: 10px 0; clear: both; height: 0; border: 0; border-top: 1px solid var(--border, #dee2e6); }

.editable { border-bottom: 1px dashed var(--link); color: var(--link); cursor: pointer; }
.editable:hover { color: var(--accent); border-color: var(--accent); }

.overlay3 {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); border-radius: 50%;
  opacity: 0; transition: opacity .2s;
  display: flex; align-items: center; justify-content: center;
}
.staffinfo-box:hover .overlay3,
.fadeoverlay:hover .overlay3 { opacity: 1; }

/* Staff card tiles are rectangular — restore from the 50% avatar default */
.staffinfo-box .overlay3 { border-radius: 3px; }

/* fadeoverlay must be a positioned container so .overlay3 stays within the image tile */
.fadeoverlay { position: relative; }
/* Gallery/banner image tiles are rectangular â€” override the avatar's border-radius: 50% */
.fadeoverlay .overlay3 { border-radius: var(--radius-md, 4px); }

/* Gallery / Banner image tiles ------------------------------------------------ */
.gallery_img { display: flex; flex-direction: column; }
.gallery_img .fadeoverlay { overflow: hidden; border-radius: var(--radius-md, 4px); }
.gallery_img .overlay3 .uploadclosebtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: rgba(220,53,69,.9); color: #fff;
  border-radius: 50%; font-size: 15px; text-decoration: none;
  transition: background .15s;
}
.gallery_img .overlay3 .uploadclosebtn:hover { background: #dc3545; }
.gallery_img > p {
  font-size: .72rem; color: var(--muted, #6c757d);
  padding: .3rem .4rem; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 1px solid var(--border-light, #dee2e6); border-top: none;
  border-radius: 0 0 var(--radius-md, 4px) var(--radius-md, 4px);
  background: var(--surface, #fff);
}

/* --- Media Library grid (Front CMS â†’ Media Manager) --- */
#media_div .image_div,
#media_div .img_div_modal {
  margin-bottom: 0;
}
#media_div .fadeoverlay {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  overflow: hidden;
  transition: box-shadow .15s, transform .15s;
}
#media_div .fadeoverlay:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
#media_div .fadeheight {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
}
#media_div .fadeheight img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#media_div .image_div > .fadeoverlay > p,
#media_div .img_div_modal > .fadeoverlay > p {
  font-size: 10px;
  color: var(--muted);
  padding: 5px 8px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--border-light);
  background: var(--surface);
  font-family: var(--mono);
  letter-spacing: -.01em;
  direction: rtl;    /* show end of filename (extension visible) when truncated */
  text-align: left;
}
#media_div .videoicon {
  position: absolute;
  top: 6px; right: 6px;
  font-size: 14px;
  color: #fff;
  background: rgba(0,0,0,.45);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
#media_div .overlay3 {
  position: absolute;
  inset: 0;
  background: rgba(26,39,51,.55);
  border-radius: 0;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity .15s;
}
#media_div .image_div:hover .overlay3,
#media_div .img_div_modal:hover .overlay3 { opacity: 1; }
#media_div .overlay3 a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
  transition: background .15s, color .15s;
}
#media_div .overlay3 a i { margin: 0; }
#media_div .overlay3 a:hover {
  background: var(--accent);
  color: var(--accent-ink);
}
#media_div .overlay3 .processing { display: none; }

/* Upload split layout â€” vertical divider between file upload & YouTube URL */
.upload-split { position: relative; }
.upload-split > .upload-split-right {
  position: relative;
}
@media (min-width: 768px) {
  .upload-split > .upload-split-right::before {
    content: '';
    position: absolute;
    left: 0; top: 16px; bottom: 16px;
    width: 1px;
    background: var(--border);
  }
  .upload-split > .upload-split-right {
    padding-left: 28px !important;
  }
}
/* Legacy upload overlay icons â€” only apply outside #media_div (original circular avatar-upload use case) */
.overlay3 .uploadclosebtn,
.overlay3 .uploadcheckbtn { cursor: pointer; }

/* Tighter column gutters for all page-level rows (padding is on .content wrapper) */
.content > .row,
.content > form > .row,
.content > .row > form.row,
.content > form.row {
  --bs-gutter-x: 16px;
  margin-top: 2px;
}
.content > .row:first-child,
.content > form:first-child > .row { margin-top: 0; }

.content h4, .content h5, .card-body h4, .card-body h5 {
  font-size: 14px; font-weight: 700; color: var(--ink);
  margin: 16px 0 10px; padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
}
.content h4:first-child, .content h5:first-child,
.card-body h4:first-child, .card-body h5:first-child { margin-top: 0; }
/* Billing progress section titles â€” must come AFTER .card-body h5 to win */
.topprograssstart h5 {
  font-size: 10px !important; font-weight: 700 !important;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted) !important;
  border-bottom: none !important;
  margin: 0 0 3px !important;
  padding-bottom: 0 !important;
}

.nav-tabs.navlistscroll .nav-link {
  font-size: 12px; padding: 8px 12px; gap: 4px;
  display: inline-flex; align-items: center;
}
.nav-tabs.navlistscroll .nav-link i { font-size: 11px; }

.table-bordered.table-condensed td,
.table-condensed td, .table-condensed th {
  padding: 6px 12px; font-size: 12px;
}
.table-condensed td:first-child, .table-condensed th:first-child {
  font-weight: 600; color: var(--muted); width: 160px;
}

.progress { height: 8px; border-radius: 4px; background: var(--surface-3); }
.progress-bar { background: var(--accent); border-radius: 4px; }
.progress-bar.bg-success, .progress-bar.progress-bar-success { background: var(--green) !important; }
.progress-bar.bg-warning, .progress-bar.progress-bar-warning { background: var(--amber) !important; }
.progress-bar.bg-danger, .progress-bar.progress-bar-danger { background: var(--red) !important; }

.plist .list-group-item, .plist .patient-list-item {
  padding: 8px 12px; border-color: var(--border-light);
  font-size: 12px; cursor: pointer; transition: background .1s;
}
.plist .list-group-item:hover { background: var(--surface-2); }
.plist .list-group-item.active { background: var(--accent-soft); border-left: 3px solid var(--accent); color: var(--accent); }

.staffinfo-box {
  text-align: center; padding: 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: box-shadow .15s, transform .15s;
  margin-bottom: 12px;
}
.staffinfo-box:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.staffinfo-box img {
  width: 70px; height: 70px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--border);
  margin-bottom: 8px;
}
.staffinfo-box h5 {
  font-size: 13px; font-weight: 700; color: var(--ink);
  margin: 4px 0 2px; border: none; padding: 0;
}
.staffinfo-box p {
  font-size: 10px; color: var(--muted);
  margin-bottom: 1px; line-height: 1.4;
}
.staffinfo-box p span { font-weight: 600; color: var(--ink-2); }

/* Duty Roster report â€” grouped shifts per staff (rowspan merged cell) */
.roster-staff-cell {
  vertical-align: middle !important;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-2);
  border-right: 2px solid var(--border) !important;
  white-space: nowrap;
  padding-left: 16px !important;
  padding-right: 16px !important;
}
tr.roster-group-start > td {
  border-top: 2px solid var(--border-strong) !important;
}
#headerTable > thead > tr > th:first-child,
#headerTable > tbody > tr > td:first-child {
  padding-left: 16px !important;
}
#headerTable > thead > tr > th:last-child,
#headerTable > tbody > tr > td:last-child {
  padding-right: 16px !important;
}

/* Staff card hover action overlay â€” rectangular card-shape (not the circular avatar ellipse from .overlay3 base) */
.staffinfo-box .overlay3 {
  border-radius: var(--radius-md);
  background: rgba(26,39,51,.55);
}
.staffinfo-box .stafficons {
  display: flex; gap: 10px; align-items: center; justify-content: center;
}
.staffinfo-box .stafficons a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: var(--ink);
  font-size: 14px; text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background .15s, color .15s, transform .15s;
}
.staffinfo-box .stafficons a:hover {
  background: var(--accent); color: var(--accent-ink);
  transform: scale(1.05);
}
body.variant-b .staffinfo-box .stafficons a {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: none;
}
body.variant-b .staffinfo-box .stafficons a:hover {
  background: var(--accent);
  color: #fff;
}

.card-header .btn-group { gap: 0; }
.card-header .btn-group .btn { border-radius: 0; }
.card-header .btn-group .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.card-header .btn-group .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

.card-header .d-flex.gap-2 { gap: 6px !important; }

@media print { .no-print, .no-print * { display: none !important; } }

/* --- AdminLTE box → card compatibility shims --- */
.box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

/* Legacy BS3 .hidden — dropped in BS5; old views (patient Stripe checkout etc.) still toggle it from JS; do NOT remove. New code: use .d-none instead. */
.hidden { display: none !important; }

/* ============================================================
   PATIENT GATEWAY CHECKOUT — shared payment-summary styling
   Used by all patient/payment/*/index.php gateways. Token-driven
   so summary renders correctly across all theme variants.
   ============================================================ */
.sh-pay-summary { margin: 0; }
.sh-pay-summary .pay-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 9px 0;
  border-bottom: 1px dashed var(--border-light);
}
.sh-pay-summary .pay-row .lbl { color: var(--muted); font-size: var(--fs-body); }
.sh-pay-summary .pay-row .val {
  color: var(--ink); font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;   /* digits align in a neat column */
}
.sh-pay-summary .pay-total {
  border-bottom: none; margin-top: 4px; padding-top: 12px;
  border-top: 2px solid var(--border-strong);
}
.sh-pay-summary .pay-total .lbl { color: var(--ink); font-weight: var(--fw-bold); font-size: var(--fs-h6); }
.sh-pay-summary .pay-total .val { color: var(--accent); font-weight: var(--fw-bold); font-size: var(--fs-h5); }

.sh-pay-actions { display: flex; gap: 10px; margin-top: 18px; }
.sh-pay-actions .btn { min-width: 120px; }
.sh-pay-actions .btn-pay { flex: 1; }   /* primary CTA fills remaining width */

/* Scannable patient identifiers (QR + barcode) — each its own cell in the
   patient details bill-info-grid: QR completes the OPD No row, barcode flows
   to the next row. White plate is intentional in every variant: scanners need
   a light quiet-zone behind the code, so the tiles stay white on dark too. */
.sh-bii-barcode {
  height: 34px; width: auto; max-width: 100%;
  margin-top: 3px; background: #fff; border-radius: 3px; padding: 2px;
}
.sh-bii-qr {
  height: 44px; width: 44px;
  margin-top: 3px; background: #fff; border-radius: 3px; padding: 2px;
}

/* ============================================================
   OPD VISIT DETAILS  Â·  visitDetails_bs5.php
   Scope: #overview tab-pane  â€” CSS-only, no features hidden
   ============================================================ */

#overview .card-header.border-b {
  border-bottom: 2px solid var(--border) !important;
  padding-bottom: 10px;
  margin-bottom: 10px;
}
#overview .card-header.border-b h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
}

#overview .profile-user-img {
  border-radius: 50%;
  border: 3px solid var(--accent);
  padding: 2px;
  object-fit: cover;
  width: 100px;
  height: 100px;
  display: block;
}

#overview .table.table-bordered.mb0,
#overview .align-content-center .table.table-bordered {
  border: none;
}
#overview .table.table-bordered.mb0 td,
#overview .align-content-center .table.table-bordered td {
  border: none;
  border-bottom: 1px solid var(--border-light);
  padding: 5px 8px;
  font-size: 12.5px;
  vertical-align: middle;
}
#overview .table.table-bordered.mb0 tr:last-child td,
#overview .align-content-center .table.table-bordered tr:last-child td {
  border-bottom: none;
}
#overview .table.table-bordered.mb0 td.bolds,
#overview .align-content-center .table.table-bordered td.bolds {
  color: var(--ink-2);
  font-weight: 600;
  width: 44%;
  white-space: nowrap;
}

/* ---- Section labels (Known Allergies, Findings, etc.) ---- */
#overview .border-r p > b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-2);
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}

/* ---- Vitals table ---- */
#overview .table-bordered .label.label-success {
  display: inline-block;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  border: none;
}
#overview .table-bordered .label.label-danger {
  display: inline-block;
  background: var(--red-soft);
  color: var(--red);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  border: none;
}

/* ---- Consultant Doctor cards ---- */
#overview .staff-members .media {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
#overview .staff-members .media-left { flex-shrink: 0; }
#overview .staff-members .member-profile-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-soft);
}
#overview .staff-members .media-body h5.media-heading {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
}
#overview .staff-members .media-body h5.media-heading a {
  color: var(--ink);
  text-decoration: none;
}

/* ---- Tab panel section headers (ALL tabs: Visits, Medication, Lab, etc.) ---- */
.box-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 12px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--border-light);
}
.box-tab-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.box-tab-title::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.box-tab-tools {
  display: flex;
  gap: 6px;
  align-items: center;
}
.box-tab-tools .btn-primary.btn-sm,
.box-tab-tools .btn-sm {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Patient IPD profile Timeline tab — AdminLTE ul.timeline.timeline-inverse action slots.
   No AdminLTE CSS is loaded in the patient portal, so span.time needs its own layout.
   The anchors (.defaults-c) inherit color from the .defaults-c rule above. */
#timeline_list .timeline-item span.time {
  float: right; display: inline-flex; gap: 6px; margin-left: 8px; align-items: center;
}
#timeline_list .timeline-item span.time a { font-size: 14px; }
#timeline_list .timeline-item span.time a:focus { outline: none; }

/* ---- OPD number badge (OPDN34 etc.) ---- */
.tab-pane h5 {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
  margin: 0 0 10px;
}
/* When OPD badge sits inside the section header (next to title),
   drop bottom margin so it aligns vertically with the title in the flex row. */
.box-tab-header h5,
.box-tab-header .opd-no-badge {
  margin: 0;
  line-height: 1.4;
}

/* ---- "No Record Found" / empty states ---- */
.tab-pane .alert-danger,
.tab-pane .text-danger:only-child:not(b) {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  padding: 20px;
  font-size: 13px;
}

/* (download_label already defined above) */

/* ---- rl-tl: clean vertical timeline (replaces AdminLTE ul.timeline) ---- */
.rl-tl { display: flex; flex-direction: column; padding: 4px 0 4px 6px; }
.rl-tl-item { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.rl-tl-item:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 20px; bottom: 0; width: 1px; background: var(--border); }
.rl-tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 4px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent-soft); }
.rl-tl-card { flex: 1; min-width: 0; }
.rl-tl-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 3px; }

/* â•â• AdminLTE ul.timeline â†’ styled as rl-tl (scoped to profile, no view changes needed)
   AdminLTE CSS is not loaded, so we define all styles from scratch here             â•â• */
.opd-profile-wrap #timeline .timeline-header.no-border { padding: 16px; }
.opd-profile-wrap #vitals .vitals-header.no-border { padding: 16px; }
/* Reset list */
/* â”€â”€ ul.timeline reset â”€â”€ */
.opd-profile-wrap #timeline ul.timeline,
.opd-profile-wrap #timeline ul.timeline-inverse {
  list-style: none; margin: 0; padding: 0;
}
/* Hide AdminLTE bullet icons + last clock li */
.opd-profile-wrap #timeline ul.timeline > li > i { display: none; }
.opd-profile-wrap #timeline ul.timeline > li:last-child { display: none; }

/* â”€â”€ DATE ROW (li.time-label): dot + muted date text â”€â”€ */
.opd-profile-wrap #timeline ul.timeline > li.time-label {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 0 5px; position: relative;
}
.opd-profile-wrap #timeline ul.timeline > li.time-label:first-child { padding-top: 0; }
/* Red dot on the date row */
.opd-profile-wrap #timeline ul.timeline > li.time-label::before {
  content: ''; flex-shrink: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent-soft);
}
/* Date text â€” plain muted, no badge */
.opd-profile-wrap #timeline ul.timeline > li.time-label > span.bg-blue,
.opd-profile-wrap #timeline ul.timeline > li.time-label > span.bg-primary {
  font-size: 11px !important; font-weight: 600 !important;
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
  padding: 3px 10px !important; border-radius: 20px !important;
  border: none !important;
}
/* IPD title h6 — inline style="color:var(--link)" forces !important override */
.opd-profile-wrap #timeline ul.timeline > li > .timeline-item h6 {
  color: var(--ink) !important; font-size: 13px !important; font-weight: 600 !important;
  margin: 0 0 2px !important;
}

/* â”€â”€ CONTENT ROW (li without .time-label): indented title + description â”€â”€ */
.opd-profile-wrap #timeline ul.timeline > li:not(.time-label):not(:last-child) {
  display: block;
  padding: 0 0 6px 24px; /* 12px dot + 12px gap indent */
  position: relative;
}
/* Vertical connector â€” from date row down through content */
.opd-profile-wrap #timeline ul.timeline > li.time-label:not(:nth-last-child(2))::after {
  content: ''; position: absolute;
  left: 5px; top: calc(100% - 2px); bottom: 0;
  width: 1px; background: var(--border); z-index: 0;
  height: calc(100% + 1px);
}
/* timeline-item: reset AdminLTE styles */
.opd-profile-wrap #timeline ul.timeline > li > .timeline-item {
  background: none !important; border: none !important;
  box-shadow: none !important; margin: 0 !important; padding: 0 !important;
}
/* Action buttons (span.time) â€” float right */
.opd-profile-wrap #timeline ul.timeline > li > .timeline-item > span.time {
  float: right; display: inline-flex; gap: 4px; margin-left: 8px;
}
/* Title */
.opd-profile-wrap #timeline ul.timeline > li > .timeline-item > h3.timeline-header {
  font-size: 13px !important; font-weight: 600 !important;
  color: var(--ink) !important; line-height: 1.4;
  margin: 0 0 3px !important; padding: 0 !important;
  border: none !important; background: none !important;
}
/* Description */
.opd-profile-wrap #timeline ul.timeline > li > .timeline-item > .timeline-body {
  font-size: 12px; color: var(--muted); line-height: 1.5;
  margin-top: 2px; clear: both; word-break: break-word;
}
.rl-tl-date { font-size: 11px; color: var(--muted); }
.rl-tl-actions { display: flex; gap: 4px; }
.rl-tl-title { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.rl-tl-body { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; word-break: break-word; }

/* ============================================================
   BILLING PROGRESS CARDS (right column)
   ============================================================ */

/* Base card style for all topprograssstart boxes */
#overview .project-progress-bars .topprograssstart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius-lg);
  padding: 12px 14px 10px;
  margin: 3px 3px 10px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow .18s;
}
#overview .project-progress-bars .topprograssstart:hover {
  box-shadow: var(--shadow-lg);
}

/* Soft colour blob in top-right corner */
#overview .project-progress-bars .topprograssstart::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 56px; height: 56px;
  border-radius: 0 var(--radius-lg) 0 56px;
  background: var(--blue-soft);
  opacity: .6;
  pointer-events: none;
}

/* Card title */
#overview .project-progress-bars .topprograssstart h5 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-2);
  margin: 0 0 5px;
  position: relative;
}

/* Percentage + amount row */
#overview .project-progress-bars .topprograssstart p {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  position: relative;
}
#overview .project-progress-bars .topprograssstart p .float-end {
  font-size: 11px;
  color: var(--ink-2);
  font-weight: 500;
}

/* Progress bar track */
#overview .project-progress-bars .progress.progress-minibar {
  height: 5px;
  border-radius: 10px;
  background: var(--border);
  overflow: visible;
  position: relative;
}
/* Progress fill (aqua class used in the view) */
#overview .project-progress-bars .progress-bar.progress-bar-aqua {
  background: var(--blue);
  border-radius: 10px;
}

/* ----- Per-row colour overrides -----
   Row 1: OPD (blue default) | Pharmacy (green)
   Row 2: Pathology (purple) | Radiology (amber)
   Row 3: Blood Bank (red)   | Ambulance (teal)
*/
/* Row 1 â€“ second card: Pharmacy â†’ green */
#overview .col-lg-6:last-child > .row:nth-child(1) .project-progress-bars:nth-child(2) .topprograssstart {
  border-top-color: var(--green);
}
#overview .col-lg-6:last-child > .row:nth-child(1) .project-progress-bars:nth-child(2) .topprograssstart::before {
  background: var(--green-soft);
}
#overview .col-lg-6:last-child > .row:nth-child(1) .project-progress-bars:nth-child(2) .progress-bar-aqua {
  background: var(--green);
}

/* Row 2 â€“ first card: Pathology â†’ purple */
#overview .col-lg-6:last-child > .row:nth-child(2) .project-progress-bars:nth-child(1) .topprograssstart {
  border-top-color: var(--purple);
}
#overview .col-lg-6:last-child > .row:nth-child(2) .project-progress-bars:nth-child(1) .topprograssstart::before {
  background: var(--purple-soft);
}
#overview .col-lg-6:last-child > .row:nth-child(2) .project-progress-bars:nth-child(1) .progress-bar-aqua {
  background: var(--purple);
}
/* Row 2 â€“ second card: Radiology â†’ amber */
#overview .col-lg-6:last-child > .row:nth-child(2) .project-progress-bars:nth-child(2) .topprograssstart {
  border-top-color: var(--amber);
}
#overview .col-lg-6:last-child > .row:nth-child(2) .project-progress-bars:nth-child(2) .topprograssstart::before {
  background: var(--amber-soft);
}
#overview .col-lg-6:last-child > .row:nth-child(2) .project-progress-bars:nth-child(2) .progress-bar-aqua {
  background: var(--amber);
}

/* Row 3 â€“ first card: Blood Bank â†’ red */
#overview .col-lg-6:last-child > .row:nth-child(3) .project-progress-bars:nth-child(1) .topprograssstart {
  border-top-color: var(--red);
}
#overview .col-lg-6:last-child > .row:nth-child(3) .project-progress-bars:nth-child(1) .topprograssstart::before {
  background: var(--red-soft);
}
#overview .col-lg-6:last-child > .row:nth-child(3) .project-progress-bars:nth-child(1) .progress-bar-aqua {
  background: var(--red);
}
/* Row 3 â€“ second card: Ambulance â†’ teal */
#overview .col-lg-6:last-child > .row:nth-child(3) .project-progress-bars:nth-child(2) .topprograssstart {
  border-top-color: var(--teal);
}
#overview .col-lg-6:last-child > .row:nth-child(3) .project-progress-bars:nth-child(2) .topprograssstart::before {
  background: var(--teal-soft);
}
#overview .col-lg-6:last-child > .row:nth-child(3) .project-progress-bars:nth-child(2) .progress-bar-aqua {
  background: var(--teal);
}

/* ---- Right column section headings (Medication, Lab, Operationâ€¦) ---- */
#overview .col-lg-6:last-child > .card-header.mb10 h3,
#overview .col-lg-6:last-child .card-header.mb10 h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-2);
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}

/* ---- Section summary tables in right col ---- */
#overview .col-lg-6:last-child .table.table-striped th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--surface-2);
  color: var(--ink-2);
  border-bottom: 2px solid var(--border);
}
#overview .col-lg-6:last-child .table.table-striped td {
  font-size: 12px;
  vertical-align: middle;
}

/* ---- Left border between columns ---- */
#overview .border-r {
  border-right: 1px solid var(--border-light) !important;
}

/* â”€â”€ Blood Bank Status â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.bloodbg { background: var(--surface-2); border-radius: var(--radius-md); padding: 14px 10px; }

/* Vertical pill nav for blood groups */
.blood-stacked { gap: 4px; }
.blood-stacked .nav-link {
  padding: 5px 8px;
  font-size: 12px; font-weight: 700;
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
  width: 100%;
  display: block;
}
.blood-stacked .nav-link:hover { background: var(--surface-3); border-color: var(--accent); }
.blood-stacked .nav-link.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Vertical pill nav for pharmacy purchase → TPA charges modal (#view_tpa_charge_model).
   Raw Bootstrap .nav-pills had no tokenized styling, so dark theme (variant-b) fell back
   to hardcoded primary-blue + secondary-gray. Anchor to design tokens for all 3 variants. */
#tpa-medicine-tabs .nav-link {
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  padding: 7px 10px;
  transition: background .15s, color .15s, border-color .15s;
}
#tpa-medicine-tabs .nav-link .text-muted { color: var(--muted) !important; }
#tpa-medicine-tabs .nav-link:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--ink);
}
#tpa-medicine-tabs .nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
#tpa-medicine-tabs .nav-link.active .text-muted { color: var(--ink-2) !important; }

/* Blood group panel header row */
.blood-body {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 6px;
}
.blood-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.blood-float-start { float: left; }
.blood-float-end   { float: right; }

/* Each Blood/Components panel â€” light card inset */
.col-lg-10 > .tab-content .blood-panel-col,
#bloodGroupDiv > div { /* _bloodListTable_bs5 renders direct children */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}

/* Sticky-header table wrapper for blood bag lists */
.tableFixHead { max-height: 300px; overflow-y: auto; overflow-x: hidden; }
.tableFixHead thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface);
}
.bloodtable { font-size: 12px; margin-bottom: 0; }
.bloodtable thead th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
/* â”€â”€ /Blood Bank Status â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* ============================================================
   OPD VISIT DETAILS â€” TAB BAR + PATIENT PROFILE REDESIGN
   Matches IPD mockup design language (CSS-only)
   ============================================================ */

/* ---- Tab bar: pill-style with accent active state ---- */
/* nav-tabs-bar: flex wrapper that holds the scrollable tab list + sticky action tools */
.nav-tabs-bar {
  border-bottom: 2px solid var(--border);
  background: var(--surface);
}
/* When inside .nav-tabs-bar, suppress the individual border-bottom on the ul */
.nav-tabs-bar .nav.nav-tabs.navlistscroll {
  border-bottom: none !important;
}
/* Action tools slot: pinned to the right of the tab bar */
.nav-tools-bar {
  background: var(--surface);
  padding: 4px 8px;
  align-self: center;
}

.nav-tabs-custom .nav.nav-tabs.navlistscroll {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 0 8px;
  flex-wrap: nowrap;
  display: flex;
  align-items: flex-end;
  gap: 0;
}
.nav-tabs-custom .nav.nav-tabs.navlistscroll > li {
  display: inline-flex;
  flex-shrink: 0;
}
.nav-tabs-custom .nav.nav-tabs.navlistscroll > li > a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
  margin-bottom: -2px;
}
.nav-tabs-custom .nav.nav-tabs.navlistscroll > li > a i { font-size: 11px; }
.nav-tabs-custom .nav.nav-tabs.navlistscroll > li > a:hover {
  color: var(--ink);
  background: var(--surface-2);
  border-bottom-color: var(--border);
  text-decoration: none;
}
.nav-tabs-custom .nav.nav-tabs.navlistscroll > li > a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
  background: var(--accent-soft);
}

/* Tab content panel */
.nav-tabs-custom .tab-content.pt6 {
  padding-top: 16px !important;
}

/* ============================================================
   OPD VISIT DETAILS â€” PATIENT PROFILE PANEL (left column)
   ============================================================ */

/* Avatar: shadow ring + larger */
#overview .profile-user-img {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Slim info table: label in muted uppercase */
#overview .table.table-bordered.mb0 td.bolds,
#overview .align-content-center .table.table-bordered td.bolds {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Barcode / QR images */
#overview .table.table-bordered.mb0 td img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 2px;
  background: var(--surface-2);
}

/* Vitals mini-card */
#overview .row .col-lg-8.col-md-8 .align-content-center {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 4px 0;
}
#overview .row .col-lg-8 .table.table-bordered {
  margin: 0; border: none;
}
#overview .row .col-lg-8 .table.table-bordered td {
  border: none;
  border-bottom: 1px solid var(--border-light);
  padding: 4px 10px;
  font-size: 12px;
}
#overview .row .col-lg-8 .table.table-bordered tr:last-child td { border-bottom: none; }

/* Allergy / Findings / Symptoms â€” styled bullet list */
#overview .border-r > ul {
  padding-left: 0;
  list-style: none;
  margin: 4px 0 8px;
}
#overview .border-r > ul > li {
  padding: 3px 0 3px 14px;
  font-size: 12.5px;
  color: var(--ink);
  position: relative;
}
#overview .border-r > ul > li::before {
  content: "â€¢";
  position: absolute;
  left: 2px;
  color: var(--accent);
  font-weight: 900;
}

/* Section labels (Known Allergies, Findings, Symptoms, ICD) */
#overview .border-r p > b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-2);
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}
#overview .border-r p > b > i.fa-tag { color: var(--accent); }

/* ICD badge */
#overview .badge.bg-info { font-size: 10px; padding: 2px 6px; }

/* Dividers */
#overview .hr-card-header { border-color: var(--border-light); margin: 8px 0; opacity: 1; }

/* Right column section headings (Medication / Lab / Charges â€¦) */
#overview .col-lg-6:last-child .card-header.mb10.pl-0 h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-2);
  border-left: 3px solid var(--accent);
  padding-left: 8px;
  margin: 0;
}

/* Section summary tables */
#overview .col-lg-6:last-child .table.table-striped th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--surface-2);
  color: var(--ink-2);
  border-bottom: 2px solid var(--border);
}
#overview .col-lg-6:last-child .table.table-striped td {
  font-size: 12px;
  vertical-align: middle;
}

/* ---- Edit/Delete/Discharge action icons ---- */
.editviewdelete-icon {
  display: flex;
  gap: 4px;
  align-items: center;
}
.editviewdelete-icon a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.editviewdelete-icon a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.editviewdelete-icon a[title*="delete" i]:hover,
.editviewdelete-icon a .fa-trash:hover {
  background: var(--red-soft);
  color: var(--red);
}

/* ---- Patient name header ---- */
#overview .card-header.border-b {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 12px;
}
#overview .card-header.border-b h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

/* ---- Left panel overall card treatment ---- */
#overview .border-r {
  border-right: 1px solid var(--border-light);
  padding-right: 20px;
}

/* ---- Patient photo center align ---- */
#overview .col-lg-3.col-md-4 {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* ---- Section separators ---- */
#overview hr.hr-card-header,
#overview hr.hr-10 {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 12px 0;
  opacity: 1;
}

/* ---- Right column OPD Details / Billing summary ---- */
#overview .col-lg-6:last-child {
  padding-left: 20px;
}
#overview .col-lg-6:last-child .card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-light);
  padding: 6px 0;
  margin-bottom: 10px;
}

/* ---- Sidebar patient list ---- */
/* ---- Sidebar patient list ---- */
.sidebarlists .card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.sidebarlists .card-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
}
.sidebarlists .card-header h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-2);
  margin: 0;
}
.sidebarlists .card-body { padding: 0; }
.sidebarlists .card-body .form-control {
  border: none;
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  font-size: 12px;
  padding: 8px 12px;
}
.sidebarlists .nav-stacked {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebarlists .nav-stacked > li {
  border-bottom: 1px solid var(--border-light);
}
.sidebarlists .nav-stacked > li:last-child { border-bottom: none; }
.sidebarlists .nav-stacked > li > a {
  display: block;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--ink);
  transition: background .12s;
}
.sidebarlists .nav-stacked > li > a:hover {
  background: var(--surface-2);
}
.sidebarlists .nav-stacked > li.active > a {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}
.sidebarlists .nav-stacked > li.active > a div > div {
  color: var(--accent) !important;
  font-weight: 700 !important;
}

/* ---- Page-type wrappers: grey backdrop so bcard/rellist appear as white cards ---- */
.ipd-detail-wrap > .tab-content,
.opd-detail-wrap > .tab-content {
  background: var(--bg, #f5f7fa);
  padding-top: 16px;
}
/* opd-profile-wrap tab content */
.opd-profile-wrap > .tab-content {
  background:  var(--bg);;
  padding-top: 16px;
}

/* ---- opd-profile-wrap: unified card container ---- */
.opd-profile-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}
/* Hero gradient: gives the header area depth vs flat white content below */
.opd-profile-wrap .page-head {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}
/* Avatar double-ring: white gap + accent halo */
.opd-profile-wrap .ph-av {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent);
}
/* Extra breathing room in the title row */
.opd-profile-wrap .ph-title-row {
  margin-top: 14px;
  padding-bottom: 6px;
}

/* Mobile: the overview "rellist" data tables (Visit Details, Lab Investigation,
   Medication, …) use table-layout:fixed (line ~3841) with the 4th column forced to
   40% break-word — crammed into ~306px the columns crushed and dates wrapped one
   character per line. Override at matching specificity so the table scrolls
   horizontally with natural, non-wrapping columns. Covers OPD + IPD profile overviews. */
@media (max-width: 768px) {
  .rellist-body .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    table-layout: auto;
  }
  /* !important needed to beat the global DataTables cell rule (white-space:normal +
     word-break:break-word !important) — without this, no-space dates like 27/05/2026
     break one char per line in the auto-sized columns. */
  .rellist-body .table > thead > tr > th,
  .rellist-body .table > tbody > tr > td {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }
  /* neutralize the desktop 4th-col 40% break-word clamp on mobile */
  .rellist-body .table > thead > tr > th:nth-child(4),
  .rellist-body .table > tbody > tr > td:nth-child(4) { width: auto !important; }
}

/* ---- Tab content panels â€” consistent padding ---- */
.nav-tabs-custom .tab-pane,
.opd-detail-wrap .tab-pane:not(#overview),
.ipd-detail-wrap .tab-pane:not(#overview) {
  padding: 16px 20px 32px;
}
/* opd-profile-wrap tabs: tab-pane IS the card (like .bcard owns outer border) */
.opd-profile-wrap .tab-pane:not(#overview) {
  padding: 0;
  border: 1px solid var(--border);
}
/* â•â• box-tab-header: identical to bcard-head â€” only border-bottom, no outer border â•â• */
.opd-profile-wrap .tab-pane:not(#overview) .box-tab-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  padding: 12px 18px;
  margin-bottom: 0;
}
/* â•â• box-tab-title: identical to bcard-head .title â•â• */
.opd-profile-wrap .tab-pane:not(#overview) .box-tab-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.opd-profile-wrap .tab-pane:not(#overview) .box-tab-title::before {
  height: 16px;
}
/* â•â• DataTable card body: no own border â€” tab-pane owns the outer boundary
   overflow:visible so Action-column dropdowns can escape               â•â• */
.opd-profile-wrap .tab-pane:not(#overview) .table-responsive {
  border: none;
  border-radius: 0;
  overflow: visible;
}
/* Vitals tab uses a plain table (no DataTables wrapper) — restore horizontal scroll
   on its inner wrapper so wide vital tables don't overflow viewport at 320. */
.opd-profile-wrap .tab-pane:not(#overview) .table_inner.table-responsive {
  overflow-x: auto;
}
/* A runaway custom vital name (a long unbroken run like "TESTTTTTTTT…") spills
   past the table's right edge. Keep the table at 100% (no horizontal scroll) and
   let only over-long words wrap onto multiple lines. The DATE column (first cell)
   stays nowrap so dates never break mid-number. */
.opd-profile-wrap #vitals .table_inner > table {
  width: 100%;
}
.opd-profile-wrap #vitals .table_inner th,
.opd-profile-wrap #vitals .table_inner td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.opd-profile-wrap #vitals .table_inner th:first-child,
.opd-profile-wrap #vitals .table_inner td:first-child {
  white-space: nowrap;
}

/* â•â• DataTable toolbar (.dt-toolbar = DOM option <"dt-toolbar"f<"dt-toolbar-right"lB>>) â•â• */
.opd-profile-wrap .dt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
}
.opd-profile-wrap .dt-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* â•â• Search input â€” taller, theme-aware â•â• */
.opd-profile-wrap .dataTables_filter {
  display: flex;
  align-items: center;
  gap: 6px;
}
.opd-profile-wrap .dataTables_filter label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.opd-profile-wrap .dataTables_filter input {
  height: 32px;
  padding: 0 10px !important;
  font-size: 12px !important;
  background: var(--surface) !important; /* white input on surface-2 toolbar */
  color: var(--ink) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  outline: none !important;
  min-width: 180px;
  transition: border-color .15s, box-shadow .15s;
}
.opd-profile-wrap .dataTables_filter input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}
.opd-profile-wrap .dataTables_filter input::placeholder { color: var(--faint); }

/* â•â• Page-length selector â•â• */
.opd-profile-wrap .dataTables_length {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}
.opd-profile-wrap .dataTables_length label { margin: 0; display: flex; align-items: center; gap: 5px; }
.opd-profile-wrap .dataTables_length select {
  height: 32px;
  padding: 0 8px !important;
  font-size: 12px !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
}

/* â•â• Export buttons â€” compact icon-only squares â•â• */
.opd-profile-wrap div.dt-buttons { display: flex; gap: 3px; }
.opd-profile-wrap div.dt-buttons .dt-button {
  width: 30px !important; height: 30px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  transition: background .15s, color .15s, border-color .15s;
}
.opd-profile-wrap div.dt-buttons .dt-button:hover {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}

/* â•â• Table body â€” comfortable row height â•â• */
.opd-profile-wrap table.dataTable > tbody > tr > td {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  vertical-align: middle !important;
  font-size: 13px;
}

/* â•â• Bottom bar: info (left) + pagination (right) â•â• */
.opd-profile-wrap .dataTables_wrapper > .dataTables_info {
  float: left;
  padding: 10px 14px !important;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border-light);
  background: var(--surface-2);
}
.opd-profile-wrap .dataTables_wrapper > .dataTables_paginate {
  float: right;
  padding: 7px 14px !important;
  border-top: 1px solid var(--border-light);
  background: var(--surface-2);
}

/* â•â• Empty state â•â• */
.opd-profile-wrap .dataTables_wrapper .dataTables_empty {
  padding: 40px 20px !important;
  color: var(--faint) !important;
  font-size: 13px;
  background: var(--surface);
  border: none !important;
  text-align: center;
}

/* ---- opd-profile-wrap: full-width cards to match page-head ---- */
.opd-profile-wrap .bcard {
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
}
.opd-profile-wrap .rellist-wrap {
  padding-left: 0;
  padding-right: 0;
}
.opd-profile-wrap .rellist {
  border-radius: 0;
  border-left: none;
  border-right: none;
}

/* ---- Overview tab: simple timeline list ---- */
.overview-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.overview-timeline li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
}
.overview-timeline li:last-child { border-bottom: none; padding-bottom: 0; }
.overview-timeline .tl-date {
  font-size: 11px; color: var(--muted); font-weight: 500;
  padding-top: 2px; white-space: nowrap;
}
.overview-timeline .tl-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue); flex-shrink: 0; margin-top: 4px;
}
.overview-timeline .tl-body { display: flex; gap: 10px; align-items: flex-start; }
.overview-timeline .tl-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.overview-timeline .tl-desc  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.overview-timeline .tl-dl    { font-size: 11px; color: var(--link); margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }

/* ---- DataTable empty state illustration ---- */
.dataTables_empty {
  text-align: center !important;
  color: var(--muted);
  padding: 30px 20px !important;
  font-size: 13px;
}

/* ---- Tab panel tables: softer header ---- */
.tab-pane .table thead th {
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid var(--border);
  padding: 8px 10px;
  white-space: nowrap;
}
.tab-pane .table tbody td {
  font-size: 12.5px;
  padding: 8px 10px;
  vertical-align: middle;
}

/* ---- Consultant Doctor section ---- */
#overview .staff-members {
  padding: 8px 0;
}
#overview .staff-members .media img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
#overview .staff-members .media .media-body h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 2px;
}
#overview .staff-members .media .media-body p {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

/* Responsive billing cards */
@media (max-width: 576px) {
  #overview .project-progress-bars { margin-bottom: 6px; }
  #overview .project-progress-bars .topprograssstart { margin: 2px 0; }
}

/* â”€â”€ Notice Board (notificationList_bs5) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.notice-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: box-shadow .15s;
}
.notice-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }

.notice-header {
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
}

.notice-title {
  font-weight: 500;
  color: var(--ink);
  text-decoration: none !important;
  font-size: 14px;
  display: flex;
  align-items: center;
}
.notice-title:hover { color: var(--accent); }

.notice-arrow {
  font-size: 11px;
  color: var(--ink-2);
  transition: transform .2s ease;
  flex-shrink: 0;
}
.notice-arrow.rotated { transform: rotate(90deg); }

.notice-body {
  border-top: 1px solid var(--border-light);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink);
}

.notice-meta { font-size: 12px; color: var(--ink-2); margin: 0; }
.notice-meta li { margin-bottom: 4px; }
.notice-meta strong { color: var(--ink); }
.notice-meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-2);
}

/* â”€â”€ DataTables toolbar: search left Â· length+buttons right â”€ */
.dataTables_wrapper .dt-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.dataTables_wrapper .dt-toolbar .dataTables_filter {
  flex: 1 1 auto;
  min-width: 120px;
}
.dataTables_wrapper .dt-toolbar .dataTables_filter label,
.dataTables_wrapper .dt-toolbar .dataTables_length label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
  color: var(--ink-2);
  font-size: 13px;
}
.dataTables_wrapper .dt-toolbar .dataTables_filter input {
  height: 30px;
  padding: 2px 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  min-width: 140px;
}
.dataTables_wrapper .dt-toolbar .dataTables_filter input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb),.15);
}
.dataTables_wrapper .dt-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.dataTables_wrapper .dt-toolbar-right .dataTables_length select {
  height: 30px;
  padding: 2px 6px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.dataTables_wrapper .dt-toolbar-right .dt-buttons { display: flex; gap: 3px; }
/* Keep old .top rules working for any remaining usage */
.dataTables_wrapper .top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dataTables_wrapper .top .dataTables_length { margin-left: auto; }

/* Fix: utility classes must override Bootstrap flex/block display */
.displaynone { display: none !important; }
.displayblock { display: block !important; }

/* â”€â”€ Chat (chats_bs5) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.card > .row > [class*="col"] { padding: 0; }

/* Layout frame */
.chatleftside {
  height: calc(100vh - 140px);
  height: calc(100dvh - 140px);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.chatrightside {
  height: calc(100vh - 140px);
  height: calc(100dvh - 140px);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
}

/* Search bar */
.custom-search-input { padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.custom-search-input .input-group { width: 100% !important; }
.custom-search-input .form-control {
  border: 1px solid var(--border);
  border-right: none;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  border-radius: var(--radius) 0 0 var(--radius);
  height: 36px;
}
.custom-search-input .form-control:focus { box-shadow: none; border-color: var(--accent); }
.custom-search-input .btn-secondary {
  border: 1px solid var(--border);
  border-left: none;
  background: var(--surface-2);
  color: var(--ink-2);
  height: 36px;
  padding: 0 10px;
}
.chataddbtn {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.chataddbtn:hover { background: color-mix(in srgb, var(--accent) 80%, #000); }

/* Contact list */
.chatfrientlist { flex: 1 1 auto; overflow-y: auto; }
.chatfrientlist ul { list-style: none; margin: 0; padding: 0; }
.chatfrientlist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background .12s;
}
.chatfrientlist li:hover { background: var(--hover); }
.chatfrientlist li.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-left: 3px solid var(--accent);
}
.chatfrientlist li img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.chatfrientlist li .chat-body { min-width: 0; }
.chatfrientlist li .chat-body h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chatfrientlist li .chat-body p { font-size: 11px; color: var(--ink-2); margin: 0; }

/* Chat header */
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-header img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-headerbody { flex: 1 1 auto; min-width: 0; }
.chat-headerbody h4 { font-size: 14px; font-weight: 600; color: var(--ink); margin: 0 0 2px; }
.chat-headerbody p { font-size: 12px; color: var(--accent); margin: 0; }
.social-media { display: flex; gap: 14px; margin-left: auto; }
.social-media i { color: var(--ink-2); cursor: pointer; font-size: 16px; transition: color .12s; }
.social-media i:hover { color: var(--accent); }

/* Messages area */
.mobile { flex: 1 1 auto; overflow: hidden; display: flex; flex-direction: column; }
.chat-w { flex: 1 1 auto; overflow-y: auto; padding: 14px; }
.chatmsg { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.chatmsg li { display: flex; flex-direction: column; }

/* Received bubble */
.bubble {
  align-self: flex-start;
  max-width: 68%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 0 12px 12px 12px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
/* Sent bubble */
.bubble2 {
  align-self: flex-end;
  max-width: 68%;
  background: var(--accent);
  color: #fff;
  border-radius: 12px 0 12px 12px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.bubble2 a { color: rgba(255,255,255,.7); font-size: 11px; margin-left: 6px; vertical-align: middle; }
.bubble2 a:hover { color: #fff; }
/* timestamp line inside both bubbles */
.bubble br + *, .bubble2 br + * { font-size: 10px; opacity: .6; }

/* Reply row */
.reply {
  flex-shrink: 0;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin: 0 !important;
}
.reply-emojis { display: flex; align-items: center; justify-content: center; }
.reply-emojis i { font-size: 20px; color: var(--ink-2); cursor: pointer; transition: color .12s; }
.reply-emojis i:hover { color: var(--accent); }
.reply-main .form-control {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 20px;
  font-size: 13px;
  padding: 7px 14px;
  resize: none;
}
.reply-main .form-control:focus { outline: none; box-shadow: none; border-color: var(--accent); }
.reply-send { display: flex; align-items: center; justify-content: center; }
.reply-send i { color: var(--accent); cursor: pointer; font-size: 22px; transition: color .12s, transform .1s; }
.reply-send i:hover { color: color-mix(in srgb, var(--accent) 80%, #000); transform: scale(1.12); }

/* â”€â”€ Media Manager / Download Center (upload_bs5) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* Fix: card needs position:relative so the absolute image anchors correctly */
.card.card-product-list,
.card.card-product-list > div {
  position: relative;
}
/* Fix: image is 100px wide but padding was only 85px â€” content overlapped */
.img-wrap-fix-right { padding-left: 108px; }
/* Cosmetic: tighten card image container */
.card-product-list .img-wrap {
  height: 100px;
  width: 100px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
[class*=card-product] .img-wrap img {
  height: 80px;
  max-width: 80px;
  object-fit: contain;
}
.card.card-product-list {
  min-height: 100px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card.card-product-list:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(var(--accent-rgb), .12);
}
/* Fix: radio-title layout in content cards */
.radio-title {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.radio-title .div_image { flex: 1; min-width: 0; }
.radio-title .div_image a {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
/* Documents sidebar BS5 refresh */
.documents_sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.d-preview {
  background: var(--surface-alt, #f8f9fa);
  border-bottom: 1px solid var(--border);
  min-height: 120px;
  box-shadow: none;
}
.d-preview-position {
  position: relative;
  display: inline-block;
}
.d-preview-count {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #dc3545;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
/* Grid view card â€” stacked image on top at small card widths */
.grid_div .card-product-list .img-wrap-fix-mobile {
  position: relative;
  left: auto;
  top: auto;
  width: 100%;
  height: 120px;
  background: var(--surface-alt, #f8f9fa);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.grid_div .card-product-list .img-wrap-fix-mobile .img-wrap {
  height: 120px;
  width: 100%;
  border: none;
  background: transparent;
}
.grid_div .card-product-list .img-wrap-fix-mobile .img-wrap img {
  max-height: 90px;
  width: auto;
  max-width: 100%;
}
.grid_div .img-wrap-fix-right { padding-left: 0; }
.grid_div .content-footer-bottom { padding: 0.5rem; }
/* List-mode toggle active state */
.btn-group .btn.btn-secondary.active,
.btn-group .btn.btn-secondary:active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* â”€â”€ Holiday step-radio alignment fix â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
ul.stepradiolist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stepradiolist li {
  display: block;
  padding: 0;
}
/* Make label a flex row so radio + text sit side-by-side */
.stepradiolist li label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin: 0;
  font-weight: normal;
}
/* Show radio input inline (do not hide it) */
.stepradiolist li label > input[type="radio"] {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}
/* stepimage as plain inline text, no pill box */
.stepimage {
  display: inline;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 14px;
  color: var(--ink);
}
.stepradiolist li label > input:checked + .stepimage {
  color: var(--accent);
  font-weight: 600;
  border: none;
  background: none;
}

/* Tile variant — used when stepimage has multi-line content (e.g., shift name + time) */
.stepradiolist.stepradiolist-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.stepradiolist-tiles li {
  margin-bottom: 0;
}
.stepradiolist-tiles li label {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
}
.stepradiolist-tiles li label > input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.stepradiolist-tiles .stepimage {
  display: block;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.5;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.stepradiolist-tiles .stepimage::first-line {
  font-weight: 600;
  font-size: 13.5px;
}
.stepradiolist-tiles li label:hover .stepimage {
  border-color: var(--accent);
  background: var(--surface-2);
}
.stepradiolist-tiles li label > input:checked + .stepimage {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--accent);
}

/* Soft side panel — used inside modals for differentiated content blocks (e.g., modules list) */
.sh-soft-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 8px);
  padding: 1rem;
}
/* Equal-height card row — children .sh-form-card stretch to match tallest sibling */
.sh-eq-card-row > [class*="col-"] {
  display: flex;
  flex-direction: column;
}
.sh-eq-card-row > [class*="col-"] > .sh-form-card {
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
}

/* Compact patient/search select inside sh-modal-accent header */
.sh-modal-accent .modal-header .patient_list_ajax,
.sh-modal-accent .modal-header .patient_list_ajax + .select2-container {
  max-width: 240px;
  flex: 0 1 240px;
}

/* â”€â”€ Report link cards (all _*_bs5.php report partials) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.reportlists {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0 0 4px;
  gap: 8px;
}
.reportlists li {
  flex: 0 0 calc(33.33% - 6px);
  min-width: 200px;
  max-width: 100%;
}
.reportlists li a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 500;
  transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
  height: 100%;
}
.reportlists li a i { color: var(--accent); font-size: 14px; flex-shrink: 0; transition: color .14s; }
.reportlists li a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.reportlists li a:hover i { color: #fff; }
/* active link (current page) */
.reportlists li.active a,
.reportlists li.active-submenu a {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
.reportlists li.active a i,
.reportlists li.active-submenu a i { color: #fff; }

@media (max-width: 768px) {
  .reportlists li { flex: 0 0 calc(50% - 4px); }
}
@media (max-width: 480px) {
  .reportlists li { flex: 0 0 100%; }
}

/* â”€â”€ Select2 full-width fix in modal headers â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.select2-full-width .select2-container,
.select2-full-width .select2-container--default { width: 100% !important; }

/* TPA checkbox in modal-media-header */
.modal-media-header .form-check {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  height: 34px;
}
.modal-media-header .form-check-input {
  width: 16px;
  height: 16px;
  margin: 0;
  border: 2px solid rgba(255,255,255,.7);
  background: rgba(255,255,255,.15);
  cursor: pointer;
  flex-shrink: 0;
}
.modal-media-header .form-check-input:checked {
  background-color: #fff;
  border-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%230d6efd' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}
.modal-media-header .form-check-label {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  cursor: pointer;
  user-select: none;
  line-height: 1;
}

/* â”€â”€ Patient detail lists (singlelist / multilinelist) used in admin modals â”€â”€ */
.singlelist, .multilinelist { margin: 0; padding: 0; list-style: none; }
.singlelist li             { display: block; padding-bottom: 10px; }
.singlelist li i           { padding-right: 10px; }
.singlelist24bold          { font-size: 24px; font-weight: 900; }
.multilinelist li          { display: inline-block; padding-bottom: 10px; }
.multilinelist li i        { padding-right: 6px; }
.multilinelist li + li     { padding-left: 30px; }

/* â”€â”€ Patient Details modal (#myModal in admin/search.php) â€” flex-aligned â”€â”€ */
#myModal .singlelist,
#myModal .multilinelist             { list-style: none; padding-left: 0 !important; margin: 0; }
#myModal .singlelist li,
#myModal .multilinelist li          { display: flex; align-items: center; gap: 9px; padding: 4px 0; font-size: 13px; color: var(--ink); line-height: 1.5; min-height: 24px; }
#myModal .singlelist li i,
#myModal .multilinelist li i        { color: var(--muted); font-size: 13px; width: 18px; text-align: center; flex-shrink: 0; line-height: 1; }
#myModal .multilinelist             { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px 24px; padding: 2px 0 6px; }
#myModal .singlelist24bold          { font-size: 20px; font-weight: 700; color: var(--ink); padding-bottom: 4px; }
#myModal .singlelist li b           { font-weight: 600; color: var(--muted); font-size: 12px; white-space: nowrap; flex-shrink: 0; }
#myModal #show_barcode img,
#myModal #show_qrcode img           { vertical-align: middle; }
/* Align nested row columns to the same left edge as outer list items */
#myModal #Myinfo .row               { margin-left: 0; margin-right: 0; }
#myModal #Myinfo .row > [class*="col-"]:first-child { padding-left: 0; }
#myModal #Myinfo .row > [class*="col-"]:last-child  { padding-right: 0; }
/* Breathing room above the patient card inside the search modal */
#myModal .bill-patient-panel        { margin-top: 16px; }
/* The custom-field form sits right below the info grid (whose last-row border is
   removed globally). Restore a separator above it — only when it actually has fields. */
#myModal #field_data:not(:empty)    { border-top: 1px solid var(--border); margin-top: 4px; }
/* Slimmer header bar for the patient details modal (overrides the .sh-modal-nospace .5rem).
   The edit/delete/close controls set the height floor, so shrink them too. */
#myModal .modal-header { padding-top: .45rem; padding-bottom: .45rem; }
/* :not(.modalbtnpatient) — this 26x26 icon-square shrink is only for the
   edit/delete icon buttons; it must NOT catch the New Patient CTA (which also
   carries .btn-sm), otherwise the ID specificity (1,2,0) crushes it to a tiny
   square and beats the global New Patient design rule. */
#myModal .modal-header .btn-sm:not(.modalbtnpatient) {
  width: 26px; height: 26px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
#myModal .modal-header .btn-close { padding: .25rem; background-size: .65em; }
/* Add Appointment modal — #myModal here is sh-modal-accent (NOT the slim
   sh-modal-nospace patient-details modal the .15rem rule above targets).
   Give it a taller header. id+2-classes (1,2,1) beats #myModal .modal-header. */
#myModal.sh-modal-accent .modal-header { padding-top: .8rem; padding-bottom: .8rem; }

/* New Visit / IPD Add modal (#myModal) — standard edge spacing + vertical divider between left & right cards */
#myModal .modal-body:has(> .row > .col-lg-8 + .col-lg-4) { padding: 0; }
#myModal .modal-body > .row:has(> .col-lg-8 + .col-lg-4) { margin: 0; }
#myModal .row > .col-lg-8:has(+ .col-lg-4) { padding: 16px 20px; }
#myModal .col-lg-8 + .col-lg-4 { border-left: 1px solid #e0e0e0; padding: 16px 20px; overflow-y: auto; }

/* Patient Visit Report heading — equal spacing above/below */
#visit_report > h4                  { padding: 16px 0; margin: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: .02em; }

/* patient info panel wrapper */
.pd-info-panel                      { padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.pd-profile-img                     { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* visit report section banner */
.pd-section-banner                  { display: flex; align-items: center; gap: 8px; padding: .6rem 1.25rem; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.pd-section-banner .btn-secondary   { background: rgba(255,255,255,.15); border-color: transparent; color: #fff; }
.pd-section-banner .btn-secondary:hover { background: rgba(255,255,255,.28); }

/* visit report section dividers */
.pd-section-header                  { padding: .45rem 1.25rem; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }

/* visit_report wrapper spacing */
#visit_report .table-responsive     { margin: 0 0 28px; }
#visit_report .table                { margin-bottom: 0; }
#visit_report .table > caption      { caption-side: top; padding: 18px 14px 12px; color: var(--ink); border-top: 1px solid var(--border); margin-top: 8px; }
#visit_report .table > caption h4   { font-size: 16px; font-weight: 700; margin: 0; color: var(--ink); letter-spacing: .01em; }
#visit_report .table-responsive:first-of-type .table > caption { border-top: 0; margin-top: 0; padding-top: 6px; }

/* â”€â”€ Chat System (#frame) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* Timestamp labels inside chat bubbles */
.time_date {
  display: block; text-align: left; margin-top: 4px;
  font-size: .85em; color: var(--ink-2); font-style: italic;
}
.time_date_send {
  display: block; text-align: right; margin-top: 4px;
  font-size: .85em; color: var(--ink-2); font-style: italic;
}

/* Frame wrapper */
#frame {
  width: 100%; height: 88vh; background: var(--surface-2);
  position: relative; display: flex;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
#contacts ul { padding: 0; margin: 0; list-style: none; }

/* Left side-panel */
#frame #sidepanel {
  min-width: 260px; max-width: 340px; width: 38%;
  height: 100%; background: var(--surface); color: var(--ink);
  overflow: hidden; position: relative;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
@media screen and (max-width: 735px) {
  #frame #sidepanel { width: 58px; min-width: 58px; }
}

/* Search / title bar */
#frame #sidepanel #search {
  height: 50px; position: relative; z-index: 1;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 46px 0 12px; flex-shrink: 0;
}
#frame #sidepanel #search label {
  font-weight: 700; font-size: 13px; color: var(--ink);
  white-space: nowrap; margin: 0; line-height: 1;
}
@media screen and (max-width: 735px) {
  #frame #sidepanel #search label { display: none; }
}

/* Add contact button (top-right of sidepanel) */
#frame #sidepanel #bottom-bar {
  position: absolute; top: 8px; right: 8px;
}
#frame #sidepanel #bottom-bar button {
  border: none; width: 34px; height: 34px;
  border-radius: 50%; background: var(--accent);
  font-size: 16px; color: #fff; cursor: pointer;
  transition: background .15s;
  display: flex; align-items: center; justify-content: center;
}
#frame #sidepanel #bottom-bar button:focus { outline: none; }
#frame #sidepanel #bottom-bar button:hover {
  background: color-mix(in srgb, var(--accent) 80%, #000);
}

/* Contacts list */
#frame #sidepanel #contacts {
  flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
}
#frame #sidepanel #contacts::-webkit-scrollbar { width: 4px; background: transparent; }
#frame #sidepanel #contacts::-webkit-scrollbar-thumb { background: var(--border); }

/* Individual contact row */
#frame #sidepanel #contacts ul li.contact {
  position: relative; padding: 10px 12px;
  cursor: pointer; transition: background .12s;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 10px;
  min-height: 60px;
}
#frame #sidepanel #contacts ul li:last-child.contact { border-bottom: 0; }
#frame #sidepanel #contacts ul li.contact:hover { background: var(--hover); }
#frame #sidepanel #contacts ul li.contact.active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-left: 3px solid var(--accent);
}

/* Contact .wrap (img + .meta) */
#frame #sidepanel #contacts ul li.contact .wrap {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
}
#frame #sidepanel #contacts ul li.contact .wrap img {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border);
}
#frame #sidepanel #contacts ul li.contact .wrap .meta {
  min-width: 0; flex: 1;
}
@media screen and (max-width: 735px) {
  #frame #sidepanel #contacts ul li.contact .wrap .meta { display: none; }
}
#frame #sidepanel #contacts ul li.contact .wrap .meta .name {
  font-size: 13px; font-weight: 600; color: var(--ink);
  margin: 0 0 2px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
#frame #sidepanel #contacts ul li.contact .wrap .meta .preview {
  font-size: 11px; color: var(--ink-2); margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#frame #sidepanel #contacts ul li.contact .wrap .meta .preview span {
  opacity: .6; margin-right: 2px;
  position: initial; border-radius: initial;
  background: none; border: none; padding: 0;
}

/* Notification badge on contact row */
.chatbadge {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  min-width: 18px; height: 18px; padding: 0 4px;
  color: #fff; text-align: center; line-height: 18px;
  background: var(--accent); border-radius: 9px; font-size: 10px;
}

/* Right content panel */
#frame .chatcontent {
  flex: 1; height: 100%; overflow: hidden;
  position: relative; display: flex; flex-direction: column;
}

/* Profile header bar */
#frame .chatcontent .contact-profile {
  width: 100%; height: 50px; flex-shrink: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 14px; gap: 10px;
}
#frame .chatcontent .contact-profile img {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border);
}
#frame .chatcontent .contact-profile p {
  flex: 1; margin: 0; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
  font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1;
}
#frame .chatcontent .contact-profile .social-media {
  display: flex; gap: 14px; margin-left: auto;
}
#frame .chatcontent .contact-profile .social-media i {
  color: var(--ink-2); cursor: pointer; font-size: 15px; transition: color .12s;
}
#frame .chatcontent .contact-profile .social-media i:hover { color: var(--accent); }

/* Messages area */
#frame .chatcontent .messages {
  flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
  width: 100%; padding: 14px 14px 80px;
}
#frame .chatcontent .messages::-webkit-scrollbar { width: 4px; background: transparent; }
#frame .chatcontent .messages::-webkit-scrollbar-thumb { background: var(--border); }
#frame .chatcontent .messages ul {
  padding: 0; margin: 0; list-style: none;
  display: flex; flex-direction: column; gap: 12px;
}
#frame .chatcontent .messages ul li {
  display: flex; flex-direction: column; clear: both;
}
#frame .chatcontent .messages ul li.sent { align-items: flex-start; }
#frame .chatcontent .messages ul li.replies { align-items: flex-end; }
#frame .chatcontent .messages ul li p {
  display: inline-block; padding: 8px 14px;
  max-width: 65%; font-size: 12.5px; line-height: 1.5; margin: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
#frame .chatcontent .messages ul li.sent p {
  background: var(--surface); color: var(--ink);
  border-radius: 0 8px 8px 8px;
}
#frame .chatcontent .messages ul li.replies p {
  background: var(--accent); color: #fff;
  border-radius: 8px 0 8px 8px;
}

/* Message input bar (sticky bottom) */
#frame .chatcontent .message-input {
  position: absolute; bottom: 0; left: 0; right: 0;
  z-index: 1; padding: 8px 12px;
  background: var(--surface); border-top: 1px solid var(--border);
}
#frame .chatcontent .message-input .wrap {
  position: relative; border-radius: 24px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center;
}
#frame .chatcontent .message-input .wrap input {
  border: none; background: transparent; width: 100%;
  padding: 10px 50px 10px 18px; color: var(--ink);
  border-radius: 24px; font-size: 13px;
}
#frame .chatcontent .message-input .wrap input:focus { outline: none; box-shadow: none; }
#frame .chatcontent .message-input .wrap button {
  border: none; width: 34px; height: 34px;
  cursor: pointer; background: var(--accent); color: #fff;
  position: absolute; right: 4px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#frame .chatcontent .message-input .wrap button:hover {
  background: color-mix(in srgb, var(--accent) 80%, #000);
}
#frame .chatcontent .message-input .wrap button:focus { outline: none; }
#frame .input_submit:disabled,
#frame .input_submit.disabled { background: var(--border) !important; cursor: not-allowed; }

/* Loading overlay */
.chatloader {
  width: 100%; height: 100%; text-align: center;
  position: absolute; inset: 0;
  background: rgba(0,0,0,.18); z-index: 9; display: none;
}
.chatloader:before {
  content: ""; position: absolute;
  left: 50%; top: 50%;
  margin: -20px 0 0 -20px;
  width: 40px; height: 40px;
  border: 4px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: chatSpin .7s linear infinite;
}
@keyframes chatSpin { to { transform: rotate(360deg); } }

/* Date separator */
.chattitle { display: block; font-size: .9em; text-align: center; margin: 8px 0; position: relative; }
.chattitle span {
  display: inline-block; border-radius: 20px;
  background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.08);
  padding: 4px 12px; position: relative; z-index: 1;
  color: var(--ink-2); font-size: 11px;
}
.chattitle:after {
  content: ""; position: absolute; left: 0; right: 0;
  margin: 0 auto; height: 1px;
  background: var(--border); top: 50%; width: 80%;
}

/* Add-contact modal search results */
/* The search input is wrapped in a stray .col-md-12 whose Bootstrap gutter
   padding insets it from the card edge, so it didn't line up with the result
   list. Strip the gutter and pin both to the same full width so the options
   span exactly as wide as the search box. */
#custom-search-input { width: 100%; }
#custom-search-input .input-group { width: 100%; padding-left: 0; padding-right: 0; }
.usersearchlist { width: 100%; }
#contact-list { height: 340px; overflow: auto; width: 100%; padding-left: 0; margin: 0; }
#contact-list li { margin-top: 5px; line-height: normal; }
#contact-list li img {
  border-radius: 50%; width: 40px; height: 40px;
  object-fit: cover; max-width: 40px;
}
#contact-list .list-group-item:first-child {
  border-top-left-radius: 0; border-top-right-radius: 0;
}
#contact-list .list-group-item {
  padding: 6px 10px; display: flex; align-items: center; gap: 10px; cursor: pointer;
  /* Bootstrap's --bs-list-group-bg stays #fff and isn't theme-aware → white box
     with washed-out text on dark presets. Anchor the resting state to tokens. */
  background: var(--surface); color: var(--ink); border-color: var(--border);
}
#contact-list .list-group-item:hover { background: var(--rowhover); }
#contact-list .list-group-item .name { color: var(--ink); }
#contact-list .list-group-item .text-muted { color: var(--muted) !important; }
#contact-list .list-group-item.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}
#contact-list .list-group-item.active .name { color: var(--accent); font-weight: 600; }
#contact-list .list-group-item img {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
#contact-list .list-group-item .col-2,
#contact-list .list-group-item .col-sm-1 { flex-shrink: 0; width: auto; padding: 0; }
#contact-list .list-group-item .col-10,
#contact-list .list-group-item .col-sm-9 { flex: 1; min-width: 0; padding: 0; }
/* â”€â”€ End Chat (#frame) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* â”€â”€ System Notifications (admin/systemnotification) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* Circular icon badge in "Type" column */
.bellcircle {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); text-align: center;
  color: #fff; font-size: 16px; line-height: 40px;
  flex-shrink: 0;
}

/* Header label row (Type / Subject / Date) */
.notigybg {
  display: flex; align-items: center;
  padding: 8px 12px;
  background: var(--surface-2);
  font-weight: 700; font-size: 11.5px;
  color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 2px solid var(--border);
}

/* Column widths â€” shared between header and each row */
.notifyleft  { width: 60px; flex-shrink: 0; }
.notifymiddle { flex: 1; min-width: 0; padding-right: 10px; }
.notifyright { width: 190px; flex-shrink: 0; font-size: 12.5px; color: var(--ink-2); }
.noteangle   { width: 36px; flex-shrink: 0; text-align: center;
               font-size: 16px; color: var(--ink-2); }

/* Each notification row (clickable header) */
.accordianheader {
  display: flex; align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--border-light);
  cursor: pointer; position: relative;
  transition: background .12s;
  outline: 0;
}
.unreadbg { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.readbg   { background: var(--surface); }
.accordianheader:hover,
.accordianheader:focus { background: var(--hover); }

/* Subject / Date text inside rows */
.noteDM10 { font-size: 13px; color: var(--ink); line-height: 1.4; }

/* Expanded description body */
.accordianbody {
  background: var(--surface-2);
  border-top: 1px solid var(--border-light);
  display: none;
}
.note-content {
  padding: 10px 12px 12px calc(60px + 12px); /* indent aligns with subject column */
  font-size: 13px; color: var(--ink); line-height: 1.6;
}

/* Responsive: tighten columns on small screens */
@media (max-width: 767px) {
  .notifyleft  { width: 50px; }
  .notifyright { width: 110px; font-size: 11px; }
  .note-content { padding-left: 62px; }
  .noteDM10 { font-size: 12px; }
}

/* ============================================================
   BILLING PAGE  Â·  bill/index + _patient_details + _opd/_ipd_charges
   ============================================================ */

/* â”€â”€ Patient panel â”€â”€ */
.bill-patient-panel {
  padding: 8px 20px 8px;
  background: color-mix(in srgb, var(--surface-2) 33%, var(--surface));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Avatar */
.bill-patient-photo { width: 100px; flex-shrink: 0; }
.bill-patient-avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  display: block;
  margin: 0 auto;
}
.bill-patient-initials {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 1px;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}

/* Gender badge */
.bill-gender-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 20px;
}
.bill-badge-blue  { background: var(--blue-soft);   color: var(--blue); }
.bill-badge-pink  { background: var(--purple-soft);  color: var(--purple); }

/* Bill summary button */
.bill-btn-summary {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: var(--radius-md);
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.bill-btn-summary:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Info grid â€” CSS Grid, auto-fill 4 cols */
.bill-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 0;
}
.bii {
  padding: 5px 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.bii:nth-child(4n) { border-right: none; }
.bii-wide { grid-column: span 2; }
/* Drop the bottom border on the last grid row so no stray divider shows
   under the final cells (e.g. barcode/QR) above the panel edge. */
@media (min-width: 768px) {
  .bill-info-grid .bii:nth-last-child(-n+4):nth-child(4n+1),
  .bill-info-grid .bii:nth-last-child(-n+4):nth-child(4n+1) ~ .bii {
    border-bottom: none;
  }
}
.bii-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 3px;
  white-space: nowrap;
}
.bii-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.bii-accent { color: var(--accent); }

/* Patient detail modal (search page #myModal): keep the header-card blocks all
   EQUAL height but force them shorter. A fixed grid-auto-rows pins every row to
   the same small height (independent of the tallest content); the barcode/QR
   images are then shrunk so they fit inside that reduced track. */
#myModal .bill-info-grid { grid-auto-rows: minmax(52px, auto); }
#myModal .bii { padding: 6px 12px; }
#myModal .bii-label { margin-bottom: 2px; }
#myModal .bii-value { line-height: 1.2; }
#myModal #getqrcode { width: 32px; height: 32px; }
#myModal #getbarcode { height: 26px; width: auto; }
/* Custom fields are injected into #field_data; display:contents lets each
   rendered .bii cell flow into the grid like the built-in labels above. */
#myModal #field_data { display: contents; }

/* â”€â”€ Charges table â”€â”€ */
.bill-charges-table { margin-bottom: 0; font-size: 13px; }
.bill-charges-table thead th {
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  border-bottom: 2px solid var(--border) !important;
  border-top: none !important;
  padding: 10px 12px;
  white-space: nowrap;
}
.bill-charges-table tbody td {
  vertical-align: middle;
  padding: 10px 12px;
  border-color: var(--border);
}
.bill-charges-table tbody tr:hover td { background: var(--rowhover); }

/* Total footer row */
.bill-total-row td {
  background: var(--surface-2) !important;
  border-top: 2px solid var(--border) !important;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink-2);
}
.bill-total-row .fw-bold { font-size: 15px; color: var(--ink); }

/* Empty state */
.bill-empty-state {
  color: var(--muted);
  font-size: 13px;
}
.bill-empty-icon {
  font-size: 28px;
  color: var(--border-strong);
  display: block;
}

.atm-readonly-input {
                    border: none !important;
                    background: transparent !important;
                    box-shadow: none !important;
                    outline: none !important;
                    padding: 2px 4px;
                    font-weight: 600;
                    color: var(--ink);
                    cursor: default;
                }
.atm-readonly-input:focus { box-shadow: none !important; outline: none !important; }
.atm-readonly-input[readonly] { background: transparent !important; }

.req{
  color: var(--red); 
}

/* Tab content padding */
.nav-tabs-custom .tab-content { padding: 16px 0 0; }

/* Responsive: collapse info grid to 2 cols on small screens */
@media (max-width: 767px) {
  .bill-info-grid { grid-template-columns: repeat(2, 1fr); }
  .bii:nth-child(4n) { border-right: 1px solid var(--border); }
  .bii:nth-child(2n) { border-right: none; }
  /* last-row bottom border removal, recalculated for the 2-col layout */
  .bill-info-grid .bii:nth-last-child(-n+2):nth-child(2n+1),
  .bill-info-grid .bii:nth-last-child(-n+2):nth-child(2n+1) ~ .bii {
    border-bottom: none;
  }
  .bill-patient-panel { padding: 12px; }
  .bill-patient-photo { width: 80px; }
  .bill-patient-avatar { width: 68px; height: 68px; }
  .bill-patient-initials { width: 68px; height: 68px; font-size: 24px; }
}

/* Visits table (OPD profile): force every column to share the panel width
   (table-layout: fixed) so content wraps instead of triggering a horizontal
   scrollbar. The Appointment Date and Action columns are pinned and kept on one
   line so dates never split and the icon buttons stay side-by-side. */
#opdVisitTable { width: 100% !important; table-layout: fixed; }
#opdVisitTable thead tr.white-space-nowrap th,
#opdVisitTable th,
#opdVisitTable td {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}
#opdVisitTable th:nth-child(3),
#opdVisitTable td:nth-child(3) { white-space: nowrap !important; width: 130px; }
#opdVisitTable th:last-child,
#opdVisitTable td:last-child { white-space: nowrap !important; }
/* â”€â”€ End System Notifications â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* ══════════════════════════════════════════════════════════════
   BED STATUS MODAL  (#bedStatusModal)
   ══════════════════════════════════════════════════════════════ */

/* sh-modal sets 1.25rem padding on .modal-body — reset so BSM content fills edge-to-edge */
#bed-status-body { padding: 0; background: transparent; }

/* ── Summary strip ── */
.bsm-summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.bsm-stat {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 5px 14px 5px 7px;
  transition: box-shadow .15s;
}
.bsm-stat:hover { box-shadow: var(--shadow-md); }
.bsm-stat-ic {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0; font-size: 11px;
}
.bsm-stat-ic.total  { background: var(--blue-soft);  color: var(--blue); }
.bsm-stat-ic.avail  { background: var(--green-soft); color: var(--green); }
.bsm-stat-ic.occup  { background: var(--red-soft);   color: var(--red); }
.bsm-stat-ic.unused { background: var(--surface-3);  color: var(--muted); border: 1px solid var(--border); }
.bsm-stat-text { display: flex; flex-direction: column; line-height: 1.15; }
.bsm-count       { font-size: 16px; font-weight: 800; color: var(--ink); font-family: var(--mono); }
.bsm-count-green { color: var(--green); }
.bsm-count-red   { color: var(--red); }
.bsm-label       { font-size: 10.5px; color: var(--muted); font-weight: 500; }

/* Donut ring gauge */
.bsm-gauge { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bsm-gauge-ring-bg   { fill: none; stroke: var(--border-strong); stroke-width: 4; }
.bsm-gauge-ring-fill {
  fill: none; stroke: var(--red); stroke-width: 4; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 50% 50%;
  transition: stroke-dasharray .6s ease;
}
.bsm-gauge-info { display: flex; flex-direction: column; }
.bsm-gauge-pct  { font-size: 19px; font-weight: 800; color: var(--red); font-family: var(--mono); line-height: 1; }
.bsm-gauge-lbl  { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Filter bar ── */
.bsm-filterbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.bsm-search {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 12px;
  flex: 1; min-width: 160px; max-width: 220px;
  transition: border-color .15s;
}
.bsm-search:focus-within { border-color: var(--blue); }
.bsm-search i     { color: var(--faint); font-size: 11px; }
.bsm-search input {
  border: none; background: transparent; outline: none;
  font-size: 12px; color: var(--ink); width: 100%;
}
.bsm-search input::placeholder { color: var(--faint); }
.bsm-fbtns { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
/* Mobile: the 4 filter pills (~348px, nowrap) overflowed the narrow modal and
   clipped the "Unused" pill. Drop the right-push auto-margin and let them wrap
   full-width so every filter stays visible/tappable. */
@media (max-width: 576px) {
  .bsm-fbtns { margin-left: 0; width: 100%; }
}
.bsm-fbtn {
  border: 1px solid var(--border); border-radius: 20px;
  padding: 4px 11px; font-size: 11.5px; font-weight: 600;
  cursor: pointer; background: var(--surface-2); color: var(--muted);
  transition: all .15s; display: inline-flex; align-items: center; gap: 4px;
}
.bsm-fbtn:hover          { background: var(--surface); color: var(--ink); }
.bsm-fbtn.f-all          { background: var(--blue-soft);  color: var(--blue);  border-color: var(--blue); }
.bsm-fbtn.f-avail        { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.bsm-fbtn.f-occup        { background: var(--red-soft);   color: var(--red);   border-color: var(--red); }
.bsm-fbtn.f-unused       { background: var(--surface-3);  color: var(--ink);   border-color: var(--border-strong); }
.bsm-fbtn-badge {
  font-size: 10px; font-weight: 700;
  background: var(--surface-3); color: var(--muted);
  border-radius: 10px; padding: 0 5px; min-width: 16px; text-align: center;
}

/* ── Body ── */
.bsm-body {
  padding: 16px 20px; display: flex; flex-direction: column; gap: 18px;
  background: var(--surface-2);
}

/* Floor header */
.bsm-floor-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--ink);
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 8px;
}
.bsm-floor-title i { color: var(--accent); font-size: 11px; }
.bsm-floor-badge {
  margin-left: auto; font-size: 10px; font-weight: 600;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 20px; padding: 1px 8px;
}

/* Ward cards */
.bsm-wards { display: flex; flex-direction: column; gap: 8px; }
.bsm-ward  {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; background: var(--surface); transition: box-shadow .15s;
}
.bsm-ward:hover { box-shadow: var(--shadow); }
.bsm-ward-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  border-left: 4px solid transparent;
}
.bsm-ward-header i   { font-size: 11px; }
.bsm-ward-name       { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.bsm-ward-pills      { margin-left: auto; display: flex; gap: 5px; align-items: center; }
.bsm-ward-pill {
  font-size: 10.5px; font-weight: 700; border-radius: 20px;
  padding: 1px 8px; display: inline-flex; align-items: center; gap: 3px;
}
.bsm-ward-pill.pa { background: var(--green-soft); color: var(--green); }
.bsm-ward-pill.po { background: var(--red-soft);   color: var(--red); }
.bsm-ward-pill.pt { background: var(--surface-3);  color: var(--muted); border: 1px solid var(--border); }
.bsm-ward-pill i  { font-size: 7px; }

/* Bed grid */
.bsm-beds {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 14px; background: var(--surface);
}

/* Bed tile */
.bsm-bed {
  display: flex; flex-direction: column; align-items: center;
  width: 96px; padding: 10px 6px 8px;
  border-radius: var(--radius-md); border: 1.5px solid;
  text-decoration: none; cursor: pointer; position: relative;
  transition: transform .15s, box-shadow .15s; user-select: none;
}
.bsm-bed:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; }
.bsm-bed i      { font-size: 26px; }
.bsm-bed-no     { font-size: 11.5px; font-weight: 700; margin-top: 5px; color: var(--ink); }
.bsm-patient    {
  font-size: 10.5px; font-weight: 600; margin-top: 4px;
  width: 100%; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.3; min-height: 1.3em;
}
.bsm-available { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.bsm-available .bsm-bed-no  { color: var(--ink); }
.bsm-available .bsm-patient { color: var(--green); }
/* Occupied: keep red as the meaning, but mix the token toward --surface so the
   border/icon read as a soft tint instead of a piercing pure red (Theme Studio
   still re-tints per preset because it's derived from var(--red)). */
.bsm-occupied  {
  border-color: color-mix(in srgb, var(--red) 38%, var(--surface));
  background: var(--red-soft);
  color: color-mix(in srgb, var(--red) 68%, var(--surface));
}
.bsm-occupied .bsm-bed-no   { color: var(--ink); }
.bsm-occupied .bsm-patient  { color: color-mix(in srgb, var(--red) 78%, var(--ink)); font-weight: 700; }
.bsm-unused    { border-color: var(--border); background: var(--surface-2); color: var(--muted); }
.bsm-unused .bsm-bed-no     { color: var(--muted); }
.bsm-available:hover { color: var(--green); }
.bsm-occupied:hover  { color: color-mix(in srgb, var(--red) 85%, var(--surface)); }
.bsm-bed::after {
  content: ''; position: absolute; top: 5px; right: 5px;
  width: 6px; height: 6px; border-radius: 50%;
}
.bsm-available::after { background: var(--green); }
.bsm-occupied::after  { background: var(--red); }
.bsm-unused::after    { background: var(--muted); opacity: .35; }

/* ── Legend footer ── */
.bsm-legend {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 9px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.bsm-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.bsm-legend-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bsm-legend-dot.la { background: var(--green); }
.bsm-legend-dot.lo { background: var(--red); }
.bsm-legend-dot.lu { background: var(--muted); opacity: .45; }
.bsm-legend-tip    { font-size: 11px; color: var(--faint); margin-left: auto; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   SH MODAL DESIGN SYSTEM  (2026-04-15)
   4-tier modal with theme-aware gradient headers.
   See Wfdocs/modal-samples.html for the reference mockup.
â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Shared content shell used by all sh-modal-* variants */
.sh-modal .modal-content {
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
  background: var(--surface, #fff);
  color: var(--ink, #212529);
}
.sh-modal .modal-header::before { content: none; }  /* kill global 4px accent bar for all sh-modal variants */
.sh-modal .modal-body  { padding: 16px 20px !important; background: var(--surface-2, #f8fafc); color: var(--ink, #212529); }

.sh-modal .modal-footer {
  border-top: 1px solid var(--border, #e2e8f0);
  padding: .5rem 1rem;
  background: var(--surface-2, #f8fafc);
}
.sh-modal .modal-header .icon-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sh-modal .modal-title,
.sh-modal .modal-header h4,
.sh-modal .modal-header h5 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
  border: none;
  border-bottom: none;
  padding: 0;
}

/* â”€â”€ sh-modal: form controls (match mockup reference) â”€â”€ */
.sh-modal .modal-body .form-label {
  font-size: .875rem;   /* 14px */
  font-weight: 600;
  color: var(--ink, #0f172a);
  margin-bottom: 4px;
}
.sh-modal .modal-body .form-label .req { color: #ef4444; }
.sh-modal .modal-body .form-control,
.sh-modal .modal-body .form-select {
  font-size: .8125rem;
  border-radius: 3px;
  border-color: var(--border, #e2e8f0);
  padding: .4375rem .75rem;
  background-color: var(--surface-2, #f8fafc);
  color: var(--ink, #212529);
}
.sh-modal .modal-body .input-group-text {
  background-color: var(--surface-3, #eef2f7);
  border-color: var(--border, #e2e8f0);
  color: var(--ink-2, #35404a);
}
.sh-modal .modal-body .form-control:focus,
.sh-modal .modal-body .form-select:focus {
  border-color: var(--link, #1B73E8);
  box-shadow: 0 0 0 3px rgba(27, 115, 232, .12);
  background-color: var(--surface, #fff);
}
.sh-modal .modal-body textarea.form-control { min-height: 60px; }

/* â”€â”€ sh-modal: keyboard tab / focus-visible â”€â”€ */
.sh-modal .modal-body .form-control:focus-visible,
.sh-modal .modal-body .form-select:focus-visible {
  outline: 2px solid var(--link, #1B73E8);
  outline-offset: 1px;
}
.sh-modal .btn-close:focus-visible {
  outline: 2px solid var(--link, #1B73E8);
  outline-offset: 2px;
  box-shadow: none;
}
.sh-modal .btn:focus-visible {
  outline: 2px solid var(--link, #1B73E8);
  outline-offset: 2px;
  box-shadow: none;
}
.sh-modal a:focus-visible {
  outline: 2px solid var(--link, #1B73E8);
  outline-offset: 2px;
}

/* â”€â”€â”€â”€â”€ Style A  Â·  Full Page Modal â”€â”€â”€â”€â”€ */
/* override AdminLTE legacy .modal{overflow-y:scroll} so modal-body handles scroll */
/* top:52px + bottom:0 keeps the global topbar visible behind the backdrop instead of being covered by the dialog */
.sh-modal-fullpage {
  overflow: hidden !important;
  padding: 0 !important;
  top: 52px !important;
  bottom: 0 !important;
  height: auto !important;
}
.sh-modal-fullpage .modal-dialog {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  height: 100%;
}
.sh-modal-fullpage .modal-content {
  border-radius: 0;
  height: 100%;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}
/* form wraps body+footer inside fullpage â€” must also flex */
.sh-modal-fullpage .modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
/* Two selectors needed: the second targets form-wrapped modals to beat the
   global .modal-content form > .modal-body { overflow: visible !important }
   hack at line 2065 (which has higher specificity than .sh-modal-fullpage .modal-body). */
.sh-modal-fullpage .modal-body,
.sh-modal-fullpage .modal-content > form > .modal-body {
  flex: 1;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  min-height: 0;
}
/* when pup-scroll-area wraps the body, it must be the flex-grow container */
.sh-modal-fullpage .pup-scroll-area {
  flex: 1;
  min-height: 0;
  max-height: none !important;
  overflow-y: auto;
  overflow-x: hidden;
}
/* modal-body inside pup-scroll-area must not double-scroll */
.sh-modal-fullpage .pup-scroll-area .modal-body {
  overflow-y: visible !important;
  overflow-x: visible !important;
}
.sh-modal-fullpage.sh-modal-auto-height .modal-dialog,
.sh-modal-fullpage.sh-modal-auto-height .modal-content {
  height: auto;
  overflow: visible;
}
.sh-modal-fullpage .modal-footer {
  flex-shrink: 0;
}
.sh-modal-fullpage .modal-header {
  background: var(--accent);
  color: var(--accent-ink, #fff);
  padding: .875rem 1.25rem;
  border-bottom: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-radius: var(--radius-lg, 16px) var(--radius-lg, 16px) 0 0;
}
.sh-modal-fullpage .modal-header .icon-badge {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .18);
  font-size: 1.1rem;
  color: #fff;
}
.sh-modal-fullpage .modal-header .modal-title,
.sh-modal-fullpage .modal-header .modal-subtitle { color: #fff; }
.sh-modal-fullpage .modal-header .form-control,
.sh-modal-fullpage .modal-header .form-select,
.sh-modal-fullpage .modal-header .input-group-text {
  background: rgba(255, 255, 255, .95);
  border: 0;
  color: var(--ink, #0f172a);
  height: 40px;
}
.sh-modal-fullpage .modal-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: .9;
  margin-left: auto;
}
.sh-modal-fullpage .modal-header .btn-close:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, .15);
}
.sh-modal-fullpage .modal-header .select2-container--default .select2-selection--single {
  border: 0 !important;
  background: rgba(255,255,255,.95);
  height: 40px;
}
.sh-modal-fullpage .modal-header .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 40px;
  color: var(--ink, #0f172a);
}
.sh-modal-fullpage .modal-header .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px;
}

/* â”€â”€â”€â”€â”€ Style B  Â·  Large Branded Modal â”€â”€â”€â”€â”€ */
.sh-modal-branded .modal-content { border-radius: var(--radius-lg) !important; }
.sh-modal-branded .modal-header {
  background: var(--accent);
  color: var(--accent-ink, #fff);
  border-bottom: 0;
  padding: .875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sh-modal-branded .modal-header .icon-badge {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
  font-size: 1.25rem;
  color: #fff;
}
.sh-modal-branded .modal-header .modal-title,
.sh-modal-branded .modal-header .modal-subtitle { color: #fff !important; }
.sh-modal-branded .modal-header .modal-title { font-size: 1.125rem; }
.sh-modal-branded .modal-header .modal-subtitle { font-size: .8125rem; opacity: .88; }
/* header action buttons â€” white ghost style on blue bg */
.sh-modal-fullpage .modal-header .btn.btn-sm.btn-light,
.sh-modal-branded .modal-header .btn.btn-sm.btn-light,
.sh-modal-accent .modal-header .btn.btn-sm.btn-light,
.sh-modal-nospace .modal-header .btn.btn-sm.btn-light {
  --bs-btn-bg: rgba(255,255,255,.18);
  --bs-btn-border-color: rgba(255,255,255,.35);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: rgba(255,255,255,.3);
  --bs-btn-hover-border-color: rgba(255,255,255,.5);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: rgba(255,255,255,.4);
  --bs-btn-active-color: #fff;
  background: rgba(255,255,255,.18) !important;
  border-color: rgba(255,255,255,.35) !important;
  color: #fff !important;
}
.sh-modal-fullpage .modal-header .btn.btn-sm.btn-light:hover,
.sh-modal-branded .modal-header .btn.btn-sm.btn-light:hover,
.sh-modal-accent .modal-header .btn.btn-sm.btn-light:hover,
.sh-modal-nospace .modal-header .btn.btn-sm.btn-light:hover {
  background: rgba(255,255,255,.3) !important;
  color: #fff !important;
}
/* New Patient button — match the header field height (~37px) so it aligns
   with the Select Patient / Prescription No inputs. Applies to every bill
   modal that uses .modalbtnpatient (pharmacy bill, blood issue, component
   issue, appointment). Overrides the legacy 28px height in style-main.css. */
.modalbtnpatient.btn {
  height: 37px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  gap: .375rem;
  /* keep the label on one line and never let the flex row squeeze the button —
     the adjacent patient select yields space instead of "New Patient" wrapping */
  white-space: nowrap;
  flex-shrink: 0;
  padding-left: .625rem;
  padding-right: .625rem;
  /* release the legacy 116px cap (style-main.css .modalbtnpatient) that clipped
     the "New Patient" label and made it overflow into the close button */
  max-width: none !important;
  width: auto;
}
/* gap owns the icon→label spacing now; neutralize the legacy 5px span padding
   (style-main.css) so span-wrapped labels aren't double-spaced. Label is
   semibold for readability at a compact size. */
.modalbtnpatient.btn span {
  padding-left: 0;
  font-size: 0.875rem;
  font-weight: 700;
}
/* ─── New Patient CTA · GLOBAL design for every bill/appointment modal ───────
   ONE source of truth for the "New Patient" button, covering BOTH markup
   styles found across the app:
     (a) the dedicated class  a.sh-newpatient-btn               (bill/appointment)
     (b) the standard ghost markup  a.modalbtnpatient.btn.btn-sm.btn-light
         inside any colored modal header (appointment/index, ambulance_call,
         bloodbank, radiology, …)
   For (b) the selector is intentionally (0,6,1) so it BEATS the faint header
   "ghost" override .sh-modal-* .modal-header .btn.btn-sm.btn-light (0,5,0).
   Design: solid pill one shade BRIGHTER than the accent header (theme-adaptive
   white overlay), white label/icon, Theme-Studio corner radius. Touch this
   block to restyle the New Patient button everywhere — no per-view edits. */
a.sh-newpatient-btn,
a.sh-newpatient-btn:link,
a.sh-newpatient-btn:visited,
.sh-modal-accent .modal-header a.modalbtnpatient.btn.btn-sm.btn-light,
.sh-modal-branded .modal-header a.modalbtnpatient.btn.btn-sm.btn-light,
.sh-modal-nospace .modal-header a.modalbtnpatient.btn.btn-sm.btn-light,
.sh-modal-fullpage .modal-header a.modalbtnpatient.btn.btn-sm.btn-light {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  height: 37px;
  padding: 0 .9rem !important;
  max-width: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  /* solid pill one shade BRIGHTER than the accent header — theme-adaptive:
     the translucent-white overlay lightens whatever accent Theme Studio sets */
  background: rgba(255,255,255,.16) !important;
  border: 1px solid rgba(255,255,255,.45) !important;
  /* follow the Theme Studio corner token like every other .btn (sh-theme.css:1154)
     instead of a hardcoded radius — stays in sync when the user changes corners */
  border-radius: var(--radius) !important;
  color: #fff !important;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none !important;
  box-shadow: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
a.sh-newpatient-btn i,
.sh-modal-accent .modal-header a.modalbtnpatient.btn.btn-sm.btn-light i,
.sh-modal-branded .modal-header a.modalbtnpatient.btn.btn-sm.btn-light i,
.sh-modal-nospace .modal-header a.modalbtnpatient.btn.btn-sm.btn-light i,
.sh-modal-fullpage .modal-header a.modalbtnpatient.btn.btn-sm.btn-light i {
  color: #fff !important;
  padding: 0 !important;
  font-size: .8125rem;
}
a.sh-newpatient-btn span,
.sh-modal-accent .modal-header a.modalbtnpatient.btn.btn-sm.btn-light span,
.sh-modal-branded .modal-header a.modalbtnpatient.btn.btn-sm.btn-light span,
.sh-modal-nospace .modal-header a.modalbtnpatient.btn.btn-sm.btn-light span,
.sh-modal-fullpage .modal-header a.modalbtnpatient.btn.btn-sm.btn-light span {
  padding: 0 !important;
  color: #fff !important;
}
a.sh-newpatient-btn:hover,
a.sh-newpatient-btn:focus,
.sh-modal-accent .modal-header a.modalbtnpatient.btn.btn-sm.btn-light:hover,
.sh-modal-branded .modal-header a.modalbtnpatient.btn.btn-sm.btn-light:hover,
.sh-modal-nospace .modal-header a.modalbtnpatient.btn.btn-sm.btn-light:hover,
.sh-modal-fullpage .modal-header a.modalbtnpatient.btn.btn-sm.btn-light:hover,
.sh-modal-accent .modal-header a.modalbtnpatient.btn.btn-sm.btn-light:focus,
.sh-modal-branded .modal-header a.modalbtnpatient.btn.btn-sm.btn-light:focus,
.sh-modal-nospace .modal-header a.modalbtnpatient.btn.btn-sm.btn-light:focus,
.sh-modal-fullpage .modal-header a.modalbtnpatient.btn.btn-sm.btn-light:focus {
  background: rgba(255,255,255,.26) !important;
  border-color: rgba(255,255,255,.6) !important;
  color: #fff !important;
}
a.sh-newpatient-btn:active,
.sh-modal-accent .modal-header a.modalbtnpatient.btn.btn-sm.btn-light:active,
.sh-modal-branded .modal-header a.modalbtnpatient.btn.btn-sm.btn-light:active,
.sh-modal-nospace .modal-header a.modalbtnpatient.btn.btn-sm.btn-light:active,
.sh-modal-fullpage .modal-header a.modalbtnpatient.btn.btn-sm.btn-light:active {
  transform: translateY(1px);
}
/* Patient-select (select2) in any bill/issue/consult modal header — match the
   37px field height so the patient pick, New Patient button and adjacent input
   are all the same height. Keyed on .patient_list_ajax (the common class on
   every patient picker) scoped to .modal-header, so it covers ALL modules
   including the headers that use sh-maxw-220 / sh-sr-patient-pick / no width
   class at all (OPD, appointment, conference, sale return, etc.). select2
   inserts its container as the immediate sibling of the original <select>. */
.modal-header .patient_list_ajax + .select2-container .select2-selection--single { height: 37px !important; }
.modal-header .patient_list_ajax + .select2-container .select2-selection__rendered { line-height: 37px; }
.modal-header .patient_list_ajax + .select2-container .select2-selection__arrow { height: 37px; }
.sh-modal-branded .modal-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: .85;
  margin-left: auto;
}
.sh-modal-branded .modal-header .btn-close:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, .15);
}
.sh-modal-branded .modal-body { padding: 1.25rem; }

/* â”€â”€â”€â”€â”€ Style C  Â·  Medium Gradient Modal  (default for add/edit) â”€â”€â”€â”€â”€ */
.sh-modal-accent .modal-header {
  background: var(--accent);
  color: var(--accent-ink, #fff);
  border-bottom: 0 !important;
  padding: .875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sh-modal-accent .modal-header h5,
.sh-modal-accent .modal-title {
  font-size: 1.125rem; font-weight: 600;
  color: #fff !important; margin: 0; line-height: 1.3;
  letter-spacing: 0;
  border: none; border-bottom: none;
  padding: 0; padding-bottom: 0;
}
.sh-modal-accent .modal-title i {
  opacity: .85;
}
.sh-modal-accent .modal-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: .85;
  margin-left: auto;
  background-color: transparent;
}
.sh-modal-accent .modal-header .btn-close:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, .15);
}

/* â”€â”€â”€â”€â”€ Style D  Â·  Small Confirm Dialog â”€â”€â”€â”€â”€ */
.sh-modal-confirm .modal-content { border-radius: var(--radius-lg) !important; }
.sh-modal-confirm .modal-header {
  background: var(--accent);
  color: var(--accent-ink, #fff);
  border: 0;
  padding: .875rem 1.25rem;
  justify-content: flex-end;
}
.sh-modal-confirm .modal-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: .85;
  background-color: transparent;
}
.sh-modal-confirm .modal-header .btn-close:hover {
  opacity: 1;
  background-color: rgba(255,255,255,.15);
}
.sh-modal-confirm .modal-body {
  text-align: center;
  padding: 0 1.75rem 1.5rem;
}
.sh-modal-confirm .confirm-icon-wrap {
  width: 72px; height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--blue-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--link);
  font-size: 1.75rem;
  position: relative;
}
.sh-modal-confirm .confirm-icon-wrap::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed var(--link);
  opacity: .3;
}
.sh-modal-confirm h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 .5rem;
}
.sh-modal-confirm p {
  font-size: .875rem;
  color: var(--muted, #64748b);
  margin: 0 0 1.25rem;
}
.sh-modal-confirm .modal-footer {
  border-top: 1px solid var(--border, #e2e8f0);
  background: var(--surface-2, #f8fafc);
  padding: .5rem 1rem;
  justify-content: center;
  gap: .5rem;
}

/* â”€â”€ Compose: autocomplete suggestion dropdown â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#suggesstion-box {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 1055;
  display: none;
}
.selector-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
}
.selector-list li {
  padding: 0;
  list-style: none;
}
.selector-list li.ui-menu-item {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.selector-list li.ui-menu-item:hover {
  background: var(--surface-2);
  color: var(--link);
}

/* â”€â”€ Share modal â€” individual tab â”€â”€ */
.category-select-btn {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.individual-list-container {
  max-height: 200px;
  overflow-y: auto;
}

/* â”€â”€ viewModel fullscreen content viewer â”€â”€ */
#viewModel {
  padding: 0 !important;
  background: #000 !important;
}
#viewModel .modal-dialog {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
}
#viewModel .modal-content {
  height: 100% !important;
  border-radius: 0 !important;
  background: #000 !important;
  border: 0 !important;
}
#viewModel .modal-header {
  background: #000 !important;
  border-bottom: none !important;
  padding: 12px 16px !important;
  min-height: 48px;
}
#viewModel .modal-header a,
#viewModel .modal-header .model_file_name {
  color: #fff !important;
  text-decoration: none;
}
#viewModel .vm-back-btn {
  font-size: 1.1rem;
}
#viewModel .model_file_name {
  font-size: .95rem;
}
#viewModel .pdfdownload-icon {
  color: #fff !important;
  font-size: 1.1rem;
}
#viewModel .modal-body {
  background: #000 !important;
  padding: 16px !important;
}

/* â•â• Cross-variant: Bootstrap Tooltips â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   BS5 tooltip has dark bg by default â€” invisible in dark theme.
   Use --ink / --surface so contrast is always correct in all 3 variants.     */
.tooltip .tooltip-inner {
  background-color: var(--ink);
  color: var(--surface);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 6px;
}
.tooltip.bs-tooltip-top    .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="top"]    .tooltip-arrow::before { border-top-color:    var(--ink) !important; }
.tooltip.bs-tooltip-bottom .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before { border-bottom-color: var(--ink) !important; }
.tooltip.bs-tooltip-start  .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="left"]   .tooltip-arrow::before { border-left-color:   var(--ink) !important; }
.tooltip.bs-tooltip-end    .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="right"]  .tooltip-arrow::before { border-right-color:  var(--ink) !important; }

/* â•â• Cross-variant: Barcode / QR images in patient info â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   QR codes are black-on-white images â€” add white bg so they stay legible in
   dark theme without inverting the image.                                     */
.patient-id-img {
  background: #fff;
  padding: 3px;
  border-radius: 4px;
}

/* Patient profile image in OPD modal */
.modal-profile-user-img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.modal-profile-user-initials { width:90px; height:90px; border-radius:6px; border:1px solid var(--border); background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:32px; letter-spacing:2px; line-height:1; text-transform:uppercase; user-select:none; }

/* â”€â”€ Zoom Consult: host/client video radio group â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sh-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 5px;
  display: block;
}
.sh-radio-group {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 2px 0 4px;
}
.sh-radio-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 400;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  user-select: none;
}
.sh-radio-option input[type="radio"] {
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  vertical-align: middle;
  display: inline-block;
  accent-color: var(--accent);
}

/* â”€â”€ Segmented status selector (connected pill) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   iOS-style joined control for leave-request approve / add modals. The native
   radio is kept (visually hidden, NOT display:none) so index-based JS .checked
   and form serialize keep working; the <label> is the clickable segment.
   Selected segment is uniform amber (matches the reference None/%/Fix control).
   Border/divider/track use color-mix on --ink (with rgba fallback) so the bar
   stays visible on every Theme Studio preset, brown/dark included. */
.sh-seg-status {
  display: flex;
  align-items: stretch;
  width: 100%;
  flex-wrap: nowrap;
  border: 1px solid rgba(140,140,140,.5);
  border: 1px solid color-mix(in srgb, var(--ink) 24%, transparent);
  border-radius: 8px;
  overflow: hidden;
  /* track is transparent — the recessed look now lives on each inactive segment
     (see .sh-seg-opt below) so a sub-pixel height gap can never expose a darker
     layer along the bottom edge. Do NOT re-add a container background here. */
  background: transparent;
}
.sh-seg-status .sh-seg-opt {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--ink-2);
  /* recessed "track" overlay carried by the segment itself — reads correctly on
     light AND dark/brown themes; the active segment overrides this with amber */
  background: rgba(0,0,0,.08);
  cursor: pointer;
  user-select: none;
  border-left: 1px solid rgba(140,140,140,.42);
  /* slim bar to match reference None/%/Fix control (was 10px 12px) */
  border-left: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  transition: background .15s ease, color .15s ease;
}
.sh-seg-status .sh-seg-opt:first-child { border-left: none; }
.sh-seg-status .sh-seg-opt i { font-size: 11px; opacity: .9; }
/* hide native radio but keep it operable + serialisable */
.sh-seg-status .sh-seg-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}
.sh-seg-status .sh-seg-opt:not(:has(input:checked)):hover {
  background: rgba(0,0,0,.14);
  color: var(--ink);
}
/* selected segment â€” uniform amber fill (matches reference segmented control) */
.sh-seg-status .sh-seg-opt:has(input:checked) { background: var(--amber); color: #4a3300; font-weight: 600; }
/* Dividers stay visible on every segment (incl. the ones touching amber) so each
   button is crisply bounded — without this, the active amber and its self-filled
   grey neighbour merge into one block and the amber looks like it under-fills.
   Do NOT make these borders transparent again. */

/* â”€â”€ Zoom Consult modal: patient details + two-panel layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#modal-online-timetable #patientDetails { margin: 0; }
#modal-online-timetable #patientDetails .singlelist24bold span { font-size: 19px; font-weight: 700; color: var(--ink); }
#modal-online-timetable #patientDetails .singlelist,
#modal-online-timetable #patientDetails .multilinelist { margin: 0; padding: 0; list-style: none; }
#modal-online-timetable #patientDetails .singlelist li,
#modal-online-timetable #patientDetails .multilinelist li { display: flex; align-items: center; gap: 9px; padding: 3px 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
#modal-online-timetable #patientDetails .singlelist li i,
#modal-online-timetable #patientDetails .multilinelist li i { color: var(--faint); font-size: 13px; width: 16px; text-align: center; flex-shrink: 0; }
#modal-online-timetable #patientDetails .multilinelist { display: flex; flex-direction: row; flex-wrap: wrap; gap: 0 18px; padding: 2px 0 6px; }
#modal-online-timetable #patientDetails .pd-info-label { font-weight: 600; color: var(--muted); font-size: 12px; margin-right: 2px; }
#modal-online-timetable #patientDetails .modal-profile-user-img { width: 90px !important; height: 90px !important; object-fit: cover; border-radius: 6px !important; border: 1px solid #e5e7eb; }
#modal-online-timetable #patientDetails .modal-profile-user-initials { border-color: #e5e7eb; }
#modal-online-timetable .modal-body { padding: .5rem; }
#modal-online-timetable .ot-left-panel { padding: 0; border-radius: 0 0 0 12px; display: flex; flex-direction: column; }
#modal-online-timetable .ot-left-panel + div { padding: 0 0 0 5px; display: flex; flex-direction: column; }
#modal-online-timetable .ot-left-panel .sh-form-card,
#modal-online-timetable .ot-left-panel + div .sh-form-card { flex: 1; min-height: 0; margin: 0; overflow-y: auto; overflow-x: hidden; }
#modal-online-timetable .ot-left-panel + div label:not(.sh-radio-option) { font-size: 12px; font-weight: 400; color: var(--ink-2); display: block; margin-bottom: 3px; }
#modal-online-timetable .ot-left-panel + div .form-control { font-size: 13px; border-color: var(--border); border-radius: 3px; height: 34px; padding: 5px 10px; color: var(--ink); }
#modal-online-timetable .ot-left-panel + div textarea.form-control { height: auto; }
#modal-online-timetable .ot-left-panel + div select.form-control { height: 34px; }
#modal-online-timetable .ot-left-panel + div .mb-3 { margin-bottom: 10px !important; }
#modal-online-timetable .ot-left-panel + div small.req { color: #e74c3c; }
body.variant-b #modal-online-timetable #patientDetails .modal-profile-user-img { border-color: var(--border); }
body.variant-b #modal-online-timetable #patientDetails .modal-profile-user-initials { border-color: var(--border); }

/* â”€â”€ Meeting modal: staff list panel â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.meeting-staff-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db #f9fafb;
}
.meeting-staff-list::-webkit-scrollbar { width: 4px; }
.meeting-staff-list::-webkit-scrollbar-track { background: #f9fafb; border-radius: 6px; }
.meeting-staff-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 6px; }
.meeting-staff-list::-webkit-scrollbar-thumb:hover { background: var(--muted);
 }
.meeting-staff-item {
  padding: 6px 12px 6px 4px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.meeting-staff-item:last-child { border-bottom: none; }
.meeting-staff-item:hover { background: var(--blue-soft, #f0f4ff); }
.meeting-staff-item .form-check { padding-left: 1.2em; }
.meeting-staff-item .form-check-input { margin-left: -1.2em; }
.meeting-staff-item .form-check-label {
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.meeting-staff-item .form-check-input {
  cursor: pointer;
  accent-color: var(--accent);
}

/* Quantity +/- input-group dropdown (itemstock & similar) */
.sh-qty-toggle {
    min-width: 46px;
    background: var(--surface);
    color: var(--ink);
    border-color: var(--border);
    border-right: 0;
    border-radius: var(--bs-border-radius) 0 0 var(--bs-border-radius) !important;
    font-weight: 700;
    font-size: 15px;
    transition: background 0.15s;
}
.sh-qty-toggle:hover,
.sh-qty-toggle:focus,
.sh-qty-toggle:active,
.show > .sh-qty-toggle {
    background: var(--surface-3) !important;
    color: var(--ink) !important;
    border-color: var(--border) !important;
    box-shadow: none !important;
}
.sh-qty-dropdown {
    min-width: 52px;
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border: 1px solid var(--border);
    background: var(--surface);
}
.sh-qty-dropdown .dropdown-item {
    font-weight: 700;
    font-size: 15px;
    text-align: center;
    padding: 6px 4px !important;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.12s, color 0.12s;
    color: var(--ink);
}
.sh-qty-dropdown .dropdown-item:hover,
.sh-qty-dropdown .dropdown-item:focus {
    background-color: var(--bs-primary);
    color: #fff;
}
.sh-qty-dropdown .dropdown-item.active {
    background-color: var(--bs-primary);
    color: #fff;
}

/* â”€â”€ View-only value display (used in detail/info modals) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sh-view-value {
    font-size: 13px;
    color: var(--ink);
    min-height: 20px;
    padding: 2px 0;
    line-height: 1.5;
}
.sh-view-value:empty::after {
    content: 'â€”';
    color: var(--faint);
}

/* â”€â”€ #leavedetails modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#leavedetails .badge.bg-secondary {
    font-size: 11px;
    font-weight: 500;
    vertical-align: middle;
    background-color: var(--muted) !important;
}

/* -- Payment Settings page ----------------------------------------------- */
.nav-tabs.navlistscroll {
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
    background: var(--surface);
    flex-wrap: nowrap;
    overflow-x: auto;
}
.nav-tabs.navlistscroll > li > a {
    border: none !important;
    color: var(--muted);
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent !important;
    white-space: nowrap;
    display: block;
}
.nav-tabs.navlistscroll > li.active > a,
.nav-tabs.navlistscroll > li > a.active {
    background: transparent !important;
    color: var(--link) !important;
    border-bottom: 2px solid var(--link) !important;
}
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active { display: block; }
.tab-content .card-body button[type="submit"] { display: block; margin: 0 auto; }
.tab-content .card-body .mb-3 {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.tab-content .card-body .mb-3 > .form-label {
    padding-top: 0;
    margin-bottom: 6px;
    text-align: left;
    font-weight: 500;
    color: var(--ink-2);
    padding-right: 0;
}
.tab-content .card-body .mb-3 > [class*="col-"] { padding: 0 8px; }
.tab-content .card-body .mb-3 > .form-label + [class*="col-"] { padding-left: 0; }
.tab-content .card-body .mb-3 label + label {
    display: block;
    font-weight: 400;
    font-size: 12px;
    color: var(--faint);
    margin-top: 6px;
    padding: 0;
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
}
.tab-content .card-body .mb-3 label + label::before { content: "current: "; color: var(--faint); }
.req { color: #dc3545; }
/* payment settings: col-md-12 wrapper acts as a row */
.tab-content .row > .col-md-12 { display: flex; flex-wrap: wrap; gap: 0; }
.tab-content .row > .col-md-12 > .col-md-7 {
    flex: 0 0 58.33333%; max-width: 58.33333%;
    padding-left: 0; padding-right: 20px;
}
.tab-content .row > .col-md-12 > .col-md-5 {
    flex: 0 0 41.66667%; max-width: 41.66667%;
    padding-left: 12px; padding-right: 0;
}
.tab-content .col-md-5.text-center,
.tab-content .col-md-5.disblock {
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 28px 20px;
    text-align: center;
    margin-top: 4px;
}
.tab-content .col-md-5 img { max-width: 180px; max-height: 80px; opacity: .88; }
/* payment form: reset BS3 floated col-* classes inside form fields to stacked layout */
.tab-content .mb-3 { margin-bottom: 16px !important; display: flex; flex-direction: column; align-items: flex-start; }
.tab-content .mb-3 > label.form-label {
    float: none !important; text-align: left !important;
    width: 100% !important; max-width: 100% !important;
    font-size: 11px; font-weight: 700; color: var(--ink-2);
    text-transform: uppercase; letter-spacing: .04em;
    margin-bottom: 6px; padding: 0 !important;
}
.tab-content .mb-3 > div[class*="col-"],
.tab-content .mb-3 > input,
.tab-content .mb-3 > select,
.tab-content .mb-3 > textarea {
    float: none !important; width: 100% !important; max-width: 100% !important;
}
/* zero out gutter padding only on BS3 col-* wrapper divs, not on bare form elements */
.tab-content .mb-3 > div[class*="col-"] {
    padding-left: 0 !important; padding-right: 0 !important;
}
/* inputs inside the col wrapper also carry col-md-7 — force full width */
.tab-content .mb-3 > div[class*="col-"] .form-control,
.tab-content .mb-3 > div[class*="col-"] .form-select {
    width: 100% !important; max-width: 100% !important; float: none !important;
}
/* radio/checkbox group spacing inside payment forms */
.tab-content .mb-3 .form-check.form-check-inline { margin-right: 0; display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.tab-content .mb-3 .form-check.form-check-inline input[type=radio] { margin: 0; flex-shrink: 0; }
.tab-content .mb-3 .row .col-sm-12 + .col-sm-12 { margin-top: 4px; }
.tab-content .card-footer {
    padding: 14px 20px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    margin-top: 12px;
    display: flex !important;
    justify-content: flex-end !important;
}
.tab-content .card-footer > .btn {
    min-width: 110px;
    margin-left: auto;
    float: none;
}
.tab-content .col-md-offset-3 { margin-left: auto !important; }
.tabscroll-wrap { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.tabscroll-wrap .nav-tabs.navlistscroll { scroll-behavior: smooth; }
.tabscroll-btn {
    position: absolute; top: 0; bottom: 1px; width: 34px;
    background: var(--surface-2); border: none; color: var(--muted); font-size: 18px;
    cursor: pointer; z-index: 5; display: none;
    align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.tabscroll-btn:hover { background: #eef0f3; color: #0d6efd; }
.tabscroll-btn.show { display: flex; }
.tabscroll-prev { left: 0; border-right: 1px solid #eef0f3; box-shadow: 6px 0 6px -4px rgba(0,0,0,.06); }
.tabscroll-next { right: 0; border-left: 1px solid #eef0f3; box-shadow: -6px 0 6px -4px rgba(0,0,0,.06); }


/* ============================================================
   Zoom Conference — Info Panel
   ============================================================ */
.zoom-info-panel {
    background: var(--blue-soft);
}
/* --blue-soft is NOT in the nightshift/midnight/oled palette so it stays at
   its light variant-a value (#DCEAFB) — a white panel on a dark surface.
   Use --surface-2 which IS in every dark preset palette. */
body[data-preset="nightshift"] .zoom-info-panel,
body[data-preset="midnight"] .zoom-info-panel,
body[data-preset="oled"] .zoom-info-panel,
body.variant-b .zoom-info-panel {
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.zoom-info-panel .zoom-icon {
    height: 30px;
}
.zoom-info-panel .zoom-url-box {
    background: var(--surface);
}

/* ============================================================
   sh-info-card — token-aware info tile (birth/death modals)
   ============================================================ */
.sh-info-card {
    background: var(--surface-2);
    color: var(--ink);
}
.sh-info-card .sh-info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.sh-info-card .sh-info-value {
    font-weight: 600;
    color: var(--ink);
}


/* ── Bill/Report View Modal — Detail Sections ──────────────────────────────
   Used by: _getPatientPathologyDetails.php, _getBillDetails.php, and any
   module bill/report view modal that follows the same layout pattern.
   ─────────────────────────────────────────────────────────────────────────── */

/* Flat info grid — patient/bill identity rows */
.sh-info-grid   { background: var(--surface-2, #f8f9fa); padding: 10px 16px 4px; }
.sh-info-item   { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px 8px; }
.sh-info-label  { font-size: 0.7rem; color: var(--muted, #6c757d); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.sh-info-value  { font-size: 0.85rem; color: var(--ink, #212529); font-weight: 500; word-break: break-word; }
.sh-info-value.highlight { font-size: 0.92rem; font-weight: 700; color: var(--link, #0d6efd); }
.sh-info-label i { margin-right: 5px; font-size: 0.92em; opacity: .6; width: 12px; text-align: center; }
/* inline variant: label on the left, value (e.g. download action) flush right on one line */
.sh-info-item.sh-info-inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.sh-row-divider { border-top: 1px solid var(--border, #dee2e6); }

/* TPA master details — larger, bolder, higher-contrast labels & values (scoped) */
.tpa-info .sh-info-item   { gap: 5px; padding: 10px 12px; }
.tpa-info .sh-info-label  { font-size: 0.82rem; font-weight: 700; color: var(--ink, #212529); opacity: .85; }
.tpa-info .sh-info-label i { opacity: .75; }
.tpa-info .sh-info-value  { font-size: 1.02rem; font-weight: 700; color: var(--ink, #212529); }
.tpa-info .sh-info-value.highlight { font-size: 1.1rem; color: var(--link, #0d6efd); }

/* Section heading strip — separates info grid from tests table */
.sh-section-hdr {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted, #6c757d);
    padding: 9px 16px 8px;
    background: var(--surface-2, #f8f9fa);
    border-bottom: 1px solid var(--border, #dee2e6);
}

/* viewDetailReportModal — flex column chain so modal-body scrolls independently */
#viewDetailReportModal                { overflow: hidden !important; }
#viewDetailReportModal .modal-content { max-height: calc(100vh - 56px); max-height: calc(100dvh - 56px); display: flex; flex-direction: column; overflow: hidden; }
#viewDetailReportModal .modal-header  { flex-shrink: 0; }
#viewDetailReportModal .modal-footer  { flex-shrink: 0; }
#viewDetailReportModal .modal-body    { flex: 1; overflow-y: auto; min-height: 0; background: var(--surface-3, #EAECF0); padding: 10px; }
#viewDetailReportModal .sh-form-card  { margin: 0; }
.modal-body.modal-background    { flex: 1; overflow-y: auto; min-height: 0; padding: 12px 16px; }

.sh-vd-sum-wrap                       { width: 234px; flex-shrink: 0; }
.sh-vd-sum-wrap .sh-form-card         { display: flex; flex-direction: column; padding-bottom: 0; }
.sh-vd-sum-wrap .sh-form-card .sh-summary-row { flex: 1; }
.sh-vd-sum-wrap .sh-form-card .sh-due-row     { margin-top: auto; }

/* ── addPaymentModal — Card Canvas ── */
#addPaymentModal .modal-body    { flex: 1; overflow-y: auto; min-height: 0; background: var(--surface-3, #EAECF0); padding: 10px; }
#addPaymentModal .sh-form-card  { margin: 0; }
/* Dark-mode: surface-3 body + surface card creates a depth inversion (cards darker than modal bg).
   Fix by elevating cards to surface-2 and strengthening form-control borders for visibility. */
body.variant-b #addPaymentModal .sh-form-card,
body[data-preset="nightshift"] #addPaymentModal .sh-form-card { background: var(--surface-2); border-color: var(--border-strong); }
body.variant-b #addPaymentModal .sh-form-card .form-control,
body.variant-b #addPaymentModal .sh-form-card .form-select,
body[data-preset="nightshift"] #addPaymentModal .sh-form-card .form-control,
body[data-preset="nightshift"] #addPaymentModal .sh-form-card .form-select { background-color: var(--surface); border-color: var(--border-strong); color: var(--ink); }
/* Save button: Bootstrap's hardcoded #dc3545 doesn't adapt to dark theme — replace with accent tokens. */
body.variant-b #addPaymentModal .btn-danger,
body[data-preset="nightshift"] #addPaymentModal .btn-danger { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-color: var(--accent-ink); --bs-btn-hover-bg: var(--accent-dark); --bs-btn-hover-border-color: var(--accent-dark); --bs-btn-hover-color: var(--accent-ink); --bs-btn-active-bg: var(--accent-dark); --bs-btn-active-border-color: var(--accent-dark); }

/* ── addReportModal — Card Canvas ── */
#addReportModal .modal-body    { background: var(--surface-3, #EAECF0); padding: 10px; }
#addReportModal .sh-form-card  { margin: 0 0 8px; }

/* ── shareModal — allow dropdowns/autocomplete to overflow card boundary ── */
#shareModal .sh-form-card { overflow: visible; margin: 0; }

/* ── collectionModal — Card Canvas ── */
#collectionModal .modal-body   { background: var(--surface-3, #EAECF0); padding: 10px; }
#collectionModal .sh-form-card { margin: 0; }

/* Bill summary side panel — sits right of patient info grid */
.sh-bill-summary-panel {
    border-left: 1px solid var(--border, #dee2e6);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
@media (max-width: 991.98px) {
    .sh-bill-summary-panel {
        border-left: 0;
        border-top: 1px solid var(--border, #dee2e6);
    }
}

/* Tests / reports table — no column borders, only row separators; outer border on container */
.sh-tests-table { border: 0 !important; }
.sh-tests-table th { font-size: 0.77rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6c757d); font-weight: 600; background: var(--surface-2, #f8f9fa); border: 0 !important; border-bottom: 2px solid var(--border, #dee2e6) !important; }
.sh-tests-table td { font-size: 0.85rem; vertical-align: middle; color: var(--ink, #212529); border: 0 !important; border-bottom: 1px solid var(--border, #dee2e6) !important; }
.sh-tests-table tbody tr:last-child td { border-bottom: 0 !important; }
.sh-tests-table tr:hover td { background: var(--rowhover, #f5f7fa); }
.sh-short-name  { display: inline-block; font-size: 0.71rem; color: var(--muted, #6c757d); background: var(--surface-3, #ebebeb); border-radius: 3px; padding: 1px 5px; margin-top: 2px; }

/* Summary card */
.sh-summary-card   { border: 1px solid var(--border, #dee2e6) !important; }
.sh-summary-row    { display: flex; align-items: center; justify-content: space-between; padding: 5px 14px; font-size: 0.85rem; color: var(--ink, #212529); }
.sh-summary-row + .sh-summary-row { border-top: 1px solid var(--border, #dee2e6); }
.sh-summary-netamt { padding: 6px 14px; border-top: 2px solid var(--border, #dee2e6); border-bottom: 1px solid var(--border, #dee2e6); background: var(--surface-2, #f8f9fa); display: flex; align-items: center; justify-content: space-between; color: var(--ink, #212529); }
.sh-due-row        { padding: 7px 14px; font-size: 0.95rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.sh-status-paid    { background: var(--green, #198754); color: #fff; }
.sh-status-due     { background: var(--accent); color: var(--accent-ink, #fff); }
/* When sh-due-row is the last child, drop the card's 5px padding-bottom so the
   coloured (paid/due) background fills all the way to the rounded bottom corners. */
.sh-form-card:has(> .sh-due-row:last-child) { padding-bottom: 0; }


/* wysihtml5 blockquote icon fix — the BS3 plugin renders a 50px absolute ❝
   that bleeds outside the toolbar button into surrounding card headers */
.glyphicon-quote { position: relative; display: inline-block; overflow: hidden; width: 1.25em; height: 1.25em; vertical-align: middle; }
.glyphicon-quote::before { font-size: 14px; position: static; }
.glyphicon-quote::after { display: none; }

/* ── sh-modal-info-strip — reusable bill info bar (Bill No / Case ID / Date) ── */
.sh-modal-info-strip {
  background: var(--surface, #fff);
  border-bottom: 2px solid var(--surface-3, #eef2f7);
  padding: 8px 20px;
}
.sh-modal-info-strip label {
  font-size: 11px;
  color: var(--muted, #5F6B7A);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
}
.sh-modal-info-strip .atm-readonly-input {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink, #1A2733);
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  width: auto;
}

/* ── sh-modal-canvas — gray canvas modal body (card-float style) ── */
.modal-body.sh-modal-canvas {
  background: var(--surface-2, #f8fafc);
  padding: 14px;
}

/* ── edit_bill modal — kill horizontal scroll + lock edittableID (mirrors #myModal pattern) ── */
#edit_bill .modal-body,
#edit_bill .modal-body .sh-form-card,
#edit_bill .modal-body .p-2,
#edit_bill .pup-scroll-area,
#edit_bill .modal-content,
#edit_bill .modal-dialog,
#edit_bill .table-responsive { overflow-x: hidden !important; }
#edit_bill #edittableID { table-layout: fixed !important; width: 100% !important; max-width: 100% !important; }
#edit_bill #edittableID th, #edit_bill #edittableID td { padding: 2px 4px !important; white-space: normal !important; word-break: break-word; }
#edit_bill #edittableID th:last-child, #edit_bill #edittableID td:last-child { width: 40px !important; min-width: 40px !important; max-width: 40px !important; }

/* ── srTableID inside saleReturnModal — compact padding + shrink-fit action column (pharmacy bill sale return) ── */
#saleReturnModal #srTableID th, #saleReturnModal #srTableID td { padding: 2px 4px !important; }
#saleReturnModal #srTableID th:last-child, #saleReturnModal #srTableID td:last-child { width: 50px !important; min-width: 50px !important; max-width: 50px !important; text-align: center !important; }


/* sh-modal modals — sh-info-grid transparent so modal surface bg shows through */
.sh-modal .sh-info-grid { background: transparent; }

/* ── Bootstrap tables inside sh-modal: bridge BS5 --bs-table-* to design tokens.
   Without this, Bootstrap's own white-default table-bg leaks through in dark/warm
   presets (nightshift, midnight, oled) where --surface is dark but --bs-table-bg
   hasn't been overridden, producing a jarring white table against the dark card. ── */
.sh-modal .modal-body .table {
  --bs-table-color:        var(--ink);
  --bs-table-bg:           transparent;
  --bs-table-border-color: var(--border);
  --bs-table-hover-color:  var(--ink);
  --bs-table-hover-bg:     var(--rowhover, rgba(128,128,128,.06));
  color: var(--ink);
}
.sh-modal .modal-body .table > :not(caption) > * > * {
  color:               var(--ink);
  background-color:    transparent;
  border-bottom-color: var(--border);
}
.sh-modal .modal-body .table-responsive { background: transparent; }

/* ══════════════════════════════════════════════════════════════
   STAFF FORM  —  page header · info banner · form cards ·
   sub-section titles · collapse · doc table · footer actions
   ══════════════════════════════════════════════════════════════ */
.page-hdr { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.page-hdr-title { font-size:16px; font-weight:700; color:var(--ink); margin:0; display:flex; align-items:center; gap:10px; }
.hdr-icon { width:32px; height:32px; background:var(--link); border-radius:var(--radius-md,5px); display:inline-flex; align-items:center; justify-content:center; color:#fff; font-size:14px; flex-shrink:0; }
.sh-info-banner { background:var(--blue-soft,#DCEAFB); border:1px solid var(--border); border-radius:var(--radius-md,5px); padding:10px 14px; color:var(--link); margin-bottom:16px; display:flex; align-items:center; gap:8px; font-size:13px; }
.sh-form-card { background:var(--surface); border:1.5px solid var(--border); border-radius:var(--radius-lg,8px); margin:0 0 14px; overflow:hidden; box-shadow:var(--shadow-sm); padding-bottom:5px; }
.sh-card-header { padding:10px 16px; border-bottom:1px solid var(--border); background:var(--surface-2); display:flex; align-items:center; gap:8px; }
.sh-card-header-title { font-size:13px; font-weight:700; color:var(--ink); margin:0; }
.sh-card-header-title i { color:var(--link); margin-right:5px; }
/* Action row inside an sh-form-card — themed separator + right-aligned buttons. */
.sh-card-actions { display:flex; justify-content:flex-end; align-items:center; gap:8px; padding:12px 16px; border-top:1px solid var(--border); background:var(--surface-2); }
/* Patient photo + name-initials fallback (44x44 circular avatar in card header).
   Migrated from inline styles in admin/searchdisablepatient.php 2026-05-26.
   Pattern reusable across patient summary modals (radio/path/pharma twins). */
.sh-card-header > img.rounded-circle { object-fit:cover; border:2px solid var(--border); }
.sh-card-header .sh-name-initials {
    width:44px; height:44px;
    border:2px solid var(--border);
    background:var(--accent); color:#fff;
    display:flex; align-items:center; justify-content:center;
    font-weight:700; font-size:16px; letter-spacing:1px;
    line-height:1; text-transform:uppercase;
    user-select:none;
}
.sh-card-header-meta { font-size:12px; }
/* Card-header action button (e.g. To-Do "+ add") — markup ships it as Bootstrap
   btn-light (fixed white), which clashes on themed/dark headers. It's the card's
   primary action, so fill it solid with the accent so it follows the theme. */
.sh-card-header .btn.btn-sm.btn-light {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-color: var(--accent-ink);
    --bs-btn-hover-bg: var(--accent-dark);
    --bs-btn-hover-border-color: var(--accent-dark);
    --bs-btn-hover-color: var(--accent-ink);
    --bs-btn-active-bg: var(--accent-dark);
    --bs-btn-active-color: var(--accent-ink);
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: var(--accent-ink) !important;
}
.sh-card-header .btn.btn-sm.btn-light:hover,
.sh-card-header .btn.btn-sm.btn-light:focus {
    background: var(--accent-dark) !important;
    border-color: var(--accent-dark) !important;
    color: var(--accent-ink) !important;
}
.sh-card-body { padding:18px 20px 20px; }
.sh-sub-section { margin-bottom:26px; }
.sh-sub-section:last-child { margin-bottom:0; }
.sh-sub-title { font-size:12px; font-weight:700; color:var(--ink); padding:7px 12px 7px 11px; background:var(--surface-2); border-left:3px solid var(--link); border-radius:0 var(--radius-md,5px) var(--radius-md,5px) 0; margin-bottom:14px; }
.sh-sub-title i { color:var(--link); margin-right:6px; }
.sh-collapse-btn { display:flex; align-items:center; gap:10px; padding:11px 16px; background:var(--surface-2); border:none; width:100%; text-align:left; font-size:13px; font-weight:700; color:var(--link); cursor:pointer; transition:background .15s; }
.sh-collapse-btn:hover { background:var(--blue-soft,#DCEAFB); }
.sh-collapse-btn .toggle-dot { width:22px; height:22px; background:var(--link); border-radius:50%; display:inline-flex; align-items:center; justify-content:center; color:#fff; font-size:10px; flex-shrink:0; transition:transform .25s ease; }
.sh-collapse-btn[aria-expanded="true"] .toggle-dot { transform:rotate(45deg); }
.sh-collapse-btn .collapse-hint { font-weight:400; font-size:12px; color:var(--muted); }
.sh-collapse-body { padding:16px 20px 22px; }
.sh-form-footer { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg,8px); padding:14px 20px; display:flex; justify-content:flex-end; align-items:center; gap:8px; box-shadow:var(--shadow-sm); }
.btn-sh-save { background:var(--link); border:none; color:#fff !important; padding:7px 20px; border-radius:var(--radius-md,5px); font-size:13px; font-weight:600; display:inline-flex; align-items:center; gap:6px; cursor:pointer; transition:opacity .15s; text-decoration:none; }
.btn-sh-save:hover { opacity:.85; }
/* sh-form-stack — merges stacked cards + footer into ONE connected panel.
   Wrapper carries the single border/shadow; inner blocks go borderless and
   are separated by a thin internal divider only. */
.sh-form-stack { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg,8px); box-shadow:var(--shadow-sm); overflow:hidden; margin:0 0 14px; }
.sh-form-stack > .sh-form-card,
.sh-form-stack > .sh-form-footer { border:none; border-radius:0; box-shadow:none; margin:0; }
.sh-form-stack > .sh-form-card { padding-bottom:0; }
.sh-form-stack > .sh-form-card > .sh-card-body { padding-bottom:20px; }
.sh-form-stack > * + * { border-top:1px solid var(--border); }
.sh-label { font-size:11px; font-weight:700; color:var(--muted); margin-bottom:5px; letter-spacing:.04em; text-transform:uppercase; display:block; }
.sh-label .req { color:var(--red); }
.sh-form-card .form-control, .sh-form-card .form-select { color:var(--ink); background-color:var(--surface); border-color:var(--border); border-radius:var(--radius); }
.sh-form-card .form-control:focus, .sh-form-card .form-select:focus { color:var(--ink); background-color:var(--surface); border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.sh-form-card .form-control::placeholder { color:var(--faint,#94a3b8); }
.sh-doc-table { border-collapse:collapse; width:100%; }
.sh-doc-table th { background:var(--surface-2); font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; padding:8px 12px; border:1px solid var(--border); }
.sh-doc-table td { padding:8px 12px; vertical-align:middle; border:1px solid var(--border); font-size:13px; color:var(--ink); }


/* ── Blood Bank Status v2 (bb-* classes) ──────────────────────────────────── */
.bb-page-hdr { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-bottom:18px; }
.bb-page-title { font-size:16px; font-weight:700; color:var(--ink); display:flex; align-items:center; gap:10px; margin:0; }
.bb-hdr-actions { display:flex; gap:8px; flex-wrap:wrap; }
.btn-bb-action { display:inline-flex; align-items:center; gap:6px; padding:5px 14px; background:var(--accent); color:#fff !important; border:none; border-radius:var(--radius-md); font-size:12px; font-weight:600; cursor:pointer; text-decoration:none; transition:opacity .15s; }
.btn-bb-action:hover { opacity:.88; }
.bb-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow); overflow:hidden; }
.bb-card-hdr { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; padding:14px 16px; background:var(--surface); }
.bb-card-body { padding:16px; }
.bb-group-col { width:110px; flex-shrink:0; border-right:1px solid var(--border); padding-right:12px; }
.bb-group-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--faint); margin-bottom:8px; }
.bb-pill-list { display:flex; flex-direction:column; gap:4px; }
.bb-pill { padding:6px 10px; font-size:13px; font-weight:700; border-radius:var(--radius); border:1px solid var(--border); background:var(--surface-2); color:var(--ink); cursor:pointer; text-align:center; transition:all .15s; user-select:none; }
.bb-pill:hover { border-color:var(--accent); color:var(--accent); }
.bb-pill.active { background:var(--accent); border-color:var(--accent); color:#fff; box-shadow:var(--shadow-sm); }
.bb-content { flex:1; min-width:0; padding-left:18px; }
.bb-panels { display:flex; gap:16px; align-items:flex-start; }
.bb-panel { flex:1; min-width:0; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); overflow:hidden; box-shadow:var(--shadow-sm); }
.bb-panel-hdr { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; background:var(--surface-2); border-bottom:1px solid var(--border); }
.bb-panel-title { font-size:13px; font-weight:700; color:var(--ink); display:flex; align-items:center; gap:7px; }
.bb-panel-title i { color:var(--accent); }
.bb-badge .count { background:var(--accent-soft); color:var(--accent); padding:1px 8px; border-radius:20px; font-size:11px; font-weight:700; display:inline-block; }
.btn-bb-add { width:26px; height:26px; background:var(--accent); color:#fff; border:none; border-radius:50%; font-size:12px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; transition:opacity .15s; flex-shrink:0; }
.btn-bb-add:hover { opacity:.82; }
.bb-table-wrap { max-height:320px; overflow-y:auto; overflow-x:hidden; }
.bb-table { width:100%; border-collapse:collapse; font-size:12px; margin:0; }
.bb-table thead th { position:sticky; top:0; z-index:2; background:var(--surface); padding:7px 12px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); border-bottom:1px solid var(--border); white-space:nowrap; }
.bb-table tbody td { padding:8px 12px; border-bottom:1px solid var(--border-light); color:var(--ink); vertical-align:middle; }
.bb-table tbody tr:last-child td { border-bottom:none; }
.bb-table tbody tr:hover td { background:var(--rowhover); }
.bb-bags-val { font-weight:600; }
.bb-component-tag { color:var(--link); font-weight:600; }
.btn-issue { padding:3px 12px; font-size:11px; font-weight:600; border:1px solid var(--border-strong); border-radius:var(--radius); background:var(--surface-2); color:var(--ink); cursor:pointer; transition:all .15s; white-space:nowrap; }
.btn-issue:hover { background:var(--accent); border-color:var(--accent); color:#fff; }

/* ── Pathology billing modal ── */
.sh-flex-col { flex: 1; min-width: 260px; }
#tableID th, #tableID td { padding: 2px 4px !important; }
#tableID th:last-child, #tableID td:last-child { width: 40px !important; min-width: 40px !important; max-width: 40px !important; }
.sh-bill-summary-input { max-width: 130px; }
.sh-discount-pct-group { width: 110px; }
.sh-net-amount-row { background: var(--surface-2, #f8f9fa); }
/* ── /Blood Bank Status v2 ─────────────────────────────────────────────────── */

/* ── Global Modal Fix (Reduce Corner Curve) ── */
.modal-content {
  border-radius: var(--radius-md) !important;
  overflow: hidden; /* Ensures inner elements don't overflow the rounded corners */
}

/* ── Dark mode: tabinsetbottom strip ── */
body.variant-b .tabinsetbottom { background: var(--surface-2); }

/* ══════════════════════════════════════════════════════════════
   Sale Return Modal — theme-aware styles
   (moved from embedded <style> in _createSaleReturn.php)
   ══════════════════════════════════════════════════════════════ */
.sr-table thead th           { font-size: 12px; font-weight: 600; vertical-align: middle; }
.sr-table thead .sr-th-readonly { background: var(--surface-2); color: var(--muted); border-bottom: 2px solid var(--border); }
.sr-table thead .sr-th-editable { background: #e8f4fd; color: #1a6fa8; border-bottom: 2px solid #3498db; }
.sr-table thead .sr-th-ref      { background: var(--surface-2); color: var(--muted); font-size: 11px; border-bottom: 2px solid var(--border); }
.sr-table td                 { vertical-align: middle; padding: 5px 6px; }
/* Token-driven so they adapt in ALL variants — built-in light, variant-b dark,
   AND dark variant-a presets (nightshift etc.). Previously hardcoded #f0f8ff /
   #f9f9f9 stayed white on nightshift's brown bg because the dark fixups were
   scoped to body.variant-b only. color-mix tints the editable field's blue
   accent over whatever the theme surface is; text blends blue with --ink so it
   reads dark-blue on light themes and light-blue on dark ones. The tuned
   body.variant-b overrides below stay (more specific → still win on variant-b). */
.sr-qty-input                { border: 2px solid #3498db !important; border-radius: 4px !important; font-weight: 700 !important; color: color-mix(in srgb, #3498db 55%, var(--ink)) !important; background: color-mix(in srgb, #3498db 12%, var(--surface)) !important; text-align: right; }
.sr-qty-input:focus          { box-shadow: 0 0 0 3px rgba(52,152,219,.15) !important; }
.sr-readonly-input           { background: var(--surface-2) !important; color: var(--muted) !important; border-color: var(--border) !important; }
.sr-summary-row              { display: flex; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border-light); }
.sr-summary-row label        { flex: 1; margin: 0; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.sr-summary-row input        { width: 120px; text-align: right; border: 1px solid var(--border) !important; border-radius: var(--radius); padding: 3px 7px; font-size: 13px; background: var(--surface-2) !important; color: var(--ink); }
.sr-summary-net              { display: flex; align-items: center; padding: 11px 12px; background: linear-gradient(90deg, #f0fff4, #e8f8f0); }
/* TODO: tokenize — #1a7a40 is a deeper green than --green (#22A06B); keep hex until shade-specific token added */
.sr-summary-net label        { flex: 1; margin: 0; color: #1a7a40; font-size: 14px; font-weight: 700; }
.sr-summary-net input        { width: 130px; text-align: right; border: 2px solid #27ae60 !important; border-radius: 4px; padding: 4px 8px; font-size: 17px; font-weight: 700; color: #1a7a40 !important; background: #fff !important; }
.sr-section-card             { border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); padding: 12px 14px; margin-bottom: 12px; }
.sr-section-head             { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--border-light); }
.sr-section-head i           { margin-right: 5px; color: var(--faint); }
/* layout helpers replacing inline styles */
.sr-divider                  { border-top: 1px solid var(--border-light); margin: 12px 0; }
.sr-summary-card             { border: 1px solid var(--border); border-radius: 5px; overflow: hidden; margin-bottom: 12px; background: var(--surface); flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.sr-prev-wrap                { border-left: 4px solid #e67e22; background: #fffbf5; border-radius: 5px; padding: 10px 14px; }
.sr-refund-wrap              { border-left: 4px solid #27ae60; background: #f6fffa; border-radius: 5px; padding: 12px 14px; }
.sr-payment-box              { background: var(--surface); border: 1px solid var(--green-soft); border-radius: 4px; padding: 10px 12px; margin-bottom: 12px; }
.sr-pct-addon                { background: var(--surface-2) !important; color: var(--muted) !important; font-size: 11px !important; padding: 0 6px !important; }
.sr-field-label              { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
/* ── sr_prev_returns_section classes ── */
.sr-prev-parent          { cursor: pointer; }
.sr-prev-td              { padding: 5px 8px; vertical-align: middle; }
.sr-prev-item-row        { background: var(--surface); }
.sr-prev-cell-muted      { color: var(--ink-2); }
.sr-prev-cell-dim        { color: var(--muted); }
.sr-prev-dot             { color: #e67e22; font-size: 7px; vertical-align: middle; margin-right: 5px; }
.sr-prev-badge-orange    { background: #e67e22; color: #fff; border-radius: 3px; padding: 1px 6px; font-size: 11px; font-weight: 600; display: inline-block; }
.sr-prev-rno             { padding: 2px 7px !important; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; }
.sr-prev-badge-green     { background: #27ae60; color: #fff; border-radius: 3px; padding: 2px 8px; font-size: 12px; font-weight: 700; display: inline-block; }
.sr-prev-eye-btn         { color: var(--orange); font-size: 15px; display: inline-block; transition: color .15s ease; }
.sr-prev-eye-btn.is-open { color: var(--red); }
.sr-prev-detail-td       { padding: 0 !important; border-top: none !important; }
.sr-prev-detail-wrap     { border-left: 3px solid #e67e22; margin: 0 0 2px; background: #fffbf5; }
.sr-prev-detail-table    { font-size: 12px; background: transparent; }
.sr-prev-detail-thead    { background: #fdebd0; border-bottom: 1px solid #f0c080; }
.sr-prev-detail-th       { padding: 5px 8px !important; font-weight: 600; color: #c0392b; border: none !important; }
/* ── dark mode overrides — variant-b ─────────────────────────── */
body.variant-b .sr-table thead .sr-th-readonly { background: var(--surface-2); color: var(--muted); border-bottom-color: var(--border); }
body.variant-b .sr-table thead .sr-th-editable { background: rgba(52,152,219,.15); color: #6bb8f0; border-bottom-color: #3498db; }
body.variant-b .sr-table thead .sr-th-ref      { background: var(--surface-2); color: var(--muted); border-bottom-color: var(--border); }
body.variant-b .sr-qty-input                   { color: #6bb8f0 !important; background: rgba(52,152,219,.12) !important; }
body.variant-b .sr-readonly-input              { background: var(--surface-2) !important; color: var(--muted) !important; border-color: var(--border) !important; }
body.variant-b .sr-summary-row                 { border-bottom-color: var(--border); }
body.variant-b .sr-summary-row label           { color: var(--ink-2); }
body.variant-b .sr-summary-row input           { background: var(--surface-2) !important; border-color: var(--border) !important; color: var(--ink) !important; }
body.variant-b .sr-summary-net                 { background: rgba(39,174,96,.12); }
body.variant-b .sr-summary-net label           { color: #4caf50; }
body.variant-b .sr-summary-net input           { color: #4caf50 !important; background: var(--surface) !important; }
body.variant-b .sr-section-card                { border-color: var(--border); background: var(--surface-2); }
body.variant-b .sr-section-head                { color: var(--muted); border-bottom-color: var(--border); }
body.variant-b .sr-section-head i              { color: var(--muted); }
body.variant-b .sr-divider                     { border-top-color: var(--border); }
body.variant-b .sr-summary-card                { border-color: var(--border); background: var(--surface); }
body.variant-b .sr-prev-wrap                   { background: var(--surface-2); }
body.variant-b .sr-refund-wrap                 { background: var(--surface-2); }
body.variant-b .sr-payment-box                 { background: var(--surface-2); border-color: var(--border); }
body.variant-b .sr-pct-addon                   { background: var(--surface-2) !important; color: var(--muted) !important; }
body.variant-b .sr-field-label                 { color: var(--muted); }
body.variant-b .sr-payment-box .form-control   { color: var(--ink) !important; border-color: var(--border) !important; }
body.variant-b .sr-prev-item-row     { background: var(--surface-2); }
body.variant-b .sr-prev-cell-muted   { color: var(--ink-2); }
body.variant-b .sr-prev-cell-dim     { color: var(--muted); }
body.variant-b .sr-prev-detail-wrap  { background: var(--surface-2); border-left-color: #e67e22; }
body.variant-b .sr-prev-detail-thead { background: rgba(230,126,34,.12); border-bottom-color: rgba(230,126,34,.25); }
body.variant-b .sr-prev-detail-th    { color: #e67e22; }
/* ── select2 full width inside srProducts table ── */
#saleReturnModal .srProducts .select2-container { width: 100% !important; }
/* ── select2 full width inside all sh-modal body/form-card ── */
.sh-modal .modal-body .select2-container { width: 100% !important; }
/* ── vertical column separator ── */
.sh-col-sep-left { border-left: 1px solid var(--border); padding-left: 12px; }
/* ── dark mode: all select2 inside any sh-modal (global) ── */
body.variant-b .sh-modal .select2-container--default .select2-selection--single { background: var(--surface-2) !important; border-color: var(--border) !important; }
body.variant-b .sh-modal .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--ink) !important; }
body.variant-b .sh-modal .select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: var(--muted) transparent transparent transparent !important; }
body.variant-b .sh-modal .select2-container--default.select2-container--disabled .select2-selection--single { background: var(--surface) !important; opacity: .7; }
/* ── dark mode: selected option row (aria-selected=true) — global, all contexts ── */
body.variant-b .select2-results__option[aria-selected="true"] { background-color: var(--surface-3) !important; color: var(--ink) !important; }
/* multi-select choice tags: moved to the base token-anchored rule near the
   `.select2-selection--multiple` block (~line 2815) so it covers nightshift (variant-a) too. */
/* ── mailsms compose — suggestion dropdown + selected list ──
   Anchor to CORE tokens (not body.variant-b) so they read on EVERY preset
   incl. nightshift, which is variant-a. Tokens resolve per active theme,
   so light mode stays white/dark and both dark presets get themed. */
#suggesstion-box .list-group-item { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--border) !important; }
#suggesstion-box .list-group-item-action:hover { background: var(--surface-3) !important; color: var(--ink) !important; }
.send_list .list-group-item { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--border) !important; }
.content-share-list .list-group-item { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--border) !important; }
.content-share-list .list-group-item .text-muted { color: var(--muted) !important; }

/* ══ CKEditor 4 (moono skin) — dark mode toolbar/chrome ══════════════
   Only the chrome lives in the parent DOM — iframe body handled via
   bodyClass config + contents.css                                      */
/* Invert icon sprites so dark icons become visible on dark toolbar */
body.variant-b .cke_button_icon   { filter: invert(1); }
body.variant-b .cke_chrome        { border-color: var(--border) !important; box-shadow: 0 0 3px rgba(0,0,0,.4) !important; }
body.variant-b .cke_inner         { background: var(--surface-2) !important; }
/* Toolbar + status bar */
body.variant-b .cke_top           { background: var(--surface-3) !important; border-bottom-color: var(--border) !important; box-shadow: none !important; }
body.variant-b .cke_bottom        { background: var(--surface-3) !important; border-top-color: var(--border) !important; box-shadow: none !important; }
/* Button groups + combo buttons */
body.variant-b .cke_toolgroup     { background: var(--surface-2) !important; border-color: var(--border) !important; box-shadow: none !important; }
body.variant-b .cke_combo_button  { background: var(--surface-2) !important; border-color: var(--border) !important; box-shadow: none !important; }
/* Text labels inside toolbar */
body.variant-b .cke_button_label,
body.variant-b .cke_combo_text,
body.variant-b .cke_path_item,
body.variant-b .cke_path_empty    { color: var(--ink-2) !important; text-shadow: none !important; }
body.variant-b .cke_button_arrow,
body.variant-b .cke_combo_arrow   { border-top-color: var(--muted) !important; }
/* Separator line */
body.variant-b .cke_toolbar_separator { background: var(--border) !important; }
/* Button hover/active states */
body.variant-b a.cke_button_off:hover,
body.variant-b a.cke_button_off:focus,
body.variant-b a.cke_button_off:active { background: var(--surface-3) !important; box-shadow: none !important; }
body.variant-b .cke_button_on     { background: rgba(255,90,92,.18) !important; box-shadow: none !important; }
/* Combo hover */
body.variant-b .cke_combo_off a.cke_combo_button:hover,
body.variant-b .cke_combo_off a.cke_combo_button:focus { background: var(--surface-3) !important; box-shadow: none !important; }
/* Toolbar collapser */
body.variant-b .cke_toolbox_collapser { background: var(--surface-2) !important; border-color: var(--border) !important; box-shadow: none !important; }
body.variant-b .cke_toolbox_collapser .cke_arrow { border-bottom-color: var(--muted) !important; }
body.variant-b .cke_toolbox_collapser.cke_toolbox_collapser_min .cke_arrow { border-top-color: var(--muted) !important; border-bottom-color: transparent !important; }
/* Dropdown panels (font, paragraph, etc.) */
body.variant-b .cke_panel        { background: var(--surface) !important; border-color: var(--border) !important; }
body.variant-b .cke_panel_grouptitle { background: var(--surface-3) !important; color: var(--ink-2) !important; border-bottom-color: var(--border) !important; box-shadow: none !important; text-shadow: none !important; }
body.variant-b .cke_panel_listItem a { color: var(--ink) !important; border-color: transparent !important; }
body.variant-b .cke_panel_listItem a:hover,
body.variant-b .cke_panel_listItem a:focus { background: var(--surface-3) !important; border-color: var(--border) !important; box-shadow: none !important; }
body.variant-b .cke_panel_listItem.cke_selected a { background: var(--surface-2) !important; border-color: var(--border) !important; box-shadow: none !important; }
/* Context menus */
body.variant-b .cke_menubutton:hover,
body.variant-b .cke_menubutton:focus  { background: var(--surface-3) !important; }
body.variant-b .cke_menubutton_icon   { background: var(--surface-3) !important; opacity: 1; }
body.variant-b .cke_menubutton:hover .cke_menubutton_icon { background: var(--surface-2) !important; }
body.variant-b .cke_menuseparator     { background: var(--border) !important; }
body.variant-b .cke_menubutton_on     { background: var(--surface-2) !important; border-color: var(--border) !important; box-shadow: none !important; }
/* Source / code view */
body.variant-b .cke_source            { background: var(--surface-2) !important; color: var(--ink) !important; }
/* Path breadcrumb */
body.variant-b a.cke_path_item:hover  { background: var(--surface-3) !important; color: var(--ink) !important; box-shadow: none !important; text-shadow: none !important; }

/* ══ CKEditor 4 (moono skin) — Variant A + C flat chrome override ═════════
   Removes all gradients, raised toolgroups, and 3D box-shadows from the
   default Moono skin so the editor chrome matches the flat BS5 theme.
   Uses body:not(.variant-b) so dark mode overrides above are not affected. */

/* Chrome wrapper */
body:not(.variant-b) .cke_chrome        { border-color: var(--border) !important; box-shadow: var(--shadow-sm) !important; border-radius: var(--radius) !important; }
body:not(.variant-b) .cke_inner         { border-radius: var(--radius) !important; }
/* Toolbar + status bar */
body:not(.variant-b) .cke_top           { background: var(--surface-2) !important; border-bottom-color: var(--border) !important; box-shadow: none !important; }
body:not(.variant-b) .cke_bottom        { background: var(--surface-2) !important; border-top-color: var(--border) !important; box-shadow: none !important; }
/* Tool groups — remove raised box */
body:not(.variant-b) .cke_toolgroup     { background: transparent !important; border: none !important; box-shadow: none !important; }
/* Combo buttons (Size, Text Color) */
body:not(.variant-b) .cke_combo_button  { background: var(--surface) !important; border-color: var(--border) !important; box-shadow: none !important; }
body:not(.variant-b) .cke_combo_off a.cke_combo_button:hover,
body:not(.variant-b) .cke_combo_off a.cke_combo_button:focus { background: var(--surface-3) !important; border-color: var(--border-strong) !important; box-shadow: none !important; }
body:not(.variant-b) .cke_combo_on  a.cke_combo_button       { background: var(--accent-soft) !important; border-color: var(--border) !important; box-shadow: none !important; }
/* Button hover/active */
body:not(.variant-b) a.cke_button_off:hover,
body:not(.variant-b) a.cke_button_off:focus,
body:not(.variant-b) a.cke_button_off:active { background: var(--surface-3) !important; border-color: transparent !important; box-shadow: none !important; }
body:not(.variant-b) .cke_button_on     { background: var(--accent-soft) !important; border-color: var(--border) !important; box-shadow: none !important; }
/* Separator */
body:not(.variant-b) .cke_toolbar_separator { background: var(--border) !important; }
/* Text labels */
body:not(.variant-b) .cke_button_label,
body:not(.variant-b) .cke_combo_text,
body:not(.variant-b) .cke_path_item,
body:not(.variant-b) .cke_path_empty    { color: var(--ink-2) !important; text-shadow: none !important; }
body:not(.variant-b) .cke_button_arrow,
body:not(.variant-b) .cke_combo_arrow   { border-top-color: var(--muted) !important; }
/* Toolbar collapser */
body:not(.variant-b) .cke_toolbox_collapser { background: var(--surface-2) !important; border-color: var(--border) !important; box-shadow: none !important; }
body:not(.variant-b) .cke_toolbox_collapser .cke_arrow { border-bottom-color: var(--muted) !important; }
body:not(.variant-b) .cke_toolbox_collapser.cke_toolbox_collapser_min .cke_arrow { border-top-color: var(--muted) !important; border-bottom-color: transparent !important; }
/* Dropdown panels */
body:not(.variant-b) .cke_panel         { background: var(--surface) !important; border-color: var(--border) !important; box-shadow: var(--shadow-md) !important; }
body:not(.variant-b) .cke_panel_grouptitle { background: var(--surface-2) !important; color: var(--ink-2) !important; border-bottom-color: var(--border) !important; box-shadow: none !important; text-shadow: none !important; }
body:not(.variant-b) .cke_panel_listItem a { color: var(--ink) !important; border-color: transparent !important; text-shadow: none !important; }
body:not(.variant-b) .cke_panel_listItem a:hover,
body:not(.variant-b) .cke_panel_listItem a:focus { background: var(--surface-3) !important; border-color: var(--border) !important; box-shadow: none !important; }
body:not(.variant-b) .cke_panel_listItem.cke_selected a { background: var(--accent-soft) !important; border-color: var(--border) !important; box-shadow: none !important; }
/* Context menus */
body:not(.variant-b) .cke_menubutton:hover,
body:not(.variant-b) .cke_menubutton:focus  { background: var(--surface-3) !important; box-shadow: none !important; }
body:not(.variant-b) .cke_menubutton_icon   { background: var(--surface-2) !important; }
body:not(.variant-b) .cke_menuseparator     { background: var(--border) !important; }
body:not(.variant-b) .cke_menubutton_on     { background: var(--accent-soft) !important; border-color: var(--border) !important; box-shadow: none !important; }
/* Source view textarea */
body:not(.variant-b) .cke_source            { background: var(--surface) !important; color: var(--ink) !important; }
/* Path breadcrumb */
body:not(.variant-b) a.cke_path_item:hover  { background: var(--surface-3) !important; color: var(--ink) !important; box-shadow: none !important; text-shadow: none !important; }

/* ── Pharmacy shared utility: note block + section divider ── */
.sh-note-block      { margin:10px 0 0; padding:8px 10px; background:var(--surface-2); border-left:3px solid var(--border); font-size:10.5px; color:var(--ink); }
.sh-section-divider { border-bottom:2px solid #cbd5e1; margin:8px 0 16px; }
body.variant-b .sh-note-block      { background:var(--surface-2); border-left-color:var(--border); color:var(--ink); }
body.variant-b .sh-section-divider { border-bottom-color:var(--border); }

/* ══ Staff Profile — redesigned ══════════════════════════════════
   sh-profile-* / sh-qs-* / sh-info-table / sh-kpi-* / sh-leave-*
   sh-att-* / sh-doc-* / sh-social-link / sh-status-chip          */

/* ── Profile header layout ── */
.sh-profile-header { display:flex; align-items:flex-start; gap:18px; padding:20px 22px; flex-wrap:wrap; }
.sh-profile-avatar-wrap { position:relative; flex-shrink:0; }
.sh-profile-avatar { width:90px; height:90px; border-radius:50%; object-fit:cover; border:3px solid var(--accent); display:block; }
.sh-profile-avatar-initials { width:90px; height:90px; border-radius:50%; border:3px solid var(--accent); background:linear-gradient(135deg, var(--accent), var(--accent-dark)); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:32px; letter-spacing:2px; line-height:1; text-transform:uppercase; user-select:none; flex-shrink:0; }
.sh-view-photo { width:90px; height:90px; object-fit:cover; }
.sh-view-initials { width:90px; height:90px; border-radius:0.375rem; border:1px solid var(--border); background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:32px; letter-spacing:2px; line-height:1; text-transform:uppercase; user-select:none; }
.sh-avatar-overlay { position:absolute; inset:0; border-radius:50%; background:rgba(0,0,0,.55); display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity .2s; cursor:pointer; }
.sh-profile-avatar-wrap:hover .sh-avatar-overlay { opacity:1; }
.sh-avatar-overlay i { color:#fff; font-size:18px; }

/* ── Quick stats row (card footer) ── */
.sh-quick-stats { display:flex; flex-wrap:wrap; }
.sh-qs-item { flex:1; min-width:110px; padding:10px 16px; border-right:1px solid var(--border); }
.sh-qs-item:last-child { border-right:none; }
.sh-qs-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); margin-bottom:3px; }
.sh-qs-value { font-size:13px; font-weight:600; color:var(--ink); }
.sh-qs-accent { color:var(--link) !important; }

/* ── Two-column info table (replaces .tshadow table in profile tab) ── */
.sh-info-table { width:100%; font-size:13px; }
.sh-info-table tr { border-bottom:1px solid var(--border-light); }
.sh-info-table tr:last-child { border-bottom:none; }
.sh-info-table td { padding:9px 14px; vertical-align:top; background:transparent; }
.sh-info-table td:first-child { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); width:200px; white-space:nowrap; }
.sh-info-table td:last-child { color:var(--ink); font-weight:500; }
.sh-info-table td a { color:var(--link); }

/* ── KPI icon box (payroll cards) ── */
.sh-kpi-icon { width:44px; height:44px; border-radius:var(--radius-md); display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }
.sh-kpi-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); margin-bottom:4px; }
.sh-kpi-value { font-size:20px; font-weight:700; color:var(--ink); line-height:1.2; }

/* ── Leave type card (replaces .staffprofile in leaves tab) ── */
.sh-leave-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:14px 16px; display:flex; align-items:center; gap:12px; height:100%; }
.sh-leave-icon { width:40px; height:40px; border-radius:var(--radius-md); background:var(--blue-soft); color:var(--blue); display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.sh-leave-name { font-size:12px; font-weight:700; color:var(--ink); margin-bottom:6px; }
.sh-leave-pills { display:flex; gap:6px; flex-wrap:wrap; }
.sh-lp { font-size:10px; font-weight:600; padding:2px 8px; border-radius:12px; }
.sh-lp-used { background:var(--red-soft); color:var(--red); }
.sh-lp-avail { background:var(--green-soft); color:var(--green); }

/* ── Attendance stat card ── */
.sh-att-stat { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:14px 16px; text-align:center; height:100%; }
.sh-att-num { font-size:22px; font-weight:700; margin-bottom:2px; }
.sh-att-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); }
.sh-att-present { color:var(--green); }
.sh-att-late { color:var(--amber); }
.sh-att-absent { color:var(--red); }
.sh-att-half { color:var(--blue); }
.sh-att-holiday { color:var(--muted); }

/* ── Document card (replaces .staffprofile in documents tab) ── */
.sh-doc-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:20px 16px; text-align:center; height:100%; display:flex; flex-direction:column; align-items:center; gap:6px; }
.sh-doc-icon { font-size:36px; color:var(--muted); }
.sh-doc-title { font-size:12px; font-weight:700; color:var(--ink); margin-bottom:4px; }
.sh-doc-actions { display:flex; justify-content:center; gap:6px; margin-top:auto; padding-top:8px; }

/* ── Calendar To-Do list (admin/calendar/events + user/calendar) ── */
.todo-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; transition: background .15s; }
.todo-item:hover { background: var(--rowhover); }
/* Completed row: tint the CURRENT surface with green instead of using --green-soft.
   --green-soft is a fixed light mint in variant-a presets (incl. dark nightshift)
   so it clashes on dark surfaces; color-mix onto --surface adapts to every theme. */
.todo-item.todo-done { background: color-mix(in srgb, var(--green) 14%, var(--surface)); }
.todo-item .form-check-input { margin-top: 3px; width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.todo-title { font-size: .875rem; font-weight: 500; line-height: 1.35; word-break: break-word; color: var(--ink); }
.todo-title.done { text-decoration: line-through; color: var(--green); font-weight: 400; }
.todo-meta { font-size: .775rem; color: var(--faint); margin-top: 3px; }
.todo-actions a { color: var(--faint); font-size: .82rem; transition: color .15s; padding: 0 2px; }
.todo-actions a:hover { color: var(--muted); }
.todopagination ul.pagination { margin: 0; justify-content: center; }
.todopagination .pagination li a, .todopagination .pagination li span { font-size: .8rem; padding: 3px 8px; }

/* ── Shared-content attachments (file tiles + colored icons) ──
   Reusable across admin/content viewShareModal + patient/dashboard/viewcontent */
.sc-ft-icon { width:52px; height:52px; border-radius:var(--radius-md,6px); display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0; }
.sc-ft-thumb { width:52px; height:52px; object-fit:cover; border-radius:var(--radius-md,6px); flex-shrink:0; }
.sc-ft-mono { font-family:var(--mono,monospace); font-size:10px; color:var(--muted,#6c757d); text-transform:uppercase; margin-top:2px; }
.sc-dl-btn { width:30px; height:30px; padding:0; border-radius:var(--radius-md,6px); display:inline-flex; align-items:center; justify-content:center; font-size:12px; border:1px solid var(--border,#dee2e6); background:transparent; color:var(--muted,#6c757d); cursor:pointer; transition:background .15s,color .15s,border-color .15s; flex-shrink:0; text-decoration:none; }
.sc-dl-btn:hover { background:var(--teal-soft,#e6f7f7); color:var(--teal,#0d9488); border-color:var(--teal,#0d9488); }
.fi-pdf { background:var(--red-soft,#fee2e2); color:var(--red,#ef4444); }
.fi-doc { background:var(--blue-soft,#dbeafe); color:var(--blue,#3b82f6); }
.fi-xls { background:var(--green-soft,#dcfce7); color:var(--green,#22c55e); }
.fi-img { background:var(--violet-soft,#ede9fe); color:var(--violet,#7c3aed); }
.fi-vid { background:var(--amber-soft,#fef3c7); color:var(--amber,#f59e0b); }
.fi-zip { background:var(--surface-3,#eef2f7); color:var(--muted,#6c757d); }
.fi-def { background:var(--surface-3,#eef2f7); color:var(--muted,#6c757d); }

/* ── Profile nav tabs — horizontal scroll on mobile ── */
.sh-profile-tabs { flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch; }
.sh-profile-tabs::-webkit-scrollbar { height:0; }
.sh-profile-tabs .nav-link { white-space:nowrap; }

/* ── Social links in profile tab ── */
.sh-social-link { display:flex; align-items:center; gap:8px; padding:7px 12px; border-radius:var(--radius-md); font-size:13px; font-weight:500; border:1px solid var(--border); color:var(--ink); transition:border-color .15s, color .15s; }
.sh-social-link:hover { border-color:var(--link); color:var(--link); }

/* ── Active/inactive status chip ── */
.sh-status-active   { font-size:10px; font-weight:700; padding:3px 10px; border-radius:20px; background:var(--green-soft); color:var(--green); }
.sh-status-inactive { font-size:10px; font-weight:700; padding:3px 10px; border-radius:20px; background:var(--red-soft);   color:var(--red); }

/* ── Attendance matrix — prevent month headers from wrapping ── */
#ajaxattendance table th { white-space:nowrap; }

/* ══════════════════════════════════════════════════════════════
   .sh-modal-nospace — Fullscreen modal gap remover
   Add to .modal element alongside sh-modal-fullpage.
   Removes all top/right/bottom/left viewport gaps using
   viewport units (100vw/100vh) — no parent-height dependency.
   Usage: class="modal fade sh-modal sh-modal-fullpage sh-modal-nospace"
   ══════════════════════════════════════════════════════════════ */
.sh-modal-nospace {
  padding: 0 !important;
  overflow: hidden !important;
}
.sh-modal-nospace .modal-dialog {
  margin:      0 !important;
  width:       100vw !important;
  max-width:   100vw !important;
  height:      100vh !important;
  height:      100dvh !important;
  min-height:  100vh !important;
  min-height:  100dvh !important;
}
.sh-modal-nospace .modal-content {
  border-radius:   0 !important;
  height:          100vh !important;
  height:          100dvh !important;
  min-height:      100vh !important;
  min-height:      100dvh !important;
  display:         flex !important;
  flex-direction:  column !important;
}
.sh-modal-nospace .modal-content > form {
  display:        flex;
  flex-direction: column;
  flex:           1;
  overflow:       hidden;
}
.sh-modal-nospace .pup-scroll-area {
  flex:           1;
  overflow-y:     auto;
  max-height:     none !important;
  display:        flex;
  flex-direction: column;
}
/* Body padding for fullpage nospace modals — prevents .sh-form-card from
   sitting flush against the modal frame after typography lift */
.sh-modal-nospace .modal-body,
.sh-modal-nospace .pup-scroll-area > .modal-body,
.sh-modal-nospace .modal-content > form > .modal-body {
  padding: 0px 10px !important;
  /* Match the card background (.sh-form-card uses var(--surface)) so the
     empty stretched-column area below the shorter column blends with the
     cards instead of contrasting as a darker band. Cards remain distinct
     via their existing 2px var(--border-strong) border. */
  background-color: var(--surface) !important;
}
/* Nospace padding-top: 0 leaves the first .sh-form-card placed directly
   under .modal-body flush against the teal header (or .sh-modal-info-strip).
   Patient/search wraps its first card in .row > .col so the direct-child
   selector skips it; this surgically restores breathing room for pharmacy,
   pathology, radio, and ambulance modals. The nested .row > [col-*] > card
   variant covers the revisitModal layout (admin/bill/patient_profile and
   admin/bill/opd_visit_detail) — when the col's first div IS the card,
   :first-of-type matches; when an empty #ajax_load precedes it (patient/search
   pattern), the selector naturally skips. */
.sh-modal-nospace .pup-scroll-area > .modal-body > .sh-form-card:first-of-type,
.sh-modal-nospace .modal-content > form > .modal-body > .sh-form-card:first-of-type,
.sh-modal-nospace .pup-scroll-area > .modal-body > .row > [class*="col-"] > .sh-form-card:first-of-type,
.sh-modal-nospace .modal-content > form > .modal-body > .row > [class*="col-"] > .sh-form-card:first-of-type {
  margin-top: 12px;
}
/* Bill Summary modal (admin/bill/index) injects its cards into a #billSummaryData
   wrapper, so the generic direct-child :first-of-type rule above doesn't match and
   the first card (TPA) sits flush against the teal header. Restore the same 12px
   gap; #billSummaryData is unique to this modal so the rule stays scoped. */
.sh-modal-nospace .pup-scroll-area > .modal-body > #billSummaryData > .sh-form-card:first-of-type {
  margin-top: 12px;
}
/* Custom-field checkbox / radio groups: Form_builder (application/libraries/
   Form_builder.php) emits Bootstrap-3-era <label class="checkbox-inline"> /
   "radio-inline" markup. Bootstrap 5 doesn't define these classes, so the box
   and its text jam together (e.g. "▢1▢2") with no gap between options. Restore
   spacing + vertical alignment. */
.checkbox-inline,
.radio-inline {
  display: inline-flex;
  align-items: center;
  margin-right: 1rem;
  margin-bottom: .25rem;
  font-weight: 400;
}
.checkbox-inline:last-child,
.radio-inline:last-child {
  margin-right: 0;
}
.checkbox-inline > input[type="checkbox"],
.radio-inline > input[type="radio"] {
  margin: 0 .4rem 0 0;
}
/* Symmetric bottom breathing room — mirrors the :first-of-type rule above so
   the last card in each column has the same 12px gap to the footer (or to
   the unfilled dark band when the column is shorter than the viewport). */
.sh-modal-nospace .pup-scroll-area > .modal-body > .sh-form-card:last-of-type,
.sh-modal-nospace .modal-content > form > .modal-body > .sh-form-card:last-of-type,
.sh-modal-nospace .pup-scroll-area > .modal-body > .row > [class*="col-"] > .sh-form-card:last-of-type,
.sh-modal-nospace .modal-content > form > .modal-body > .row > [class*="col-"] > .sh-form-card:last-of-type {
  margin-bottom: 12px;
}
.sh-modal-nospace .modal-header {
  background: var(--accent);
  color: var(--accent-ink, #fff);
  border-bottom: 0 !important;
  border-radius: 0 !important;
  padding: .5rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sh-modal-nospace .modal-header h5,
.sh-modal-nospace .modal-title {
  font-size: 1.125rem; font-weight: 600;
  color: #fff !important; margin: 0; line-height: 1.3;
  letter-spacing: 0;
  border: none; border-bottom: none;
  padding: 0; padding-bottom: 0;
}
.sh-modal-nospace .modal-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: .85;
  margin-left: auto;
  background-color: transparent;
}
.sh-modal-nospace .modal-header .btn-close:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, .15);
}

/* Pathology single-billing modal — body is dynamically injected (no
   .sh-form-card), so the shared :last-of-type margin-bottom rule above
   never fires here. Push the footer down so it doesn't sit flush. */
#assigntestModal .modal-footer { margin-top: 12px; }

/* Media Manager picker (#mediaModal) — body is AJAX-injected as a plain
   .row (no .sh-form-card), so the nospace :first-of-type breathing-room
   rules never fire and the 0px 10px body padding leaves the search/filter
   controls cramped against the teal header and the side frame. Restore
   comfortable, symmetric padding. #id specificity beats .class — no !important needed. */
#mediaModal .modal-body { padding: 1rem 1.25rem 1.25rem; }

/* ══ Patient Dashboard — content area update ══════════════════
   sh-kpi-card  : clickable KPI card with hover lift
   sh-chart-card: chart wrapper card
   sh-chart-header: chart card title row with icon             */
.sh-kpi-card { border:1px solid var(--border); background:var(--surface); border-radius:var(--radius-lg); padding:14px 16px; display:flex; align-items:center; gap:12px; text-decoration:none; color:inherit; transition:box-shadow .15s,transform .15s; height:100%; }
.sh-kpi-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); color:inherit; }
.sh-chart-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; }
.sh-chart-header { padding:12px 16px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:8px; font-size:13px; font-weight:600; color:var(--ink); }
.sh-chart-header i { color:var(--link); font-size:14px; }
.sh-ins-alert { background:var(--red-soft); border:1px solid var(--red); border-radius:var(--radius-lg); padding:10px 16px; color:var(--red); display:flex; align-items:flex-start; gap:10px; }
.sh-ins-alert i { margin-top:2px; flex-shrink:0; }

/* ══ Pharmacy Purchase Modal — supplier select wrapper ════════
   Used in #myModal header (purchase.php) to size the Select2   */
.sh-supplier-select-wrap { flex:1; min-width:200px; max-width:420px; }

/* ══ Card canvas layout — flex card wrapper ══════════════════
   Used in purchase/billing modals for side-by-side cards       */
.sh-card-wrap { flex:1; min-width:260px; }

/* ══ Edit Purchase Modal — header element sizing ═════════════
   Replaces inline max-width styles on header inputs/selects    */
.sh-edit-supplier-wrap { flex:1; min-width:160px; max-width:320px; }
.sh-inp-130 { max-width:130px; }
.sh-inp-180 { max-width:180px; }
.sh-inp-200 { max-width:200px; }

/* ══ Summary card inputs — compact right-aligned inputs ═══════
   Used inside sh-summary-row rows                              */
.sh-summary-input     { max-width:130px; }
.sh-summary-input-pct { width:55px; }
.sh-summary-input-tax { max-width:130px; }

/* ══ Quantity input in return/issue tables ══════════════════════
   Replaces inline style="width:75px; display:inline-block"     */
.sh-qty-input { width:75px; display:inline-block; }


/* ══ Patient / Staff ID Card Preview ════════════════════════════
   Moved from inline <style> blocks in patientidcardpreview.php
   and staffidcardpreview.php — enables dark mode overrides      */
.tc-container          { width:100%; position:relative; text-align:center; }
.tcmybg                { background:top center; background-size:contain; position:absolute; left:0; bottom:10px; right:0; width:160px; height:160px; margin:auto; }
.patienttop            { padding:2px; color:#fff; overflow:hidden; position:relative; z-index:1; }
.patienttop img        { height:30px; vertical-align:initial; }
.sttext1               { font-size:24px; font-weight:bold; line-height:30px; }
.stgray                { background:#efefef; padding-top:5px; padding-bottom:10px; }
.staddress             { margin-bottom:0; padding-top:2px; }
.stdivider             { border-bottom:2px solid #000; margin-top:5px; margin-bottom:5px; }
.stlist                { padding:0; margin:0; list-style:none; }
.stlist li             { text-align:left; display:inline-block; width:100%; padding:0 5px; }
.stlist li span        { width:65%; float:right; }
.stimg                 { width:80px; height:auto; }
.stimg img             { width:100%; height:auto; border-radius:2px; display:block; }
.staround              { padding:3px 10px 3px 0; position:relative; overflow:hidden; }
.staround2             { position:relative; z-index:9; }
.stbottom              { background:#453278; height:20px; width:100%; clear:both; margin-bottom:5px; }
.principal             { margin-top:-40px; margin-right:10px; float:right; }
.stred                 { color:#000; }
.spanlr                { padding-left:5px; padding-right:5px; }
.cardleft              { width:20%; float:left; }
.cardright             { width:77%; float:right; }
.barcodeimg            { width:80px; height:auto; }
.barcodeimg img        { width:100%; height:auto; border-radius:2px; display:block; margin-top:2px; }
.patientmain           { background:#efefef; width:100%; margin-bottom:30px; }
.sh-idcard-card-bg     { background:#f0f8fd; }
.sh-idcard-title-strip { color:#fff; font-size:16px; padding:2px 0 0; position:relative; z-index:1; text-transform:uppercase; }

/* Dark mode overrides — must cover BOTH dark presets: variant-b (built-in dark)
   AND variant-a (nightshift/preset dark). A variant-b-only rule misses variant-a,
   which is the live preset on this install (see #myModal View ID Card). */
body.variant-a .stgray,
body.variant-b .stgray              { background:var(--surface-2); }
body.variant-a .patientmain,
body.variant-b .patientmain         { background:var(--surface-2); }
body.variant-a .stdivider,
body.variant-b .stdivider           { border-bottom-color:var(--border); }
body.variant-a .stred,
body.variant-b .stred               { color:var(--ink); }
body.variant-a .stlist li,
body.variant-b .stlist li           { color:var(--ink); }
body.variant-a .sh-idcard-card-bg,
body.variant-b .sh-idcard-card-bg   { background:var(--surface-2) !important; color:var(--ink); }
/* Plain text on the card (hospital address, etc.) has no class — anchor it
   to --ink so it stays readable on the dark surface. Colored header strips
   keep their own direct color:#fff and are unaffected. */
body.variant-a .sh-idcard-card-bg p,
body.variant-b .sh-idcard-card-bg p { color:var(--ink); }

/* ══ Attendance Setting — att-role-wrap / att-table ════════════════
   Moved from embedded <style> in setting/attendance.php             */
.att-role-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.att-role-wrap + .att-role-wrap .att-role-header { border-top: 1px solid var(--border); }
.att-role-header .role-label { font-size: 14px; color: var(--muted); }
.att-role-header .role-name  { font-weight: 600; color: var(--ink); font-size: 15px; }
.att-table { margin: 0; }
.att-table thead th {
    background: var(--surface-2);
    color: var(--muted);
    font-weight: 600; font-size: 12px;
    text-transform: uppercase; letter-spacing: .03em;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}
.att-table tbody td { padding: 12px 16px; vertical-align: middle; border-color: var(--border); }
.att-table tbody tr:nth-child(even) td { background: var(--surface-2); }
.att-type-cell { font-weight: 500; color: var(--ink-2); }
.att-type-cell .att-key { color: var(--faint); font-weight: 400; margin-left: 4px; }
.att-table .input-group-text { background: var(--surface); color: var(--faint); }
.att-role-wrap .table-responsive { overflow: visible; }

/* ══ SMS Config — smsconfig/smsList.php ════════════════════════════
   Moved from embedded <style>; hardcoded colours replaced with CSS vars */

/* Layout shim for legacy .form-horizontal */
.form-horizontal .form-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}
.form-horizontal .control-label {
    padding-top: 0;
    margin-bottom: 0;
    text-align: right;
    font-weight: 500;
    color: var(--ink-2);
    padding-right: 12px;
}
.form-horizontal .form-group > [class*="col-"] { padding: 0 8px; }
.form-horizontal .form-group > .control-label + [class*="col-"] { padding-left: 0; }
.form-horizontal .req { color: #dc3545; }
.form-horizontal .text-danger { font-size: 12px; display: block; margin-top: 4px; }

/* Masked-value helper: second <label> shows current (partially masked) value */
.form-horizontal .form-group label + label {
    display: block;
    font-weight: 400;
    font-size: 12px;
    color: var(--faint);
    margin-top: 6px;
    padding: 0;
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
}
.form-horizontal .form-group label + label::before {
    content: "current: ";
    color: var(--faint);
}

/* Gateway brand panel */
.tab-content .disblock {
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 28px 20px;
    margin-top: 8px;
}
.tab-content .disblock a { text-decoration: none; }
.tab-content .disblock img { max-width: 180px; max-height: 80px; opacity: .92; }
.tab-content .disblock p { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

/* Tab bar */
.nav-tabs.navlistscroll {
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
    background: var(--surface-2);
    flex-wrap: nowrap;
    overflow-x: auto;
}
.nav-tabs.navlistscroll > li > a {
    border: none !important;
    color: var(--muted);
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent !important;
    white-space: nowrap;
    display: block;
}
.nav-tabs.navlistscroll > li.active > a,
.nav-tabs.navlistscroll > li > a.active {
    background: transparent !important;
    color: var(--link) !important;
    border-bottom: 2px solid var(--link) !important;
}
.nav-tabs.navlistscroll > li > a:hover { color: var(--ink); }

/* ── dark mode (variant-b) — navlistscroll compatibility ──
   Light strip blends with card; inactive text uses brighter ink-2;
   subtle hover bg for affordance on dark surface. */
body.variant-b .nav-tabs.navlistscroll { background: transparent; }
body.variant-b .nav-tabs.navlistscroll > li > a,
body.variant-b .nav-tabs.navlistscroll .nav-link {
    color: var(--ink-2);
    background: transparent;
    border-color: transparent !important;
}
body.variant-b .nav-tabs.navlistscroll > li > a:hover,
body.variant-b .nav-tabs.navlistscroll .nav-link:hover:not(.active) {
    color: var(--ink);
    background: rgba(255,255,255,.04);
    border-color: transparent !important;
}
body.variant-b .nav-tabs.navlistscroll > li > a.active,
body.variant-b .nav-tabs.navlistscroll .nav-link.active {
    color: var(--link) !important;
    background: transparent !important;
    border-color: transparent !important;
    border-bottom-color: var(--link) !important;
}


/* col-md-7/col-md-5 flex wrapper */
.tab-content .minheight170 {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-left: -12px;
    margin-right: -12px;
    padding: 20px 0;
}
.tab-content .minheight170 > .col-md-7,
.tab-content .minheight170 > .col-md-5 { padding-left: 12px; padding-right: 12px; }

/* BS5 tab-pane visibility */
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active { display: block; }

@media (max-width: 767px) {
    .form-horizontal .control-label { text-align: left; padding-right: 0; margin-bottom: 4px; }
    .tab-content .minheight170 { flex-direction: column; }
}

/* ══ Form Switch — dark mode visibility fix ════════════════════════
   Bootstrap default unchecked knob is rgba(0,0,0,.25) — invisible on dark surface */
body.variant-b .form-switch .form-check-input,
body[data-preset="nightshift"] .form-switch .form-check-input,
body[data-preset="midnight"] .form-switch .form-check-input,
body[data-preset="oled"] .form-switch .form-check-input {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(255,255,255,.6)'/%3e%3c/svg%3e");
    background-color: var(--surface-2);
    border-color: var(--border);
}
body.variant-b .form-switch .form-check-input:checked,
body[data-preset="nightshift"] .form-switch .form-check-input:checked,
body[data-preset="midnight"] .form-switch .form-check-input:checked,
body[data-preset="oled"] .form-switch .form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* ── Content Upload Cards ── */
.sh-content-card-meta a {
    color: inherit;
    text-decoration: none;
}

/* ── Content Upload Card — Overlay Full-Bleed (grid view) ── */
.sh-cnt-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
    cursor: pointer;
    background: var(--surface);
}
.sh-cnt-card:hover {
    box-shadow: 0 10px 28px rgba(0,0,0,.14);
    transform: translateY(-4px);
    border-color: var(--border-strong);
}
.sh-cnt-thumb {
    height: 172px;
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
}
.sh-cnt-img-wrap {
    display: block;
    width: 100%;
    height: 100%;
}
.sh-cnt-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sh-cnt-icon-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sh-cnt-icon-img {
    max-height: 80px;
    max-width: 80px;
    object-fit: contain;
    opacity: .75;
}
/* gradient overlay — always readable */
.sh-cnt-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 15%, rgba(0,0,0,.78) 100%);
    pointer-events: none;
}
/* ext badge — top-right */
.sh-cnt-ext {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 5px;
    letter-spacing: .7px;
    text-transform: uppercase;
    background: rgba(255,255,255,.92);
    color: var(--ink);
    border: 1px solid rgba(0,0,0,.08);
    backdrop-filter: blur(4px);
}
/* checkbox */
.sh-cnt-chk {
    width: 15px !important;
    height: 15px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.35) !important;
    accent-color: var(--accent);
}
/* overlay text — bottom of thumb */
.sh-cnt-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 10px 12px;
}
.sh-cnt-fname {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-bottom: 5px;
    letter-spacing: -.1px;
}
.sh-cnt-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.sh-cnt-meta span {
    font-size: 10px;
    font-weight: 500;
    color: rgba(248,250,252,.65);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sh-cnt-meta span i { font-size: 9px; }
.sh-cnt-meta a { color: inherit; text-decoration: none; }
/* action footer — 50-50 split */
.sh-cnt-actions {
    display: flex;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.sh-cnt-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 4px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--blue);
    font-size: 12px;
    transition: background .15s ease;
}
.sh-cnt-btn span {
    font-size: 10px;
    font-weight: 600;
    color: var(--blue);
    letter-spacing: .2px;
    transition: color .15s;
}
.sh-cnt-btn:first-child { border-right: 1px solid var(--border); }
.sh-cnt-btn:hover { background: var(--blue-soft); }
.sh-cnt-btn.sh-cnt-del { color: #dc2626; }
.sh-cnt-btn.sh-cnt-del span { color: #dc2626; }
.sh-cnt-btn.sh-cnt-del:hover { background: #fff5f5; }
.sh-cnt-btn.sh-cnt-del:hover,
.sh-cnt-btn.sh-cnt-del:hover span { color: #b91c1c; }
/* dark mode */
body.variant-b .sh-cnt-card { box-shadow: 0 2px 10px rgba(0,0,0,.3); }
body.variant-b .sh-cnt-card:hover { box-shadow: 0 10px 28px rgba(255,90,92,.15); }
body.variant-b .sh-cnt-btn.sh-cnt-del:hover { background: rgba(220,38,38,.08); }

/* ── Content Upload — dark mode fixes ── */
body.variant-b .d-preview { background: var(--surface-2); }
.sh-type-badge { background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--border); font-weight: 500; }
body.variant-b .sh-type-badge { background: var(--surface-3); color: var(--ink-2); border-color: var(--border); }

/* ── Pagination dark mode — overrides Bootstrap 5.3 component-level vars ── */
body.variant-b .page-link {
    background: var(--surface-2);
    color: var(--ink-2);
    border-color: var(--border);
}
body.variant-b .page-link:hover {
    background: var(--surface-3);
    color: var(--ink);
    border-color: var(--border);
}
body.variant-b .page-item.active .page-link {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
body.variant-b .page-item.disabled .page-link {
    background: var(--surface);
    color: var(--muted);
    border-color: var(--border);
}

/* Bootstrap Timepicker — glyphicon → Font Awesome mapping */
.bootstrap-timepicker-widget .glyphicon {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
    font-style: normal;
}
.bootstrap-timepicker-widget .glyphicon-chevron-up::before   { content: '\f077'; }
.bootstrap-timepicker-widget .glyphicon-chevron-down::before  { content: '\f078'; }

/* btn-light inside modal card bodies — dark mode (variant-b built-in dark + variant-a nightshift/presets) */
body.variant-b .sh-modal .sh-form-card .btn-light,
body.variant-b .sh-modal .modal-body .btn-light,
body.variant-a .sh-modal .sh-form-card .btn-light,
body.variant-a .sh-modal .modal-body .btn-light {
    --bs-btn-color: var(--ink);
    --bs-btn-bg: var(--surface-3);
    --bs-btn-border-color: var(--border);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--surface-2);
    --bs-btn-hover-border-color: var(--border);
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-bg: var(--surface-2);
}

/* Bootstrap Timepicker — dark mode overrides */
body.variant-b .bootstrap-timepicker-widget.dropdown-menu {
    background-color: var(--surface);
    border-color: var(--border);
}
body.variant-b .bootstrap-timepicker-widget.dropdown-menu::before {
    border-bottom-color: var(--border);
}
body.variant-b .bootstrap-timepicker-widget.dropdown-menu::after {
    border-bottom-color: var(--surface);
}
body.variant-b .bootstrap-timepicker-widget table td a {
    color: var(--ink);
}
body.variant-b .bootstrap-timepicker-widget table td a:hover {
    background-color: var(--surface-3);
    border-color: var(--border);
}
body.variant-b .bootstrap-timepicker-widget table td input {
    background-color: var(--surface-2);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 4px;
}


/* File input — base fix (removes need for inline style="height:auto;padding") */
.form-control[type="file"] {
    height: auto;
    padding: 4px 10px;
}
body.variant-b .form-control[type="file"] {
    background-color: var(--surface-2);
    border-color: var(--border);
    color: var(--ink);
}
body.variant-b .form-control[type="file"]::file-selector-button {
    background-color: var(--surface-3);
    border-color: var(--border);
    color: var(--ink);
}
body.variant-b .form-control[type="file"]:hover::file-selector-button {
    background-color: var(--surface-2);
}

/* jquery.multiselect plugin (staff specialist, etc.) — token-anchored, GLOBAL.
   Was scoped to body.variant-b only, so it never fired on preset overlays that
   map to variant-a (e.g. nightshift): the plugin's hardcoded white panel + the
   global light --ink produced light-on-white options. Anchoring to core tokens
   (with !important to beat the plugin's #fff/#555/#3c8dbc) reproduces the light
   look on variant-a/c and the dark look on every dark preset — one source. */
.ms-options-wrap > button,
.ms-options-wrap > button:focus {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--ink) !important;
}
.ms-options-wrap > button:after {
    border-top-color: var(--muted) !important;
}
.ms-options-wrap > .ms-options {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow-md);
}
.ms-options-wrap > .ms-options > .ms-search input {
    background-color: var(--surface-2) !important;
    color: var(--ink) !important;
    border-bottom-color: var(--border) !important;
}
.ms-options-wrap > .ms-options > .ms-search input::placeholder { color: var(--muted) !important; }
.ms-options-wrap > .ms-options > ul > li.optgroup + li.optgroup {
    border-top-color: var(--border) !important;
}
.ms-options-wrap > .ms-options > ul label {
    color: var(--ink);
}
/* themed checkmarks instead of default browser blue */
.ms-options-wrap > .ms-options > ul input[type="checkbox"] { accent-color: var(--accent); }
.ms-options-wrap > .ms-options > ul li.selected label,
.ms-options-wrap > .ms-options > ul label:hover {
    background: var(--accent) !important;
    color: var(--accent-ink) !important;
}
.ms-options-wrap > .ms-options .ms-selectall { color: var(--accent) !important; }

/* Split button divider (replaces inline border-left on btn-group toggle) */
.btn-group .sh-split-btn {
    border-left: 1px solid rgba(0, 0, 0, 0.15);
}
body.variant-b .btn-group .sh-split-btn {
    border-left-color: rgba(255, 255, 255, 0.15);
}

/* ══ Notice Board (admin/notification) ═══════════════════════════════
   Moved from embedded <style> in notificationList.php; all colours
   use CSS vars so light / dark / variant-c all work automatically    */
.notice-list { display: flex; flex-direction: column; gap: 6px; }

.notice-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    transition: box-shadow .15s ease;
    overflow: hidden;
}
.notice-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,.09);
}
.notice-header {
    padding: 10px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid transparent;
    transition: background .15s ease;
}
.notice-card:hover .notice-header,
.notice-card.open .notice-header {
    background: var(--surface-3);
    border-bottom-color: var(--border);
}
.notice-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    display: flex;
    align-items: center;
}
.notice-title:hover { color: var(--link); text-decoration: none; }
.notice-arrow {
    font-size: .7rem;
    color: var(--muted);
    transition: transform .2s ease;
    flex-shrink: 0;
}
.notice-arrow.rotated { transform: rotate(90deg); }
.notice-body {
    padding: 14px 18px;
    font-size: .88rem;
    color: var(--ink-2);
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.notice-content {
    font-size: .88rem;
    color: var(--ink-2);
    line-height: 1.6;
    padding-bottom: 12px;
}
.notice-meta-bar {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    background: var(--surface-2);
    border-radius: 0 0 5px 5px;
    overflow: hidden;
}
.notice-meta-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 18px;
    border-right: 1px solid var(--border);
    min-width: 130px;
}
.notice-meta-item:last-child { border-right: none; flex: 1; }
.notice-meta-item .meta-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.notice-meta-item .meta-value {
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink);
}
.notice-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    list-style: none;
    padding: 0;
}
.notice-roles li {
    background: var(--surface-3);
    color: var(--ink-2);
    border: 1px solid var(--border);
    font-size: .72rem;
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.notice-roles li .fa { font-size: .65rem; }
.btn-xs { padding: 2px 7px; font-size: .75rem; line-height: 1.4; border-radius: 4px; }

/* ══ Disabled / readonly inputs — dark mode fix ══════════════════════
   Bootstrap hardcodes background-color:#e9ecef on :disabled — looks
   broken in variant-b (light gray on dark surface)                   */
body.variant-b .form-control:disabled,
body.variant-b .form-control[readonly],
body.variant-b .form-select:disabled {
    background-color: var(--surface-3);
    color: var(--muted);
    border-color: var(--border);
    opacity: 1;
}

/* ══ OPD Patient Selection Card — search.php #patientDetails ═════
   Moved from inline <style> block in patient/search.php           */
/* QR/barcode PNGs are black-ink-on-transparent — force a white backing so
   they stay visible (and scannable) on dark surfaces, not just light ones. */
.pd-barcode-img { height: 26px; width: auto; vertical-align: middle; background: #fff; padding: 2px 4px; border-radius: 3px; }
.pd-qrcode-img  { height: 42px; width: 42px; vertical-align: middle; background: #fff; padding: 2px; border-radius: 3px; }
.opd-pd-photo-cell { padding: 10px 8px; border-left: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: center; flex-shrink: 0; width: 130px; }
.opd-pd-photo-lg   { width: 114px; height: 114px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
.opd-pd-initials-lg { width: 114px; height: 114px; border-radius: 6px; border: 1px solid var(--border); background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 42px; letter-spacing: 2px; line-height: 1; text-transform: uppercase; user-select: none; }
.opd-note-area        { height: 34px; resize: vertical; }
.opd-instruction-area { height: 34px; min-height: 0 !important; resize: vertical; }
#add_prescription textarea[name^="instruction_"] { height: 34px; min-height: 0 !important; resize: vertical; }

/* ── Prescription modal: both cols scroll independently ── */
/* Small screens: normal stacked flow */
#add_prescription .opd-rx-left  { padding: 12px; }
#add_prescription .opd-rx-right { padding: 12px; }
/* Large screens (≥992px): split scroll layout */
@media (min-width: 992px) {
    #add_prescription .pup-scroll-area      { overflow-y: auto; }
    #add_prescription .modal-body           { display: flex; padding: 0; overflow: hidden; height: 100%; }
    #add_prescription .modal-body > .row    { flex: 1; margin: 0; min-height: 0; overflow: hidden; }
    #add_prescription .opd-rx-left          { overflow-y: auto; height: 100%; }
    #add_prescription .opd-rx-right         { overflow-y: auto; height: 100%; }
    #add_prescription .opd-rx-left::-webkit-scrollbar,
    #add_prescription .opd-rx-right::-webkit-scrollbar            { width: 4px; }
    #add_prescription .opd-rx-left::-webkit-scrollbar-track,
    #add_prescription .opd-rx-right::-webkit-scrollbar-track      { background: transparent; }
    #add_prescription .opd-rx-left::-webkit-scrollbar-thumb,
    #add_prescription .opd-rx-right::-webkit-scrollbar-thumb      { background: var(--border); border-radius: 4px; }
    #add_prescription .opd-rx-left::-webkit-scrollbar-thumb:hover,
    #add_prescription .opd-rx-right::-webkit-scrollbar-thumb:hover { background: var(--muted); }
}

/* ── Prescription medicine table: stop horizontal scroll inside modal ──
   The `.table-responsive` wrapper around #tableID (a tbody) triggers
   overflow-x: auto whenever th min-widths (200+110+120+120+160+50 ≈ 760px)
   plus padding exceed the col-lg-9 column. Drop the min-widths so columns
   shrink to fit, lock layout to fixed, and clip rather than scroll. */
#add_prescription .table-responsive { overflow-x: hidden !important; }
#add_prescription .table-responsive > table { table-layout: fixed; width: 100%; }
#add_prescription .table-responsive > table > thead > tr > th { min-width: 0 !important; }

/* ── Datepicker wrapper — allows calendar dropdown to overflow card/modal boundary ── */
.sh-datepicker-wrap { position: relative; overflow: visible !important; }

/* ── Modal header patient select width ── */
.sh-header-select-wrap { width: 220px; }

/* ============================================================
   OPD / IPD MEDICATION TAB — Card-and-chips redesign (v2)
   Scoped under .opd-med-v2 — zero conflict with old table classes
   ============================================================ */
.opd-med-v2 { padding: 16px 18px 24px; }
.opd-med-v2 .med-date-group  { margin-bottom: 22px; }
.opd-med-v2 .med-date-group:last-child { margin-bottom: 0; }
.opd-med-v2 .med-date-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.opd-med-v2 .med-date-badge  { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 20px; padding: 3px 12px 3px 8px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.opd-med-v2 .med-date-badge .fa { color: var(--muted); font-size: 11px; }
.opd-med-v2 .med-date-day    { font-size: 10.5px; font-weight: 500; color: var(--muted); background: var(--amber-soft); border: 1px solid #f0ddb2; padding: 2px 8px; border-radius: 10px; }
.opd-med-v2 .med-date-line   { flex: 1; height: 1px; background: var(--border-light); }
.opd-med-v2 .med-row         { display: flex; align-items: flex-start; padding: 10px 10px 10px 14px; background: var(--surface); border-radius: var(--radius-md); margin-bottom: 8px; border: 1px solid var(--border-light); box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s; }
.opd-med-v2 .med-row:hover   { box-shadow: var(--shadow); border-color: var(--border-strong); }
.opd-med-v2 .med-name-col    { width: 155px; min-width: 140px; flex-shrink: 0; padding-right: 12px; padding-top: 2px; border-right: 1px dashed var(--border); margin-right: 14px; }
.opd-med-v2 .med-name        { font-size: 13px; font-weight: 700; color: var(--ink); word-break: break-word; line-height: 1.35; }
.opd-med-v2 .med-doses       { flex: 1; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; min-width: 0; }
.opd-med-v2 .dose-chip       { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--link); border-radius: var(--radius-md); padding: 9px 11px; min-width: 134px; max-width: 200px; font-size: 11.5px; transition: border-color .15s, box-shadow .15s; }
.opd-med-v2 .dose-chip:hover { border-color: var(--border-strong); border-left-color: var(--link); box-shadow: var(--shadow-sm); }
.opd-med-v2 .dose-amount     { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.2; margin-bottom: 5px; word-break: break-word; }
.opd-med-v2 .dose-time       { display: inline-flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--border); color: var(--link); border-radius: 10px; padding: 2px 8px; font-size: 11px; font-weight: 600; margin-bottom: 8px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opd-med-v2 .dose-time .fa   { font-size: 10px; color: var(--link); }
.opd-med-v2 .dose-remark     { font-size: 10.5px; color: var(--muted); font-style: italic; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.opd-med-v2 .dose-foot       { display: flex; align-items: center; gap: 6px; padding-top: 6px; border-top: 1px solid var(--border-light); }
.opd-med-v2 .dose-creator    { flex: 1; min-width: 0; font-size: 10px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opd-med-v2 .dose-index      { position: absolute; bottom: 4px; right: 7px; font-size: 9px; font-weight: 700; color: var(--faint); letter-spacing: .04em; }
.opd-med-v2 .dose-actions    { display: flex; gap: 4px; flex-shrink: 0; opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s; }
.opd-med-v2 .dose-chip:hover .dose-actions { opacity: 1; visibility: visible; }
.opd-med-v2 .dose-btn        { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 10px; transition: background .12s, color .12s, border-color .12s; text-decoration: none; }
.opd-med-v2 .dose-btn.edit:hover { color: var(--link); border-color: var(--link); background: var(--blue-soft); }
.opd-med-v2 .dose-btn.del:hover  { color: var(--red);  border-color: var(--red);  background: var(--red-soft);  }
.opd-med-v2 .dose-add-btn    { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: 1.5px dashed var(--border-strong); background: transparent; color: var(--muted); font-size: 14px; transition: background .15s, color .15s, border-color .15s; text-decoration: none; align-self: center; flex-shrink: 0; }
.opd-med-v2 .dose-add-btn:hover  { background: var(--blue-soft); color: var(--link); border-color: var(--link); border-style: solid; }
.opd-med-v2 .med-empty       { text-align: center; padding: 40px 20px; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius-lg); background: var(--surface-2); }
.opd-med-v2 .med-empty .fa   { font-size: 32px; color: var(--faint); display: block; margin-bottom: 10px; }
.opd-med-v2 .med-col-header  { display: flex; align-items: center; padding: 4px 10px 4px 14px; margin-bottom: 6px; }
.opd-med-v2 .med-col-header .med-name-col { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.opd-med-v2 .med-col-header .med-doses-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }

/* ── wrapper-dropdown-3 — cascading symptom/section filter dropdown ── */
.wrapper-dropdown-3 { position: relative; width: 100%; }
.wrapper-dropdown-3 .filterinput { border-radius: 5px; border: 1px solid var(--border); height: 33px; }
.wrapper-dropdown-3 .dropdown {
    position: absolute; top: 102%; left: 0; right: 0; z-index: 999;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    list-style: none; padding: 4px 0; padding-left: 0; margin: 0;
    opacity: 0; pointer-events: none;
    transition: opacity 0.15s ease-in;
}
.wrapper-dropdown-3.active .dropdown { opacity: 1; pointer-events: auto; }
.wrapper-dropdown-3 .dropdown li.section-placeholder {
    padding: 6px 14px 5px; font-size: 11px; font-weight: 600;
    color: var(--faint); text-transform: uppercase; letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border); pointer-events: none;
}
.wrapper-dropdown-3 .dropdown li.option .form-check {
    padding: 7px 14px 7px 36px; margin: 0; cursor: pointer;
    border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.wrapper-dropdown-3 .dropdown li.option:last-child .form-check { border-bottom: none; }
.wrapper-dropdown-3 .dropdown li.option:hover .form-check { background: var(--surface-2); }
.wrapper-dropdown-3 .dropdown li.option .form-check-input { margin-left: -22px; margin-top: 3px; cursor: pointer; }
.wrapper-dropdown-3 .dropdown li.option .form-check-label { cursor: pointer; font-size: 13px; font-weight: 400; width: 100%; color: var(--ink); }

/* ── OPD type badge — used in opd_visit_detail page-head title ── */
.opd-type-badge { background: var(--blue-soft); color: var(--blue); border: 1px solid var(--blue); font-weight: 600; }

/* ── revisitModal — allow wrapper-dropdown-3 to extend beyond card boundary ──
   sh-form-card has overflow:hidden by default (for border-radius clipping).
   Removing it here lets the symptoms dropdown list overflow the card edge.
   The header gets explicit top border-radius to compensate. */
#revisitModal .sh-form-card   { overflow: visible; }
#revisitModal .sh-card-header { border-radius: var(--radius-lg, 8px) var(--radius-lg, 8px) 0 0; }

/* ── sh-summary-input — constrains editable inputs inside sh-summary-row flex rows ── */
.sh-summary-input { max-width: 110px; min-width: 0; }

/* ── bill-patient-panel — full border card (left/right added to existing top/bottom) ── */
.bill-patient-panel {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
/* block-level images inside bii-value removes inline descender gap */
.bii-value img { display: block; }

/* ── leave-request modal utilities ── */
.sh-no-resize { resize: none; }
.sh-cal-trigger { cursor: pointer; }

/* ── Front CMS settings page — form layout + toggle + theme radio ── */
.frontcms-form .card-body .mb-3 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}
.frontcms-form .card-body .mb-3 > .form-label {
    padding-top: 0;
    margin-bottom: 0;
    text-align: right;
    font-weight: 500;
    color: var(--ink-2);
    padding-right: 12px;
    font-size: 13px;
}
.frontcms-form .card-body .mb-3 > [class*="col-"] { padding: 0 8px; }
.frontcms-form .card-body .mb-3 > .form-label + [class*="col-"] { padding-left: 0; }

.frontcms-form .radio-img { cursor: pointer; display: block; text-align: center; }
.frontcms-form .radio-img img {
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 3px;
    max-width: 100%;
    transition: border-color .15s;
}
.frontcms-form .radio-img input[type="radio"] { display: none; }
.frontcms-form .radio-img input[type="radio"]:checked + img { border-color: var(--accent); }
.frontcms-form .radio-img .radiotext {
    display: block;
    font-size: 12px;
    margin-top: 6px;
    color: var(--muted);
}

.material-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    vertical-align: middle;
}
.material-switch > input[type="checkbox"] { display: none; }
.material-switch > label {
    cursor: pointer;
    display: block;
    width: 44px;
    height: 24px;
    position: relative;
    margin: 0;
}
.material-switch > label::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 44px;
    height: 24px;
    border-radius: 24px;
    background: var(--surface-3);
    transition: background .2s ease-in-out;
}
.material-switch > label::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: left .2s ease-in-out;
}
.material-switch > input[type="checkbox"]:checked + label::before { background: var(--accent); }
.material-switch > input[type="checkbox"]:checked + label::after  { left: 22px; }

/* ── Addons page — addon card elevated shadow ── */
.addon-services { box-shadow: var(--shadow-md) !important; }

/* ── Obstetric history form — compact textarea ── */
.obstetric-textarea { height: 28px; }

/* ── Dark mode: filterinput + findings dropdown list ── */
body.variant-b .wrapper-dropdown-3 .filterinput {
    background-color: var(--surface) !important;
    color: var(--ink) !important;
    border-color: var(--border) !important;
}
body.variant-b .wrapper-dropdown-3 .filterinput::placeholder { color: var(--muted) !important; }
body.variant-b .wrapper-dropdown-3 .dropdown {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,.35) !important;
}
body.variant-b .wrapper-dropdown-3 .dropdown li label {
    color: var(--ink) !important;
    border-bottom-color: var(--border) !important;
}
body.variant-b .wrapper-dropdown-3 .dropdown li:hover label,
body.variant-b .wrapper-dropdown-3 .dropdown li:hover .form-check { background: var(--surface-2) !important; }
body.variant-b .wrapper-dropdown-3 .dropdown li .form-check-label { color: var(--ink) !important; }

/* ── Updater page ───────────────────────────────────────────────────────── */

/* neumorphic version card */
.sh-ver-neu {
  --neu-bg:    #eaf5ea;
  --neu-dark:  #c2d9c2;
  --neu-light: #ffffff;
  background: var(--neu-bg);
  border-radius: var(--radius-lg,14px);
  padding: 16px 24px 14px;
  margin: 0 0 18px;
}
body.variant-b .sh-ver-neu {
  --neu-bg:    #1a2e1f;
  --neu-dark:  rgba(0,0,0,.4);
  --neu-light: rgba(255,255,255,.06);
}
.sh-ver-neu-logo {
  width:44px; height:44px; border-radius:calc(var(--radius-lg,14px) + 2px);
  background:var(--neu-bg);
  box-shadow:5px 5px 12px var(--neu-dark),-5px -5px 12px var(--neu-light);
  display:flex; align-items:center; justify-content:center;
  font-size:20px; color:var(--green,#22a06b);
  margin:0 auto 8px;
}
.sh-ver-neu-name { text-align:center; font-size:13px; font-weight:700; color:var(--ink); margin-bottom:8px; }
.sh-ver-neu-box {
  background:var(--neu-bg);
  border-radius:var(--radius-lg,14px);
  box-shadow:inset 3px 3px 8px var(--neu-dark),inset -3px -3px 8px var(--neu-light);
  padding:12px 16px; text-align:center;
}
.sh-ver-neu-kicker { font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; color:var(--muted); margin-bottom:4px; }
.sh-ver-neu-num { font-size:2rem; font-weight:800; color:var(--green,#22a06b); line-height:1; letter-spacing:-.02em; }

/* update available strip */
.sh-update-strip { display:flex; align-items:center; gap:12px; background:var(--surface-2,#f4f6f9); border:1.5px solid var(--border,#dee2e6); border-radius:10px; padding:14px 16px; margin-bottom:0; flex-wrap:wrap; }
.sh-update-strip-icon { width:36px; height:36px; border-radius:10px; background:linear-gradient(135deg,#f59e0b,#fbbf24); display:flex; align-items:center; justify-content:center; color:#fff; font-size:15px; flex-shrink:0; }
.sh-update-strip-body { flex:1; min-width:200px; }
.sh-update-strip-title { font-size:13px; font-weight:700; color:var(--ink,#212529); margin-bottom:1px; }
.sh-update-strip-sub   { font-size:11px; color:var(--muted,#6c757d); }
.sh-update-strip-ver   { font-size:1.3rem; font-weight:800; color:var(--accent,#2563eb); white-space:nowrap; }
.sh-update-strip form  { margin:0; flex-shrink:0; }

/* flash list */
.sh-update-list { padding:0; margin:0; list-style:none; }
.sh-update-list li { padding:2px 0; font-size:0.875rem; }

/* ── Updater page redesign — hero version display + meta grid + status pill ── */
.sh-updater-hero { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px; background:linear-gradient(135deg,var(--surface-2,#f8fafc),var(--surface,#fff)); border:1px solid var(--border,#dee2e6); border-radius:12px; flex-wrap:wrap; }
.sh-updater-hero-left { display:flex; align-items:center; gap:16px; flex:1; min-width:240px; }
.sh-updater-hero-icon { width:56px; height:56px; border-radius:14px; background:linear-gradient(135deg,var(--accent,#2563eb),var(--accent-dark,#1e40af)); color:#fff; display:flex; align-items:center; justify-content:center; font-size:24px; flex-shrink:0; box-shadow:0 4px 12px rgba(37,99,235,0.25); overflow:hidden; }
.sh-updater-hero-icon:has(img) { background:#fff; border:1px solid var(--border,#dee2e6); padding:6px; box-shadow:0 2px 6px rgba(0,0,0,0.06); }
.sh-updater-hero-icon img { max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; display:block; }
.sh-updater-hero-name { font-size:18px; font-weight:700; color:var(--ink,#212529); line-height:1.2; }
.sh-updater-hero-subtitle { font-size:12px; color:var(--muted,#6c757d); margin-top:2px; }
.sh-updater-hero-right { text-align:right; padding-left:16px; border-left:2px solid var(--border,#dee2e6); }
.sh-updater-hero-ver-label { font-size:11px; text-transform:uppercase; letter-spacing:0.5px; color:var(--muted,#6c757d); font-weight:600; }
.sh-updater-hero-ver-num { font-size:32px; font-weight:800; color:var(--accent,#2563eb); line-height:1; margin-top:4px; }

/* Status pill — used on updater hero */
.sh-status-pill { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:0.3px; }
.sh-status-pill-ok   { background:rgba(34,197,94,0.12); color:#16a34a; }
.sh-status-pill-warn { background:rgba(251,191,36,0.15); color:#d97706; }
.sh-status-pill-danger { background:rgba(239,68,68,0.12); color:#dc2626; }
.sh-status-pill-muted  { background:var(--surface-3, rgba(108,117,125,0.12)); color:var(--text-muted, #6c757d); }

/* Status badge — inline header indicator (matches queueprocess pattern) */
.stat-badge { display:inline-block; padding:3px 12px; border-radius:12px; font-size:11px; font-weight:600; vertical-align:middle; margin-left:10px; }
.stat-badge.direct { background:#e8f5e9; color:#2e7d32; border:1px solid #c8e6c9; }
.stat-badge.queue  { background:#e3f2fd; color:#1565c0; border:1px solid #bbdefb; }

/* ── Segmented tabs — underline style matching theme's nav-tabs (Users, Permission, etc.) ── */
.sh-segmented-tabs { gap:0; border:none; flex-wrap:nowrap; margin:0; padding:0; overflow-x:auto; scrollbar-width:none; }
.sh-segmented-tabs::-webkit-scrollbar { display:none; }
.sh-segmented-tabs .nav-link { white-space:nowrap; }
.sh-segmented-tabs .nav-item { margin:0; }
.sh-segmented-tabs .nav-link { font-size:13px; font-weight:500; padding:8px 16px; color:var(--muted); background:transparent; border:none; border-bottom:2px solid transparent; border-radius:0; transition:color .15s, border-color .15s; display:inline-flex; align-items:center; gap:6px; line-height:1.4; }
.sh-segmented-tabs .nav-link i { font-size:12px; opacity:.85; }
.sh-segmented-tabs .nav-link:hover { color:var(--ink); background:transparent; }
.sh-segmented-tabs .nav-link.active { color:var(--accent); background:transparent; border-bottom-color:var(--accent); font-weight:600; }

/* Environment meta grid (PHP / Environment / License cards) */
.sh-updater-meta-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; }
.sh-updater-meta-item { display:flex; align-items:center; gap:12px; padding:12px 14px; background:var(--surface-2,#f8fafc); border:1px solid var(--border,#dee2e6); border-radius:10px; }
.sh-updater-meta-icon { width:36px; height:36px; border-radius:10px; background:var(--surface,#fff); border:1px solid var(--border,#dee2e6); display:flex; align-items:center; justify-content:center; color:var(--accent,#2563eb); font-size:14px; flex-shrink:0; }
.sh-updater-meta-key  { font-size:11px; text-transform:uppercase; letter-spacing:0.4px; color:var(--muted,#6c757d); font-weight:600; }
.sh-updater-meta-val  { font-size:14px; font-weight:700; color:var(--ink,#212529); margin-top:2px; }

/* Charge Category list table column widths */
#tachelist table.ajaxlist { table-layout: fixed; }
#tachelist table.ajaxlist th:nth-child(1), #tachelist table.ajaxlist td:nth-child(1) { width: 20%; }
#tachelist table.ajaxlist th:nth-child(2), #tachelist table.ajaxlist td:nth-child(2) { width: 20%; }
#tachelist table.ajaxlist th:nth-child(3), #tachelist table.ajaxlist td:nth-child(3) { width: 60%; overflow: hidden; }

/* ── General Settings form (schsettings) ───────────────────────────────── */
.sh-form-row { margin-bottom: 16px; }
.sh-field { width: 100%; }

.session-head {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--accent, #e42527);
    margin: 4px 0 14px;
    padding: 7px 12px 7px 10px;
    border-left: 3px solid var(--accent, #e42527);
    background: rgba(228,37,39,.05);
    border-radius: 0 4px 4px 0;
    display: block;
}
body.variant-b .session-head { background: rgba(255,90,92,.07); color: var(--accent, #ff5a5c); border-left-color: var(--accent, #ff5a5c); }
body.variant-c .session-head { background: rgba(27,115,232,.06); color: var(--accent, #1b73e8); border-left-color: var(--accent, #1b73e8); }

.settinghr { border-bottom: 1px solid var(--border) !important; background: none !important; height: 1px; margin: 18px 0 16px !important; clear: both; }

.card .form-control, .card .form-select { color: var(--ink); background-color: var(--surface); border-color: var(--border); }
.card .form-control:focus, .card .form-select:focus { color: var(--ink); background-color: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.card .form-control::placeholder { color: var(--faint, #94a3b8); }
.card select.form-control option { background: var(--surface); color: var(--ink); }

/* ── Settings sidebar ───────────────────────────────────────────────────── */
.tablists-divider { height: 1px; background: var(--border); margin: 6px 8px; }
.ptbnull { border-bottom: 1px solid var(--border) !important; }
/* "ptbnull" = padding-top/bottom null. Empty divider bands
   (<div class="card-header ptbnull"></div>) are meant to be a thin 1px line,
   not a full 24px card-header. :empty zeroes their vertical padding while
   leaving content-bearing .ptbnull headers (charges/items/users/etc.) intact. */
.card-header.ptbnull:empty { padding-top: 0 !important; padding-bottom: 0 !important; }

/* ── Theme variant picker (svp-*) ───────────────────────────────────────── */
.svp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 580px;
}
.svp-card {
    position: relative;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
    background: var(--surface);
    display: block;
    user-select: none;
}
.svp-card input[type=radio] { display: none; }
.svp-card:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.svp-active { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(228,37,39,.15); }
body.variant-c .svp-active { box-shadow: 0 0 0 3px rgba(27,115,232,.18); }

/* checkmark badge */
.svp-check {
    display: none;
    position: absolute; top: 6px; right: 6px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--accent); color: #fff;
    font-size: 9px; align-items: center; justify-content: center; z-index: 1;
}
.svp-active .svp-check { display: flex; }

/* preview box */
.svp-preview {
    height: 78px; overflow: hidden;
    border-radius: 6px 6px 0 0;
    display: flex; flex-direction: column;
}
.svp-tb {
    height: 14px; display: flex; align-items: center;
    padding: 0 6px; gap: 3px; flex-shrink: 0;
}
.svp-tb-title { height: 5px; width: 38%; border-radius: 3px; margin-right: auto; }
.svp-tb-dot   { width: 5px; height: 5px; border-radius: 50%; }
.svp-tb-dot2  { width: 5px; height: 5px; border-radius: 50%; }

.svp-body { flex: 1; display: flex; overflow: hidden; }
.svp-rail {
    width: 22px; flex-shrink: 0;
    display: flex; flex-direction: column;
    gap: 3px; padding: 5px 4px;
}
.svp-ri { height: 4px; border-radius: 2px; width: 100%; }

.svp-content {
    flex: 1; padding: 6px;
    display: flex; flex-direction: column; gap: 3px;
}
.svp-row { height: 5px; border-radius: 2px; }

/* card footer */
.svp-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 10px;
    border-top: 1px solid var(--border);
}
.svp-name { font-size: 12px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.svp-sub  { font-size: 10px; color: var(--muted); }
.svp-pill {
    font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    background: var(--accent); color: #fff;
    padding: 2px 7px; border-radius: 10px; white-space: nowrap; flex-shrink: 0;
}

/* ── Nurse Note timeline (nn-*) ───────────────────────────── */
.nn-timeline { position: relative; padding-left: 28px; margin-top: 10px; }
.nn-timeline::before { content: ""; position: absolute; left: 10px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.nn-item { position: relative; margin-bottom: 18px; }
.nn-item::before { content: ""; position: absolute; left: -23px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.nn-card { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.nn-card-header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: 8px 8px 0 0; }
.nn-date-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent); padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.nn-staff { font-size: 14px; font-weight: 600; color: var(--ink); }
.nn-staff-id { color: var(--muted); font-weight: 400; font-size: 12px; }
.nn-actions { margin-left: auto; }
.nn-card-body { padding: 14px; }
.nn-note { border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--surface-2); border-radius: 0 4px 4px 0; margin: 0; color: var(--ink); }
.nn-section-label { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 600; letter-spacing: .5px; margin-bottom: 4px; }
.nn-comment { background: var(--surface-2); border: 1px solid var(--amber); border-radius: 4px; padding: 8px 12px; margin-top: 12px; color: var(--ink); }
.nn-comment-meta { font-size: 11px; color: var(--amber); }
.nn-fields dt { font-weight: 600; color: var(--ink); }
.nn-fields dd { color: var(--muted); }
.nn-subcomment { border-top: 1px solid var(--border); padding: 10px 14px; font-size: 13px; background: var(--surface-2); }
.nn-subcomment:last-child { border-radius: 0 0 8px 8px; }
.nn-subcomment-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.nn-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.nn-empty i { font-size: 48px; margin-bottom: 12px; display: block; }


/* ==========================================================================
   Tempus Dominus 6 Picker — Theme Overrides
   Replaces BS3 bootstrap-datepicker / datetimepicker / timepicker / daterangepicker
   ========================================================================== */

/* Picker dropdown — set CSS variable explicitly to ensure z-index stays at 9999+ above all modals.
   BS5 modal: 1055, modal-backdrop: 1050. TD 6 picker must be above when appended to body level.
   The CSS variable approach works because TD 6 widget uses z-index: var(--td-widget-z-index). */
:root {
    --td-widget-z-index: 9999;
}
.tempus-dominus-widget {
    z-index: 9999 !important; /* hard override to escape any modal stacking context */
    box-shadow: 0 8px 24px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.08);
    border: 1px solid #e3e6ec;
    border-radius: 8px;
}
/* Also handle case when widget is inside a positioned container (modal-body etc.) */
.modal .tempus-dominus-widget {
    z-index: 9999 !important;
}

/* Picker input fields — clickable cursor + hide blinking caret since input opens picker */
input.form-control.date,
input.form-control.datetime,
input.form-control.timepicker,
input.form-control.daterange {
    cursor: pointer;
    caret-color: transparent;
}
input.form-control.date:focus,
input.form-control.datetime:focus,
input.form-control.timepicker:focus,
input.form-control.daterange:focus {
    caret-color: auto;
}

/* Selected day/month/year — match project primary color (AdminLTE blue) */
.tempus-dominus-widget .date-container-days .day.active,
.tempus-dominus-widget .date-container-days .day.active:hover,
.tempus-dominus-widget .date-container-months .month.active,
.tempus-dominus-widget .date-container-years .year.active,
.tempus-dominus-widget .date-container-decades .decade.active {
    background-color: var(--sh-color-primary, #3c8dbc) !important;
    color: #fff;
}
.tempus-dominus-widget .date-container-days .day.today:not(.active) {
    color: var(--sh-color-primary, #3c8dbc);
    font-weight: 600;
}

/* Hover state for all selectable cells */
.tempus-dominus-widget .date-container-days .day:not(.disabled):hover,
.tempus-dominus-widget .date-container-months .month:not(.disabled):hover,
.tempus-dominus-widget .date-container-years .year:not(.disabled):hover,
.tempus-dominus-widget .date-container-decades .decade:not(.disabled):hover {
    background-color: var(--sh-color-primary-soft, #eaf3fb);
}

/* Time picker (clock) selected hour/minute */
.tempus-dominus-widget .time-container .picker-switch.active {
    background-color: var(--sh-color-primary, #3c8dbc);
    color: #fff;
}

/* Input group icon background for picker fields */
.input-group .form-control.date,
.input-group .form-control.datetime,
.input-group .form-control.timepicker,
.input-group .form-control.daterange {
    background-color: #fff;
}

/* ==========================================================================
   Modern Action Buttons (Today / Clear / Close) — bottom toolbar
   ========================================================================== */
.tempus-dominus-widget .toolbar {
    border-top: 1px solid #eef0f3;
    padding: 8px 6px;
    display: flex;
    gap: 6px;
    justify-content: center;
    background: linear-gradient(to bottom, #fafbfc 0%, #f4f6f9 100%);
    border-radius: 0 0 8px 8px;
}
.tempus-dominus-widget .toolbar > div[data-action] {
    flex: 1;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    color: #495057;
}

/* Today button — primary blue gradient */
.tempus-dominus-widget .toolbar > div[data-action="today"] {
    background: linear-gradient(135deg, #3c8dbc 0%, #2c6f96 100%);
    color: #fff;
    box-shadow: 0 1px 2px rgba(60,141,188,.25);
}
.tempus-dominus-widget .toolbar > div[data-action="today"]:hover {
    background: linear-gradient(135deg, #4a9bcc 0%, #357fa6 100%);
    box-shadow: 0 3px 8px rgba(60,141,188,.35);
    transform: translateY(-1px);
}
.tempus-dominus-widget .toolbar > div[data-action="today"] span { color: #fff; }
.tempus-dominus-widget .toolbar > div[data-action="today"]::after { content: 'Today'; }

/* Clear button — soft red (warning) */
.tempus-dominus-widget .toolbar > div[data-action="clear"] {
    background: #fff;
    color: #d9534f;
    border-color: #f1d3d2;
}
.tempus-dominus-widget .toolbar > div[data-action="clear"]:hover {
    background: #fef0ef;
    color: #c9302c;
    border-color: #e8b3b1;
    box-shadow: 0 2px 6px rgba(217,83,79,.15);
}
.tempus-dominus-widget .toolbar > div[data-action="clear"] span { color: inherit; }
.tempus-dominus-widget .toolbar > div[data-action="clear"]::after { content: 'Clear'; }

/* Close button — neutral gray */
.tempus-dominus-widget .toolbar > div[data-action="close"] {
    background: #fff;
    color: #6c757d;
    border-color: #dee2e6;
}
.tempus-dominus-widget .toolbar > div[data-action="close"]:hover {
    background: #f1f3f5;
    color: #343a40;
    border-color: #ced4da;
    box-shadow: 0 2px 6px rgba(108,117,125,.15);
}
.tempus-dominus-widget .toolbar > div[data-action="close"] span { color: inherit; }
.tempus-dominus-widget .toolbar > div[data-action="close"]::after { content: 'Close'; }

/* Active state for all buttons (button press feedback) */
.tempus-dominus-widget .toolbar > div[data-action]:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 3px rgba(0,0,0,.1);
}

/* AM/PM Meridiem toggle button — same primary blue gradient as Today button */
.tempus-dominus-widget .toggleMeridiem {
    background: linear-gradient(135deg, #3c8dbc 0%, #2c6f96 100%);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 8px 14px;
    margin: 4px;
    height: auto;
    min-height: 38px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 1px 2px rgba(60,141,188,.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tempus-dominus-widget .toggleMeridiem:hover {
    background: linear-gradient(135deg, #4a9bcc 0%, #357fa6 100%);
    box-shadow: 0 3px 8px rgba(60,141,188,.35);
    transform: translateY(-1px);
}
.tempus-dominus-widget .toggleMeridiem:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 3px rgba(0,0,0,.15);
}

/* ==========================================================================
   Tempus Dominus 6 — DARK MODE Overrides
   Activated when <body> has class "variant-b" (Dark Premium theme)
   ========================================================================== */

body.variant-b .tempus-dominus-widget {
    background-color: var(--surface, #1A2027) !important;
    color: var(--ink, #E8EDF2);
    border: 1px solid var(--border, rgba(255,255,255,.08));
    box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.4);
}

/* Header (month/year navigation arrows + label) */
body.variant-b .tempus-dominus-widget .picker-switch,
body.variant-b .tempus-dominus-widget .calendar-header,
body.variant-b .tempus-dominus-widget .date-container-decades .picker-switch,
body.variant-b .tempus-dominus-widget [data-action="previous"],
body.variant-b .tempus-dominus-widget [data-action="next"],
body.variant-b .tempus-dominus-widget [data-action="pickerSwitch"] {
    color: var(--ink, #E8EDF2) !important;
    background-color: transparent;
}
body.variant-b .tempus-dominus-widget [data-action="previous"]:hover,
body.variant-b .tempus-dominus-widget [data-action="next"]:hover,
body.variant-b .tempus-dominus-widget [data-action="pickerSwitch"]:hover {
    background-color: var(--surface-2, #222A33) !important;
}

/* Day cells, month cells, year cells, decade cells */
body.variant-b .tempus-dominus-widget .date-container-days .day,
body.variant-b .tempus-dominus-widget .date-container-months .month,
body.variant-b .tempus-dominus-widget .date-container-years .year,
body.variant-b .tempus-dominus-widget .date-container-decades .decade,
body.variant-b .tempus-dominus-widget .dow {
    color: var(--ink, #E8EDF2) !important;
}

/* Other-month days (faded) */
body.variant-b .tempus-dominus-widget .date-container-days .day.old,
body.variant-b .tempus-dominus-widget .date-container-days .day.new {
    color: var(--faint, #5F6B7A) !important;
}

/* Day-of-week header (Mon, Tue, ...) */
body.variant-b .tempus-dominus-widget .dow,
body.variant-b .tempus-dominus-widget .calendar-header .dow {
    color: var(--muted, #8995A4) !important;
    background-color: var(--surface-2, #222A33);
}

/* Hover state — dark variant: subtle blue tint */
body.variant-b .tempus-dominus-widget .date-container-days .day:not(.disabled):hover,
body.variant-b .tempus-dominus-widget .date-container-months .month:not(.disabled):hover,
body.variant-b .tempus-dominus-widget .date-container-years .year:not(.disabled):hover,
body.variant-b .tempus-dominus-widget .date-container-decades .decade:not(.disabled):hover {
    background-color: var(--blue-soft, rgba(78,162,255,.12)) !important;
    color: var(--ink, #E8EDF2) !important;
}

/* Selected (active) — dark variant: bright blue */
body.variant-b .tempus-dominus-widget .date-container-days .day.active,
body.variant-b .tempus-dominus-widget .date-container-days .day.active:hover,
body.variant-b .tempus-dominus-widget .date-container-months .month.active,
body.variant-b .tempus-dominus-widget .date-container-years .year.active,
body.variant-b .tempus-dominus-widget .date-container-decades .decade.active {
    background-color: var(--blue, #4EA2FF) !important;
    color: var(--surface, #1A2027) !important;
    font-weight: 600;
}

/* Today (not selected) — blue text + bold */
body.variant-b .tempus-dominus-widget .date-container-days .day.today:not(.active) {
    color: var(--blue, #4EA2FF) !important;
    font-weight: 700;
    border: 1px solid var(--blue-soft, rgba(78,162,255,.12));
}

/* Disabled day */
body.variant-b .tempus-dominus-widget .date-container-days .day.disabled,
body.variant-b .tempus-dominus-widget .date-container-months .month.disabled,
body.variant-b .tempus-dominus-widget .date-container-years .year.disabled {
    color: var(--faint, #5F6B7A) !important;
    opacity: .5;
}

/* Time picker (clock) */
body.variant-b .tempus-dominus-widget .time-container {
    background-color: var(--surface-2, #222A33);
}
body.variant-b .tempus-dominus-widget .time-container .picker-switch {
    color: var(--ink, #E8EDF2);
}
body.variant-b .tempus-dominus-widget .time-container .picker-switch.active {
    background-color: var(--blue, #4EA2FF) !important;
    color: var(--surface, #1A2027) !important;
}
body.variant-b .tempus-dominus-widget .time-container .separator {
    color: var(--ink, #E8EDF2);
}
body.variant-b .tempus-dominus-widget .time-container [data-action="incrementHours"],
body.variant-b .tempus-dominus-widget .time-container [data-action="incrementMinutes"],
body.variant-b .tempus-dominus-widget .time-container [data-action="decrementHours"],
body.variant-b .tempus-dominus-widget .time-container [data-action="decrementMinutes"] {
    color: var(--ink-2, #C5CDD5);
}
body.variant-b .tempus-dominus-widget .time-container [data-action="incrementHours"]:hover,
body.variant-b .tempus-dominus-widget .time-container [data-action="incrementMinutes"]:hover,
body.variant-b .tempus-dominus-widget .time-container [data-action="decrementHours"]:hover,
body.variant-b .tempus-dominus-widget .time-container [data-action="decrementMinutes"]:hover {
    background-color: var(--surface-3, #2D3640);
    color: var(--blue, #4EA2FF);
}

/* AM/PM toggle in dark mode — bright blue gradient */
body.variant-b .tempus-dominus-widget .toggleMeridiem {
    background: linear-gradient(135deg, var(--blue, #4EA2FF) 0%, #2E7DD7 100%) !important;
    color: var(--surface, #1A2027) !important;
    box-shadow: 0 1px 2px rgba(78,162,255,.25);
}
body.variant-b .tempus-dominus-widget .toggleMeridiem:hover {
    background: linear-gradient(135deg, #6BB0FF 0%, #3F8DDC 100%) !important;
    box-shadow: 0 3px 8px rgba(78,162,255,.35);
}

/* Toolbar / action buttons (Today / Clear / Close) — dark variant */
body.variant-b .tempus-dominus-widget .toolbar {
    background: linear-gradient(to bottom, var(--surface-2, #222A33) 0%, var(--surface-3, #2D3640) 100%);
    border-top: 1px solid var(--border, rgba(255,255,255,.08));
}
body.variant-b .tempus-dominus-widget .toolbar > div[data-action] {
    color: var(--ink-2, #C5CDD5);
}
body.variant-b .tempus-dominus-widget .toolbar > div[data-action="today"] {
    background: linear-gradient(135deg, var(--blue, #4EA2FF) 0%, #2E7DD7 100%);
    color: var(--surface, #1A2027);
    box-shadow: 0 1px 2px rgba(78,162,255,.25);
}
body.variant-b .tempus-dominus-widget .toolbar > div[data-action="today"]:hover {
    background: linear-gradient(135deg, #6BB0FF 0%, #3F8DDC 100%);
    box-shadow: 0 3px 8px rgba(78,162,255,.35);
}
body.variant-b .tempus-dominus-widget .toolbar > div[data-action="today"] span { color: var(--surface, #1A2027); }
body.variant-b .tempus-dominus-widget .toolbar > div[data-action="clear"] {
    background: var(--surface, #1A2027);
    color: var(--red, #F87171);
    border-color: var(--red-soft, rgba(248,113,113,.12));
}
body.variant-b .tempus-dominus-widget .toolbar > div[data-action="clear"]:hover {
    background: var(--red-soft, rgba(248,113,113,.12));
    color: var(--red, #F87171);
    border-color: var(--red, #F87171);
}
body.variant-b .tempus-dominus-widget .toolbar > div[data-action="close"] {
    background: var(--surface, #1A2027);
    color: var(--ink-2, #C5CDD5);
    border-color: var(--border, rgba(255,255,255,.08));
}
body.variant-b .tempus-dominus-widget .toolbar > div[data-action="close"]:hover {
    background: var(--surface-3, #2D3640);
    color: var(--ink, #E8EDF2);
    border-color: var(--border-strong, rgba(255,255,255,.18));
}

/* Picker arrow/caret pointing to input */
body.variant-b .tempus-dominus-widget::before,
body.variant-b .tempus-dominus-widget::after {
    border-bottom-color: var(--surface, #1A2027) !important;
    border-top-color: var(--surface, #1A2027) !important;
}

/* Input fields in dark mode — match background */
body.variant-b input.form-control.date,
body.variant-b input.form-control.datetime,
body.variant-b input.form-control.timepicker,
body.variant-b input.form-control.daterange {
    background-color: var(--surface-2, #222A33);
    color: var(--ink, #E8EDF2);
    border-color: var(--border, rgba(255,255,255,.08));
}

/* ── Staff Profile — sh-ph-* / sh-overview / sh-field-grid ──────────── */
.sh-ph-card { }
.sh-ph-top-right { position:absolute; top:14px; right:16px; display:flex; align-items:center; gap:8px; }
.sh-ph-qr-img { background:#fff; padding:2px; border:1px solid var(--border); border-radius:4px; }
.sh-ph-codes img { background:#fff; padding:4px; }
.sh-ph-identity { min-width:0; padding-right:160px; }
.sh-ph-name { font-size:20px; letter-spacing:-.3px; }
.sh-ph-badge-role { background:rgba(var(--accent-rgb,59,111,232),.12); color:var(--accent); border:1px solid rgba(var(--accent-rgb,59,111,232),.2); }
.sh-ph-badge-empid { background:var(--blue-soft); color:var(--blue); }
.sh-ph-badge-dept { background:var(--surface-3); color:var(--muted); }
.sh-ph-actions { border-top:1px solid rgba(226,232,240,.8); }
.sh-ph-switcher-thumb { width:36px; height:36px; object-fit:cover; border:1px solid var(--border); }

.sh-overview-header { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); padding:12px 18px; background:var(--surface-2); border-bottom:1px solid var(--border); }
.sh-link-icon { color:var(--link); }

/* Activity / profile field grid */
.sh-field-grid { display:grid; grid-template-columns:1fr 1fr; }
.sh-field-item { padding:10px 16px; border-bottom:1px solid var(--border-light,#f1f5f9); }
.sh-fi-l { border-right:1px solid var(--border-light,#f1f5f9); }
.sh-fi-full { grid-column:1/-1; }
.sh-fi-section { grid-column:1/-1; padding:6px 16px; background:var(--surface-2); border-top:1px solid var(--border); border-bottom:1px solid var(--border); font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:var(--muted); }
.sh-fi-section:first-child { border-top:none; }
.sh-fi-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); margin-bottom:2px; }
.sh-fi-value { font-size:13px; font-weight:500; color:var(--ink); word-break:break-word; }
.sh-fi-value a { color:var(--link); }

/* Social icon brand colours */
.sh-si-fb { color:#1877F2; font-size:15px; }
.sh-si-tw { color:#1DA1F2; font-size:15px; }
.sh-si-li { color:#0A66C2; font-size:15px; }
.sh-si-ig { color:#E1306C; font-size:15px; }
.sh-social-link-off { opacity:.45; cursor:default; }

/* KPI icon colour variants */
.sh-kpi-green { background:var(--green-soft); color:var(--green); }
.sh-kpi-blue  { background:var(--blue-soft);  color:var(--blue);  }
.sh-kpi-teal  { background:var(--teal-soft);  color:var(--teal);  }
.sh-kpi-red   { background:var(--red-soft);   color:var(--red);   }

/* Staff profile misc */
.sh-leave-allot { color:var(--muted); font-weight:400; }
.sh-att-filter-bar { background:var(--surface-2); border:1px solid var(--border); border-radius:8px; padding:10px 14px; }
.sh-att-year-sel { width:100px; }
.sh-att-legend { font-size:11px; font-weight:600; color:var(--muted); }
.sh-att-legend-item { display:inline-flex; align-items:center; gap:4px; background:var(--surface); border:1px solid var(--border); border-radius:20px; padding:3px 10px; white-space:nowrap; font-size:11px; font-weight:600; color:var(--muted); }
.sh-att-legend-val { color:var(--ink); display:inline-block; vertical-align:baseline; }
.sh-att-legend-val, .sh-att-legend-val * { font-size:11px !important; font-weight:700 !important; line-height:1 !important; font-family:inherit !important; vertical-align:baseline !important; }
.sh-att-link { color:var(--ink); }
.sh-cursor-pointer { cursor:pointer; }

/* ── Staff Timeline ──────────────────────────────────────── */
.sh-timeline-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; gap:10px; flex-wrap:wrap; }
.sh-timeline-label { font-weight:700; font-size:11px; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); }
.sh-timeline { position:relative; padding-left:26px; }
.sh-timeline::before { content:''; position:absolute; left:7px; top:8px; bottom:8px; width:2px; background:var(--border); border-radius:2px; }
.sh-tl-item { position:relative; margin-bottom:14px; }
.sh-tl-item:last-child { margin-bottom:0; }
.sh-tl-dot { position:absolute; left:-22px; top:14px; width:14px; height:14px; border-radius:50%; background:var(--blue); border:2px solid var(--surface); box-shadow:0 0 0 2px var(--blue-soft); display:block; }
.sh-tl-card { background:var(--surface); border:1px solid var(--border); border-radius:8px; transition:box-shadow .15s ease,transform .15s ease; }
.sh-tl-card:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }
.sh-tl-head { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; gap:10px; flex-wrap:wrap; }
.sh-tl-meta { display:flex; align-items:center; gap:10px; flex-wrap:wrap; min-width:0; }
.sh-tl-date-badge { display:inline-flex; align-items:center; font-size:11px; font-weight:600; color:var(--blue); background:var(--blue-soft); border-radius:20px; padding:3px 10px; white-space:nowrap; }
.sh-tl-date-badge i { font-size:10px; opacity:.85; }
.sh-tl-title { font-size:13px; font-weight:700; color:var(--ink); word-break:break-word; }
.sh-tl-actions { display:flex; align-items:center; gap:5px; flex-shrink:0; }
.sh-tl-body { padding:0 14px 12px; font-size:13px; color:var(--muted); line-height:1.55; border-top:1px dashed var(--border); padding-top:10px; }
.sh-tl-body p:last-child { margin-bottom:0; }

/* ── Staff Switcher Offcanvas — Atrium Concept ────────────── */
.sh-switcher.offcanvas { top:52px; height:calc(100vh - 52px); height:calc(100dvh - 52px); border-top:1px solid var(--border); }
body.sh-switcher-open .offcanvas-backdrop { top:52px; background:transparent !important; --bs-backdrop-opacity:0; }
.sh-switcher { background:var(--surface); overflow:hidden; }
.sh-switcher::before { content:''; position:absolute; bottom:-120px; right:-120px; width:340px; height:340px; background:radial-gradient(circle, var(--accent-soft) 0%, transparent 70%); opacity:.7; pointer-events:none; border-radius:50%; z-index:0; }
.sh-switcher::after { content:''; position:absolute; top:-80px; left:-80px; width:240px; height:240px; background:radial-gradient(circle, var(--amber-soft) 0%, transparent 70%); opacity:.6; pointer-events:none; border-radius:50%; z-index:0; }
.sh-switcher .offcanvas-header,
.sh-switcher .offcanvas-body { position:relative; z-index:1; }

.sh-switcher-header { padding:18px 22px 14px; border-bottom:1px solid var(--border); align-items:center; }
.sh-switcher-head-content { flex:1; min-width:0; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.sh-switcher h5.sh-switcher-title,
.sh-switcher .offcanvas-title.sh-switcher-title { font-family:var(--font, 'Inter', sans-serif) !important; font-weight:700 !important; font-size:22px !important; line-height:1.2 !important; letter-spacing:-0.01em !important; color:var(--muted) !important; margin:0 !important; padding:0 !important; border:none !important; background:transparent !important; display:block !important; }
.sh-switcher-subtitle { display:inline-flex; align-items:center; font-family:var(--font, 'Inter', sans-serif); font-size:11px; font-weight:700; color:var(--accent); letter-spacing:.02em; background:var(--accent-soft); border:1px solid transparent; border-radius:99px; padding:3px 10px; line-height:1; }

/* Tabs — pill style with arrow nav */
.sh-switcher-tabs-wrap { position:relative; display:flex; align-items:stretch; padding:6px 14px 16px; border-bottom:1px solid var(--border-light, var(--border)); background:transparent; gap:4px; }
.sh-switcher-tab-arrow { flex:0 0 auto; width:28px; height:32px; border:1px solid var(--border); background:var(--surface); color:var(--muted); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:11px; border-radius:50%; transition:all .15s; }
.sh-switcher-tab-arrow:hover:not(:disabled) { color:var(--accent); background:var(--accent-soft); border-color:var(--accent); }
.sh-switcher-tab-arrow:disabled { opacity:.3; cursor:not-allowed; }
.sh-switcher-tab-arrow-left,
.sh-switcher-tab-arrow-right { border-right:none; border-left:none; }
.sh-switcher-tabs { flex:1; min-width:0; display:flex; flex-wrap:nowrap; gap:6px; padding:0 4px; background:transparent; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; -ms-overflow-style:none; -webkit-overflow-scrolling:touch; align-items:center; }
.sh-switcher-tabs::-webkit-scrollbar { display:none; height:0; width:0; }
.sh-switcher-tabs .nav-item { flex:0 0 auto; }
.sh-switcher-tabs .nav-link { font-family:var(--font, 'Inter', sans-serif); padding:6px 14px; font-size:12px; font-weight:600; letter-spacing:.01em; color:var(--muted); background:var(--surface-2); border:1px solid transparent; border-radius:100px; cursor:pointer; white-space:nowrap; transition:all .2s ease; }
.sh-switcher-tabs .nav-link:hover { background:var(--surface-3); color:var(--ink); }
.sh-switcher-tabs .nav-link.active { background:var(--accent); color:var(--accent-ink, #fff); border-color:var(--accent); box-shadow:0 4px 12px var(--accent-soft); }

/* List */
.sh-switcher-content { padding:8px 14px 14px; }
.sh-switcher-list { display:flex; flex-direction:column; gap:4px; }
.sh-switcher-item { display:flex; align-items:center; gap:14px; padding:10px 12px; border-radius:14px; text-decoration:none; color:inherit; transition:all .25s ease; position:relative; border:1px solid transparent; }
.sh-switcher-item:hover { background:var(--surface-2); color:inherit; }
.sh-switcher-avatar { width:42px; height:42px; border-radius:14px; object-fit:cover; border:1px solid var(--border); flex-shrink:0; box-shadow:0 2px 6px rgba(0,0,0,.06); }
.sh-switcher-initials { width:42px; height:42px; border-radius:14px; border:1px solid var(--border); flex-shrink:0; background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:15px; letter-spacing:1px; line-height:1; text-transform:uppercase; user-select:none; }
.sh-switcher-info { display:flex; flex-direction:column; gap:1px; min-width:0; flex:1; }
.sh-switcher-name { font-family:var(--font, 'Inter', sans-serif); font-size:13.5px; font-weight:600; line-height:1.3; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; letter-spacing:-0.005em; }
.sh-switcher-id { font-family:var(--mono, 'JetBrains Mono', monospace); font-size:11px; color:var(--muted); font-weight:500; letter-spacing:.01em; }

/* Current viewing staff — gradient + bookmark */
.sh-switcher-current { background:linear-gradient(90deg, var(--accent-soft) 0%, var(--surface-2) 100%); border-color:var(--accent); }
.sh-switcher-current:hover { background:linear-gradient(90deg, var(--accent-soft) 0%, var(--surface-2) 100%); }
.sh-switcher-current .sh-switcher-name { color:var(--accent); }
.sh-switcher-current-icon { color:var(--accent); font-size:14px; flex-shrink:0; }

/* Empty state */
.sh-switcher-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:36px 16px; color:var(--muted); gap:10px; text-align:center; }
.sh-switcher-empty i { font-size:34px; opacity:.35; color:var(--accent); }
.sh-switcher-empty span { font-family:var(--font, 'Inter', sans-serif); font-size:12px; font-weight:600; color:var(--muted); }

/* ── Staff Listing (search + disabled) ─────────────────────── */
.sh-results-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-bottom:14px; padding:8px 0; border-bottom:1px solid var(--border); }
.sh-results-label { font-size:13px; color:var(--muted); font-weight:600; }
.sh-view-switch { display:flex; gap:2px; }
.sh-vs-btn { background:var(--surface-2); border:1px solid var(--border); color:var(--muted); padding:5px 12px; font-size:12px; cursor:pointer; display:inline-flex; align-items:center; gap:5px; transition:background .15s; }
.sh-vs-btn:first-child { border-radius:3px 0 0 3px; }
.sh-vs-btn:last-child { border-radius:0 3px 3px 0; }
.sh-vs-btn.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.sh-vs-btn:hover:not(.active) { background:var(--surface-3); }

/* ── Staff Card – Design 6 (Split Panel v2) ─────────────── */
#sh-view-card .row.g-3 { display:grid !important; grid-template-columns:repeat(3,1fr); grid-auto-rows:210px; gap:16px; margin:0; }
#sh-view-card .row.g-3 > [class*="col-"] { padding:0 !important; width:auto !important; max-width:none !important; flex:none !important; }
@media(max-width:991px){ #sh-view-card .row.g-3 { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:575px){ #sh-view-card .row.g-3 { grid-template-columns:minmax(0,1fr); } }
#sh-view-card .sh-staff-card { min-width:0; }
#sh-view-card .sh-staff-content { min-width:0; }
.sh-staff-card { background:var(--surface); border-radius:var(--radius-lg); overflow:hidden; height:100%; display:flex; flex-direction:column; box-shadow:0 2px 12px rgba(0,0,0,.08); transition:box-shadow .18s,transform .18s; border:1px solid var(--border); }
.sh-staff-card:hover { box-shadow:0 6px 24px rgba(0,0,0,.14); transform:translateY(-2px); }
.sh-staff-card-body { display:flex; flex:1; }

.sh-staff-sidebar { width:100px; flex-shrink:0; display:flex; align-items:center; justify-content:center; padding:0; position:relative; background:var(--surface-3) !important; }
.sh-staff-sidebar::before { content:''; position:absolute; inset:0; background:rgba(255,255,255,.44); pointer-events:none; z-index:0; }
.sh-staff-sidebar > * { position:relative; z-index:1; }
.sh-staff-av-wrap { position:absolute; inset:5px; border-radius:6px; overflow:hidden; z-index:2; }
.sh-staff-av { width:100%; height:100%; border-radius:0; background:#9ca3af; border:none; box-shadow:none; font-size:34px; font-weight:800; color:#fff; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.sh-staff-av img { width:100%; height:100%; object-fit:cover; border-radius:0; }
.sh-staff-online { display:none; }

.sh-staff-content { flex:1; min-width:0; padding:12px 10px 10px; display:flex; flex-direction:column; }
.sh-staff-head-row { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-bottom:2px; }
.sh-staff-name { font-size:15.5px; font-weight:700; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.2; flex:1; min-width:0; }
.sh-staff-eid-tag { font-size:12px; font-weight:700; color:var(--ink-2); margin-bottom:8px; display:block; }
.sh-staff-eid-tag::after { content:''; display:block; width:50%; height:1px; background:var(--border); margin-top:5px; }
.sh-staff-role-row { display:flex; flex-wrap:nowrap; align-items:center; gap:4px; flex-shrink:0; margin-bottom:0; }
.sh-role-badge { display:inline-block; font-size:12px; font-weight:700; padding:4px 12px; border-radius:3px; letter-spacing:.01em; }
.sh-dept-badge { display:inline-flex; align-items:center; font-size:11px; font-weight:600; padding:3px 10px; border-radius:3px; background:var(--surface-3); color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.role-doctor { background:var(--green-soft); color:var(--green); }
.role-nurse { background:var(--blue-soft); color:var(--blue); }
.role-admin { background:var(--red-soft); color:var(--red); }
.role-pharmacist { background:var(--amber-soft); color:var(--amber); }
.role-default { background:var(--surface-3); color:var(--muted); }

.sh-staff-rows { display:grid; grid-template-columns:1fr 1fr; gap:7px 8px; flex:1; align-content:start; }
.sh-staff-row { display:flex; align-items:center; gap:7px; min-width:0; }
.sh-staff-ico { width:26px; height:26px; border-radius:7px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:11px; }
.sh-ico-a { background:var(--accent-soft); color:var(--accent); }
.sh-ico-g { background:var(--green-soft); color:var(--green); }
.sh-ico-b { background:var(--blue-soft); color:var(--blue); }
.sh-ico-p { background:var(--amber-soft); color:var(--amber); }
.sh-staff-row-text { min-width:0; flex:1; }
.sh-staff-row-label { display:block; font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--faint); line-height:1.2; }
.sh-staff-row-val { display:block; font-size:11.5px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.sh-staff-card-actions { border-top:1px solid var(--border); background:var(--surface-2); padding:8px 12px; display:flex; gap:6px; }
.sh-staff-card-actions a { flex:1; text-align:center; padding:5px 8px; border-radius:var(--radius); font-size:11.5px; font-weight:600; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:5px; transition:all .15s; border:1.5px solid transparent; }
.sh-btn-view { background:var(--accent-soft); color:var(--accent); border-color:transparent; }
.sh-btn-view:hover { background:var(--accent); color:#fff; }
.sh-btn-edit { background:var(--surface-3); color:var(--ink-2); border:1.5px solid transparent !important; }
.sh-btn-edit:hover { background:var(--surface-3); color:var(--ink); border-color:var(--border-strong) !important; }
.sh-btn-enable { background:var(--green-soft); color:var(--green); border-color:transparent; }
.sh-btn-enable:hover { border-color:var(--green); color:var(--green); }

.sh-tbl-name-cell { display:flex; align-items:center; gap:10px; }
.sh-tbl-avatar { width:32px; height:32px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color:#fff; flex-shrink:0; overflow:hidden; }
.sh-tbl-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.sh-tbl-name { font-weight:600; color:var(--ink); }

/* ── Side-by-side card alignment helper ────────────────────────
   Use on a smaller "summary" card sitting beside a taller "details"
   card (in a Bootstrap row). Card stretches to row height, content
   flows top-to-bottom with the highlighted total/due row pushed to
   the bottom — no awkward empty space inside or below the card.
   Optional sticky behavior keeps it visible while details scroll.
   ────────────────────────────────────────────────────────────── */
.sh-sticky-summary { display:flex; flex-direction:column; height:100%; }
.sh-sticky-summary .sh-due-row { margin-top:auto; }

/* KPI clickable card */
.sh-kpi-card { border:1px solid var(--border); background:var(--surface); border-radius:var(--radius-lg,8px); padding:14px 16px; display:flex; align-items:center; gap:12px; text-decoration:none; color:inherit; transition:box-shadow .15s,transform .15s; height:100%; }
.sh-kpi-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); color:inherit; }

/* Profile header chip */
.sh-ph-chip { display:inline-flex; align-items:center; gap:5px; font-size:12px; color:var(--muted); background:var(--surface-2,var(--surface-3,#f1f5f9)); border:1px solid var(--border); border-radius:20px; padding:3px 10px; white-space:nowrap; }
.sh-ph-chip i { font-size:11px; opacity:.75; }

/* Profile avatar v2 — slightly larger with shadow ring */
.sh-ph-avatar-v2 { width:100px; height:100px; border-radius:50%; object-fit:cover; border:3px solid var(--accent); box-shadow:0 4px 14px var(--accent-soft); }
.sh-ph-initials-v2 { width:100px; height:100px; border-radius:50%; border:3px solid var(--accent); box-shadow:0 4px 14px var(--accent-soft); background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:36px; letter-spacing:2px; line-height:1; text-transform:uppercase; user-select:none; }

/* ── Payslip Modal View ──────────────────────────────────────── */
.sh-payslip { font-size:13px; background:var(--surface); }
.sh-payslip-header { line-height:0; }
.sh-payslip-period { text-align:center; font-size:15px; font-weight:700; padding:12px 16px 10px; color:var(--ink); background:var(--surface-2); border-bottom:1px solid var(--border); }
.sh-payslip-meta { display:flex; justify-content:space-between; align-items:center; padding:7px 16px; background:var(--surface); border-bottom:1px solid var(--border); font-size:12px; font-weight:600; color:var(--muted); }
.sh-payslip-empinfo { padding:12px 16px; border-bottom:1px solid var(--border); }
.sh-payslip-ei-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px 20px; }
.sh-payslip-ei-item { display:flex; flex-direction:column; gap:2px; }
.sh-payslip-ei-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); }
.sh-payslip-ei-value { font-size:13px; font-weight:600; color:var(--ink); }
.sh-payslip-body { padding:12px 16px; border-bottom:1px solid var(--border); }
.sh-payslip-table { border-collapse:collapse; width:100%; }
.sh-payslip-table th, .sh-payslip-table td { padding:6px 10px; border:1px solid var(--border); font-size:12px; vertical-align:middle; }
.sh-payslip-table thead th { background:var(--surface-2); color:var(--muted); font-weight:700; text-transform:uppercase; font-size:10px; letter-spacing:.4px; }
.sh-payslip-table tfoot th { background:var(--surface-2); font-weight:700; color:var(--ink); font-size:12px; }
.sh-payslip-summary { padding:12px 16px; }
.sh-payslip-sum-row { display:flex; justify-content:space-between; align-items:center; padding:6px 0; border-bottom:1px solid var(--border); font-size:13px; }
.sh-payslip-sum-row > span:first-child { color:var(--muted); }
.sh-payslip-sum-row > span:last-child { font-weight:600; color:var(--ink); }
.sh-payslip-net { margin-top:6px; padding:9px 14px; background:var(--green-soft); border-radius:6px; border:none !important; }
.sh-payslip-net > span:first-child { color:var(--green) !important; font-weight:700; }
.sh-payslip-net > span:last-child { color:var(--green) !important; font-size:16px; font-weight:800; }

/* ============================================================
   D. DROPIFY (file upload) — dark theme compatibility
   Covers variant-b AND all named dark presets (nightshift=variant-a,
   midnight, oled) because these presets don't carry the variant-b class.
   ============================================================ */
body[data-preset="nightshift"] .dropify-wrapper,
body[data-preset="midnight"] .dropify-wrapper,
body[data-preset="oled"] .dropify-wrapper,
body.variant-b .dropify-wrapper{
  background:var(--surface-2) !important;
  border-color:var(--border-strong) !important;
  color:var(--ink-2) !important;
}
body[data-preset="nightshift"] .dropify-wrapper:hover,
body[data-preset="midnight"] .dropify-wrapper:hover,
body[data-preset="oled"] .dropify-wrapper:hover,
body.variant-b .dropify-wrapper:hover{
  background:var(--surface-3) !important;
  border-color:var(--accent) !important;
}
body[data-preset="nightshift"] .dropify-wrapper.has-preview,
body[data-preset="midnight"] .dropify-wrapper.has-preview,
body[data-preset="oled"] .dropify-wrapper.has-preview,
body.variant-b .dropify-wrapper.has-preview{
  background:var(--surface) !important;
}
body[data-preset="nightshift"] .dropify-wrapper .dropify-message p,
body[data-preset="midnight"] .dropify-wrapper .dropify-message p,
body[data-preset="oled"] .dropify-wrapper .dropify-message p,
body.variant-b .dropify-wrapper .dropify-message p{
  color:var(--ink-2) !important;
}
body[data-preset="nightshift"] .dropify-wrapper .dropify-message span.file-icon::before,
body[data-preset="midnight"] .dropify-wrapper .dropify-message span.file-icon::before,
body[data-preset="oled"] .dropify-wrapper .dropify-message span.file-icon::before,
body.variant-b .dropify-wrapper .dropify-message span.file-icon::before{
  color:var(--muted) !important;
}
body[data-preset="nightshift"] .dropify-wrapper .dropify-preview,
body[data-preset="midnight"] .dropify-wrapper .dropify-preview,
body[data-preset="oled"] .dropify-wrapper .dropify-preview,
body.variant-b .dropify-wrapper .dropify-preview{
  background:var(--surface-2) !important;
}
body[data-preset="nightshift"] .dropify-wrapper .dropify-preview .dropify-infos,
body[data-preset="midnight"] .dropify-wrapper .dropify-preview .dropify-infos,
body[data-preset="oled"] .dropify-wrapper .dropify-preview .dropify-infos,
body.variant-b .dropify-wrapper .dropify-preview .dropify-infos{
  background:rgba(15,20,25,.78) !important;
  color:#fff !important;
}
body[data-preset="nightshift"] .dropify-wrapper .dropify-preview .dropify-infos .dropify-filename,
body[data-preset="nightshift"] .dropify-wrapper .dropify-preview .dropify-infos .dropify-infos-inner p,
body[data-preset="midnight"] .dropify-wrapper .dropify-preview .dropify-infos .dropify-filename,
body[data-preset="midnight"] .dropify-wrapper .dropify-preview .dropify-infos .dropify-infos-inner p,
body[data-preset="oled"] .dropify-wrapper .dropify-preview .dropify-infos .dropify-filename,
body[data-preset="oled"] .dropify-wrapper .dropify-preview .dropify-infos .dropify-infos-inner p,
body.variant-b .dropify-wrapper .dropify-preview .dropify-infos .dropify-filename,
body.variant-b .dropify-wrapper .dropify-preview .dropify-infos .dropify-infos-inner p{
  color:#fff !important;
}
body[data-preset="nightshift"] .dropify-wrapper .dropify-clear,
body[data-preset="midnight"] .dropify-wrapper .dropify-clear,
body[data-preset="oled"] .dropify-wrapper .dropify-clear,
body.variant-b .dropify-wrapper .dropify-clear{
  background:var(--accent) !important;color:#fff !important;border-color:var(--accent) !important;
}
body[data-preset="nightshift"] .dropify-wrapper .dropify-clear:hover,
body[data-preset="midnight"] .dropify-wrapper .dropify-clear:hover,
body[data-preset="oled"] .dropify-wrapper .dropify-clear:hover,
body.variant-b .dropify-wrapper .dropify-clear:hover{
  background:var(--accent-dark) !important;
}
body[data-preset="nightshift"] .dropify-errors-container,
body[data-preset="midnight"] .dropify-errors-container,
body[data-preset="oled"] .dropify-errors-container,
body.variant-b .dropify-errors-container{
  background:var(--accent-soft) !important;color:var(--accent) !important;border-color:var(--accent) !important;
}

/* ============================================================
   E. FRONTCMS admin (.fcms-*) — dark theme overrides
   Inline styles in views/admin/frontcms/index.php use hardcoded
   light colors. Override here for body.variant-b only.
   ============================================================ */
body.variant-b .frontcms-tabs .nav-link{color:var(--ink-2) !important}
body.variant-b .frontcms-tabs .nav-link:hover{color:var(--ink) !important;border-bottom-color:var(--border-strong) !important}
body.variant-b .frontcms-tabs .nav-link.active{color:var(--accent) !important;border-bottom-color:var(--accent) !important}

body.variant-b .fcms-section-title{color:var(--muted) !important;border-bottom-color:var(--border) !important}

body.variant-b .fcms-toggle-label strong{color:var(--ink) !important}
body.variant-b .fcms-toggle-label span{color:var(--muted) !important}

body.variant-b .fcms-step-line{background:var(--border) !important}
body.variant-b .fcms-step-num{background:var(--surface-3) !important;color:var(--muted) !important}
body.variant-b .fcms-step.active .fcms-step-num{background:var(--accent) !important;color:#fff !important;box-shadow:0 0 0 4px var(--accent-soft) !important}
body.variant-b .fcms-step-label{color:var(--muted) !important}
body.variant-b .fcms-step.active .fcms-step-label{color:var(--accent) !important}

body.variant-b .fcms-theme-card{background:var(--surface-2) !important;border-color:var(--border) !important}
body.variant-b .fcms-theme-card:hover{border-color:var(--accent) !important}
body.variant-b .fcms-theme-card.selected{border-color:var(--accent) !important;box-shadow:0 0 0 3px var(--accent-soft) !important}
body.variant-b .fcms-theme-name{color:var(--ink) !important;background:var(--surface-2) !important}
body.variant-b .fcms-theme-badge{background:rgba(255,255,255,.10) !important;color:var(--ink) !important}
body.variant-b .fcms-check-mark{background:var(--accent) !important;color:#fff !important}

body.variant-b .fcms-swatch-item.selected .fcms-swatch-circle{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--ink) !important}
body.variant-b .fcms-swatch-name{color:var(--muted) !important}
body.variant-b .fcms-swatch-item.selected .fcms-swatch-name{color:var(--ink) !important}

body.variant-b .fcms-layout-card{background:var(--surface-2) !important;border-color:var(--border) !important}
body.variant-b .fcms-layout-card:hover{border-color:var(--accent) !important}
body.variant-b .fcms-layout-card.selected{border-color:var(--accent) !important;background:var(--accent-soft) !important}
body.variant-b .fcms-layout-title{color:var(--ink) !important}
body.variant-b .fcms-chip{background:var(--surface-3) !important;color:var(--ink-2) !important}
body.variant-b .fcms-layout-card.selected .fcms-chip{background:var(--accent-soft) !important;color:var(--accent) !important}

body.variant-b .fcms-auto-tag{background:var(--surface-3) !important;color:var(--muted) !important}
body.variant-b .fcms-auto-info{background:var(--green-soft) !important;border-color:rgba(52,211,153,.3) !important;color:var(--green) !important}
body.variant-b .fcms-auto-info i{color:var(--green) !important}

body.variant-b .fcms-remove-btn{background:var(--accent-soft) !important;color:var(--accent) !important}
body.variant-b .fcms-add-btn{color:var(--accent) !important;border-color:var(--accent) !important}
body.variant-b .fcms-add-btn:hover{background:var(--accent-soft) !important}

body.variant-b .fcms-faq-item{background:var(--surface-2) !important;border-color:var(--border) !important;color:var(--ink) !important}

/* ==========================================================================
   Pharmacy module — theme-color compatibility & layout helpers
   Replaces inline style="color:red" on <small class="req"> in bill tables and
   embedded <style> blocks in medicine masters list views.
   ========================================================================== */

/* Required-field asterisk inside pharmacy bill product tables — adopt theme red
   so dark variants render readable color instead of hardcoded #dc3545. */
.tblProducts .req { color: var(--red); }

/* Pharmacy masters list tables (medicine group / company / unit) —
   fixed 2-column layout: 15% id, 85% name. */
.pharmacy-master-table { table-layout: fixed; }
.pharmacy-master-table th:nth-child(1),
.pharmacy-master-table td:nth-child(1) { width: 15%; }
.pharmacy-master-table th:nth-child(2),
.pharmacy-master-table td:nth-child(2) { width: 70%; }
.pharmacy-master-table th:nth-child(3),
.pharmacy-master-table td:nth-child(3) { width: 15%; }

/* ==========================================================================
   Patient dashboard — Pulse layout
   Used by application/views/patient/dashboard.php
   Mockup reference: Wfdocs/reference/mockup_patient_dashboard_1_pulse.html
   ========================================================================== */

/* KPI icon colour modifiers — extends existing green/blue/teal/red (lines ~9305) */
.sh-kpi-amber  { background:var(--amber-soft);  color:var(--amber);  }
.sh-kpi-purple { background:var(--purple-soft); color:var(--purple); }
.sh-kpi-violet { background:var(--violet-soft); color:var(--violet); }
.sh-kpi-orange { background:var(--orange-soft); color:var(--orange); }
.sh-kpi-accent { background:var(--accent-soft); color:var(--accent); }

/* Welcome banner */
.sh-welcome-banner {
  background:linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:18px 22px;
  display:flex; align-items:center; gap:18px;
  margin-bottom:14px;
  box-shadow:var(--shadow-sm);
  flex-wrap:wrap;
}
.sh-welcome-banner .sh-profile-avatar-wrap { border-radius:50%; outline:2px solid var(--accent); outline-offset:3px; }
.sh-welcome-banner .sh-profile-avatar { width:88px; height:88px; border-width:3px; }
.sh-welcome-banner .sh-profile-avatar-initials { width:88px; height:88px; font-size:30px; }
.sh-welcome-text { flex:1; min-width:200px; }
.sh-welcome-text h2 { font-size:18px; font-weight:700; margin:0 0 4px; color:var(--ink); }
.sh-welcome-text .sub { font-size:12px; color:var(--muted); margin:0; }
.sh-welcome-meta {
  display:flex; gap:16px; margin-top:8px;
  font-size:11px; color:var(--muted); flex-wrap:wrap;
}
.sh-welcome-meta .item .lbl {
  text-transform:uppercase; letter-spacing:.4px;
  font-weight:600; font-size:10px;
}
.sh-welcome-meta .item .val {
  color:var(--ink); font-weight:600; font-size:12px; margin-left:4px;
}

/* Pulse CTA button */
.btn-pulse {
  background:var(--accent); color:var(--accent-ink) !important;
  padding:9px 18px; border-radius:var(--radius-md);
  border:none; font-weight:600; font-size:13px;
  cursor:pointer;
  display:inline-flex; align-items:center; gap:6px;
  transition:opacity .15s;
  text-decoration:none;
}
.btn-pulse:hover { opacity:.88; color:var(--accent-ink) !important; }

/* Mini-list (used by upcoming appointments / prescriptions / bills / labs) */
.sh-mini-list { list-style:none; padding:0; margin:0; }
.sh-mini-list-item {
  display:flex; align-items:center; gap:12px;
  padding:11px 16px;
  border-bottom:1px solid var(--border-light);
}
.sh-mini-list-item:last-child { border-bottom:none; }
.sh-mini-list-icon {
  width:34px; height:34px; border-radius:var(--radius-md);
  display:grid; place-items:center;
  font-size:14px; flex-shrink:0;
}
.sh-mini-list-body { flex:1; min-width:0; }
.sh-mini-list-title { font-size:13px; font-weight:600; color:var(--ink); margin:0 0 1px; }
.sh-mini-list-meta { font-size:11px; color:var(--muted); }
.sh-mini-list-action { font-size:11px; color:var(--link); font-weight:600; }
.sh-mini-list-amount { font-size:13px; color:var(--ink); font-weight:700; white-space:nowrap; }
/* Monospace + tabular numerals for titles displaying identifiers (bill no, etc.) */
.sh-mini-list-title.is-mono {
  font-family:var(--mono);
  font-variant-numeric:tabular-nums;
  letter-spacing:.3px;
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
}

/* ── Upcoming Appointments — calendar-block row layout ─────────
   Used in patient dashboard's Upcoming Appointments card. Each
   row has a left-side calendar tile (MONTH band coloured by
   status, big DAY number, time below) + body content on the right. */
.sh-appt-row {
  list-style:none;
  display:flex; align-items:stretch; gap:14px;
  padding:14px 16px;
  border-bottom:1px solid var(--border-light);
}
.sh-appt-row:last-child { border-bottom:none; }

.sh-appt-cal {
  flex-shrink:0;
  width:62px;
  display:flex; flex-direction:column;
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  overflow:hidden;
  background:var(--surface);
  text-align:center;
}
.sh-appt-cal-month {
  background:var(--muted); color:#fff;
  font-size:9px; font-weight:800; letter-spacing:.6px;
  text-transform:uppercase; padding:3px 0;
}
.sh-appt-cal.is-confirmed .sh-appt-cal-month { background:var(--green); }
.sh-appt-cal.is-pending   .sh-appt-cal-month { background:var(--amber); }
.sh-appt-cal-day {
  font-size:24px; font-weight:800; color:var(--ink);
  font-family:var(--mono); line-height:1; padding:6px 0 2px;
}
.sh-appt-cal-time {
  font-size:10px; color:var(--muted); font-weight:600;
  padding:0 0 5px; font-family:var(--mono);
}

.sh-appt-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:5px; }
.sh-appt-body-row { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.sh-appt-doctor { font-size:13px; font-weight:700; color:var(--ink); }
.sh-appt-meta { font-size:11px; color:var(--muted); }
.sh-appt-meta .rel { color:var(--accent); font-weight:600; }
.sh-appt-chips { display:flex; flex-wrap:wrap; gap:0; margin-top:2px; }
.sh-appt-action { display:flex; align-items:center; gap:6px; flex-shrink:0; }

.sh-appt-status {
  font-size:10px; font-weight:700; letter-spacing:.4px;
  text-transform:uppercase; white-space:nowrap;
  display:inline-flex; align-items:center;
}
.sh-appt-status.is-confirmed { color:var(--green); }
.sh-appt-status.is-pending   { color:var(--amber); }
.sh-appt-status .dot {
  display:inline-block; width:6px; height:6px; border-radius:50%;
  background:currentColor; margin-right:5px;
}

/* Subtle uppercase chip used for secondary appointment details
   (Priority, Slot, Source, Payment Mode, etc.) */
.sh-mini-list-tag {
  display:inline-flex; align-items:center;
  padding:2px 8px;
  margin:2px 2px 2px 0;
  border-radius:4px;
  background:var(--surface-2);
  border:1px solid var(--border);
  color:var(--ink);
  font-size:10px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.4px;
  white-space:nowrap;
}

/* Mini-list row right-side icon button (e.g. Print prescription, View report) */
.sh-mini-list-iconbtn {
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px;
  border-radius:var(--radius-md);
  color:var(--muted);
  background:var(--surface-2);
  border:1px solid var(--border);
  font-size:12px;
  flex-shrink:0;
  text-decoration:none;
  transition:color .15s, background .15s, border-color .15s;
}
.sh-mini-list-iconbtn:hover {
  color:var(--link);
  border-color:var(--link);
  background:var(--blue-soft);
}

/* Modern empty-state panel — used inside list cards when there are no records.
   Renders icon-in-circle + title + subtitle + optional CTA. */
.sh-mini-empty {
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  padding:28px 16px 24px;
  text-align:center;
}
.sh-mini-empty-icon {
  width:56px; height:56px;
  border-radius:50%;
  background:var(--surface-2);
  border:1px solid var(--border);
  display:grid; place-items:center;
  margin-bottom:14px;
}
.sh-mini-empty-icon i {
  font-size:22px;
  color:var(--muted);
  opacity:.7;
}
.sh-mini-empty-icon.success {
  background:var(--green-soft);
  border-color:var(--green-soft);
}
.sh-mini-empty-icon.success i {
  color:var(--green);
  opacity:1;
}
.sh-mini-empty-title {
  font-size:13px; font-weight:600; color:var(--ink);
  margin:0 0 4px;
}
.sh-mini-empty-sub {
  font-size:11px; color:var(--muted);
  margin:0 0 12px;
  max-width:220px;
  line-height:1.45;
}
.sh-mini-empty-cta {
  font-size:11px; font-weight:600;
  color:var(--link);
  padding:5px 14px;
  border:1px solid var(--link);
  border-radius:var(--radius-md);
  text-decoration:none;
  transition:background .15s, color .15s;
  display:inline-flex; align-items:center; gap:6px;
}
.sh-mini-empty-cta:hover {
  background:var(--link); color:#fff;
}
.sh-mini-empty-cta i { font-size:9px; }

/* Pending-bills card header — prominent total balance pill (solid red) */
.sh-bill-total-pill {
  margin-left:auto;
  display:inline-flex; align-items:center;
  padding:4px 12px;
  border-radius:999px;
  background:var(--red);
  color:#fff;
  font-size:12px; font-weight:700;
  letter-spacing:.3px;
  white-space:nowrap;
}

/* Section "view all" link */
.sh-section-link {
  font-size:11px; color:var(--link);
  font-weight:600; text-decoration:none;
  margin-left:auto;
}
.sh-section-link:hover { color:var(--link-2); }

/* Chart canvas wrapper — replaces inline style="position:relative;height:300px;" */
.sh-chart-canvas-wrap { position:relative; height:300px; }

/* Chart-header meta — small subtitle on the right showing totals etc. */
.sh-chart-header-meta {
  margin-left:auto;
  font-size:11px; font-weight:500;
  color:var(--muted);
  white-space:nowrap;
}
.sh-chart-header-meta strong { color:var(--ink); font-weight:700; }

/* Chart empty-state placeholder */
.sh-chart-empty {
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  height:100%; width:100%;
  color:var(--muted); text-align:center;
  padding:20px;
}
.sh-chart-empty i { font-size:32px; opacity:.35; margin-bottom:12px; color:var(--muted); }
.sh-chart-empty p { font-size:12px; margin:0; }

/* Patient dashboard KPI strip — make cards fill column width when columns are flex */
.sh-pulse-kpi-strip > [class*="col-"] { display:flex; }
.sh-pulse-kpi-strip .sh-kpi-card { width:100%; }

/* Welcome banner — patient QR code (clickable, opens full size) */
.sh-welcome-qr-link { display:inline-flex; line-height:0; align-self:center; }
.sh-welcome-qr {
  display:block; width:46px; height:46px;
  padding:3px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  transition:border-color .15s, box-shadow .15s;
}
.sh-welcome-qr-link:hover .sh-welcome-qr {
  border-color:var(--border-strong);
  box-shadow:var(--shadow-sm);
}

/* Square 28x28 icon-only action button — used in datatable action button groups */
.sh-icon-btn { width:28px; height:28px; padding:0; display:inline-flex; align-items:center; justify-content:center; }

/* Topbar patient avatar — larger than tb-btn (32px) but fits within 52px header height */
.tb-patient-avatar,
.topbar .tb-patient-avatar { width:38px !important; height:38px !important; border-radius:50%; object-fit:cover; border:2px solid var(--border); flex-shrink:0; display:block; }

/* Appointment time-slot pills */
.slot { background:var(--surface-2); border:1px solid var(--border); color:var(--muted); border-radius:6px; padding:4px 10px; font-size:12px; cursor:pointer; transition:background .15s,color .15s; }
.slot-selected { background:var(--accent); border-color:var(--accent); color:#fff; }

/* ── Event color picker (calendar / dashboard add-event modal) ── */
.cpicker-wrapper { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:6px 0; }
.cpicker         { cursor:pointer; border-radius:50%; flex-shrink:0; transition:transform .15s, box-shadow .15s; }
.cpicker-small   { width:20px; height:20px; }
.cpicker-big     { width:28px; height:28px; box-shadow:0 0 0 2px #fff, 0 0 0 4px #555; transform:scale(1.1); }
[data-bs-theme="dark"] .slot-selected { background:var(--accent-dark,#e63939); border-color:var(--accent-dark,#e63939); }

/* ── FullCalendar v3 "today" cell (calendar/events page) ──
   Stock fullcalendar.min.css hardcodes `.fc-unthemed td.fc-today { background:#fcf8e3 }`
   (cream) — glares on dark presets. Self-tint the current surface with the accent
   via color-mix so the highlight stays subtle and adapts to every theme. Matches the
   stock selector's specificity; sh-theme.css loads after FullCalendar so it wins on
   source order (no !important needed). */
.fc-unthemed td.fc-today { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }

/* ── To-Do List (calendar/events page) ── */
/* Flush list-groups are meant to blend edge-to-edge into their parent card, but
   Bootstrap's --bs-list-group-bg stays #fff and isn't theme-aware → white rows on
   dark presets (e.g. nightshift). Make them transparent so each item inherits the
   card's --surface in every theme. Container-scoped overrides above (#contact-list,
   .plist, #suggesstion-box) set their own bg and still win. */
.list-group-flush > .list-group-item { background-color: transparent; }
.todo-item { display:flex; align-items:flex-start; gap:10px; padding:10px 14px; transition:background .15s; }
.todo-item:hover { background:var(--rowhover); }
.todo-item.todo-done { background:color-mix(in srgb, var(--green) 14%, var(--surface)); }
.todo-item .form-check-input { margin-top:3px; width:16px; height:16px; cursor:pointer; flex-shrink:0; }
.todo-title { font-size:.875rem; font-weight:500; line-height:1.35; word-break:break-word; color:var(--ink); }
.todo-title.done { text-decoration:line-through; color:var(--green); font-weight:400; }
.todo-meta { font-size:.775rem; color:var(--faint); margin-top:3px; }
/* To-Do row action buttons (edit/delete) — markup ships them as Bootstrap
   btn-light (fixed light grey), so they ignored the active theme. Anchor them
   to the accent tokens so they follow whatever theme/preset is active. */
.todo-actions .btn.btn-sm.btn-light {
    padding:2px 6px; font-size:.78rem; line-height:1.4;
    --bs-btn-bg: var(--accent-soft);
    --bs-btn-border-color: transparent;
    --bs-btn-color: var(--accent);
    --bs-btn-hover-bg: var(--accent);
    --bs-btn-hover-border-color: var(--accent);
    --bs-btn-hover-color: var(--accent-ink);
    --bs-btn-active-bg: var(--accent);
    --bs-btn-active-color: var(--accent-ink);
    background: var(--accent-soft) !important;
    border-color: transparent !important;
    color: var(--accent) !important;
}
.todo-actions .btn.btn-sm.btn-light:hover,
.todo-actions .btn.btn-sm.btn-light:focus {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: var(--accent-ink) !important;
}
.todopagination ul.pagination { margin:0; justify-content:center; }
.todopagination .pagination li a,
.todopagination .pagination li span { font-size:.8rem; padding:3px 8px; }

/* ── Media Detail Modal (#detail) ─────────────────────────── */
.sh-media-dv-wrap {
    display: flex;
    min-height: 300px;
}
.sh-media-dv-preview {
    flex: 0 0 58%;
    background: #111923;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
body.variant-b .sh-media-dv-preview { background: #090d11; }
.sh-media-dv-preview img  { max-width:100%; max-height:420px; object-fit:contain; display:block; }
.sh-media-dv-preview object { display:block; width:100%; min-height:280px; }
.sh-media-dv-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.sh-media-dv-fields {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.sh-media-dv-fields .sh-info-item {
    padding: 10px 14px;
}
.sh-media-dv-url {
    padding: 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--surface);
}
.sh-media-dv-url-box {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    word-break: break-all;
    font-size: 11px;
    line-height: 1.6;
    color: var(--link);
}

/* ── Media Library: icon visibility fix on button hover ──────────────────────
   Specificity (1,3,1) beats the embedded-CSS static .uploadcheckbtn rule (1,2,1)
   so icon color stays readable when accent background is applied.            */
#media_div .overlay3 a.uploadcheckbtn:hover { background: var(--accent); color: var(--accent-ink); }
#media_div .overlay3 a.uploadclosebtn:hover  { background: rgba(220,53,69,.9); color: #fff; }

/* ── sh-modal-confirm: icon top spacing + list2 item styling ──────────────
   modal-body padding-top was 0, icon sat flush against header.
   list2 had no CSS — rendered as default browser bullets.                */
.sh-modal-confirm .modal-body { padding-top: 1.5rem; }
.sh-modal-confirm .modal-body ul.list2 {
    list-style : none;
    padding    : .5rem .75rem;
    margin     : 0;
    text-align : left;
    font-size  : .875rem;
    background : var(--surface-2);
    border     : 1px solid var(--border-light);
    border-radius: var(--radius-sm, 4px);
}
.sh-modal-confirm .modal-body ul.list2 li { padding: .2rem 0; color: var(--ink-2); }
.sh-modal-confirm .modal-body ul.list2 li span { font-weight: 600; color: var(--ink); }

/* ── Global Modal: center-expand animation ─────────────────────────────────
   Overrides Bootstrap's default top-slide (translateY -50px).
   Modal scales up from its own center point (transform-origin: center).
   Smooth ease-out — no overshoot/bounce. Scale starts at 0.95 (subtle).
   Applies to ALL .modal.fade modals project-wide via sh-theme.css.       */
.modal.fade .modal-dialog {
    transform        : scale(0.95) !important;
    opacity          : 0;
    transform-origin : center center;
    transition       : transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                       opacity   0.18s ease-out !important;
}
.modal.fade.show .modal-dialog {
    transform : scale(1) !important;
    opacity   : 1;
}

/* ============================================================
   Issue Item — "Click To Return" labeled button override
   The global .table tbody td:last-child .btn.btn-sm rule squeezes
   any .btn.btn-sm in the last column to 30×30px icon size.
   .item_remove is a text-labeled button so we exempt it.
   ============================================================ */
.table tbody td:last-child     .btn.btn-sm.item_remove,
.table tbody td.noExport       .btn.btn-sm.item_remove {
    width         : auto;
    height        : auto;
    padding       : 3px 12px;
    border-radius : var(--radius-pill, 50rem);
    font-size     : 11px;
    white-space   : nowrap;
}
.table tbody td:last-child     .btn.btn-sm.item_remove i,
.table tbody td.noExport       .btn.btn-sm.item_remove i {
    font-size : 11px;
    margin    : 0 4px 0 0;
}

/* ── Appointment slot grid (patient/appointment.php)
   Wraps .slot pills in a flex row with consistent gap between each pill. */
.sh-slot-grid { display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }

/* ============================================================
   Payment Gateway Tab — PayPal redesign
   Classes: gw-tab-card, gw-brand, gw-logo-box, gw-brand-info,
   gw-brand-text, gw-name, gw-desc, gw-status, cred-header,
   cred-header-icon, cred-body, cred-field, inp-wrap, inp,
   saved-hint, fees-optional, fee-seg, amount-group
   ============================================================ */

/* outer card */
.gw-tab-card { border:1px solid var(--border,#e2e8f0); border-radius:8px; overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,.05); }

/* brand panel */
.gw-brand { display:flex; align-items:center; gap:16px; padding:16px 18px; background:color-mix(in srgb, var(--accent-soft) 30%, var(--surface,#fff)); border-bottom:1px solid var(--border,#e2e8f0); }
.gw-logo-box { flex-shrink:0; width:100px; height:56px; border-radius:10px; background:#fff; border:1px solid rgba(0,0,0,.10); display:flex; align-items:center; justify-content:center; }
.gw-logo-box img { width:80px; height:40px; object-fit:contain; display:block; }
.gw-brand-info { flex:1; min-width:0; display:flex; align-items:center; gap:20px; }
.gw-brand-text { flex:1; }
.gw-brand-text .gw-name { font-size:16px; font-weight:800; color:var(--ink,#1e293b); margin:0 0 2px; letter-spacing:-.015em; }
.gw-brand-text .gw-desc { font-size:11px; color:var(--link,#2563eb); margin:0; line-height:1.5; }
.gw-status { display:inline-flex; align-items:center; gap:5px; font-size:10px; font-weight:700; padding:4px 11px; border-radius:20px; background:#dcfce7; color:#15803d; letter-spacing:.03em; white-space:nowrap; }
.gw-status::before { content:''; width:6px; height:6px; border-radius:50%; background:#16a34a; animation:gw-pulse 2s ease-in-out infinite; }
@keyframes gw-pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* section headers */
.cred-header { display:flex; align-items:center; gap:10px; padding:11px 16px; background:var(--surface-2,#f8fafc); border-bottom:1px solid var(--border,#e2e8f0); }
.cred-header-icon { width:30px; height:30px; border-radius:7px; background:color-mix(in srgb, var(--link,#2563eb) 15%, var(--surface-2,#f8fafc)); color:var(--link,#2563eb); display:flex; align-items:center; justify-content:center; font-size:13px; }
.cred-header h6 { margin:0; font-size:13px; font-weight:700; color:var(--ink,#1e293b); }
.fees-optional { font-size:10px; font-weight:600; padding:2px 8px; border-radius:20px; background:var(--surface-2,#f8fafc); color:var(--muted,#64748b); letter-spacing:.03em; margin-left:auto; border:1px solid var(--border,#e2e8f0); }

/* section body */
.cred-body { padding:20px 24px 14px; background:var(--surface,#fff); }
.cred-field { display:grid; grid-template-columns:160px minmax(0,50%); align-items:center; gap:0 12px; margin-bottom:12px; }
.cred-field-top { align-items:start; }
.cred-field-top > label { padding-top:8px; }
.cred-field label { font-size:12px; font-weight:600; color:var(--ink,#1e293b); text-align:left; line-height:1.3; }
.cred-field label .req { color:#ef4444; font-weight:400; }

/* input wrapper — block, fills grid column for equal widths */
.inp-wrap { display:block; width:100%; }
.inp-wrap .inp { display:block; width:100%; height:34px; border:1px solid var(--border,#e2e8f0); border-radius:6px; padding:0 11px; font-size:12px; color:var(--ink,#1e293b); background:var(--surface,#fff); outline:none; transition:border .15s,box-shadow .15s; box-sizing:border-box; }
.inp-wrap .inp:focus { border-color:var(--link,#2563eb); box-shadow:0 0 0 3px rgba(37,99,235,.1); }

/* saved credential hint */
.saved-hint { display:inline-flex; align-items:center; gap:5px; font-size:11px; color:var(--muted,#94a3b8); font-family:monospace; letter-spacing:.04em; margin-top:3px; }
.saved-hint i { font-size:10px; color:var(--muted,#94a3b8); }

/* segmented fee-type control */
.fee-seg { display:flex; width:100%; border:1px solid var(--border,#e2e8f0); border-radius:6px; overflow:hidden; background:var(--surface,#fff); box-shadow:0 1px 2px rgba(0,0,0,.04); }
.fee-seg label { flex:1; display:flex; align-items:center; justify-content:center; padding:6px 14px; font-size:12px; color:var(--ink-2,#475569); cursor:pointer; border-right:1px solid var(--border,#e2e8f0); transition:background .12s,color .12s; white-space:nowrap; margin:0; font-weight:500; }
.fee-seg label:last-child { border-right:none; }
.fee-seg input[type=radio] { display:none; }
.fee-seg label:has(input:checked) { background:var(--link,#2563eb); color:#fff; font-weight:600; }
.fee-seg label:not(:has(input:checked)):hover { background:var(--accent-soft); }

/* amount input group */
.amount-group { display:flex; width:100%; align-items:center; border:1px solid var(--border,#e2e8f0); border-radius:6px; overflow:hidden; background:var(--surface,#fff); box-shadow:0 1px 2px rgba(0,0,0,.04); }
.amount-group .inp-amt { flex:1; min-width:0; height:34px; border:none; outline:none; padding:0 11px; font-size:12px; color:var(--ink,#1e293b); background:transparent; }
.amount-group .amt-unit { padding:0 12px; height:34px; display:flex; align-items:center; font-size:12px; font-weight:600; color:var(--link,#2563eb); background:var(--surface-2,#f8fafc); border-left:1px solid var(--border,#e2e8f0); white-space:nowrap; flex-shrink:0; }

/* section footer */
.cred-footer { padding:10px 16px; border-top:1px solid var(--border,#e2e8f0); display:flex; justify-content:flex-end; background:var(--surface,#fff); }
.text-xs { font-size:11px; }

/* ── Gateway Selector Panel ─────────────────────────── */
.gw-selector-card { border:1px solid var(--border,#e2e8f0); border-radius:8px; overflow:hidden; }
.gw-selector-list { overflow-y:auto; max-height:480px; }
.gw-selector-item { display:flex; align-items:center; gap:9px; padding:8px 14px; border-bottom:1px solid var(--border,#e2e8f0); cursor:pointer; transition:background .12s; margin:0; font-weight:400; }
.gw-selector-item:last-child { border-bottom:none; }
.gw-selector-item:hover { background:var(--surface-2,#f8fafc); }
.gw-selector-item input[type=radio] { display:none; }
.gw-selector-item:has(input:checked) { background:color-mix(in srgb,var(--accent-soft) 60%,var(--surface,#fff)); }
.gw-selector-dot { width:13px; height:13px; border-radius:50%; border:2px solid var(--border,#c8d0dc); flex-shrink:0; transition:border-color .12s,background .12s; background:var(--surface,#fff); }
.gw-selector-item:has(input:checked) .gw-selector-dot { border-color:var(--accent,#e05252); background:var(--accent,#e05252); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 20%,transparent); }
.gw-selector-name { font-size:12px; color:var(--ink,#1e293b); flex:1; line-height:1.3; }
.gw-selector-item:has(input:checked) .gw-selector-name { color:var(--accent,#e05252); font-weight:700; }

/* ── Payment Settings — layout (instructions.txt 2026-05-13) ── */
/* 1. reduce gap between Payment Methods col and Gateway Selector col */
.payment-methods-col { padding-right:6px; }
.payment-methods-col > .card { height:100%; }
.gateway-selector-col { padding-left:6px; display:flex; flex-direction:column; }
/* 2. stretch gateway selector card to same height as payment methods card */
.gw-selector-card { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.gw-selector-list { flex:1; max-height:none; overflow-y:auto; }
/* 3. light background for unselected gateway rows + visible hover */
.gw-selector-item { background:var(--surface,#fff); }
.gw-selector-item:not(:has(input:checked)):hover { background:color-mix(in srgb,var(--accent-soft) 25%,var(--surface-2,#f8fafc)); }

/* ── Payment Settings — equal card heights across all 3 columns ── */
.payment-settings-row { align-items:stretch; }
.payment-settings-row > div > .card,
.payment-settings-row > div > .card.border0 { height:100%; }

/* ── Payment tab pane — pin Save button to card bottom ─── */
.payment-methods-col > .card > .tab-content { flex:1; display:flex; flex-direction:column; }
.payment-methods-col .tab-pane.active.show { flex:1; display:flex; flex-direction:column; }
.payment-methods-col .tab-pane > form { flex:1; display:flex; flex-direction:column; }
.payment-methods-col .tab-pane > form > .p-3 { flex:1; display:flex; flex-direction:column; }
.payment-methods-col .gw-tab-card { flex:1; display:flex; flex-direction:column; }
.payment-methods-col .gw-tab-card > .cred-footer { margin-top:auto; }

/* ── Fix: remove gap above Gateway Selector card ─── */
.gateway-selector-col { display:block; padding-left:6px; }
.gateway-selector-col > .gw-selector-card { flex:none; }

/* ── Final: force all 3 cards to fill column from top via flex ── */
.payment-settings-row > div { display:flex; flex-direction:column; }
.payment-settings-row > div > .card,
.payment-settings-row > div > .card.border0 { flex:1 1 auto; height:auto; min-height:0; }
.gateway-selector-col > .gw-selector-card { flex:1 1 auto; }

/* Sidebar (.card.border0) keeps natural auto height — opt out of equal-height stretch */
.payment-settings-row > div:has(> .card.border0) { display:block; align-self:flex-start; }
.payment-settings-row > div > .card.border0 { flex:none; height:auto; }

/* === Match middle/right cards to sidebar height via absolute positioning === */
.payment-methods-col, .gateway-selector-col {
    position: relative;
    display: block;
}
.payment-methods-col > .card,
.gateway-selector-col > .gw-selector-card {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    flex: none;
    height: auto;
    margin: 0;
}
/* Internal scrolling inside payment methods card */
.payment-methods-col > .card > .tab-content { overflow-y: auto; min-height: 0; }

/* === Gateway selector — restore form flex chain so save btn shows + list scrolls === */
.gateway-selector-col { padding-left: 12px; }
.gateway-selector-col > .gw-selector-card { display: flex; flex-direction: column; }
.gateway-selector-col > .gw-selector-card > form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.gateway-selector-col .gw-selector-list {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

/* More gap between Payment Methods card and Gateway Selector card */
.payment-methods-col { padding-right: 30px; }
.gateway-selector-col { padding-left: 30px; }

/* Fix gap: absolute cards need explicit left/right offsets (column padding gets covered) */
.payment-methods-col > .card  { left: 0;    right: 0;    }
.gateway-selector-col > .gw-selector-card { left: 10px; right: 0;    }

/* Thin glass-effect scrollbar for gateway list */
.gw-selector-list { scrollbar-width: thin; scrollbar-color: rgba(120,130,145,0.35) transparent; }
.gw-selector-list::-webkit-scrollbar { width: 5px; }
.gw-selector-list::-webkit-scrollbar-track { background: transparent; }
.gw-selector-list::-webkit-scrollbar-thumb {
    background: rgba(120,130,145,0.30);
    border-radius: 10px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.gw-selector-list::-webkit-scrollbar-thumb:hover { background: rgba(120,130,145,0.55); }

/* Match sub-sidebar -> centered gap to 10px */
.payment-settings-row > div:has(> .card.border0) { padding-right: 10px; }

/* ─────────────────────────────────────────────────────────────
   OPD "New Visit" modal — #myModal
   Migrated from inline <style> block in
   application/views/admin/patient/search.php (2026-05-14).
   All selectors scoped to #myModal so no global side-effects.
   Colors use design-token vars for dark-mode compatibility.
   ───────────────────────────────────────────────────────────── */
#myModal .select2-search--dropdown .select2-search__field { border: 1px solid var(--border) !important; outline: none !important; box-shadow: none !important; }
#myModal .select2-search--dropdown .select2-search__field:focus { border-color: var(--border) !important; }
/* Modal layout */
#myModal .modal-body { padding: 0; }
#myModal .row.row-eq { margin: 0; }
/* Section headers — hidden, flat layout like reference */
.opd-section-hdr { display: none; }
.opd-section-hdr-mt { margin-top: 0; }
#myModal .col-12:has(.opd-section-hdr) { display: none; }
/* Right panel */
#myModal .col-lg-4 .form-control { font-size: 13px; border-color: var(--border); border-radius: 4px; height: 34px; padding: 5px 10px; color: var(--ink); }
#myModal .col-lg-4 select.form-control { height: 34px; }
#myModal .col-lg-4 .mb-3 { margin-bottom: 10px !important; }
#myModal .col-lg-4 .input-group-text { font-size: 13px; height: 34px; padding: 0 10px; background: var(--surface-2); border-color: var(--border); color: var(--muted); }
#myModal .col-lg-4 .form-check { padding-top: 4px; }
.cheque_div { flex-wrap: wrap; }
.cheque_div .col-md-6:first-child { padding-left: 0; padding-right: 12px; }
.cheque_div .col-md-6:last-child { padding-left: 12px; padding-right: 0; }
#myModal .col-lg-4 .form-check-label { font-size: 13px; font-weight: 400; color: var(--ink-2); }
.sh-check-box { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); cursor: pointer; }
.sh-check-box .form-check-input, .sh-check-box input[type="checkbox"] { margin: 0; cursor: pointer; }
.sh-check-box .form-check-label, .sh-check-box label { margin: 0; cursor: pointer; font-size: 13px; color: var(--ink); font-weight: 400; }
#myModal .col-lg-4 small.req { color: #e74c3c; }
/* Modal footer */
#myModal .modal-footer { background: var(--surface-2); border-top: 1px solid var(--border); padding: 10px 20px; }

/* ──────────────────────────────────────────────────────────────────
   SYSTEM NOTIFICATION PAGE · Variant B (date-grouped timeline)
   View: application/views/admin/systemnotification/index.php
   Mock: Wfdocs/systemnotification-samples.html
   Approved 2026-05-15. All values use sh-tokens.css variables only.
   ────────────────────────────────────────────────────────────────── */

/* Shell — sits inside the existing .card */
.sh-notif-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.sh-notif-head .ttl {
  font-size: var(--fs-h3); font-weight: var(--fw-bold); margin: 0; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.sh-notif-head .ttl .count {
  background: var(--accent-soft); color: var(--accent);
  font-size: var(--fs-sm); font-weight: var(--fw-bold);
  padding: 2px 9px; border-radius: 999px; min-width: 22px; text-align: center;
  line-height: 1.5;
}
.sh-notif-head .tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Toolbar */
.sh-notif-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.sh-notif-search {
  flex: 1; min-width: 220px; max-width: 340px;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--muted); font-size: var(--fs-sm);
}
.sh-notif-search input {
  flex: 1; border: 0; outline: none; background: transparent; color: var(--ink);
  font-size: var(--fs-sm); font-family: var(--font);
}
.sh-notif-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.sh-notif-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; font-family: var(--font);
}
.sh-notif-chip:hover { color: var(--ink); border-color: var(--border-strong); }
.sh-notif-chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sh-notif-chip .n {
  background: rgba(0,0,0,.08); padding: 0 6px; border-radius: 999px;
  font-size: var(--fs-micro);
}
.sh-notif-chip.is-active .n { background: rgba(255,255,255,.25); }

/* Group header */
.sh-notif-group { padding: 8px 0 4px; }
.sh-notif-group-label {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px 8px;
  font-size: var(--fs-micro); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--ls-wide);
  color: var(--muted);
}
.sh-notif-group-label .lbl { color: var(--ink-2); }
.sh-notif-group-label .cnt {
  background: var(--surface-2); color: var(--muted);
  padding: 2px 8px; border-radius: 999px;
  font-size: var(--fs-micro); font-weight: var(--fw-bold);
  letter-spacing: 0;
}
.sh-notif-group-label::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* Timeline rail */
.sh-notif-tl { position: relative; padding: 0 20px 8px; }
.sh-notif-tl::before {
  content: ""; position: absolute;
  left: 36px; top: 8px; bottom: 8px; width: 2px; background: var(--border);
}

/* Item row — 2-column grid: icon + card. Date now lives inside card. */
.sh-notif-item {
  position: relative; display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px; align-items: flex-start;
  padding: 10px 0;
}
.sh-notif-item .dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; position: relative; z-index: 1;
  transition: box-shadow .25s, transform .15s;
}
.sh-notif-item.is-unread .dot {
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 4px var(--surface);
}
.sh-notif-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 14px;
  transition: background .35s, border-color .15s, box-shadow .15s;
  position: relative;
}
.sh-notif-item:hover .sh-notif-card {
  background: var(--surface-2); border-color: var(--border-strong);
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.sh-notif-item.is-unread .sh-notif-card { background: var(--surface-2); }

/* Read-fade transient flash on auto-mark-read */
.sh-notif-item.is-clearing .sh-notif-card { background: var(--green-soft); }
.sh-notif-item.is-clearing .dot { box-shadow: 0 0 0 3px var(--green-soft); }

/* Head row inside card */
.sh-notif-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.sh-notif-item .ttl {
  font-size: var(--fs-body); font-weight: var(--fw-semibold);
  color: var(--ink); margin: 0; line-height: 1.4; flex: 1; min-width: 0;
  transition: font-weight .35s;
}
.sh-notif-item.is-unread .ttl { font-weight: var(--fw-bold); }
.sh-notif-item .ttl .unread-dot {
  display: inline-block; vertical-align: middle;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  margin-right: 7px;
}
.sh-notif-item .actions { display: flex; gap: 4px; flex-shrink: 0; }
.sh-notif-item .iconbtn {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  border-radius: var(--radius); font-size: 13px;
}
.sh-notif-item .iconbtn:hover { background: var(--surface-3); color: var(--red); }

/* Description preview */
.sh-notif-item .desc {
  font-size: var(--fs-sm); color: var(--muted); margin: 6px 0 0;
  line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta row */
.sh-notif-item .meta {
  margin-top: 10px; font-size: var(--fs-sm); color: var(--muted);
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.sh-notif-type-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: var(--fs-micro); font-weight: var(--fw-semibold);
  text-transform: uppercase; letter-spacing: var(--ls-wide);
}
.sh-notif-item .meta .sep { color: var(--border-strong); }
.sh-notif-item .meta .recipient { color: var(--muted); }
.sh-notif-item .meta .recipient strong { color: var(--ink-2); font-weight: var(--fw-semibold); }
.sh-notif-item .meta .id { color: var(--faint); font-family: var(--mono); font-size: var(--fs-micro); }
.sh-notif-item .meta .read-receipt {
  color: var(--green); font-size: var(--fs-micro); font-weight: var(--fw-semibold);
  display: inline-flex; align-items: center; gap: 4px;
}

/* Inline time — visible ONLY in unread state (next to title) */
.sh-notif-item .time-inline {
  font-size: var(--fs-sm); font-weight: var(--fw-regular);
  color: var(--muted); white-space: nowrap; margin-left: 10px;
}
.sh-notif-item:not(.is-unread) .time-inline { display: none; }

/* Expand wrapper — wraps description + meta. Collapsed when unread. */
.sh-notif-expand {
  overflow: hidden;
  max-height: 240px;
  opacity: 1;
  margin-top: 6px;
  transition: max-height .3s ease-out, opacity .25s ease-out .05s, margin-top .3s ease-out;
}
.sh-notif-item.is-unread .sh-notif-expand {
  max-height: 0; opacity: 0; margin-top: 0;
}

/* Meta row time (inside meta, only shown when expanded/read) */
.sh-notif-item .meta .time {
  font-size: var(--fs-sm); color: var(--muted); white-space: nowrap;
}

/* Module color swatches — drives both .dot bg and .sh-notif-type-tag bg/color */
.sh-notif-c-info    .dot { background: var(--blue); }
.sh-notif-c-success .dot { background: var(--green); }
.sh-notif-c-warn    .dot { background: var(--amber); }
.sh-notif-c-danger  .dot { background: var(--red); }
.sh-notif-c-violet  .dot { background: var(--violet); }
.sh-notif-c-teal    .dot { background: var(--teal); }
.sh-notif-c-info    .sh-notif-type-tag { background: var(--blue-soft);   color: var(--blue); }
.sh-notif-c-success .sh-notif-type-tag { background: var(--green-soft);  color: var(--green); }
.sh-notif-c-warn    .sh-notif-type-tag { background: var(--amber-soft);  color: var(--amber); }
.sh-notif-c-danger  .sh-notif-type-tag { background: var(--red-soft);    color: var(--red); }
.sh-notif-c-violet  .sh-notif-type-tag { background: var(--violet-soft); color: var(--violet); }
.sh-notif-c-teal    .sh-notif-type-tag { background: var(--teal-soft);   color: var(--teal); }

/* Empty state */
.sh-notif-empty {
  text-align: center; padding: 60px 24px; color: var(--muted);
}
.sh-notif-empty i { font-size: 42px; color: var(--faint); display: block; margin-bottom: 12px; }
.sh-notif-empty .ttl { font-size: var(--fs-h4); font-weight: var(--fw-semibold); color: var(--ink); }
.sh-notif-empty .sub { font-size: var(--fs-sm); margin-top: 6px; }

/* Pagination — reuse global pagination, but ensure spacing inside this card */
.sh-notif-pager { display: flex; justify-content: center; padding: 18px; }
.sh-notif-pager .pagination { margin: 0; }

/* ════════════════════════════════════════════════════════════════════════
   TOPBAR QUICK ADD (+) — Variant C searchable flat list with Ctrl+K
   12 RBAC-gated actions. Toggle .is-open on .sh-qa-wrap to show panel.
   ════════════════════════════════════════════════════════════════════════ */

/* Wrapper — anchors the absolutely positioned panel under the + button */
.sh-qa-wrap { position: relative; display: inline-block; }

/* The + button — metallic relief stamp (only "raised" button in topbar) */
.tb-btn.tb-btn-plus {
  width: 36px; height: 36px;
  border-radius: 4px;
  border: none;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 78%, white) 0%,
    var(--accent) 55%,
    var(--accent-dark) 100%);
  color: var(--accent-ink);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255, calc(.5 * var(--depth) + .15)),
    inset 0 -2px 4px rgba(0,0,0, calc(.2 * var(--depth))),
    0 2px 5px rgba(0,0,0, calc(.35 * var(--depth)));
  transition: transform .15s, filter .15s, box-shadow .15s;
}
.tb-btn.tb-btn-plus:hover {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 85%, white) 0%,
    var(--accent) 55%,
    var(--accent-dark) 100%);
  color: var(--accent-ink);
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.tb-btn.tb-btn-plus i { font-size: 14px; }

/* Backdrop — invisible click-catcher to close panel on outside click */
.sh-qa-backdrop {
  display: none; position: fixed; inset: 0; z-index: 1040; background: transparent;
}
.sh-qa-wrap.is-open .sh-qa-backdrop { display: block; }

/* The dropdown panel */
.sh-qa-panel {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  width: 420px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg, 10px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
  z-index: 1050; overflow: hidden;
}
.sh-qa-wrap.is-open .sh-qa-panel { display: block; }

/* Panel head — title + Ctrl+K shortcut chip */
.sh-qa-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.sh-qa-head .ttl {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-body); font-weight: var(--fw-bold); color: var(--ink); margin: 0;
}
.sh-qa-head .ttl i { color: var(--link); }
.sh-qa-head .kbd-chip {
  font-family: var(--font-mono, monospace); font-size: 10px; font-weight: var(--fw-semibold);
  color: var(--muted); padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface-2);
}

/* Search row */
.sh-qa-search-wrap { position: relative; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.sh-qa-search-wrap .si {
  position: absolute; left: 26px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 13px; pointer-events: none;
}
.sh-qa-search-in {
  width: 100%; height: 36px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); padding: 0 12px 0 34px;
  font-size: var(--fs-sm); color: var(--ink); font-family: var(--font);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.sh-qa-search-in:focus { border-color: var(--link); box-shadow: 0 0 0 3px var(--blue-soft); background: var(--surface); }
.sh-qa-search-in::placeholder { color: var(--faint); }

/* Scrollable item list */
.sh-qa-list { padding: 6px 0; max-height: 380px; overflow-y: auto; }
.sh-qa-list::-webkit-scrollbar { width: 8px; }
.sh-qa-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* Each row */
.sh-qa-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  text-decoration: none; color: inherit; cursor: pointer; transition: background .15s;
}
.sh-qa-item:hover, .sh-qa-item.is-focus { background: var(--surface-2); }
.sh-qa-item:focus { outline: none; background: var(--surface-2); }
.sh-qa-item .ic {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.sh-qa-item .lbl {
  flex: 1; min-width: 0; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sh-qa-item .mod {
  font-size: var(--fs-micro); color: var(--muted);
  padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); flex-shrink: 0;
}

/* Module color tints — reuse paired tokens (--*-soft bg, --* fg) */
.sh-qa-item .ic.qa-blue   { background: var(--blue-soft);   color: var(--blue); }
.sh-qa-item .ic.qa-teal   { background: var(--teal-soft);   color: var(--teal); }
.sh-qa-item .ic.qa-green  { background: var(--green-soft);  color: var(--green); }
.sh-qa-item .ic.qa-amber  { background: var(--amber-soft);  color: var(--amber); }
.sh-qa-item .ic.qa-violet { background: var(--violet-soft); color: var(--violet); }
.sh-qa-item .ic.qa-red    { background: var(--red-soft);    color: var(--red); }

/* Empty state — shown via JS when filtered list is empty */
.sh-qa-empty {
  display: none; padding: 28px 16px; text-align: center;
  color: var(--muted); font-size: var(--fs-sm);
}
.sh-qa-empty i { font-size: 26px; color: var(--faint); display: block; margin-bottom: 8px; }

/* Footer keyboard hints */
.sh-qa-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 14px; border-top: 1px solid var(--border); background: var(--surface-2);
  font-size: var(--fs-micro); color: var(--muted);
}
.sh-qa-foot .keys { display: flex; gap: 12px; flex-wrap: wrap; }
.sh-qa-foot .kbd {
  font-family: var(--font-mono, monospace); font-size: 10px; font-weight: var(--fw-semibold);
  color: var(--muted); padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); margin-right: 3px;
}

/* RTL — panel anchors to the left side instead of right */
html[dir="rtl"] .sh-qa-panel { right: auto; left: 0; }

/* Small screens — the panel is position:absolute anchored to .sh-qa-wrap, which
   sits mid-topbar; on narrow screens a right-anchored 420px panel overflows off
   the left/top edge (renders off-screen, unusable). Switch to position:fixed so
   it anchors to the VIEWPORT's top-right (near the + button) and is capped to fit.
   The backdrop is already position:fixed inset:0, so they align. */
@media (max-width: 768px) {
  .sh-qa-panel {
    position: fixed;
    top: 58px; right: 12px; left: auto;
    width: min(420px, calc(100vw - 24px));
    max-width: none;
    max-height: calc(100vh - 74px);
    overflow-y: auto;
  }
  html[dir="rtl"] .sh-qa-panel { right: auto; left: 12px; }
}

/* ══ Custom field helper — .control-label in sh-modal context ════════════════
   customfield_helper.php renders labels with Bootstrap 3 legacy class="control-label".
   The sh-modal rule (line 6453) covers only .form-label — extend to .control-label
   so custom field labels match regular form labels in font-weight and color.
   Scope: .sh-modal only — does not affect form-horizontal or other legacy contexts. */
.sh-modal .modal-body .control-label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  display: inline-block;
}

/* ══ Dark mode — global alert + form-check fixes ═════════════════
   .alert-warning: text color #A76C00 is invisible on dark amber-soft bg
   (rgba(251,191,36,.12)). Switch to amber token for contrast.
   .form-check radio/checkbox: --bs-border-color rgba(255,255,255,.08)
   is too faint on dark surfaces — raise to border-strong + surface-2 bg.
   Usage: applies globally to all pages in variant-b (dark mode). */
body.variant-b .alert-warning {
  color: var(--amber);
}
body.variant-b .form-check:not(.form-switch) .form-check-input {
  border-color: var(--border-strong);
  background-color: var(--surface-2);
}
body.variant-b .form-check:not(.form-switch) .form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}
/* ── Dark mode — balance/due row status colours ───────────────────
   In light mode solid green/red backgrounds work fine with white text.
   In dark mode those hues become too bright; flip to soft (translucent)
   background + full-opacity token as text for readable, theme-native look. */
body.variant-b .sh-status-paid { background: var(--green-soft); color: var(--green); }
body.variant-b .sh-status-due  { background: var(--red-soft);   color: var(--red);   }
/* Dark variant-a presets (e.g. nightshift) need the same soft status look, but
   --green-soft/--red-soft are NOT in the Theme Studio preset palette so they
   stay at their light variant-a values (light pink/green) — useless on a dark
   bg. Derive a translucent tint from --green/--red with color-mix instead: it
   layers correctly over the dark surface. color-mix is safe here (project
   already relies on :has()). Add future dark variant-a presets to this list. */
body[data-preset="nightshift"] .sh-status-paid { background: color-mix(in srgb, var(--green) 16%, transparent); color: color-mix(in srgb, var(--green) 72%, white); }
body[data-preset="nightshift"] .sh-status-due  { background: color-mix(in srgb, var(--red) 16%, transparent);   color: color-mix(in srgb, var(--red) 72%, white);   }
/* NOTE: the completed To-Do row (.todo-item.todo-done) is themed at its base rule
   via color-mix onto --surface, so it adapts to every preset without a per-preset
   override here. Do NOT re-add a [data-preset]/body.variant override for it. */

/* ── Pharmacy viewModal — Stock / Bad-Stock tab panel ─────────────────────────
   medicineDetail.php is AJAX-loaded into #tabledata inside #viewModal. The
   tabs sit at the bottom edge of the card-header so the active link reads as
   a continuation of the body. */
.sh-stock-panel               { margin-top: 4px; }
.sh-stock-tabs-header         { padding: 0 8px; }
.sh-stock-tabs                { border: 0; gap: 4px; flex-wrap: wrap; }
.sh-stock-tabs .nav-item      { margin-bottom: -1px; }
.sh-stock-tabs .nav-link      {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 9px 14px;
    font-size: 12px; font-weight: 600; letter-spacing: .02em;
    color: var(--muted, #6c757d);
    background: transparent;
    border: 0; border-bottom: 2px solid transparent;
    border-radius: 0;
    text-transform: uppercase;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.sh-stock-tabs .nav-link:hover    { color: var(--ink, #212529); background: transparent; }
.sh-stock-tabs .nav-link.active   {
    color: var(--link, #0d6efd);
    background: transparent;
    border-bottom-color: var(--link, #0d6efd);
}
.sh-stock-tabs .nav-link i        { font-size: 11px; }
.sh-tab-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    margin-left: 4px;
    font-size: 10px; font-weight: 700; line-height: 1;
    color: var(--muted, #6c757d);
    background: var(--surface-3, #ebebeb);
    border-radius: 9px;
}
.sh-stock-tabs .nav-link.active .sh-tab-count {
    color: #fff;
    background: var(--link, #0d6efd);
}
.sh-stock-tab-content         { background: var(--surface, #fff); }

/* DataTable toolbar inside the stock tab — search left, buttons right */
.sh-stock-tab-content .sh-dt-toolbar           { padding: 4px 2px 0; }
.sh-stock-tab-content .sh-dt-search input      {
    height: 30px; padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--border, #dee2e6); border-radius: 4px;
    background: var(--surface, #fff); color: var(--ink, #212529);
}
.sh-stock-tab-content .sh-dt-buttons           { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.sh-stock-tab-content .sh-dt-buttons .btn      { padding: 4px 9px; font-size: 12px; line-height: 1; }
.sh-stock-tab-content .sh-dt-buttons .btn i    { font-size: 12px; }
.sh-stock-tab-content .dataTables_info,
.sh-stock-tab-content .dataTables_paginate     { font-size: 12px; padding-top: 8px; }
.sh-stock-tab-content .dataTables_paginate .paginate_button {
    padding: 2px 8px !important;
    font-size: 12px;
}

/* Empty state inside a stock tab pane */
.sh-empty-state               { color: var(--muted, #6c757d); }
.sh-empty-state i             { color: var(--faint, #adb5bd); }

/* Dark mode — keep contrast on tabs and empty state */
body.variant-b .sh-stock-tabs .nav-link              { color: var(--muted); }
body.variant-b .sh-stock-tabs .nav-link:hover        { color: var(--ink); }
body.variant-b .sh-stock-tabs .nav-link.active       { color: var(--link); border-bottom-color: var(--link); }
body.variant-b .sh-tab-count                         { color: var(--muted); background: var(--surface-3); }
body.variant-b .sh-stock-tabs .nav-link.active .sh-tab-count { color: #fff; background: var(--link); }
body.variant-b .sh-stock-tab-content                 { background: var(--surface); }
body.variant-b .sh-stock-tab-content .sh-dt-search input { background: var(--surface-2); color: var(--ink); border-color: var(--border-strong); }

/* ── Related-list (.rellist) body text color ──────────────────────────────
   Value text inside .rellist-body (visitDetails.php Alerts/Vitals/Billing,
   ipdprofile.php related lists) has no inline `color`, so it inherited the
   AdminLTE default dark color and rendered black/invisible in dark theme
   (variant-b). Anchoring the body to var(--ink) fixes dark mode and is a
   no-op in light mode (--ink is already dark). Explicit child colors
   (labels using var(--muted), table td, badges) keep overriding this. */
.rellist-body { color: var(--ink); }

/* ── Card body plain text color (all variants) ────────────────────────────
   Bootstrap's .card-body sets color: var(--bs-card-color), which is undefined,
   so raw text nodes inside .card-body (e.g. patient/import CSV instructions)
   fell back to a low-contrast / mismatched color across themes. Anchoring to
   var(--ink) makes the text readable in every variant (light, dark, and
   Theme Studio custom palettes) since --ink tracks each theme's background.
   This rule sits at end-of-file so it wins the cascade over Bootstrap's rule.
   Explicit child colors (muted labels, links, badges, table td) keep
   overriding this. */
.card-body { color: var(--ink); }

/* ── Sidebar filter input text + placeholder color (all variants) ─────────
   Base .sh-sidebar-search .form-control set no color/placeholder, so the
   "Filter Menu" placeholder fell back to Bootstrap's hardcoded grey and was
   barely visible on a dark sidebar (variant-b and dark Theme Studio palettes
   on variant-a). The input's own bg is var(--surface-2), so anchoring text to
   --ink and placeholder to --muted guarantees contrast in every theme.
   variant-c keeps its own higher-specificity rules above (lines ~578/680). */
.sh-sidebar-search .form-control { color: var(--ink); }
.sh-sidebar-search .form-control::placeholder { color: var(--muted); opacity: 1; }

/* ── Table cell background follows theme surface in ALL variants ──────────
   The Bootstrap --bs-table-* bridge (transparent cell bg) is defined ONLY in
   the body.variant-b block, so dark Theme Studio palettes running on
   body.variant-a kept Bootstrap's default light --bs-table-bg → table cells
   rendered as a white block on the dark page (patient/dashboard/profile).
   Forcing the cell bg transparent lets each cell inherit the token-driven
   parent surface, so non-striped .table tbody cells adapt to any palette.
   thead (var(--surface-3) !important), striped rows (transparent !important)
   and hover (var(--rowhover) !important) already win over this. */
.table > :not(caption) > * > * { --bs-table-bg: transparent; background-color: transparent; }

/* ── .bcard-grid 5-column modifier ────────────────────────────────────────
   Opt-in 5-per-row variant of the 4-col .bcard-grid (used on patient IPD
   profile so 10 fields lay out as a clean 5×2). Desktop-only (min-width:901px)
   so it falls back to the base 2-col mobile layout. The base grid removes the
   right border on :nth-child(4n) and the bottom border on the last 4 cells;
   those are re-pointed here to the 5th column / last row of five so dividers
   stay clean at 8, 9 or 10 fields. Apply with class="bcard-grid bcard-grid-5". */
@media (min-width: 901px) {
  .bcard-grid-5 { grid-template-columns: repeat(5, 1fr); }
  .bcard-grid-5 .field:nth-child(4n)        { border-right: 1px solid var(--border-light); }
  .bcard-grid-5 .field:nth-child(5n)        { border-right: none; }
  .bcard-grid-5 .field:nth-last-child(-n+4) { border-bottom: 1px solid var(--border-light); }
  .bcard-grid-5 .field:nth-last-child(-n+5) { border-bottom: none; }
}

/* FIX (2026-05-20): page-head action icons (.ph-actions) — dark-preset visibility.
   Bare `.btn.btn-sm` anchors (edit/discharge/revert/delete) carry no Bootstrap
   variant, so they fall through to AdminLTE's legacy color:#444 and the static
   .text-danger #dc3545 — both vanish on the nightshift dark-brown --surface.
   Re-bind to adaptive theme tokens so the icons read in every variant/preset. */
.ph-actions .btn.btn-sm {
  color: var(--muted);
  background: transparent;
  border: 0;
  transition: color .12s ease, background .12s ease;
}
.ph-actions .btn.btn-sm:hover { color: var(--ink); background: var(--surface-3); }
.ph-actions .btn.btn-sm.text-danger { color: var(--red) !important; }
.ph-actions .btn.btn-sm.text-danger:hover { background: var(--red-soft); }

/* ── SweetAlert2 dark-theme override ─────────────────────────────────────
   sweetalert2.all.js (v7) is the all-in-one bundle — it injects its own
   <style> tag, but our selector specificity (0,1,1,0) beats the injected
   rules (0,0,1,0) regardless of load order.
   Covers: variant-b (dark premium, midnight, oled) and nightshift
   (variant-a dark preset). The success icon's .swal2-success-fix and
   .swal2-success-ring-fix carry explicit background:#fff — those must
   match the popup bg or ghost-white lines appear on dark dialogs. */
body.variant-b .swal2-popup,
body[data-preset="nightshift"] .swal2-popup {
  background-color: var(--surface-2);
  box-shadow: 0 8px 40px rgba(0,0,0,.55);
}
body.variant-b .swal2-title,
body[data-preset="nightshift"] .swal2-title {
  color: var(--ink);
}
body.variant-b .swal2-content,
body[data-preset="nightshift"] .swal2-content {
  color: var(--ink-2);
}
body.variant-b .swal2-success-fix,
body.variant-b .swal2-success-circular-line-left,
body.variant-b .swal2-success-circular-line-right,
body[data-preset="nightshift"] .swal2-success-fix,
body[data-preset="nightshift"] .swal2-success-circular-line-left,
body[data-preset="nightshift"] .swal2-success-circular-line-right {
  background-color: var(--surface-2) !important;
}

/* ─────────────────────────────────────────────────────────────────────────
   REDESIGN (2026-05-23): .ph-actions semantic chip buttons
   ─────────────────────────────────────────────────────────────────────────
   Used by: application/views/admin/patient/ipdprofile.php (page-head action row)
   Anchors carry a base .ph-act class + a per-action modifier
   (.ph-act-profile / -edit / -revert / -discharge / -delete).
   The base .ph-actions .btn.btn-sm rules above (2026-05-20) still apply as
   the fallback for anything that lacks .ph-act, so removing the modifier
   classes degrades gracefully to the old flat-icon look.

   Color binding uses color-mix(in srgb, var(--<color>) 12%, transparent)
   for the resting tint — Theme Studio's variant-a presets (nightshift/
   midnight/oled) don't override the --*-soft tokens, so a translucent
   mix renders correctly over both light and dark surfaces.
   (cf. memory: theme_studio_token_coverage)
*/
.ph-actions .ph-act.btn.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  transition: color .15s ease, background .15s ease,
              border-color .15s ease, transform .15s ease,
              box-shadow .15s ease;
}
.ph-actions .ph-act.btn.btn-sm > i { line-height: 1; }
.ph-actions .ph-act.btn.btn-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .10);
}
.ph-actions .ph-act.btn.btn-sm:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Profile — neutral / accent on hover */
.ph-actions .ph-act-profile {
  color: var(--muted);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.ph-actions .ph-act-profile:hover {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

/* Edit — blue */
.ph-actions .ph-act-edit {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  border-color: color-mix(in srgb, var(--blue) 40%, transparent);
}
.ph-actions .ph-act-edit:hover {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

/* History — blue (informational / archived navigation, e.g. Previous IPD) */
.ph-actions .ph-act-history {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  border-color: color-mix(in srgb, var(--blue) 35%, transparent);
}
.ph-actions .ph-act-history:hover {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

/* Discharge revert — amber (cautious / reversal) */
.ph-actions .ph-act-revert {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  border-color: color-mix(in srgb, var(--amber) 40%, transparent);
}
.ph-actions .ph-act-revert:hover {
  color: #fff;
  background: var(--amber);
  border-color: var(--amber);
}

/* Patient discharge — green (positive completion) */
.ph-actions .ph-act-discharge {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
  border-color: color-mix(in srgb, var(--green) 40%, transparent);
}
.ph-actions .ph-act-discharge:hover {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

/* Delete — red. Wins over the legacy `.ph-actions .btn.btn-sm.text-danger`
   rule by virtue of selector specificity (extra class). */
.ph-actions .ph-act-delete.text-danger,
.ph-actions .ph-act-delete {
  color: var(--red) !important;
  background: color-mix(in srgb, var(--red) 12%, transparent);
  border-color: color-mix(in srgb, var(--red) 40%, transparent);
}
.ph-actions .ph-act-delete:hover {
  color: #fff !important;
  background: var(--red);
  border-color: var(--red);
}

/* Tighten gap between chips slightly so semantic borders don't feel cramped. */
.ph-actions { gap: 8px; }

/* Issueitem list — action column has only 1 trash icon button.
   The wrapper uses .mailbox-messages which inherits the 26% last-child width meant for
   Front Office tables (3-4 action buttons). Override here to give a tight, sensible width
   that fits 1 icon button + comfortable padding. ID selector beats the .mailbox-messages
   class chain on specificity, so this is honored without modifying the shared rule. */
#issueitem-list-table > thead > tr > th:last-child,
#issueitem-list-table > tbody > tr > td:last-child,
#issueitem-list-table.dataTable > thead > tr > th:last-child,
#issueitem-list-table.dataTable > tbody > tr > td:last-child {
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
}
/* OPD bill table action column (single icon button) — same use case as above.
   Migrated from inline <style> in admin/bill/opd/opd.php 2026-05-26. */
#opdBillTable th:last-child,
#opdBillTable td:last-child {
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
}
/* OPD visit table action column — holds up to two 30px icon buttons (print + show),
   so it needs ~86px; 50px clipped them and forced the table wider. Updated 2026-06-06. */
#opdVisitTable th:last-child,
#opdVisitTable td:last-child {
  width: 86px !important;
  min-width: 86px !important;
  max-width: 86px !important;
}

/* Age year + month side-by-side input pair (floated layout, classic clearfix wrapper).
   Per-instance proportions overridable via CSS variables on the wrapper (defaults
   match opd.php; patient_profile.php uses --yr-w:43% etc.). Migrated 2026-05-26. */
.sh-age-input-row { clear: both; overflow: hidden; }
.sh-age-input-row > .age-y { width: var(--yr-w, 40%); float: left; }
.sh-age-input-row > .age-m { width: var(--mo-w, 56%); float: left; margin-left: var(--mo-gap, 5px); }

/* Utility / component classes migrated from inline styles in
   admin/bill/opd/patient_profile.php 2026-05-26. */
.sh-fs-13 { font-size: 13px; }
.sh-modal-body-scroll { overflow-y: auto; flex: 1; }
.sh-file-input-wrap { margin-top: -5px; border: 0; outline: none; }
.sh-instruction-textarea { height: 28px; }

/* Patient bill modal-header control width constraints (shared by pathology/radio/pharma
   bill twins — identical markup). Migrated from inline styles in
   admin/bill/pathology/pathology.php 2026-05-26. Extended with case-search and
   edit-patient-pick variants for blood-bank issue billing same day. */
.sh-bill-patient-pick      { max-width: 220px; }
.sh-bill-rx-search         { max-width: 240px; }
.sh-bill-case-search       { max-width: 220px; }
.sh-bill-edit-patient-pick { width: 240px; }
.sh-bill-caseid-search     { max-width: 280px; }

/* Bootstrap datetimepicker widget — allow internal content to overflow widget bounds.
   Widget is appended to <body> so page-scoping is moot. Migrated from embedded <style>
   in admin/appointment/index.php 2026-05-26. Same specificity (0,1,0) as original. */
.bootstrap-datetimepicker-widget { overflow: visible !important; }

/* Appointment list tables — action column tight width (90px). Migrated from embedded
   <style> in admin/appointment/index.php 2026-05-26. Same selector/specificity (0,1,2)
   to preserve original cascade behavior — no ID promotion (antipattern). */
table.ajaxlist_todays th:last-child,   table.ajaxlist_todays td:last-child,
table.ajaxlist_upcoming th:last-child, table.ajaxlist_upcoming td:last-child,
table.ajaxlist_old th:last-child,      table.ajaxlist_old td:last-child {
  width: 90px !important; min-width: 90px !important; max-width: 90px !important;
}

/* ──────────────────────────────────────────────────────────
   Patient profile page (admin/patient/profile.php)
   Migrated from inline + embedded <style> 2026-05-26.
   ────────────────────────────────────────────────────────── */

/* Patient sub-sidebar component — theme-aware, uses sh-tokens.css variables.
   Migrated from embedded <style> in profile.php (was lines 9-43). */
.patient_sidebarlists .ss-card { border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface); box-shadow:var(--shadow-sm); overflow:hidden; }
.patient_sidebarlists .ss-head { padding:12px 14px; border-bottom:1px solid var(--border-light); background:var(--surface-2); display:flex; align-items:center; justify-content:space-between; }
.patient_sidebarlists .ss-title { font-size:13px; font-weight:700; color:var(--accent); text-transform:uppercase; letter-spacing:.4px; margin:0; display:flex; align-items:center; gap:6px; }
.patient_sidebarlists .ss-count { background:var(--accent); color:var(--accent-ink); font-size:11px; font-weight:600; padding:2px 8px; border-radius:10px; min-width:22px; text-align:center; }
.patient_sidebarlists .ss-search-wrap { padding:10px; border-bottom:1px solid var(--border-light); position:relative; }
.patient_sidebarlists .ss-search-wrap i.search-icon { position:absolute; left:20px; top:50%; transform:translateY(-50%); color:var(--faint); font-size:12px; pointer-events:none; }
.patient_sidebarlists .ss-search-wrap input { font-size:12px; padding:7px 10px 7px 28px; border-radius:var(--radius); border:1px solid var(--border); background:var(--surface); color:var(--ink); transition:border-color .15s, box-shadow .15s; }
.patient_sidebarlists .ss-search-wrap input:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); outline:none; }
.patient_sidebarlists .ss-list { list-style:none; margin:0; padding:6px; max-height:calc(100vh - 240px); overflow-y:auto; }
.patient_sidebarlists .ss-list::-webkit-scrollbar { width:6px; }
.patient_sidebarlists .ss-list::-webkit-scrollbar-thumb { background:var(--border-strong); border-radius:3px; }
.patient_sidebarlists .ss-list::-webkit-scrollbar-thumb:hover { background:var(--muted); }
.patient_sidebarlists .ss-item { margin-bottom:4px; }
.patient_sidebarlists .ss-item:last-child { margin-bottom:0; }
.patient_sidebarlists .ss-link { display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:var(--radius); border:1px solid transparent; text-decoration:none; color:inherit; transition:background .15s, border-color .15s, transform .15s; }
.patient_sidebarlists .ss-link:hover { background:var(--accent-soft); border-color:var(--border); text-decoration:none; transform:translateX(1px); }
.patient_sidebarlists .ss-item.active .ss-link { background:var(--accent-soft); border-color:var(--accent); box-shadow:inset 3px 0 0 var(--accent); }
.patient_sidebarlists .ss-avatar { width:32px; height:32px; flex-shrink:0; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--teal)); display:flex; align-items:center; justify-content:center; color:var(--accent-ink); font-size:12px; font-weight:700; box-shadow:var(--shadow-sm); }
.patient_sidebarlists .ss-item.active .ss-avatar { background:linear-gradient(135deg,var(--accent),var(--violet)); }
.patient_sidebarlists .ss-info { flex:1; min-width:0; }
.patient_sidebarlists .ss-name { font-size:12.5px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.3; }
.patient_sidebarlists .ss-item.active .ss-name { color:var(--accent); }
.patient_sidebarlists .ss-meta { font-size:10.5px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:1px; }
.patient_sidebarlists .ss-badge { font-size:10px; font-weight:700; padding:3px 7px; border-radius:10px; background:var(--accent-soft); color:var(--accent); white-space:nowrap; flex-shrink:0; border:1px solid var(--border); }
.patient_sidebarlists .ss-item.active .ss-badge { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.patient_sidebarlists .ss-empty { text-align:center; padding:30px 10px; color:var(--faint); font-size:12px; }
.patient_sidebarlists .ss-empty i { font-size:28px; display:block; margin-bottom:8px; }
.patient_sidebarlists .ss-pagination { display:flex; align-items:center; justify-content:center; gap:6px; padding:8px 10px; border-top:1px solid var(--border-light); background:var(--surface-2); }
.patient_sidebarlists .ss-pagination button { border:1px solid var(--border); background:var(--surface); color:var(--muted); width:26px; height:26px; border-radius:var(--radius); display:flex; align-items:center; justify-content:center; font-size:10px; transition:all .15s; flex-shrink:0; }
.patient_sidebarlists .ss-pagination button:hover:not(:disabled) { background:var(--accent-soft); color:var(--accent); border-color:var(--accent); }
.patient_sidebarlists .ss-pagination button:disabled { opacity:.35; cursor:not-allowed; }
.patient_sidebarlists .ss-pagination-info { font-size:12px; color:var(--ink); font-weight:600; min-width:36px; text-align:center; }

/* Profile page wrapper paddings (static portions of conditional inline styles).
   Conditional display:none on .patient_sidebarlists wrapper kept inline (PHP ternary). */
.patient_sidebarlists.sh-sidebar-col { padding-left:0; padding-right:3px; }
.patient_itemcol.sh-no-pl            { padding-left:0; }

/* Avatar img object-fit (extends existing .ph-av — text avatars unaffected) */
img.ph-av { object-fit: cover; }

/* Profile page badges */
.sh-badge-opd       { background: var(--blue-soft);             color: var(--blue);              border: 1px solid var(--blue);              font-weight: 600; }
.sh-badge-antenatal { background: var(--violet-soft, #f0ebff);  color: var(--violet, #7c3aed);   border: 1px solid var(--violet, #7c3aed); }

/* Doctor list (inside rellist-body — patient profile "doctors" section) */
.sh-doctor-stack         { display: flex; flex-direction: column; gap: 8px; }
.sh-doctor-row           { display: flex; align-items: center; gap: 10px; }
.sh-doctor-row > img     { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sh-doctor-row .doc-link { font-size: 13px; color: var(--link); }
.sh-doctor-row .doc-emp  { color: var(--muted); font-size: 11px; }

/* Auto-fill chip grid (medical history stats inside rellist-body) */
.sh-chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }

/* Small font utility (12.5px) — table inside rellist-body */
.sh-fs-12-5 { font-size: 12.5px; }

/* Loading placeholder padding+color (was hardcoded #adb5bd, now themed) */
.sh-loading-pad    { padding: 20px; color: var(--muted); }
.sh-loading-pad-lg { padding: 30px; color: var(--muted); }

/* Extend .sh-instruction-textarea to allow per-instance height override via CSS variable.
   Default 28px matches admin/bill/opd/patient_profile.php; admin/patient/profile.php
   sets --ta-h:32px on its prescription textareas. */
.sh-instruction-textarea-2 { height: 32px; }

/* ──────────────────────────────────────────────────────────
   visitDetails.php (admin/patient/visitDetails.php) migration 2026-05-26
   Largest single-file migration (98 inline + 1 <style> block in 7203 lines).
   ────────────────────────────────────────────────────────── */

/* Sub-sidebar component (parallel to .patient_sidebarlists — same styling,
   different parent class). Duplicated rather than consolidated for independence. */
.sidebarlists .ss-card { border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface); box-shadow:var(--shadow-sm); overflow:hidden; }
.sidebarlists .ss-head { padding:12px 14px; border-bottom:1px solid var(--border-light); background:var(--surface-2); display:flex; align-items:center; justify-content:space-between; }
.sidebarlists .ss-title { font-size:13px; font-weight:700; color:var(--accent); text-transform:uppercase; letter-spacing:.4px; margin:0; display:flex; align-items:center; gap:6px; }
.sidebarlists .ss-count { background:var(--accent); color:var(--accent-ink); font-size:11px; font-weight:600; padding:2px 8px; border-radius:10px; min-width:22px; text-align:center; }
.sidebarlists .ss-search-wrap { padding:10px; border-bottom:1px solid var(--border-light); position:relative; }
.sidebarlists .ss-search-wrap i.search-icon { position:absolute; left:20px; top:50%; transform:translateY(-50%); color:var(--faint); font-size:12px; pointer-events:none; }
.sidebarlists .ss-search-wrap input { font-size:12px; padding:7px 10px 7px 28px; border-radius:var(--radius); border:1px solid var(--border); background:var(--surface); color:var(--ink); transition:border-color .15s, box-shadow .15s; }
.sidebarlists .ss-search-wrap input::placeholder { color:var(--faint); opacity:1; }
.sidebarlists .ss-search-wrap input:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); outline:none; }
.sidebarlists .ss-list { list-style:none; margin:0; padding:6px; max-height:calc(100vh - 240px); overflow-y:auto; }
.sidebarlists .ss-list::-webkit-scrollbar { width:6px; }
.sidebarlists .ss-list::-webkit-scrollbar-thumb { background:var(--border-strong); border-radius:3px; }
.sidebarlists .ss-list::-webkit-scrollbar-thumb:hover { background:var(--muted); }
.sidebarlists .ss-item { margin-bottom:4px; }
.sidebarlists .ss-item:last-child { margin-bottom:0; }
.sidebarlists .ss-link { display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:var(--radius); border:1px solid transparent; text-decoration:none; color:inherit; transition:background .15s, border-color .15s, transform .15s; }
.sidebarlists .ss-link:hover { background:var(--accent-soft); border-color:var(--border); text-decoration:none; transform:translateX(1px); }
.sidebarlists .ss-item.active .ss-link { background:var(--accent-soft); border-color:var(--accent); box-shadow:inset 3px 0 0 var(--accent); }
.sidebarlists .ss-avatar { width:32px; height:32px; flex-shrink:0; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--teal)); display:flex; align-items:center; justify-content:center; color:var(--accent-ink); font-size:12px; font-weight:700; box-shadow:var(--shadow-sm); }
.sidebarlists .ss-item.active .ss-avatar { background:linear-gradient(135deg,var(--accent),var(--violet)); }
.sidebarlists .ss-info { flex:1; min-width:0; }
.sidebarlists .ss-name { font-size:12.5px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.3; }
.sidebarlists .ss-item.active .ss-name { color:var(--accent); }
.sidebarlists .ss-meta { font-size:10.5px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:1px; }
.sidebarlists .ss-badge { font-size:10px; font-weight:700; padding:3px 7px; border-radius:10px; background:var(--accent-soft); color:var(--accent); white-space:nowrap; flex-shrink:0; border:1px solid var(--border); }
.sidebarlists .ss-item.active .ss-badge { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.sidebarlists .ss-empty { text-align:center; padding:30px 10px; color:var(--faint); font-size:12px; }
.sidebarlists .ss-empty i { font-size:28px; display:block; margin-bottom:8px; }
.sidebarlists .ss-pagination { display:flex; align-items:center; justify-content:center; gap:6px; padding:8px 10px; border-top:1px solid var(--border-light); background:var(--surface-2); }
.sidebarlists .ss-pagination button { border:1px solid var(--border); background:var(--surface); color:var(--muted); width:26px; height:26px; border-radius:var(--radius); display:flex; align-items:center; justify-content:center; font-size:10px; transition:all .15s; flex-shrink:0; }
.sidebarlists .ss-pagination button:hover:not(:disabled) { background:var(--accent-soft); color:var(--accent); border-color:var(--accent); }
.sidebarlists .ss-pagination button:disabled { opacity:.35; cursor:not-allowed; }
.sidebarlists .ss-pagination-info { font-size:12px; color:var(--ink); font-weight:600; min-width:36px; text-align:center; }

/* Wrapper paddings (static portion of conditional inline) */
/* Symmetric 8px column padding -> 16px gutter between the patient-list
   sidebar and the profile/detail card, matching the Theme Studio settings
   layout (col-md-2 + col-md-10, both 8px). Was 2px (cramped), then briefly
   10px+14px (asymmetric, too spread); 8px+8px is the balanced match. */
.sidebarlists.sh-sidebar-col-2 { padding-left:8px; padding-right:8px; }
.itemcol.sh-pl-2 { padding-left:8px; }

/* Mini progress bar (5px height) with dynamic width via CSS variable */
.sh-progress-mini { height: 5px; }
.sh-progress-mini > .progress-bar { width: var(--w, 0); }

/* Billing-payment graph card typography (6× repeated pattern: OPD/Pharmacy/Path/Radio/BB/Amb) */
.sh-bill-graph-title { font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.sh-bill-graph-meta  { font-size: 11px; color: var(--muted); margin-bottom: 4px; }

/* Auto-fill chip grid variants (different proportions used in visitDetails) */
.sh-chip-grid-200    { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.sh-chip-grid-120    { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.sh-chip-grid-200-16 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* Vital cards (current vitals strip). $rl_vcol drives border-left + range text color
   via single CSS variable --v-col, inherited from .sh-vital-card parent. */
.sh-vital-card                  { padding: 10px 12px; background: var(--surface-2); border-radius: 6px; border-left: 3px solid var(--v-col, var(--border)); }
.sh-vital-card .sh-vital-label  { font-size: 10px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sh-vital-card .sh-vital-value  { font-size: 16px; font-weight: 800; margin-top: 2px; }
.sh-vital-card .sh-vital-unit   { font-size: 11px; color: var(--muted); }
.sh-vital-card .sh-vital-range  { font-size: 10px; color: var(--v-col, var(--muted)); }

/* Red-bordered rellist (allergies / findings / symptoms danger section) */
.rellist.sh-rellist-danger                    { border-color: var(--red); }
.rellist.sh-rellist-danger > .rellist-head    { background: var(--red-soft); }
.rellist.sh-rellist-danger .rellist-head .ic.danger { background: var(--red); color: #fff; }
.rellist.sh-rellist-danger .rellist-head .title     { color: var(--red); }
.sh-section-label { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.sh-section-item  { margin-bottom: 5px; font-size: 12px; }

/* Doctor row 36x36 variant (visitDetails — larger than patient/profile's 32x32) */
.sh-doctor-flex                  { display: flex; flex-wrap: wrap; gap: 12px; }
.sh-doctor-row-md                { display: flex; align-items: center; gap: 10px; }
.sh-doctor-row-md > img,
.sh-doctor-row-md > .sh-doc-initials { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.sh-doctor-row-md > img          { object-fit: cover; }
.sh-doctor-row-md > .sh-doc-initials { background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 700; }
.sh-doctor-row-md .doc-name      { font-size: 12px; font-weight: 600; }
.sh-doctor-row-md .doc-emp       { font-size: 11px; color: var(--muted); }

/* Age input 3-column variant (year/month/day) — visitDetails uses 30/36/26/4px gap */
.sh-age-input-row-3                    { clear: both; overflow: hidden; }
.sh-age-input-row-3 > .age-y           { width: 30%; float: left; }
.sh-age-input-row-3 > .age-m           { width: 36%; float: left; margin-left: 4px; }
.sh-age-input-row-3 > .age-d           { width: 26%; float: left; margin-left: 4px; }

/* Misc small utility */
.sh-pt-8 { padding-top: 8px; }

/* Dropdown rendered as full-width absolute positioned (custom dropdown widget).
   Migrated from inline in admin/patient/ipdsearch.php 2026-05-26. */
.sh-dropdown-fullw { position: absolute; width: 100%; }


/* easySelectable jQuery plugin (used on admin/patient/import)
   Migrated from inline <style> in import.php 2026-05-26. Color #2196F3
   preserved (plugin signature, differs from --blue). */
#easySelectable li.es-selected { background: #2196F3; color: #fff; }
.easySelectable { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; }

/* === Setup: Bed/Ward/Room/Floor (S2) ===
   Migrated from internal <style> block in setup/floor.php 2026-05-26.
   Original used .example which is too generic (would affect every
   DataTables.example list in the app). Rescoped to .setup-floor-fixed
   added alongside .example on the floor list table. */
.setup-floor-fixed { table-layout: fixed !important; }
.setup-floor-fixed th:nth-child(1),
.setup-floor-fixed td:nth-child(1) { width: 25% !important; }
.setup-floor-fixed th:nth-child(2),
.setup-floor-fixed td:nth-child(2) { width: 60% !important; }
.setup-floor-fixed th:nth-child(3),
.setup-floor-fixed td:nth-child(3) { width: 15% !important; }

/* === Setup: Symptoms + ICD-10 (S5) ===
   Migrated from internal <style> blocks 2026-05-26.
   All originals scoped to .example (too generic). Rescoped to per-list
   classes added alongside existing .example on each table. */
.setup-symptoms-type-fixed th:nth-child(1),
.setup-symptoms-type-fixed td:nth-child(1) { width: 85% !important; }
.setup-symptoms-type-fixed th:nth-child(2),
.setup-symptoms-type-fixed td:nth-child(2) { width: 15% !important; }
.setup-symptoms-head-fixed th:nth-child(1),
.setup-symptoms-head-fixed td:nth-child(1) { width: 25% !important; }
.setup-symptoms-head-fixed th:nth-child(2),
.setup-symptoms-head-fixed td:nth-child(2) { width: 20% !important; }
.setup-symptoms-head-fixed th:nth-child(3),
.setup-symptoms-head-fixed td:nth-child(3) { width: 40% !important; }
.setup-symptoms-head-fixed th:nth-child(4),
.setup-symptoms-head-fixed td:nth-child(4) { width: 15% !important; }
.setup-icd10-codes-fixed th:nth-child(1),
.setup-icd10-codes-fixed td:nth-child(1) { width: 15% !important; }
.setup-icd10-codes-fixed th:nth-child(2),
.setup-icd10-codes-fixed td:nth-child(2) { width: 50% !important; }
.setup-icd10-codes-fixed th:nth-child(3),
.setup-icd10-codes-fixed td:nth-child(3) { width: 20% !important; }
.setup-icd10-codes-fixed th:nth-child(4),
.setup-icd10-codes-fixed td:nth-child(4) { width: 15% !important; }
.setup-icd10-groups-fixed th:nth-child(1),
.setup-icd10-groups-fixed td:nth-child(1) { width: 30% !important; }
.setup-icd10-groups-fixed th:nth-child(2),
.setup-icd10-groups-fixed td:nth-child(2) { width: 55% !important; }
.setup-icd10-groups-fixed th:nth-child(3),
.setup-icd10-groups-fixed td:nth-child(3) { width: 15% !important; }

/* Utilities used by Add Symptoms Type multi-row modal.
   Migrated from inline styles in symptoms/symptomstypeList.php 2026-05-26. */
.sh-tbl-transparent { background: transparent; }
.sh-col-46         { width: 46px; }

/* === Setup: System Notification / Notice Board (S4) ===
   Migrated from inline styles 2026-05-26.
   Note: views live under admin/systemnotification/ but their
   controller is admin/notification (URLs use /admin/notification/...).
   - Compose/Edit message textarea uses wysihtml5 editor, fixed 300px height. */
.sh-textarea-300 { height: 300px; }

/* === Setup: TPA Management (S11) ===
   Migrated from inline styles 2026-05-26.
   - TPA list table columns: uniform 150px width.
   - tpareport.php's 2 hidden date filters (display:none) intentionally
     left inline because jQuery .show()/.hide() in showdate() expects
     to toggle the inline style attribute, and .d-none !important would
     win over the toggle leaving fields permanently hidden. */
.sh-th-150 { width: 150px; }

/* === Setup: Misc Setup (S10) ===
   Migrated from inline/internal styles 2026-05-26.
   Mixed cluster: Holiday, Addons, IncomeHead masters, Users, UserLog. */

/* Holiday list — modal-title icon soft hint. Action button cursor:pointer
   inlines REMOVED; .btn class provides pointer cursor in BS5 by default. */
.sh-icon-soft { opacity: .85; }

/* Addons upload form — bounded widths and fixed-height controls.
   Note: addons line ~21 .modal_loader_div display:none intentionally left
   inline — jQuery .css("display","block") and .fadeOut() toggle the inline
   attribute. Same JS-toggle pattern as tpareport.php (S11). */
.sh-w-560     { max-width: 560px; }
.sh-w-420     { max-width: 420px; }
.sh-h-40      { height: 40px; }
.sh-h-42      { height: 42px; }
.sh-min-h-300 { min-height: 300px; }

/* Income Head list — single-column at full width (same pattern as Symptoms
   Type in S5, kept as its own class for semantic scoping). */
.setup-incomehead-fixed th:nth-child(1),
.setup-incomehead-fixed td:nth-child(1) { width: 85% !important; }
.setup-incomehead-fixed th:nth-child(2),
.setup-incomehead-fixed td:nth-child(2) { width: 15% !important; }

/* Users list — explicit per-column widths for both tabs.
   Patient tab (5 cols): ID 120, Name 220, Username 180, Mobile 160, Action 140.
   Staff tab (8 cols): ID 120, Name 180, Email 220, Role 140, Designation 160,
   Department 160, Phone 150, Action 120.
   Widths set on <th> so they cascade to every <td> in the column; DataTables
   (patient tab ajaxlist) honors these header width hints. */
.sh-th-140 { width: 140px; }
.sh-th-120 { width: 120px; }
.sh-th-160 { width: 160px; }
.sh-th-180 { width: 180px; }
.sh-th-220 { width: 220px; }

/* UserLog — 2 hidden date filters (display:none) intentionally left inline
   because jQuery .show()/.hide() in showdate() expects to toggle the inline
   style attribute. Same pattern as tpareport.php (S11). */

/* === Setup: General Settings cluster (S1) ===
   Migrated from internal <style> blocks and inline styles 2026-05-26.
   Covers: settingList.php, setting.php (legacy variant), queueprocess.php,
   permission.php, eventcalendar.php, attendance.php. */

/* settingList.php — moved out of <style> block at top of file.
   .modal-dialog2 and .color_box not used directly in settingList.php
   itself; preserved as-is in case other views reference them. */
.modal-dialog2 { margin: 1% auto; }
.color_box {
    float: left;
    width: 10px;
    height: 10px;
    margin: 5px;
    border: 1px solid rgba(0, 0, 0, .2);
}

/* settingList.php — hospital/small/app logo image heights (22px). */
.sh-img-h22 { height: 22px; }

/* setting.php (legacy variant) — older logo heights (15px) plus compact
   margin variant. Used only in the legacy general-settings view. */
.sh-img-h15     { height: 15px; }
.sh-img-h15-mt5 { height: 15px; margin-top: 5px; }

/* queueprocess.php — large internal style block migrated wholesale.
   Component is the Direct vs Queue mode switcher with cron strip,
   steppers and tip-box. Uses theme tokens so it adapts to Theme Studio
   variants. Dark-preset overrides preserved verbatim. */

/* Toggle switch */
.big-toggle {
    position: relative;
    width: 200px; height: 46px;
    background: var(--surface-3);
    border-radius: 23px;
    cursor: pointer;
    transition: background .3s;
    border: 2px solid var(--border-strong);
    user-select: none;
}
.big-toggle.on { background: #1abc9c; border-color: #16a085; }
.big-toggle .knob {
    position: absolute;
    top: 3px; left: 3px;
    width: 36px; height: 36px;
    background: var(--surface);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
    transition: left .3s;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: var(--muted);
}
.big-toggle.on .knob { left: 157px; color: #1abc9c; }
.big-toggle .lbl-left {
    position: absolute;
    left: 48px; top: 50%;
    transform: translateY(-50%);
    font-size: 11px; font-weight: 700; color: var(--muted);
    transition: opacity .2s; white-space: nowrap;
}
.big-toggle.on .lbl-left { opacity: 0; }
.big-toggle .lbl-right {
    position: absolute;
    right: 48px; top: 50%;
    transform: translateY(-50%);
    font-size: 11px; font-weight: 700; color: #fff;
    opacity: 0; transition: opacity .2s; white-space: nowrap;
}
.big-toggle.on .lbl-right { opacity: 1; }

/* Mode description panels */
.mode-desc-row { display: flex; gap: 12px; flex: 1; }
.mode-desc {
    flex: 1; border-radius: 6px; padding: 13px 15px;
    border: 2px solid var(--border); transition: all .25s;
    opacity: .42;
}
.mode-desc.active { opacity: 1; }
.mode-desc.direct.active {
    background: color-mix(in srgb, var(--amber) 8%, var(--surface));
    border-color: var(--amber);
}
.mode-desc.queue.active {
    background: color-mix(in srgb, var(--teal) 8%, var(--surface));
    border-color: var(--teal);
}
.mode-desc .md-title {
    font-size: 13px; font-weight: 700; margin-bottom: 5px;
    display: flex; align-items: center; gap: 7px;
}
.mode-desc.direct .md-title { color: var(--amber); }
.mode-desc.queue  .md-title { color: var(--teal); }
.mode-desc p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* Toggle section wrapper */
.toggle-section {
    display: flex; align-items: center; gap: 24px;
    padding: 18px 0 22px; flex-wrap: wrap;
}
.toggle-wrap { flex-shrink: 0; }
.toggle-hint { font-size: 11px; color: var(--muted); margin-top: 7px; text-align: center; }

/* Cron strip */
.cron-strip {
    background: color-mix(in srgb, var(--blue) 8%, var(--surface));
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--blue);
    border-radius: 6px; padding: 12px 15px;
    font-size: 12px; color: var(--ink);
    display: flex; align-items: flex-start; gap: 12px;
    margin-bottom: 20px;
}
.cron-strip i { font-size: 20px; flex-shrink: 0; margin-top: 1px; color: var(--blue); }
.cron-strip strong { display: block; margin-bottom: 4px; font-size: 12px; }
.cron-strip code {
    background: color-mix(in srgb, var(--blue) 14%, var(--surface));
    color: var(--ink);
    padding: 2px 6px; border-radius: 4px; font-size: 11px; word-break: break-all;
}
.sh-cron-note { margin-top: 4px; display: block; }

/* Params row */
.params-section { transition: opacity .3s; }
.params-section.dimmed { opacity: .38; pointer-events: none; }

.field-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.field-item { flex: 0 0 auto; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field-label .req { color: #e74c3c; }

/* Stepper */
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper-btn {
    width: 30px; height: 30px; border-radius: 50%;
    border: 1.5px solid var(--border-strong); background: var(--surface);
    font-size: 18px; line-height: 1; cursor: pointer;
    color: var(--ink-2); display: flex; align-items: center;
    justify-content: center; transition: all .15s; padding: 0;
}
.stepper-btn:hover { border-color: var(--blue); color: var(--blue); }
.stepper-val {
    width: 68px; text-align: center;
    border: 1.5px solid var(--border-strong); border-radius: 6px;
    font-size: 17px; font-weight: 700; color: var(--ink);
    background: var(--surface);
    height: 36px; padding: 0;
}
.stepper-val:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 15%, transparent); }

/* Tip box */
.tip-box {
    background: color-mix(in srgb, var(--amber) 8%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--border));
    border-left: 4px solid var(--amber);
    border-radius: 6px; padding: 12px 14px;
    font-size: 12px; color: var(--ink); flex: 1;
}
.tip-box .tip-title { font-weight: 700; margin-bottom: 5px; font-size: 12px; color: var(--amber); }

/* Status badge */
.stat-badge {
    display: inline-block; padding: 3px 12px;
    border-radius: 12px; font-size: 11px;
    font-weight: 600; vertical-align: middle; margin-left: 10px;
}
.stat-badge.direct {
    background: color-mix(in srgb, var(--green) 12%, var(--surface));
    color: var(--green);
    border: 1px solid color-mix(in srgb, var(--green) 30%, var(--border));
}
.stat-badge.queue {
    background: color-mix(in srgb, var(--blue) 12%, var(--surface));
    color: var(--blue);
    border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--border));
}

/* Nightshift (variant-a body + dark brown surfaces) brightening for badges. */
body[data-preset="nightshift"] .stat-badge.direct { color: #34D399; border-color: rgba(52,211,153,.35); }
body[data-preset="nightshift"] .stat-badge.queue  { color: #4EA2FF; border-color: rgba(78,162,255,.35); }
body[data-preset="nightshift"] .mode-desc.direct .md-title,
body[data-preset="nightshift"] .tip-box .tip-title           { color: #FBBF24; }
body[data-preset="nightshift"] .mode-desc.queue  .md-title   { color: #2DD4BF; }
body[data-preset="nightshift"] .cron-strip i                 { color: #4EA2FF; }

/* Dark-theme legibility for inactive (dimmed) cards across 3 dark presets. */
body[data-preset="nightshift"] .mode-desc:not(.active),
body[data-preset="midnight"]   .mode-desc:not(.active),
body[data-preset="oled"]       .mode-desc:not(.active)        { opacity: .72; }

body[data-preset="nightshift"] .params-section.dimmed,
body[data-preset="midnight"]   .params-section.dimmed,
body[data-preset="oled"]       .params-section.dimmed         { opacity: .62; }

body[data-preset="nightshift"] .mode-desc:not(.active) p,
body[data-preset="midnight"]   .mode-desc:not(.active) p,
body[data-preset="oled"]       .mode-desc:not(.active) p      { color: var(--ink-2); }

body[data-preset="nightshift"] .mode-desc:not(.active) .md-title,
body[data-preset="midnight"]   .mode-desc:not(.active) .md-title,
body[data-preset="oled"]       .mode-desc:not(.active) .md-title { color: var(--ink); }

/* eventcalendar.php — color picker swatches (cpicker family).
   PHP-rendered per-color background/border stay inline (dynamic per swatch). */
.cpicker-wrapper { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
.cpicker         { cursor: pointer; border-radius: 50%; flex-shrink: 0; transition: transform .15s, box-shadow .15s; }
.cpicker-small   { width: 20px; height: 20px; }
.cpicker-big     { width: 28px; height: 28px; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #555; transform: scale(1.1); }

/* attendance.php — attendance schedule table 4-col uniform 25% split.
   Scoped to existing .att-table class. */
.att-table th { width: 25%; }

/* permission.php — reuses .sh-th-140 from S10 (Users action column). */

/* === Setup: Pathology Setup masters (S6) ===
   Migrated from internal <style> blocks and inline styles 2026-05-26.
   Master data screens: category, unit, parameter, plus test create/edit modals.
   Note: 8 select2 dropdowns inline style="width:100%" migrated to BS5 .w-100
   utility (existing) — no new utility class needed for those. */

/* Pathology Category list — single-column 100% width. */
.setup-patho-category-fixed { table-layout: fixed !important; }
.setup-patho-category-fixed th:nth-child(1),
.setup-patho-category-fixed td:nth-child(1) { width: 85% !important; }
.setup-patho-category-fixed th:nth-child(2),
.setup-patho-category-fixed td:nth-child(2) { width: 15% !important; }

/* Pathology Unit list — single-column 100% width. */
.setup-patho-unit-fixed { table-layout: fixed !important; }
.setup-patho-unit-fixed th:nth-child(1),
.setup-patho-unit-fixed td:nth-child(1) { width: 85% !important; }
.setup-patho-unit-fixed th:nth-child(2),
.setup-patho-unit-fixed td:nth-child(2) { width: 15% !important; }

/* Pathology Parameter list — 4 cols at 25/15/10/50 split. */
.setup-patho-parameter-fixed { table-layout: fixed !important; }
.setup-patho-parameter-fixed th:nth-child(1),
.setup-patho-parameter-fixed td:nth-child(1) { width: 25% !important; }
.setup-patho-parameter-fixed th:nth-child(2),
.setup-patho-parameter-fixed td:nth-child(2) { width: 15% !important; }
.setup-patho-parameter-fixed th:nth-child(3),
.setup-patho-parameter-fixed td:nth-child(3) { width: 10% !important; }
.setup-patho-parameter-fixed th:nth-child(4),
.setup-patho-parameter-fixed td:nth-child(4) { width: 35% !important; }
.setup-patho-parameter-fixed th:nth-child(5),
.setup-patho-parameter-fixed td:nth-child(5) { width: 15% !important; }

/* Token-color utilities — extracted from editparameter.php's blue + button
   and parameterdetails.php's red asterisks. Theme-token-aware so they
   adapt under Theme Studio variants. Reused by S7 radiology mirrors. */
.sh-text-blue { color: var(--blue); }
.sh-text-red  { color: var(--red);  }

/* === Setup: Radiology Setup masters (S7) ===
   Migrated from internal <style> blocks and inline styles 2026-05-26.
   Mirrors S6 (Pathology) structure: category, unit, parameter masters
   plus test create/edit modals. Heavy reuse: .w-100 (BS5), .sh-fs-13 (S1),
   .sh-text-red + .sh-text-blue (S6). Only 3 new table-fixed classes. */

/* Radiology Category list — single-column 100% width (mirrors patho). */
.setup-radio-category-fixed { table-layout: fixed !important; }
.setup-radio-category-fixed th:nth-child(1),
.setup-radio-category-fixed td:nth-child(1) { width: 85% !important; }
.setup-radio-category-fixed th:nth-child(2),
.setup-radio-category-fixed td:nth-child(2) { width: 15% !important; }

/* Radiology Unit list — single-column 100% width. */
.setup-radio-unit-fixed { table-layout: fixed !important; }
.setup-radio-unit-fixed th:nth-child(1),
.setup-radio-unit-fixed td:nth-child(1) { width: 85% !important; }
.setup-radio-unit-fixed th:nth-child(2),
.setup-radio-unit-fixed td:nth-child(2) { width: 15% !important; }

/* Radiology Parameter list — 4 cols at 25/15/10/50 split. */
.setup-radio-parameter-fixed { table-layout: fixed !important; }
.setup-radio-parameter-fixed th:nth-child(1),
.setup-radio-parameter-fixed td:nth-child(1) { width: 25% !important; }
.setup-radio-parameter-fixed th:nth-child(2),
.setup-radio-parameter-fixed td:nth-child(2) { width: 15% !important; }
.setup-radio-parameter-fixed th:nth-child(3),
.setup-radio-parameter-fixed td:nth-child(3) { width: 10% !important; }
.setup-radio-parameter-fixed th:nth-child(4),
.setup-radio-parameter-fixed td:nth-child(4) { width: 35% !important; }
.setup-radio-parameter-fixed th:nth-child(5),
.setup-radio-parameter-fixed td:nth-child(5) { width: 15% !important; }

/* === Setup: Pharmacy Masters (S8) ===
   Migrated from inline width:46px on delete-column cells 2026-05-26.
   Applies to dose_duration, dose_interval, medicine_company,
   medicine_group, medicine_unit. Width set on both static <th>
   AND JS-template <td> (via dynamic .append). Single utility class,
   joining .sh-w-* family. Other pharmacy masters (medicine_category,
   medicine_dosage, supplier, supplier_category, pharmacyMasters)
   had ZERO inline CSS — no edits needed. */
.sh-w-46 { width: 46px !important; }

/* === Setup: Front Office Setup masters (S9) ===
   Migrated from inline th/td widths and 2 internal <style> blocks 2026-05-26.
   Cluster covers: complainttypeview (3 cols 45/auto/46px),
   sourceview (3 cols 45/auto/46px), appointpriorityview (1 col 100%),
   visitorspurposeview (2 cols 25/75). Reuses .sh-w-46 from S8.
   Kept inline: 3 popover holders (.fee_detail_popover style="display:none")
   on complainttypeeditview, enquiry_typeview, referenceview — these are
   source divs read by Bootstrap popover plugin and must stay hidden via
   inline. Already-clean (no edits): sourceeditview, referenceeditview,
   visitorspurposeeditview. */

/* Single utility — 45% width applied to first column of complaint+source masters. */
.sh-w-45p { width: 45% !important; }

/* Appointment Priority list — single column 100%. */
.setup-priority-fixed { table-layout: fixed !important; }
.setup-priority-fixed th:nth-child(1),
.setup-priority-fixed td:nth-child(1) { width: 85% !important; }
.setup-priority-fixed th:nth-child(2),
.setup-priority-fixed td:nth-child(2) { width: 15% !important; }

/* Purpose of Visit list — 2 cols at 25/75 split. */
.setup-visitorspurpose-fixed { table-layout: fixed !important; }
.setup-visitorspurpose-fixed th:nth-child(1),
.setup-visitorspurpose-fixed td:nth-child(1) { width: 25% !important; }
.setup-visitorspurpose-fixed th:nth-child(2),
.setup-visitorspurpose-fixed td:nth-child(2) { width: 60% !important; }
.setup-visitorspurpose-fixed th:nth-child(3),
.setup-visitorspurpose-fixed td:nth-child(3) { width: 15% !important; }

/* === Setup: Vital + Finding masters (S12) ===
   Migrated 2026-05-26. PURE REUSE — zero new classes added.
   Single file touched: finding/categorylist.php (3 inlines).
   Reused: .sh-tbl-transparent (S5), .sh-w-46 (S8).
   vital/vital.php and findingcreate/findinglist/findingshow already CSS-clean.
   findingedit.php popover holder kept inline (S9 precedent). */

/* === Setup: Roles + Captcha (S13) ===
   Migrated 2026-05-26.
   roles/allotmodule.php: 4x permission-matrix column headers (view/add/edit/delete).
   captcha/index.php: 1x action column header (reuses .sh-th-140 from S10).
   Kept inline: roles/allotmodule.php line 55 .modal_loader_div display:none
   (JS-toggled via .css("display","block") and .fadeOut() — see lines 183/196/201/206).
   Already-clean (no work): customfield, prefix, payment_setting, contenttype. */
.sh-th-90 { width: 90px; }

/* === Setup: Mail/SMS Settings (S14) ===
   Migrated 2026-05-26.
   compose.php + composeemail.php: 3 mirror inlines each (overflow:visible,
   absolute-positioned autocomplete dropdown, min-height:200px wellscroll).
   index.php: 2x #fromdate/#todate display:none KEPT INLINE — both JS-toggled
   via $.show()/$.hide() at lines 122-126. The #suggesstion-box autocomplete
   ALSO keeps its display:none inline (7x .show()/.hide() calls across both
   files) — only its static positioning extracted to .sh-suggestion-dropdown.
   Reuse: BS5 .overflow-visible builtin. */
/* Specificity 110 (#id + .class) intentionally beats the legacy
   #suggesstion-box{display:none} ID rule (here + style-main.css) so the
   box can show. Visibility is toggled purely via .d-none (Batch 1D migration):
   .d-none{display:none!important} wins when hidden. Other #suggesstion-box
   pages lack .sh-suggestion-dropdown, so they are unaffected. */
#suggesstion-box.sh-suggestion-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 1055;
  display: block;
}
.sh-min-h-200 { min-height: 200px; }

/* === Setup: Expense Head (S15) ===
   Migrated 2026-05-26. PURE REUSE — zero new classes added.
   Single file touched: expensehead/expenseheadList.php (3 inlines).
   Reused: .sh-tbl-transparent (S5), .sh-w-46 (S8).
   Identical pattern to S12 (Vital+Finding): list view with transparent
   bg + add-row table with 46px delete-column. Kept inline: 2 popover
   holders (expenseheadList line 58 + expenseheadEdit line 73). Already-clean
   (no edits): expenseheadCreate, expenseheadShow. */

/* === Setup: Charges (S16) ===
   Migrated 2026-05-26.
   charge.php: 1x select2 width:100% → BS5 .w-100.
   chargeType.php: 3 inlines — composite TH (60px+11px+wrap+break+center)
   split into BS5 utilities + 2 new (.sh-th-60, .sh-fs-11); action col TH
   reuses .sh-th-90 (S13); checkbox TD migrated to text-center align-middle.
   schedulechargeEdit.php: 1x bundled (vertical-align:bottom + text-align:right
   + padding-right:20px) split into BS5 .align-bottom + .text-end + new .sh-pe-20.
   Reuse: BS5 .w-100, .text-center, .align-middle, .text-wrap, .text-break,
   .text-end, .align-bottom; .sh-th-90 (S13). Already-clean (no edits):
   _viewDetails, chargeCategory, schedulechargeDetail, sidebar, taxCategory. */
.sh-th-60 { width: 60px; }
.sh-fs-11 { font-size: 11px; }
.sh-pe-20 { padding-right: 20px; }

/* === Setup: Referral (S17) ===
   Migrated 2026-05-26.
   category.php: 1x internal <style> block (.example single-col 100%)
   migrated to .setup-referral-category-fixed.
   commission.php: 1x inline overflow-x:hidden → BS5 .overflow-x-hidden;
   1x internal <style> block (.example 2-col 30/70) migrated to
   .setup-referral-commission-fixed.
   payment.php: 1x cursor:pointer → .sh-cursor-pointer (existing); 1x
   #patientDetails display:none KEPT INLINE (JS-toggled — see lines
   417, 437, 484 with $.show()/$.hide()/$.css()).
   person.php: 1x cursor:pointer → .sh-cursor-pointer (existing).
   report.php: 3x select2 width:100% → BS5 .w-100.
   Reuse: BS5 .overflow-x-hidden, .w-100; .sh-cursor-pointer (line 10184). */
.setup-referral-category-fixed { table-layout: fixed !important; }
.setup-referral-category-fixed th:nth-child(1),
.setup-referral-category-fixed td:nth-child(1) { width: 85% !important; }
.setup-referral-category-fixed th:nth-child(2),
.setup-referral-category-fixed td:nth-child(2) { width: 15% !important; }

.setup-referral-commission-fixed { table-layout: fixed !important; }
.setup-referral-commission-fixed th:nth-child(1),
.setup-referral-commission-fixed td:nth-child(1) { width: 30% !important; }
.setup-referral-commission-fixed th:nth-child(2),
.setup-referral-commission-fixed td:nth-child(2) { width: 55% !important; }
.setup-referral-commission-fixed th:nth-child(3),
.setup-referral-commission-fixed td:nth-child(3) { width: 15% !important; }

/* === Setup: Inventory Masters (S18) ===
   Migrated 2026-05-26. Cluster: itemcategory + itemstore + itemsupplier.
   itemcategoryList: 5 edits — removed top @media print block (dupe of global
   line 4366); removed inner <style>; added .setup-itemcategory-fixed; table-bg
   transparent reused; new .sh-w-44 for static <th> AND JS template <td>.
   itemstoreList: removed top @media print + inner <style>; added .setup-itemstore-fixed.
   itemsupplierList: removed inner <style>; added .setup-itemsupplier-fixed.
   Kept inline: 5 popover holders across all 6 files (S9 precedent).
   Reuse: .sh-tbl-transparent (S5), global .no-print already at line 4366. */
.sh-w-44 { width: 44px !important; }

.setup-itemcategory-fixed { table-layout: fixed !important; }
.setup-itemcategory-fixed th:nth-child(1),
.setup-itemcategory-fixed td:nth-child(1) { width: 85% !important; }
.setup-itemcategory-fixed th:nth-child(2),
.setup-itemcategory-fixed td:nth-child(2) { width: 15% !important; }

.setup-itemstore-fixed { table-layout: fixed !important; }
.setup-itemstore-fixed th:nth-child(1),
.setup-itemstore-fixed td:nth-child(1) { width: 70% !important; }
.setup-itemstore-fixed th:nth-child(2),
.setup-itemstore-fixed td:nth-child(2) { width: 15% !important; }
.setup-itemstore-fixed th:nth-child(3),
.setup-itemstore-fixed td:nth-child(3) { width: 15% !important; }

.setup-itemsupplier-fixed { table-layout: fixed !important; }
.setup-itemsupplier-fixed th:nth-child(1),
.setup-itemsupplier-fixed td:nth-child(1) { width: 35% !important; }
.setup-itemsupplier-fixed th:nth-child(2),
.setup-itemsupplier-fixed td:nth-child(2) { width: 25% !important; }
.setup-itemsupplier-fixed th:nth-child(3),
.setup-itemsupplier-fixed td:nth-child(3) { width: 25% !important; }
.setup-itemsupplier-fixed th:nth-child(4),
.setup-itemsupplier-fixed td:nth-child(4) { width: 15% !important; }

/* === Patient IPD Profile (ipdprofile.php) ===
   Migrated 2026-05-26. 3 embedded <style> blocks + inline styles moved here.
   Kept inline: display:none toggled by jQuery (sidebar count, pagination,
   cheque_div, evpatientDetails); dynamic CSS vars passed per-iteration (--v-col,
   --ov-fill-w/--ov-fill-c, --w). */

/* IPD sidebar column layout helpers */
/* Symmetric 8px -> 16px gutter, matching the Theme Studio settings layout
   and the OPD list layout. Was 2px (cramped), then 10px+14px (asymmetric). */
.ipd-sidebar-px { padding-left: 8px; padding-right: 8px; }
.ipd-pl-2       { padding-left: 8px; }

/* "Admitted" status badge + inline status dot */
.sh-badge-admitted       { background: var(--green-soft); color: var(--green); border: 1px solid var(--green); font-weight: 600; }
.sh-badge-admitted > span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 4px; }

/* Timeline dot — violet variant (overrides default var(--accent)) */
.rl-tl-dot.violet { background: var(--violet, #7c3aed); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--violet, #7c3aed) 25%, transparent); }

/* Red alert rellist — uses color-mix() instead of --red-soft so dark-mode
   presets (nightshift/midnight/oled) render correctly. See comment in ipdprofile.php
   overview <style> block re: --*-soft tokens not being overridden by dark presets. */
.rellist.sh-rellist-red                       { border-color: var(--red); }
.rellist.sh-rellist-red > .rellist-head       { background: color-mix(in srgb, var(--red) 10%, transparent); }
.rellist.sh-rellist-red .rellist-head .ic.red { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.rellist.sh-rellist-red .rellist-head .title  { color: var(--red); }

/* Spacing utility */
.sh-mt-10 { margin-top: 10px; }

/* IPD sidebar AJAX error state */
.ipd-empty.error { color: #dc3545; }

/* ── IPD Sub-sidebar (#ipd_sidebarlists) ── */
#ipd_sidebarlists .ipd-sidebar-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
#ipd_sidebarlists .ipd-sidebar-head { padding: 12px 14px; border-bottom: 1px solid var(--border-light); background: var(--surface-2); display: flex; align-items: center; justify-content: space-between; }
#ipd_sidebarlists .ipd-sidebar-title { font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .4px; margin: 0; display: flex; align-items: center; gap: 6px; }
#ipd_sidebarlists .ipd-sidebar-count { background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; min-width: 22px; text-align: center; }
#ipd_sidebarlists .ipd-search-wrap { padding: 10px; border-bottom: 1px solid var(--border-light); position: relative; }
#ipd_sidebarlists .ipd-search-wrap i.search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 12px; pointer-events: none; }
#ipd_sidebarlists .ipd-search-wrap input { font-size: 12px; padding: 7px 10px 7px 28px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
#ipd_sidebarlists .ipd-search-wrap input::placeholder { color: var(--faint); opacity: 1; }
#ipd_sidebarlists .ipd-search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
#ipd_sidebarlists .ipd-patient-list { list-style: none; margin: 0; padding: 6px; max-height: calc(100vh - 240px); overflow-y: auto; }
#ipd_sidebarlists .ipd-patient-list::-webkit-scrollbar { width: 6px; }
#ipd_sidebarlists .ipd-patient-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
#ipd_sidebarlists .ipd-patient-list::-webkit-scrollbar-thumb:hover { background: var(--muted); }
#ipd_sidebarlists .ipd-patient-item { margin-bottom: 4px; }
#ipd_sidebarlists .ipd-patient-item:last-child { margin-bottom: 0; }
#ipd_sidebarlists .ipd-patient-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius); border: 1px solid transparent; text-decoration: none; color: inherit; transition: background .15s, border-color .15s, transform .15s; }
#ipd_sidebarlists .ipd-patient-link:hover { background: var(--accent-soft); border-color: var(--border); text-decoration: none; transform: translateX(1px); }
#ipd_sidebarlists .ipd-patient-item.active .ipd-patient-link { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
#ipd_sidebarlists .ipd-avatar { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--teal)); display: flex; align-items: center; justify-content: center; color: var(--accent-ink); font-size: 12px; font-weight: 700; box-shadow: var(--shadow-sm); }
#ipd_sidebarlists .ipd-patient-item.active .ipd-avatar { background: linear-gradient(135deg, var(--accent), var(--violet)); }
#ipd_sidebarlists .ipd-patient-info { flex: 1; min-width: 0; }
#ipd_sidebarlists .ipd-patient-name { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
#ipd_sidebarlists .ipd-patient-item.active .ipd-patient-name { color: var(--accent); }
#ipd_sidebarlists .ipd-patient-meta { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
#ipd_sidebarlists .ipd-patient-badge { font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; flex-shrink: 0; border: 1px solid var(--border); }
#ipd_sidebarlists .ipd-patient-item.active .ipd-patient-badge { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
#ipd_sidebarlists .ipd-empty { text-align: center; padding: 30px 10px; color: var(--faint); font-size: 12px; }
#ipd_sidebarlists .ipd-empty i { font-size: 28px; display: block; margin-bottom: 8px; }
#ipd_sidebarlists .ipd-pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border-light); background: var(--surface-2); }
#ipd_sidebarlists .ipd-pagination button { border: 1px solid var(--border); background: var(--surface); color: var(--muted); width: 26px; height: 26px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 10px; transition: all .15s; flex-shrink: 0; }
#ipd_sidebarlists .ipd-pagination button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
#ipd_sidebarlists .ipd-pagination button:disabled { opacity: .35; cursor: not-allowed; }
#ipd_sidebarlists .ipd-pagination-info { font-size: 12px; color: var(--ink); font-weight: 600; min-width: 36px; text-align: center; }

/* ── Overview tab (#overview .ov-*) ── */
#overview .ov-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
#overview .ov-tile-grid.tight { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
#overview .ov-tile { padding: 10px 12px; border-radius: var(--radius-md, 8px); border: 1px solid var(--border, #e3e6ea); background: var(--surface-2, #fafbfc); transition: transform .15s ease, box-shadow .15s ease; }
#overview .ov-tile:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.06); }
#overview .ov-tile-label { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
#overview .ov-tile-value { font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.3; }
#overview .ov-tile-sub   { font-size: 10px; color: var(--muted); font-weight: 500; margin-left: 4px; }
/* Alert tiles — color-mix() avoids --*-soft token dark-mode issue (cf. ipdprofile.php comment) */
#overview .ov-alert { border-width: 1px; }
#overview .ov-alert.red   { border-color: var(--red);   background: color-mix(in srgb, var(--red)   12%, transparent); }
#overview .ov-alert.red   .ov-tile-label { color: var(--red); }
#overview .ov-alert.amber { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); }
#overview .ov-alert.amber .ov-tile-label { color: var(--amber); }
#overview .ov-alert.blue  { border-color: var(--blue);  background: color-mix(in srgb, var(--blue)  12%, transparent); }
#overview .ov-alert.blue  .ov-tile-label { color: var(--blue); }
/* Vital tile — border-color and status-color via CSS var --v-col (set inline per-iteration) */
#overview .ov-vital { border-width: 1.5px; padding: 10px 12px; border-color: var(--v-col, var(--border)); }
#overview .ov-vital-status { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; margin-top: 2px; color: var(--v-col, var(--muted)); }
/* Doctor cards */
#overview .ov-doctors-wrap { display: flex; flex-wrap: wrap; gap: 10px; }
#overview .ov-doctor { display: flex; align-items: center; gap: 10px; padding: 8px 34px 8px 12px; border-radius: var(--radius-md, 8px); background: var(--surface-2, #fafbfc); border: 1px solid var(--border, #e3e6ea); position: relative; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
#overview .ov-doctor:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.06); border-color: var(--blue, #0d6efd); }
#overview .ov-doctor-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--blue, #0d6efd), var(--teal, #0dcaf0)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; flex-shrink: 0; box-shadow: 0 2px 4px rgba(0,0,0,.08); }
#overview .ov-doctor-avatar.alt { background: linear-gradient(135deg, var(--teal, #0dcaf0), var(--blue, #0d6efd)); }
#overview .ov-doctor-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
#overview .ov-doctor-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.2; }
#overview .ov-doctor-id   { font-size: 11px; color: var(--muted, #6c757d); margin-top: 2px; }
#overview .ov-doctor-remove { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 22px; height: 22px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface, #fff); border: 1px solid var(--border, #e3e6ea); color: var(--muted, #6c757d); font-size: 10px; line-height: 1; cursor: pointer; opacity: 0; visibility: hidden; transition: opacity .15s ease, background .15s ease, color .15s ease, border-color .15s ease; }
#overview .ov-doctor:hover .ov-doctor-remove { opacity: 1; visibility: visible; }
#overview .ov-doctor-remove:hover { background: var(--red, #dc3545); border-color: var(--red, #dc3545); color: #fff; }
/* Credit limit stats — credit value colors set via class, fill width+color via CSS vars */
#overview .ov-credit-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
#overview .ov-credit-stat { text-align: center; padding: 8px; border-radius: var(--radius-sm, 6px); background: var(--surface-2, #fafbfc); border: 1px solid var(--border, #e3e6ea); }
#overview .ov-credit-label { font-size: 11px; color: var(--muted, #6c757d); font-weight: 500; margin-bottom: 4px; }
#overview .ov-credit-value { font-size: 15px; font-weight: 700; }
#overview .ov-credit-v-red   { color: var(--red,   #dc3545); }
#overview .ov-credit-v-green { color: var(--green, #198754); }
#overview .ov-credit-bar  { height: 8px; border-radius: 4px; background: var(--border, #e3e6ea); overflow: hidden; }
#overview .ov-credit-fill { height: 100%; border-radius: 4px; transition: width .4s ease; background-image: linear-gradient(90deg, currentColor 0%, currentColor 100%); width: var(--ov-fill-w, 0); color: var(--ov-fill-c, var(--green)); }
#overview .ov-credit-pct-text { font-size: 11px; color: var(--muted, #6c757d); margin-top: 6px; font-weight: 500; }
/* Billing overview module tiles — bar fill width via CSS var --w */
#overview .ov-module { padding: 12px; border-radius: var(--radius-md, 8px); background: var(--surface-2, #fafbfc); border: 1px solid var(--border, #e3e6ea); transition: transform .15s, box-shadow .15s; }
#overview .ov-module:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.06); }
#overview .ov-module-head  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
#overview .ov-module-label { font-size: 11px; font-weight: 700; color: var(--ink-2, #495057); text-transform: uppercase; letter-spacing: .3px; }
#overview .ov-module-icon  { color: var(--faint, #adb5bd); font-size: 14px; }
#overview .ov-module-value { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
#overview .ov-module-bar   { height: 6px; border-radius: 3px; background: var(--border, #e3e6ea); overflow: hidden; }
#overview .ov-module-fill  { height: 100%; border-radius: 3px; background: var(--blue, #0d6efd); transition: width .4s ease; width: var(--w, 0); }
/* Prescription list */
#overview .ov-prescription { padding: 8px 12px; border-radius: var(--radius-sm, 6px); background: var(--surface-2, #fafbfc); border: 1px solid var(--border, #e3e6ea); border-left: 3px solid var(--amber, #f59e0b); font-size: 12.5px; color: var(--ink); transition: transform .15s, box-shadow .15s; }
#overview .ov-prescription:hover { transform: translateX(2px); box-shadow: 0 2px 6px rgba(0,0,0,.05); }
#overview .ov-prescription-list { display: flex; flex-direction: column; gap: 8px; }

/* ── Nurse Note tab (#nurse_note .nn-*) ── */
#nurse_note .nn-timeline { position: relative; padding-left: 28px; margin-top: 10px; }
#nurse_note .nn-timeline::before { content: ""; position: absolute; left: 10px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
#nurse_note .nn-item { position: relative; margin-bottom: 18px; }
#nurse_note .nn-item::before { content: ""; position: absolute; left: -23px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--blue); border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--blue); }
#nurse_note .nn-card { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); }
#nurse_note .nn-card-header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: 8px 8px 0 0; }
#nurse_note .nn-date-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-soft); color: var(--blue); padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
#nurse_note .nn-staff { font-size: 14px; font-weight: 600; color: var(--ink); }
#nurse_note .nn-staff-id { color: var(--muted); font-weight: 400; font-size: 12px; }
#nurse_note .nn-actions { margin-left: auto; }
#nurse_note .nn-card-body { padding: 14px; }
#nurse_note .nn-note { border-left: 3px solid var(--blue); padding: 8px 12px; background: var(--surface-2); border-radius: 0 4px 4px 0; margin: 0; color: var(--ink-2); }
#nurse_note .nn-section-label { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 600; letter-spacing: .5px; margin-bottom: 4px; }
#nurse_note .nn-comment { background: color-mix(in srgb, var(--amber) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); border-left: 3px solid var(--amber); border-radius: 4px; padding: 8px 12px; margin-top: 12px; color: var(--ink-2); }
#nurse_note .nn-comment-meta { font-size: 11px; color: var(--muted); }
#nurse_note .nn-fields dt { font-weight: 600; color: var(--ink-2); }
#nurse_note .nn-fields dd { color: var(--muted); }
#nurse_note .nn-subcomment { border-top: 1px solid var(--border); padding: 10px 14px; font-size: 13px; background: var(--surface-2); color: var(--ink-2); }
#nurse_note .nn-subcomment:last-child { border-radius: 0 0 8px 8px; }
#nurse_note .nn-subcomment-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
#nurse_note .nn-empty { text-align: center; padding: 60px 20px; color: var(--faint); }
#nurse_note .nn-empty i { font-size: 48px; margin-bottom: 12px; display: block; }

/* === Setup: Language + Online Appointment (S19) ===
   Migrated 2026-05-26.
   languageList: 4 TH widths (50/90×2/140) — 50 new, rest reused.
   languageSwitcher: 1 split inline — fs-11 reused, margin-top:3px kept inline.
   onlineappointment/addrow.php: 1 style block migrated to global rule.
   onlineappointment/globalShift.php: 1 style block migrated to setup-globalshift-fixed.
   onlineappointment/index.php: 3x select2 width:100% → BS5 .w-100.
   onlineappointment/patientQueue.php: 1 global tr cursor rule scoped to
   #headerTable; 1 PHP-conditional inline color → .sh-text-red conditional.
   Reuse: .sh-th-90 (S13), .sh-th-140 (S10), .sh-fs-11 (S16), .sh-text-red (S6),
   BS5 .w-100. Skip: onlineappointment/print/patientQueue_print.php (print view). */
.sh-th-50 { width: 50px; }

.setup-globalshift-fixed { table-layout: fixed !important; }
.setup-globalshift-fixed th:nth-child(1),
.setup-globalshift-fixed td:nth-child(1) { width: 40% !important; }
.setup-globalshift-fixed th:nth-child(2),
.setup-globalshift-fixed td:nth-child(2) { width: 20% !important; }
.setup-globalshift-fixed th:nth-child(3),
.setup-globalshift-fixed td:nth-child(3) { width: 25% !important; }
.setup-globalshift-fixed th:nth-child(4),
.setup-globalshift-fixed td:nth-child(4) { width: 15% !important; }

/* Online appointment addrow form — error labels positioned absolutely
   inside .relative containers (was inline <style> on each addrow.php render). */
.relative label.text-danger { position: absolute; left: 5px; bottom: 0; }

/* PatientQueue draggable rows — was a global tr { cursor: all-scroll; }
   inside patientQueue.php (risky global selector). Scoped to specific table. */
#headerTable tr { cursor: all-scroll; }

/* === Setup: ID Card Setup (S20) ===
   Migrated 2026-05-26. PURE REUSE — zero new classes added.
   3 files touched: createpatientidcard, staffidcardview (cursor:pointer on
   popover-trigger <a>), patientidcardedit (removed dupe @media print).
   Reused: .sh-cursor-pointer (line 10184), global .no-print (line 4366).
   INTENTIONALLY SKIPPED (print-design HTML for direct browser printing):
   patientidcardpreview.php, generatemultiple.php, staffidcardpreview.php —
   these contain inline padding/background/color on print-targeted <table>/<td>
   elements with PHP-dynamic colors that can't be externalized. Touching them
   would break direct-print rendering (no mPDF involved, but same skip-rule). */

/* === Setup: Bulk Message + Inventory Verification (S21) ===
   Migrated 2026-05-26.
   bulkmessage/index.php: 2 inlines migrated — TH width:40px → new .sh-th-40
   (joins .sh-th-* family); checkbox composite (transform:scale + cursor)
   split into new .sh-scale-130 + existing .sh-cursor-pointer.
   VERIFIED-PRESERVED (no edits — all inlines are JS-toggled or popover):
     item/additemreport.php (2x #fromdate/#todate display:none — JS-toggled)
     item/itemreport.php (2x same JS-toggled date filters)
     item/itemEdit.php (1x popover holder)
     itemstock/additem.php (1x popover holder)
     itemstock/itemEdit.php (1x popover holder)
   Reuse: .sh-cursor-pointer (line 10184). */
.sh-th-40 { width: 40px; }
.sh-scale-130 { transform: scale(1.3); }

/* === Setup: Zoom Conference Settings (S22) ===
   Migrated 2026-05-26. PURE REUSE — zero new classes added.
   Single file touched: conference/index.php — removed 1x redundant
   inline style="color:var(--ink)" on <p> (var(--ink) is the default
   text color from body cascade, so the inline was tautological).
   DEFERRED — TRANSACTIONAL (out of Setup-only scope):
     conference/consult.php (6 inlines incl. #patientDetails+.visit_div JS toggles)
     conference/staffconsult.php (6 inlines — mirror of consult)
     conference/consult_report.php (3 inlines + #fromdate/#todate JS toggles)
     conference/meeting.php (2 flex layout inlines)
     conference/meeting_report.php (2x #fromdate/#todate JS toggles)
     conference/join.php (1 standalone-page <style> block + 1 empty style="")
   These are telemedicine consultation rooms / meeting interfaces, not Setup. */

/* === Setup: Appearance + Backup (S23) ===
   Migrated 2026-05-26.
   appearance/index.php: 1x icon color:var(--accent) → new .sh-text-accent
   (joins .sh-text-* family).
   backup.php: 1x TH width:260px+nowrap → new .sh-th-260 + BS5 .text-nowrap;
   1x download-button composite (now themed via var(--accent) — !important
   retained to defend against btn-success cascade still on the element).
   Kept inline: backup.php line 83 #cronkey display:none (JS-toggled via
   $.show()/$.hide() at lines 107/113). */
.sh-text-accent { color: var(--accent); }
.sh-th-260 { width: 260px; }
.sh-btn-download-icon {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--accent-ink) !important;
  padding: .25rem .5rem !important;
  min-width: 31px;
  min-height: 31px;
  line-height: 1.5 !important;
}

/* === Setup: Operation Theatre (S24) ===
   Migrated 2026-05-26.
   category.php: 2x inlines (TH 46px + JS template TD 46px) → reuse .sh-w-46.
   operation.php: 1 internal <style> block (2-col 25/75) → new .setup-operation-fixed;
   2x TH widths (45%/46px) → reuse .sh-w-45p (S9) + .sh-w-46 (S8); 1x select2
   width:100% + 1x JS template select width:100% → reuse BS5 .w-100; 1x JS
   template TD 46px → reuse .sh-w-46.
   DEFERRED — Reports & Transactional/Print views (out of Setup scope):
     operationtheatre/otReport.php (5 inlines — report viewer)
     operationtheatre/otsearch.php (11 inlines — search/transactional)
     operationtheatre/printBill.php (2 inlines — PRINT VIEW, skip)
     operationtheatre/_printotdetails.php (7 inlines — PRINT VIEW, skip)
   Reuse: .sh-w-46 (S8), .sh-w-45p (S9), BS5 .w-100. */
.setup-operation-fixed { table-layout: fixed !important; }
.setup-operation-fixed th:nth-child(1),
.setup-operation-fixed td:nth-child(1) { width: 25% !important; }
.setup-operation-fixed th:nth-child(2),
.setup-operation-fixed td:nth-child(2) { width: 60% !important; }
.setup-operation-fixed th:nth-child(3),
.setup-operation-fixed td:nth-child(3) { width: 15% !important; }

/* === Pharmacy Bill (admin/pharmacy/bill) ===
   Migrated 2026-05-26.
   pharmacyBill.php: 1 embedded <style> block (pharmacyBillTable col widths + billModal
     overflow/table-layout) + 6 inline styles (modal-header max-widths + JS-string selects/span).
   _createBill.php: 1 embedded <style> block (billModal overflow duplicate) + 10 inline styles
     (overflow wrapper, table-layout, select2 widths, flex panels, summary inputs).
   _createSaleReturn.php: 7 inline styles (table-layout, flex panels, summary inputs).
   Exceptions kept inline: display:none on .cheque_div, .sr_cheque_div, #sr_prev_returns_section,
     .sr-prev-detail-row (all jQuery-toggled).
   Reuse: .sh-flex-col (flex panels), .sh-bill-summary-input (130px inputs),
     .sh-bill-patient-pick (220px), .sh-bill-rx-search (240px). */

/* pharmacyBillTable — lock last 7 data columns to 80px for DataTable layout */
#pharmacyBillTable colgroup col:nth-last-child(1), #pharmacyBillTable th:nth-last-child(1), #pharmacyBillTable td:nth-last-child(1),
#pharmacyBillTable colgroup col:nth-last-child(2), #pharmacyBillTable th:nth-last-child(2), #pharmacyBillTable td:nth-last-child(2),
#pharmacyBillTable colgroup col:nth-last-child(3), #pharmacyBillTable th:nth-last-child(3), #pharmacyBillTable td:nth-last-child(3),
#pharmacyBillTable colgroup col:nth-last-child(4), #pharmacyBillTable th:nth-last-child(4), #pharmacyBillTable td:nth-last-child(4),
#pharmacyBillTable colgroup col:nth-last-child(5), #pharmacyBillTable th:nth-last-child(5), #pharmacyBillTable td:nth-last-child(5),
#pharmacyBillTable colgroup col:nth-last-child(6), #pharmacyBillTable th:nth-last-child(6), #pharmacyBillTable td:nth-last-child(6),
#pharmacyBillTable colgroup col:nth-last-child(7), #pharmacyBillTable th:nth-last-child(7), #pharmacyBillTable td:nth-last-child(7)
{ width: 80px !important; min-width: 80px !important; max-width: 80px !important; }
#pharmacyBillTable th:nth-last-child(1),
#pharmacyBillTable th:nth-last-child(2),
#pharmacyBillTable th:nth-last-child(3),
#pharmacyBillTable th:nth-last-child(4),
#pharmacyBillTable th:nth-last-child(5),
#pharmacyBillTable th:nth-last-child(6),
#pharmacyBillTable th:nth-last-child(7) { text-align: right !important; }

/* myModal (Purchase Medicine) — kill all horizontal scroll.
   13-col medicines table locked to fixed layout so it fits the modal width.
   overflow-x:hidden on every container + table-responsive prevents any
   scrollbar at every level. */
#myModal .modal-body,
#myModal .modal-body .sh-form-card,
#myModal .modal-body .p-2,
#myModal .pup-scroll-area,
#myModal .modal-content,
#myModal .modal-dialog,
#myModal .table-responsive { overflow-x: hidden !important; }
#myModal #tableID { table-layout: fixed !important; width: 100% !important; max-width: 100% !important; }
#myModal #tableID th,
#myModal #tableID td { white-space: normal !important; word-break: break-word; }

/* billModal: kill horizontal scrollbar + hard-lock medicines table width.
   The medicines table (#tableID) has 10 columns under table-layout:fixed.
   Overflow-x:hidden on every scroll host prevents select2/input-group from
   triggering horizontal scroll on an ancestor. */
#billModal .modal-body,
#billModal .modal-body .sh-form-card,
#billModal .modal-body .p-2,
#billModal .pup-scroll-area,
#billModal .modal-content,
#billModal .modal-dialog,
#billModal .table-responsive { overflow-x: hidden !important; }
#billModal #tableID { table-layout: fixed !important; width: 100% !important; max-width: 100% !important; }

/* saleReturnModal: kill horizontal scrollbar + lock srTableID width (mirrors billModal block) */
#saleReturnModal .modal-body,
#saleReturnModal .modal-body .sh-form-card,
#saleReturnModal .modal-body .p-2,
#saleReturnModal .pup-scroll-area,
#saleReturnModal .modal-content,
#saleReturnModal .modal-dialog,
#saleReturnModal .table-responsive { overflow-x: hidden !important; }
#saleReturnModal #srTableID { table-layout: fixed !important; width: 100% !important; max-width: 100% !important; }

/* Sale Return modal — header width constraints */
.sh-sr-patient-pick { max-width: 260px; }
.sh-sr-bill-search  { max-width: 250px; }

/* Medicine row: available-qty badge font size */
.available_qty { font-size: 10pt; }

/* Billing summary inputs — gross-discount percent field */
.sh-bill-pct-input { max-width: 75px; }

/* === Setup: Certificate + Notification + GenerateStaffIdCard (S25 — partial) ===
   Migrated 2026-05-26. Tight scope — easy wins only.
   certificate/generatecertificate.php: 1x TH text-align:left → BS5 .text-start.
   generatestaffidcard/generatestaffidcardview.php: same .text-start.
   notification/notificationAdd + notificationEdit: 3 mirror edits each —
   textarea min-height:260px → new .sh-min-h-260; redundant inline cursor:pointer
   removed (existing .cursor-pointer class in style-main.css handles it via
   PHP conditional); "You" badge composite (fs:9px + accent-soft bg + accent
   color, all theme tokens) → new .sh-badge-you.
   DEFERRED to S26 — complex blocks requiring careful migration:
     certificate/createcertificate.php (2 <style> blocks)
     certificate/preview_certificate.php (11 PHP-dynamic print inlines + style block — PRINT VIEW skip)
     certificate/printcertificate.php (13 PHP-dynamic print inlines + style block — PRINT VIEW skip)
     content/upload.php (10 composite inlines + style block)
     content/_getsharedcontents.php (3 composites + style block)
     content/_getuploaddata.php (11 mixed inlines)
     content/list.php (1 JS-toggled modal_loader — verify-preserve)
     notification/system_notification_setting.php (.notif-table/.notif-switch-group block)
     generatestaffidcard/generatemultiplestaffidcard.php (6 inlines + style — PRINT-DESIGN skip)
   VERIFIED-PRESERVED:
     issueitem/issueinventoryreport.php (2x #fromdate/#todate JS-toggled).
   Reuse: BS5 .text-start. */
.sh-min-h-260 { min-height: 260px; }
.sh-badge-you { font-size: 9px; background: var(--accent-soft); color: var(--accent); }

/* === Setup: Complex Residuals (S26) ===
   Migrated 2026-05-26. Handled the deferred items from S25.
   certificate/createcertificate.php: 2 <style> blocks → block 1 (@media print)
   was duplicate of global line 4366 (removed); block 2 (#certificateTable
   column constraints) moved here as scoped rule below.
   notification/system_notification_setting.php: full <style> block migrated
   (notif-table + notif-switch-group component rules — keeps hardcoded
   #0d6efd for checked state, BS5 primary, theme-resistant by design).
   content/_getuploaddata.php: 11 inlines migrated — 2 new TH widths
   (.sh-th-32, .sh-th-36); 1 composite checkbox (.sh-checkbox-teal —
   uses --teal token); 1 font-weight (.sh-fw-500); 2x color:var(--ink)
   REDUNDANT removed (default text color); BS5 .text-end, .text-nowrap,
   .d-inline-flex, .sh-cursor-pointer reused. Kept 1 margin:3px inline
   (niche value not in BS5 spacers).
   STILL-DEFERRED to future module (content/* large files):
     content/upload.php (10 composite inlines + style block — modal sizing)
     content/_getsharedcontents.php (3 image-thumb composites + style block)
   Reuse: BS5 .text-end .text-nowrap .d-inline-flex .text-start;
   .sh-cursor-pointer (10184). */

/* Certificate template list — sticky last-2-cols (was inline <style> on
   createcertificate.php). Width forced to 120px/130px regardless of content. */
#certificateTable colgroup col:nth-last-child(1),
#certificateTable th:nth-last-child(1),
#certificateTable td:nth-last-child(1) { width: 120px !important; min-width: 120px !important; max-width: 120px !important; }
#certificateTable colgroup col:nth-last-child(2),
#certificateTable th:nth-last-child(2),
#certificateTable td:nth-last-child(2) { width: 130px !important; min-width: 130px !important; max-width: 130px !important; }

/* System Notification Settings — table + switch-group component
   (was inline <style> at top of system_notification_setting.php). */
.notif-table td { vertical-align: middle; }
.notif-switch-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notif-switch-group .form-switch { padding-left: 2.5em; margin: 0; }
.notif-switch-group .form-check-input {
  width: 2em;
  height: 1.1em;
  margin-left: -2.5em;
  cursor: pointer;
}
.notif-switch-group .form-check-label {
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.notif-switch-group .form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

/* Content upload data utilities (from content/_getuploaddata.php migration). */
.sh-th-32 { width: 32px; }
.sh-th-36 { width: 36px; }
.sh-fw-500 { font-weight: 500; }

/* Styled checkbox — small (14x14), pointer cursor, theme-aware accent color.
   --teal is a Smart Hospital theme token (see sh-tokens.css). */
.sh-checkbox-teal {
  accent-color: var(--teal);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* === Setup: Content Upload + Shared Contents (S27) ===
   Migrated 2026-05-26. Largest module yet — 161+ lines of component CSS
   moved verbatim from 2 files. Theme-aware: includes variant-b (midnight/oled)
   AND body[data-preset="nightshift"] overrides preserved exactly.
   upload.php: full 148-line <style> block migrated (sh-cnt-* page layout +
   sh-sb-* sidebar + sh-btn-icon + .fi-* file-type colors + responsive
   breakpoints + dark theme overrides); 1 inline mb-0 migrated (BS5 reuse).
   _getsharedcontents.php: full 12-line <style> block migrated (#viewShareModal
   .sc-ft-icon, .sc-ft-mono, .sc-dl-btn + .fi-* indicator colors).
   STILL-DEFERRED — composite inlines requiring careful split:
     upload.php L170 form display:contents
     upload.php L195 div opacity:.35
     upload.php L431/L470 scroll containers (max-height + overflow-y)
     upload.php L493/L515 modal max-width:380px
     upload.php L526 delete files list composite (8 props)
     upload.php L749 dynamic JS-string iframe modal (runtime-generated)
     _getsharedcontents.php L111/L118/L157 image-thumb composites
   These are niche modal/layout values. KEPT INLINE for safety.
   VERIFIED-PRESERVED: upload.php L182 .modal_loader_div display:none (JS-toggled). */

/* ── Danger confirm icon (was upload.php inline <style>) ── */
.sh-modal-confirm .confirm-icon-wrap.sh-confirm-danger { background: var(--red-soft,#fee2e2); color: var(--red,#ef4444); margin-top: .75rem; }
.sh-modal-confirm .confirm-icon-wrap.sh-confirm-danger::before { border-color: var(--red,#ef4444); }
/* ── Delete files list ── */
#confirm-delete .delete_files_list ul { margin: 0; padding-left: 1.1rem; }
#confirm-delete .delete_files_list li { padding: 2px 0; color: var(--ink); }
/* ── Content Upload Page ── */
/* Main layout */
.sh-cnt-layout { display: grid; grid-template-columns: 1fr 278px; gap: 16px; align-items: start; }
.sh-cnt-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; }
/* Toolbar */
.sh-cnt-toolbar { padding: 11px 15px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sh-cnt-search { flex: 1; min-width: 150px; display: flex; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sh-cnt-search input { border: none; background: transparent; padding: 6px 10px; color: var(--ink); outline: none; flex: 1; font-size: 13px; }
.sh-cnt-search input::placeholder { color: var(--faint); }
.sh-cnt-search button { border: none; background: transparent; padding: 0 9px; color: var(--muted); cursor: pointer; font-size: 12px; }
.sh-cnt-vtoggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sh-cnt-vbtn { padding: 6px 10px; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; transition: all .15s; }
.sh-cnt-vbtn.active { background: var(--teal); color: #fff; }
.sh-cnt-vbtn:not(:last-child) { border-right: 1px solid var(--border); }
#sh-sel-pill { display: none; font-size: 11.5px; font-weight: 700; color: var(--teal); background: var(--teal-soft); border: 1px solid var(--teal); padding: 3px 10px; border-radius: 20px; white-space: nowrap; font-family: var(--mono,monospace); }
.sh-cnt-body { padding: 15px; min-height: 300px; position: relative; }
/* Grid cards */
.sh-cnt-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(170px,1fr)); gap: 12px; }
.sh-cnt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; cursor: pointer; transition: border-color .15s,box-shadow .15s,transform .15s; }
.sh-cnt-card:hover { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft),var(--shadow); transform: translateY(-1px); }
.sh-cnt-card.sh-sel { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.sh-cnt-thumb { aspect-ratio: 4/3; background: var(--bg-2); position: relative; overflow: hidden; display: block; }
.sh-cnt-thumb .image_content { display: block; width: 100%; height: 100%; }
.sh-cnt-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sh-cnt-icon-wrap { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.sh-cnt-icon-wrap i { font-size: 28px; opacity: .65; }
.sh-cnt-chk-wrap { position: absolute; top: 7px; left: 7px; z-index: 3; }
.sh-cnt-chk-wrap input { width: 15px; height: 15px; accent-color: var(--teal); cursor: pointer; }
.sh-cnt-ext { position: absolute; top: 7px; right: 7px; background: rgba(0,0,0,.55); color: #fff; font-family: var(--mono,monospace); font-size: 9.5px; padding: 2px 5px; border-radius: var(--radius); text-transform: uppercase; }
.sh-cnt-overlay { position: absolute; inset: 0; background: linear-gradient(to top,rgba(0,0,0,.78) 35%,transparent); opacity: 0; transition: opacity .15s; padding: 10px; display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none; }
.sh-cnt-card:hover .sh-cnt-overlay { opacity: 1; }
.sh-cnt-ov-name { font-size: 11.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-cnt-ov-meta { font-family: var(--mono,monospace); font-size: 10px; color: rgba(255,255,255,.6); margin-top: 2px; }
.sh-cnt-footer { padding: 8px 10px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 5px; }
.sh-cnt-fname { font-size: 12px; font-weight: 500; color: var(--ink); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Icon button */
.sh-btn-icon { width: 28px; height: 28px; padding: 0; border-radius: var(--radius-md); display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; transition: background .15s,color .15s,border-color .15s; flex-shrink: 0; text-decoration: none; }
.sh-btn-icon:hover { background: var(--teal-soft); color: var(--teal); border-color: var(--teal); }
.sh-btn-icon.del:hover { background: var(--red-soft); color: var(--red); border-color: var(--red); }
/* List table */
.sh-cnt-table { width: 100%; border-collapse: collapse; }
.sh-cnt-table th { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px 12px; text-align: left; background: var(--bg); border-bottom: 1px solid var(--border); white-space: nowrap; }
.sh-cnt-table td { padding: 9px 12px; border-bottom: 1px solid var(--border-light,var(--border)); vertical-align: middle; color: var(--ink); }
.sh-cnt-table tbody tr { cursor: pointer; transition: background .1s; }
.sh-cnt-table tbody tr:hover { background: var(--rowhover); }
.sh-cnt-table tbody tr:last-child td { border-bottom: none; }
.sh-cnt-lt-ico { width: 30px; height: 30px; border-radius: var(--radius-md); font-size: 13px; display: flex; align-items: center; justify-content: center; }
.sh-cnt-lt-badge { display: inline-flex; padding: 1px 7px; border-radius: 20px; font-size: 11px; font-weight: 600; background: var(--teal-soft); color: var(--teal); }
.sh-cnt-lt-mono { font-family: var(--mono,monospace); font-size: 11.5px; color: var(--muted); }
/* File type icon colors */
.fi-pdf { background: var(--red-soft); color: var(--red); }
.fi-doc { background: var(--blue-soft); color: var(--blue); }
.fi-xls { background: var(--green-soft); color: var(--green); }
.fi-img { background: var(--violet-soft); color: var(--violet); }
.fi-vid { background: var(--amber-soft); color: var(--amber); }
.fi-zip { background: var(--surface-3,#eef2f7); color: var(--muted); }
.fi-def { background: var(--surface-3,#eef2f7); color: var(--muted); }
/* Sidebar */
.sh-cnt-sidebar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow: hidden; position: sticky; top: 72px; }
.sh-sb-preview { background: var(--surface-3,#eef2f7); border-bottom: 1px solid var(--border); padding: 18px; min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: background .15s; }
.sh-sb-preview:hover { background: var(--bg-2); }
.sh-sb-preview-icon { width: 58px; height: 58px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.sh-sb-state-default { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sh-sb-state-count { display: none; flex-direction: column; align-items: center; gap: 8px; }
.sh-sb-state-file { display: none; flex-direction: column; align-items: center; gap: 6px; }
.sh-cnt-sidebar.state-count .sh-sb-state-default { display: none; }
.sh-cnt-sidebar.state-count .sh-sb-state-count { display: flex; }
.sh-cnt-sidebar.state-file .sh-sb-state-default { display: none; }
.sh-cnt-sidebar.state-file .sh-sb-state-file { display: flex; }
.sh-sb-count-icon { width: 58px; height: 58px; border-radius: var(--radius-lg); background: var(--teal-soft); color: var(--teal); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.sh-sb-count-badge { background: var(--teal); color: #fff; border-radius: 20px; padding: 3px 12px; font-size: 12px; font-weight: 700; }
.sh-sb-count-lbl { font-size: 11px; color: var(--muted); }
.sh-sb-file-name { font-size: 11.5px; color: var(--muted); max-width: 90%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-sb-hint { font-size: 11px; color: var(--faint); text-align: center; }
.sh-sb-stats { padding: 12px 15px; border-bottom: 1px solid var(--border); }
.sh-sb-stat { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border-light,var(--border)); }
.sh-sb-stat:last-child { border-bottom: none; }
.sh-sb-stat-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.sh-sb-stat-val { font-size: 14px; font-weight: 700; color: var(--teal); font-family: var(--mono,monospace); }
.sh-sb-actions { padding: 12px 15px; border-bottom: 1px solid var(--border); display: none; gap: 6px; flex-wrap: wrap; }
.sh-cnt-sidebar.state-count .sh-sb-actions, .sh-cnt-sidebar.state-file .sh-sb-actions { display: flex; }
.sh-sb-edit { padding: 13px 15px; display: none; }
.sh-cnt-sidebar.state-file .sh-sb-edit { display: block; }
.sh-sb-edit-hd { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
@media (max-width: 1200px) { .sh-cnt-layout { grid-template-columns: 1fr 240px; } }
@media (max-width: 992px) { .sh-cnt-layout { grid-template-columns: 1fr; } .sh-cnt-sidebar { position: static; } }
@media (max-width: 560px) { .sh-cnt-grid { grid-template-columns: repeat(2,1fr); } }

/* ── Dark mode overrides (preserved verbatim from upload.php) ──
   variant-b = midnight/oled. body[data-preset="nightshift"] = nightshift.
   Nightshift inherits variant-a's opaque *-soft tokens so it gets rgba()-based
   overrides at 20% opacity. */
body.variant-b .sh-cnt-vtoggle { border-color: var(--border-strong); background: var(--bg); }
body.variant-b .sh-cnt-vbtn { color: rgba(232,237,242,.45); }
body.variant-b .sh-cnt-vbtn.active { background: var(--teal); color: #fff; }
body.variant-b #sh-sel-pill { background: rgba(45,212,191,.2); }
body.variant-b .sh-cnt-card:hover,
body.variant-b .sh-cnt-card.sh-sel { box-shadow: 0 0 0 3px rgba(45,212,191,.22),var(--shadow); }
body.variant-b .sh-btn-icon { border-color: var(--border-strong); }
body.variant-b .fi-pdf { background: rgba(248,113,113,.2); }
body.variant-b .fi-doc { background: rgba(78,162,255,.2); }
body.variant-b .fi-xls { background: rgba(52,211,153,.2); }
body.variant-b .fi-img { background: rgba(167,139,250,.2); }
body.variant-b .fi-vid { background: rgba(251,191,36,.2); }
body.variant-b .fi-zip, body.variant-b .fi-def { background: var(--surface-3); color: var(--muted); }
body.variant-b .sh-sb-count-icon { background: rgba(45,212,191,.2); }
body.variant-b .sh-sb-actions .btn-outline-secondary { color: var(--ink-2); border-color: var(--border-strong); background: transparent; }
body.variant-b .sh-sb-actions .btn-outline-secondary:hover { background: var(--surface-3); color: var(--ink); border-color: var(--border-strong); }
body.variant-b .sh-sb-actions .btn-outline-danger { color: var(--red); border-color: var(--red); background: transparent; }
body.variant-b .sh-sb-actions .btn-outline-danger:hover { background: rgba(248,113,113,.12); color: var(--red); border-color: var(--red); }

body[data-preset="nightshift"] .sh-cnt-vtoggle { border-color: var(--border-strong); background: var(--bg); }
body[data-preset="nightshift"] .sh-cnt-vbtn { color: rgba(245,230,211,.55); }
body[data-preset="nightshift"] .sh-cnt-vbtn.active { background: var(--accent); color: var(--accent-ink); }
body[data-preset="nightshift"] #sh-sel-pill { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
body[data-preset="nightshift"] .sh-cnt-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft),var(--shadow); }
body[data-preset="nightshift"] .sh-cnt-card.sh-sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
body[data-preset="nightshift"] .sh-btn-icon { border-color: var(--border-strong); }
body[data-preset="nightshift"] .fi-pdf { background: rgba(228,37,39,.2); }
body[data-preset="nightshift"] .fi-doc { background: rgba(27,115,232,.2); }
body[data-preset="nightshift"] .fi-xls { background: rgba(34,160,107,.2); }
body[data-preset="nightshift"] .fi-img { background: rgba(126,87,194,.2); }
body[data-preset="nightshift"] .fi-vid { background: rgba(243,156,18,.2); }
body[data-preset="nightshift"] .fi-zip, body[data-preset="nightshift"] .fi-def { background: var(--surface-3); color: var(--muted); }
body[data-preset="nightshift"] .sh-sb-count-icon { background: var(--accent-soft); color: var(--accent); }
body[data-preset="nightshift"] .sh-sb-count-badge { background: var(--accent); color: var(--accent-ink); }
body[data-preset="nightshift"] .sh-sb-stat-val { color: var(--accent); }
body[data-preset="nightshift"] .sh-cnt-chk-wrap input { accent-color: var(--accent); }
body[data-preset="nightshift"] .sh-sb-actions .btn-outline-secondary { color: var(--ink-2); border-color: var(--border-strong); background: transparent; }
body[data-preset="nightshift"] .sh-sb-actions .btn-outline-secondary:hover { background: var(--surface-3); color: var(--ink); border-color: var(--border-strong); }
body[data-preset="nightshift"] .sh-sb-actions .btn-outline-danger { color: var(--red); border-color: var(--red); background: transparent; }
body[data-preset="nightshift"] .sh-sb-actions .btn-outline-danger:hover { background: rgba(228,37,39,.12); color: var(--red); border-color: var(--red); }

/* ── viewShareModal (from _getsharedcontents.php) ── */
#viewShareModal .sc-ft-icon { width: 52px; height: 52px; border-radius: var(--radius-md,6px); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
#viewShareModal .sc-ft-mono { font-family: var(--mono,monospace); font-size: 10px; color: var(--muted,#6c757d); text-transform: uppercase; margin-top: 2px; }
#viewShareModal .sc-dl-btn { width: 30px; height: 30px; padding: 0; border-radius: var(--radius-md,6px); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; border: 1px solid var(--border,#dee2e6); background: transparent; color: var(--muted,#6c757d); cursor: pointer; transition: background .15s,color .15s,border-color .15s; flex-shrink: 0; text-decoration: none; }
#viewShareModal .sc-dl-btn:hover { background: var(--teal-soft,#e6f7f7); color: var(--teal,#0d9488); border-color: var(--teal,#0d9488); }
#viewShareModal .fi-pdf { background: var(--red-soft,#fee2e2); color: var(--red,#ef4444); }
#viewShareModal .fi-doc { background: var(--blue-soft,#dbeafe); color: var(--blue,#3b82f6); }
#viewShareModal .fi-xls { background: var(--green-soft,#dcfce7); color: var(--green,#22c55e); }
#viewShareModal .fi-img { background: var(--violet-soft,#ede9fe); color: var(--violet,#7c3aed); }
#viewShareModal .fi-vid { background: var(--amber-soft,#fef3c7); color: var(--amber,#f59e0b); }
#viewShareModal .fi-zip { background: var(--surface-3,#eef2f7); color: var(--muted,#6c757d); }
#viewShareModal .fi-def { background: var(--surface-3,#eef2f7); color: var(--muted,#6c757d); }

/* === Setup: Content Composites Cleanup (S28) ===
   Migrated 2026-05-26. Final cleanup of S27's deferred composite inlines.
   upload.php: 7 composite inlines migrated — display:contents form wrapper,
   .35 opacity icon, 2x scroll containers (240/200), 2x modal max-width:380,
   delete-files-list 8-prop composite. Kept inline: L600 dynamic JS-string
   iframe modal (runtime-generated in $('#viewModel .modal-body').html()).
   _getsharedcontents.php: 3 composites migrated — image thumb (5 props),
   min-width:0 → BS5 .min-w-0, user-circle icon (4 props).
   Reuse: BS5 .overflow-y-auto, .min-w-0.
   VERIFIED-PRESERVED: upload.php L33 .modal_loader_div display:none (JS-toggled). */

/* Utility classes */
.sh-display-contents { display: contents; }
.sh-opacity-35 { opacity: .35; }
.sh-mh-240 { max-height: 240px; }
.sh-mh-200 { max-height: 200px; }
.sh-modal-max-380 { max-width: 380px; }

/* Component classes */
.sh-delete-files-list {
  max-height: 160px;
  overflow-y: auto;
  background: var(--bg, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: .75rem;
  font-size: 12.5px;
}

.sh-shared-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--radius-md, 6px);
  flex-shrink: 0;
}

.sh-icon-user-circle {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

/* === Global BS5 Border Utility Lightening (S29) ===
   Applied 2026-05-26. User-reported: BS5 default border-color (#dee2e6) feels
   too dark/heavy against Smart Hospital's lighter surface tokens. Override
   all BS5 border utilities to use --border-light token (which is theme-aware
   and switches correctly across all 5 presets: light/blue/nightshift/midnight/oled).

   Token values:
     variant-a (light):   --border-light: #F0F3F7
     variant-b (dark):    --border-light: rgba(255,255,255,.05)
     variant-c (blue):    --border-light: #EAF0F6

   Affected: every page using BS5 .border, .border-top, .border-bottom,
   .border-start, .border-end utility classes. Card row separators,
   form-control adjacent borders, side-divider lines, etc. all become lighter.

   Override scope is intentionally bs-utility-only — does NOT affect:
   - Form controls (.form-control border — uses --bs-border-color separately)
   - Buttons (own border-color)
   - Tables (.table own border rules)
   - Custom .sh-* component classes (use --border or --border-strong as designed) */
/* S29 — Updated 2026-05-26: --border-light was too faint (#F0F3F7 ~indistinguishable
   from #FFF card backgrounds). Bumped to --border (#E4E8ED) for proper definition
   while staying lighter than original BS5 default --bs-border-color (#DEE2E6). */
.border-bottom { border-bottom-color: var(--border) !important; }
.border-top    { border-top-color:    var(--border) !important; }
.border-start  { border-left-color:   var(--border) !important; }
.border-end    { border-right-color:  var(--border) !important; }
.border        { border-color:        var(--border) !important; }

/* ============================================================
   P31 — Theme Studio (admin/themestudio/index.php)
   ------------------------------------------------------------
   Migrated verbatim from the view's <style> block. All selectors
   are .ts-* prefixed so they only fire on the Theme Studio page.
   Already token-disciplined (uses var(--ink), var(--accent-soft),
   etc.) — no refactor needed.

   Per-preset mock palette overrides (.ts-preset-card.preset-*)
   intentionally hardcode hex values because those are MOCK
   thumbnails showing what each preset LOOKS like — they're
   illustrative samples, not live theme tokens.

   Kept INLINE in the view (cannot migrate):
   - PHP-dynamic swatch backgrounds (lines 192, 220)
   - PHP-dynamic font sampler font-family (line 240) — the font
     picker MUST display each sample IN that font; this is the
     one legitimate exception to "no font-family in CSS".
   - PHP-dynamic text-size sampler font-size (line 268)
   ============================================================ */
.ts-page-head { padding: 0 4px 12px; }
.ts-page-title-row { display: flex; align-items: center; gap: 12px; }
.ts-page-title { font-size: 22px; font-weight: 800; color: var(--ink); margin: 0; letter-spacing: -0.01em; }
.ts-live-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--green-soft); color: var(--green); }
.ts-live-tag .ts-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: tsPulse 1.4s ease-in-out infinite; }
@keyframes tsPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.ts-live-hint { margin: 0 0 18px; padding: 10px 14px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border); border-radius: var(--radius-md, 6px); font-size: 12px; display: flex; align-items: center; gap: 10px; }
.ts-live-hint i { font-size: 14px; }
.ts-live-hint strong { font-weight: 700; }

.ts-studio-wrap { max-width: 1000px; }
.ts-settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md, 8px); padding: 22px; box-shadow: var(--shadow-sm); }

.ts-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ts-section-num { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.ts-section-head h3 { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0; }
.ts-section-head h3 small { font-weight: 500; color: var(--muted); font-size: 11px; }
.ts-section-divider { margin: 22px 0 20px; border: 0; border-top: 1px solid var(--border); }

/* ===== Preset cards with rich mock UI ===== */
.ts-preset-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 900px) { .ts-preset-grid { grid-template-columns: repeat(2, 1fr); } }
.ts-preset-card { position: relative; background: var(--ts-mock-bg, #fff); border: 2px solid var(--border); border-radius: var(--radius-md, 6px); overflow: hidden; cursor: pointer; transition: transform .12s, border-color .15s, box-shadow .15s; }
.ts-preset-card:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: 0 4px 14px rgba(15,23,42,.08); }
.ts-preset-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ts-preset-card.active .ts-preset-check { display: grid; }
.ts-preset-check { display: none; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink, #fff); place-items: center; font-size: 11px; z-index: 2; }
.ts-mock-bar { display: flex; align-items: center; gap: 6px; padding: 7px 9px; background: var(--ts-mock-surface); border-bottom: 1px solid var(--ts-mock-border); }
.ts-mock-dot { width: 12px; height: 12px; border-radius: 3px; background: var(--ts-mock-accent); }
.ts-mock-line { flex: 1; height: 5px; border-radius: 3px; background: var(--ts-mock-border); }
.ts-mock-body { padding: 8px 9px 10px; background: var(--ts-mock-bg); }
.ts-mock-row { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.ts-mock-row:last-child { margin-bottom: 0; }
.ts-mock-btn { height: 16px; padding: 0 7px; border-radius: 3px; background: var(--ts-mock-accent); color: var(--ts-mock-accent-ink); font-size: 8px; font-weight: 700; display: inline-flex; align-items: center; }
.ts-mock-badge { height: 12px; padding: 0 6px; border-radius: 999px; background: var(--ts-mock-accent-soft); color: var(--ts-mock-accent); font-size: 7px; font-weight: 800; display: inline-flex; align-items: center; }
.ts-mock-badge.warn { background: var(--ts-mock-amber-soft); color: var(--ts-mock-amber); }
.ts-mock-badge.danger { background: var(--ts-mock-red-soft); color: var(--ts-mock-red); }
.ts-preset-meta { padding: 7px 9px 9px; background: var(--ts-mock-surface); border-top: 1px solid var(--ts-mock-border); }
.ts-preset-meta strong { display: block; font-size: 11px; font-weight: 800; color: var(--ts-mock-ink); }
.ts-preset-meta small { display: block; font-size: 9px; color: var(--ts-mock-muted); font-weight: 600; margin-top: 1px; }

/* Per-preset mock palette overrides (illustrative — NOT live tokens) */
.ts-preset-card.preset-clinical   { --ts-mock-bg:#F7FAFC; --ts-mock-surface:#FFF; --ts-mock-border:#E2E8F0; --ts-mock-ink:#0F172A; --ts-mock-muted:#64748B; --ts-mock-accent:#00B5AD; --ts-mock-accent-ink:#FFF; --ts-mock-accent-soft:#D4F1EF; --ts-mock-amber-soft:#FEF3C7; --ts-mock-amber:#D97706; --ts-mock-red-soft:#FEE2E2; --ts-mock-red:#DC2626; }
.ts-preset-card.preset-slate      { --ts-mock-bg:#F1F5F9; --ts-mock-surface:#FFF; --ts-mock-border:#CBD5E1; --ts-mock-ink:#1E293B; --ts-mock-muted:#64748B; --ts-mock-accent:#4F46E5; --ts-mock-accent-ink:#FFF; --ts-mock-accent-soft:#E0E7FF; --ts-mock-amber-soft:#FEF3C7; --ts-mock-amber:#D97706; --ts-mock-red-soft:#FEE2E2; --ts-mock-red:#DC2626; }
.ts-preset-card.preset-midnight   { --ts-mock-bg:#0F172A; --ts-mock-surface:#1E293B; --ts-mock-border:rgba(255,255,255,.10); --ts-mock-ink:#E2E8F0; --ts-mock-muted:#94A3B8; --ts-mock-accent:#4EA2FF; --ts-mock-accent-ink:#0F172A; --ts-mock-accent-soft:rgba(78,162,255,.18); --ts-mock-amber-soft:rgba(251,191,36,.18); --ts-mock-amber:#FBBF24; --ts-mock-red-soft:rgba(248,113,113,.18); --ts-mock-red:#F87171; }
.ts-preset-card.preset-oled       { --ts-mock-bg:#000; --ts-mock-surface:#0A0A0A; --ts-mock-border:rgba(255,255,255,.10); --ts-mock-ink:#F1F5F9; --ts-mock-muted:#94A3B8; --ts-mock-accent:#60A5FA; --ts-mock-accent-ink:#000; --ts-mock-accent-soft:rgba(96,165,250,.16); --ts-mock-amber-soft:rgba(251,191,36,.16); --ts-mock-amber:#FBBF24; --ts-mock-red-soft:rgba(248,113,113,.16); --ts-mock-red:#F87171; }
.ts-preset-card.preset-nightshift { --ts-mock-bg:#2A1F14; --ts-mock-surface:#3D2F1F; --ts-mock-border:rgba(245,230,211,.14); --ts-mock-ink:#F5E6D3; --ts-mock-muted:#BFA98F; --ts-mock-accent:#F59E0B; --ts-mock-accent-ink:#1A0F05; --ts-mock-accent-soft:rgba(245,158,11,.20); --ts-mock-amber-soft:rgba(251,191,36,.20); --ts-mock-amber:#FBBF24; --ts-mock-red-soft:rgba(251,146,60,.16); --ts-mock-red:#FB923C; }

/* ===== Customize controls ===== */
.ts-customize-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
@media (max-width: 768px) { .ts-customize-grid { grid-template-columns: 1fr; } }
.ts-setting-group { margin: 0; }
.ts-setting-label { font-size: 11px; font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; display: block; }
.ts-setting-label small { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }

.ts-swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ts-swatch-btn { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; transition: transform .12s, border-color .15s; display: grid; place-items: center; position: relative; }
.ts-swatch-btn:hover { transform: scale(1.08); }
.ts-swatch-btn.active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.ts-swatch-btn.active::after { content: "\f00c"; font-family: "Font Awesome 6 Free", "Font Awesome 5 Free"; font-weight: 900; font-size: 10px; color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.4); }
.ts-swatch-btn.custom { background: conic-gradient(from 0deg, #f87171, #fbbf24, #34d399, #60a5fa, #a78bfa, #f87171); }
.ts-swatch-btn.custom i { color: #fff; font-size: 10px; text-shadow: 0 1px 2px rgba(0,0,0,.4); }

.ts-hex-row { display: flex; gap: 6px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.ts-hex-input { width: 96px; padding: 6px 8px; font-size: 12px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius, 3px); font-family: 'JetBrains Mono', ui-monospace, monospace; }
.ts-hex-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Native color picker chip — replaces inline width/height/border/background/cursor/padding */
.ts-color-picker { width: 28px; height: 28px; border: none; background: transparent; cursor: pointer; padding: 0; }

.ts-contrast-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.ts-contrast-badge .ts-ratio { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.ts-contrast-badge.pass { background: var(--green-soft); color: var(--green); }
.ts-contrast-badge.warn { background: var(--amber-soft); color: var(--amber); }
.ts-contrast-badge.fail { background: var(--red-soft); color: var(--red); }

.ts-collision-warning { margin-top: 10px; padding: 8px 10px; display: none; background: var(--amber-soft); border: 1px solid var(--border); border-radius: var(--radius, 3px); font-size: 11px; color: var(--amber); align-items: flex-start; gap: 8px; }
.ts-collision-warning.show { display: flex; }
.ts-collision-warning i { font-size: 12px; margin-top: 1px; }

.ts-font-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ts-font-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius, 3px); cursor: pointer; transition: border-color .15s, background .15s; }
.ts-font-btn .ts-a-mark { font-size: 18px; font-weight: 800; line-height: 1; color: var(--ink); }
.ts-font-btn .ts-a-name { font-size: 9px; font-weight: 600; color: var(--muted); }
.ts-font-btn:hover { border-color: var(--accent); }
.ts-font-btn.active { background: var(--accent-soft); border-color: var(--accent); }
.ts-font-btn.active .ts-a-mark, .ts-font-btn.active .ts-a-name { color: var(--accent); }

.ts-radius-row, .ts-size-row, .ts-density-row { display: flex; gap: 8px; }
.ts-radius-btn, .ts-size-btn, .ts-density-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius, 3px); cursor: pointer; transition: border-color .15s; font-size: 10px; font-weight: 600; color: var(--ink); }
.ts-radius-btn:hover, .ts-size-btn:hover, .ts-density-btn:hover { border-color: var(--accent); }
.ts-radius-btn.active, .ts-size-btn.active, .ts-density-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.ts-radius-btn .ts-shape { width: 24px; height: 18px; background: var(--accent-soft); border: 2px solid var(--accent); }
.ts-radius-btn[data-corner="sharp"]   .ts-shape { border-radius: 0; }
.ts-radius-btn[data-corner="soft"]    .ts-shape { border-radius: 4px; }
.ts-radius-btn[data-corner="rounded"] .ts-shape { border-radius: 10px; }

.ts-size-btn .ts-a-mark { font-weight: 800; color: var(--ink); line-height: 1; }
.ts-size-btn.active .ts-a-mark { color: var(--accent); }

.ts-density-btn .ts-lines { display: flex; flex-direction: column; gap: 2px; width: 22px; }
.ts-density-btn .ts-lines span { height: 2px; background: var(--muted); border-radius: 1px; }
.ts-density-btn:hover .ts-lines span { background: var(--accent); }
.ts-density-btn.active .ts-lines span { background: var(--accent); }
.ts-density-btn[data-density="compact"]    .ts-lines { gap: 1px; }
.ts-density-btn[data-density="spacious"]   .ts-lines { gap: 4px; }

/* ===== Save bar ===== */
.ts-save-bar { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.ts-save-bar .ts-save-info { flex: 1; }
.ts-dirty-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; font-size: 11px; font-weight: 700; background: var(--amber-soft); color: var(--amber); border-radius: 999px; }
.ts-dirty-pill.clean { background: var(--green-soft); color: var(--green); }

/* ============================================================
   P32a — Front CMS (admin/frontcms/index.php) — 3 style blocks
   ------------------------------------------------------------
   Three blocks moved verbatim. Architecture intentionally layered:

   Block 1 (.fcms-*, .fcms2-*): base styles, mix of tokens + legacy
           hardcoded colors (var(--accent), #e4e7ec, etc.). Approved
           2026-05-13 — see Wfdocs/frontcms-samples.html.

   Block 2 (.hsec-*): Home Sections sidebar+canvas styles.

   Block 3: Theme adaptation override layer (readability fix
           2026-05-22 + saffron-ise selected/checked states).
           Re-maps the legacy hardcoded colors in Blocks 1+2 to
           theme tokens. **MUST load AFTER Blocks 1+2** so its
           overrides win the cascade.

   Inline styles still in the view file = P32b (next iteration).
   ============================================================ */

/* ── Block 1: Front CMS base ─────────────────────────────── */
.frontcms-tabs{border-bottom:1px solid var(--border-light);}
.frontcms-tabs .nav-link{color:var(--muted);border:none;border-bottom:2.5px solid transparent;padding:10px 14px;font-weight:600;font-size:13px;transition:color .15s,border-color .15s;background:none;}
.frontcms-tabs .nav-link:hover{color:var(--ink-2);border-bottom-color:var(--border);background:none;}
.frontcms-tabs .nav-link.active{color:var(--link);border-bottom-color:var(--link);background:none;}
.fcms-section-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--faint);margin:20px 0 10px;padding-bottom:6px;border-bottom:1px solid var(--border-light);}
.fcms-section-title:first-child{margin-top:0;}
.fcms-toggle-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 0;border-bottom:1px solid var(--border-light);}
.fcms-toggle-row:last-child{border-bottom:none;}
.fcms-toggle-label{min-width:0;}
.fcms-toggle-label strong{display:block;font-size:13px;font-weight:600;color:var(--ink);}
.fcms-toggle-label span{font-size:11.5px;color:var(--faint);}
.fcms-toggle-row .form-check.form-switch{flex:none;margin:0;min-height:auto;}
.fcms-toggle-row .form-check-input{margin-top:0;cursor:pointer;}
.fcms-toggle-row .form-check-input:checked{background-color:var(--link);border-color:var(--link);}
.fcms-toggle-row .form-check-input:focus{box-shadow:0 0 0 .2rem rgba(27,115,232,.15);}
/* Step indicator */
.fcms-steps{display:flex;align-items:flex-start;gap:0;margin-bottom:24px;}
.fcms-step{flex:1;text-align:center;position:relative;}
.fcms-step-line{position:absolute;top:16px;left:calc(50% + 18px);right:calc(-50% + 18px);height:2px;background:#e4e7ec;}
.fcms-step:last-child .fcms-step-line{display:none;}
.fcms-step-num{width:32px;height:32px;border-radius:50%;background:#e4e7ec;color:#8c93a5;font-weight:700;font-size:13px;display:flex;align-items:center;justify-content:center;margin:0 auto 6px;position:relative;z-index:1;transition:all .25s;}
.fcms-step.active .fcms-step-num{background:var(--accent);color:#fff;box-shadow:0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);}
.fcms-step.done .fcms-step-num{background:#12b76a;color:#fff;}
.fcms-step.done .fcms-step-line{background:#12b76a;}
.fcms-step-label{font-size:11.5px;font-weight:600;color:#8c93a5;}
.fcms-step.active .fcms-step-label{color:var(--accent);}
.fcms-step.done .fcms-step-label{color:#12b76a;}
/* Theme cards */
.fcms-theme-card{border:2px solid #e4e7ec;border-radius:10px;cursor:pointer;transition:all .2s;overflow:hidden;position:relative;}
.fcms-theme-card:hover{border-color:#b2bcf8;transform:translateY(-2px);box-shadow:0 6px 18px color-mix(in srgb, var(--accent) 12%, transparent);}
.fcms-theme-card.selected{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);}
.fcms-theme-preview{height:90px;position:relative;}
.preview-atrium{background:linear-gradient(135deg,#0d1b2a 0%,#1a3a5c 40%,#0baa8e 100%);}
.preview-organic{background:linear-gradient(135deg,#1a2b1a 0%,#2d4a2d 40%,#3f7a3f 100%);}
.fcms-theme-name{padding:8px 12px;font-weight:700;font-size:13px;color:#1d2939;background:#fff;}
.fcms-theme-badge{position:absolute;top:6px;right:6px;font-size:10px;font-weight:700;background:rgba(0,0,0,.35);color:#fff;padding:2px 7px;border-radius:10px;}
.fcms-check-mark{position:absolute;top:6px;left:6px;width:20px;height:20px;background:var(--accent);border-radius:50%;display:none;align-items:center;justify-content:center;color:#fff;font-size:9px;}
.fcms-theme-card.selected .fcms-check-mark{display:flex;}
/* Swatches */
.fcms-swatch-group{display:flex;gap:12px;align-items:center;flex-wrap:wrap;}
.fcms-swatch-item{cursor:pointer;text-align:center;}
.fcms-swatch-circle{width:36px;height:36px;border-radius:50%;border:3px solid transparent;transition:all .18s;display:block;}
.fcms-swatch-item:hover .fcms-swatch-circle{transform:scale(1.1);}
.fcms-swatch-item.selected .fcms-swatch-circle{box-shadow:0 0 0 2px #fff,0 0 0 4px #344054;}
.fcms-swatch-name{font-size:10.5px;color:#8c93a5;margin-top:3px;font-weight:600;}
.fcms-swatch-item.selected .fcms-swatch-name{color:#344054;}
/* Layout cards */
.fcms-layout-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;}
@media(max-width:900px){.fcms-layout-grid{grid-template-columns:repeat(3,1fr);}}
.fcms-layout-card{border:2px solid #e4e7ec;border-radius:10px;cursor:pointer;transition:all .2s;padding:12px 8px;text-align:center;}
.fcms-layout-card:hover{border-color:#b2bcf8;}
.fcms-layout-card.selected{border-color:var(--accent);background:var(--accent-soft);}
.fcms-layout-icon{font-size:24px;margin-bottom:6px;}
.fcms-layout-title{font-weight:700;font-size:12px;color:#1d2939;margin-bottom:6px;}
.fcms-chip-list{min-height:48px;}
.fcms-chip{display:inline-block;font-size:10px;background:#eef0f4;color:#667085;padding:2px 5px;border-radius:7px;margin:1px;}
.fcms-layout-card.selected .fcms-chip{background:var(--accent-soft);color:var(--accent);}
/* Section accordion */
.fcms-section-meta{display:flex;align-items:center;gap:6px;margin-left:auto;margin-right:8px;}
.fcms-auto-tag{font-size:10px;color:#8c93a5;font-weight:500;background:#f0f2f5;padding:2px 7px;border-radius:7px;}
.fcms-auto-info{background:#f0fdf4;border:1px solid #a7f3d0;border-radius:8px;padding:10px 12px;font-size:12.5px;color:#065f46;display:flex !important;flex-direction:row !important;flex-wrap:nowrap;align-items:center;justify-content:flex-start;text-align:left !important;}
.fcms-auto-info i{color:#10b981;margin-right:7px;flex-shrink:0;display:inline-block !important;}
.fcms-auto-info strong{margin:0 3px;display:inline !important;}
.fcms-auto-info > *{display:inline-block}
/* Stat rows */
.fcms-stat-row{display:grid;grid-template-columns:1fr 1fr 1fr 30px;gap:7px;align-items:center;margin-bottom:7px;}
.fcms-remove-btn{width:26px;height:26px;border-radius:50%;border:none;background:#fee4e2;color:#d92d20;font-size:11px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;}
.fcms-add-btn{font-size:12px;font-weight:600;color:var(--accent);border:1.5px dashed #b2bcf8;background:transparent;padding:4px 12px;border-radius:7px;cursor:pointer;}
.fcms-add-btn:hover{background:#f5f7ff;}
/* FAQ */
.fcms-faq-item{background:#fff;border:1px solid #e4e7ec;border-radius:8px;padding:12px;margin-bottom:8px;position:relative;}
.fcms-faq-item .fcms-remove-btn{position:absolute;top:8px;right:8px;}
/* Page editor */
.fcms-page-type-panel{display:none;}
.fcms-page-type-panel.active{display:block;}
/* Social */
.fcms-social-row{display:flex;align-items:center;gap:10px;margin-bottom:12px;}
.fcms-social-icon{width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:15px;color:#fff;}

/* ─── v2: Theme & Layout — interactive panel ─── */
.fcms2-pagehead{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.fcms2-pagehead .lhs h4{font-size:15px;font-weight:700;color:#101828;margin:0}
.fcms2-pagehead .lhs p{font-size:12.5px;color:#667085;margin:2px 0 0}
.fcms2-livepill{display:inline-flex;align-items:center;gap:8px;background:#dcfce7;color:#15803d;font-size:12px;font-weight:700;padding:6px 12px;border-radius:99px;letter-spacing:.02em}
.fcms2-livepill .dot{width:7px;height:7px;border-radius:50%;background:#12b76a;box-shadow:0 0 0 3px rgba(18,183,106,.18);animation:fcms2pulse 1.6s ease-in-out infinite}
@keyframes fcms2pulse{50%{box-shadow:0 0 0 6px rgba(18,183,106,0)}}

.fcms2-shell{display:grid;grid-template-columns:1fr 360px;gap:18px;align-items:flex-start}
@media(max-width:1080px){.fcms2-shell{grid-template-columns:1fr}}

.fcms2-config{background:#fff;border:1px solid #e4e7ec;border-radius:12px;padding:18px}
.fcms2-preview{position:sticky;top:18px;background:#fff;border:1px solid #e4e7ec;border-radius:12px;overflow:hidden}

.fcms2-sec{padding:0 0 18px;border-bottom:1px dashed #e4e7ec;margin-bottom:18px}
.fcms2-sec:last-child{border-bottom:0;padding-bottom:0;margin-bottom:0}
.fcms2-sec-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.fcms2-sec-head .lhs{display:flex;align-items:center;gap:10px}
.fcms2-sec-num{width:26px;height:26px;border-radius:50%;flex:none;background:var(--accent);color:var(--accent-ink, #fff);font-weight:700;font-size:11.5px;display:grid;place-items:center}
.fcms2-sec-title{font-size:13.5px;font-weight:700;color:#101828;margin:0;line-height:1.2}
.fcms2-sec-sub{font-size:11.5px;color:#667085;margin:1px 0 0;line-height:1.3}
.fcms2-sec-cur{font-size:11.5px;color:#667085}
.fcms2-sec-cur b{color:#101828;font-weight:700}

.fcms2-theme-cards{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.fcms2-tcard{position:relative;border:2px solid #e4e7ec;border-radius:12px;overflow:hidden;cursor:pointer;transition:all .2s;background:#fff}
.fcms2-tcard:hover{border-color:#a3b1f7;transform:translateY(-2px)}
.fcms2-tcard.on{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent)}
.fcms2-tcard-prev{height:110px;padding:14px;color:#fff;display:flex;flex-direction:column;justify-content:flex-end;position:relative}
.fcms2-tcard-prev .tc-name{font-size:16px;font-weight:700;letter-spacing:-.01em;color:#fff;margin:0}
.fcms2-tcard-prev .tc-tag{font-size:10.5px;color:rgba(255,255,255,.78);font-weight:500;margin-top:1px}
.fcms2-tcard-foot{padding:8px 12px;font-size:11.5px;color:#667085;background:#fff;display:flex;align-items:center;justify-content:space-between;border-top:1px solid #e4e7ec;gap:6px}
.fcms2-tcard.on .fcms2-tcard-foot{background:#eef2ff;color:var(--accent);font-weight:700}
.fcms2-livetag{display:inline-flex;align-items:center;gap:5px;font-size:9.5px;font-weight:700;color:#15803d;background:#dcfce7;padding:2px 7px;border-radius:99px;letter-spacing:.02em}
.fcms2-livetag .dot{width:5px;height:5px;border-radius:50%;background:#12b76a}

.fcms2-palette-group{display:none}
.fcms2-palette-group.on{display:flex;flex-wrap:wrap;gap:8px}
.fcms2-swatch{display:inline-flex;align-items:center;gap:8px;background:#fff;border:1.5px solid #e4e7ec;border-radius:99px;padding:5px 12px 5px 5px;cursor:pointer;transition:all .2s;font-size:12.5px;font-weight:600;color:#344054}
.fcms2-swatch:hover{border-color:#a3b1f7}
.fcms2-swatch.on{border-color:var(--accent);background:#eef2ff;color:var(--accent)}
.fcms2-swatch .dot{width:20px;height:20px;border-radius:50%;flex:none;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06)}
.fcms2-swatch .live-mini{font-size:9px;color:#15803d;font-weight:700;letter-spacing:.04em;margin-left:4px}

.fcms2-layouts{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
@media(max-width:780px){.fcms2-layouts{grid-template-columns:1fr 1fr}}
.fcms2-lcard{position:relative;border:2px solid #e4e7ec;border-radius:12px;overflow:hidden;cursor:pointer;background:#fff;transition:all .2s;display:flex;flex-direction:column}
.fcms2-lcard:hover{border-color:#a3b1f7;transform:translateY(-2px)}
.fcms2-lcard.on{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent)}
.fcms2-lthumb{height:90px;background:#f1f5f9;position:relative;overflow:hidden}
.fcms2-lthumb .lt-nav{position:absolute;left:8px;right:8px;top:6px;height:5px;background:rgba(0,0,0,.15);border-radius:3px}
.fcms2-lthumb .lt-hero{position:absolute;left:14%;right:14%;top:18px;bottom:36px;border-radius:6px;background:linear-gradient(135deg,var(--lt-1,#cbd5e1),var(--lt-2,#94a3b8))}
.fcms2-lthumb .lt-tile{position:absolute;left:14%;bottom:6px;width:24%;height:22px;background:rgba(0,0,0,.08);border-radius:4px}
.fcms2-lthumb .lt-tile.b{left:43%}
.fcms2-lthumb .lt-tile.c{left:72%}
.fcms2-lthumb.hospital{--lt-1:#60a5fa;--lt-2:#1e3a8a}
.fcms2-lthumb.specialist{--lt-1:#fdba74;--lt-2:#9a3412}
.fcms2-lthumb.dental{--lt-1:#c4b5fd;--lt-2:#5b21b6}
.fcms2-lthumb.eye{--lt-1:#86efac;--lt-2:#166534}
.fcms2-lthumb.diagnostic{--lt-1:#fcd34d;--lt-2:#92400e}
.fcms2-lthumb.cardiology{--lt-1:#fca5a5;--lt-2:#991b1b}
.fcms2-lcard-body{padding:12px;flex:1;display:flex;flex-direction:column;gap:6px}
.fcms2-licon{font-size:16px;line-height:1;margin-right:6px}
.fcms2-ltitle{font-size:12.5px;font-weight:700;color:#101828;margin:0;display:inline}
.fcms2-lpill{position:absolute;top:6px;right:6px;font-size:9.5px;font-weight:700;letter-spacing:.04em;padding:2px 7px;border-radius:99px;text-transform:uppercase}
.fcms2-lpill.live{background:#dcfce7;color:#15803d}
.fcms2-lpill.on{background:var(--accent);color:#fff}

.fcms2-pv-head{padding:10px 14px;border-bottom:1px solid #e4e7ec;display:flex;align-items:center;justify-content:space-between}
.fcms2-pv-head h3{font-size:12px;font-weight:700;color:#101828;margin:0;letter-spacing:.02em;text-transform:uppercase}
.fcms2-pv-toggle{display:flex;background:#f1f5f9;border-radius:7px;padding:2px}
.fcms2-pv-toggle button{background:transparent;border:0;padding:4px 9px;border-radius:5px;color:#667085;font-weight:600;cursor:pointer;font-size:10.5px}
.fcms2-pv-toggle button.on{background:#fff;color:#101828;box-shadow:0 1px 2px rgba(0,0,0,.06)}
.fcms2-pv-body{padding:14px;background:repeating-linear-gradient(45deg,#f8fafc,#f8fafc 6px,#f1f5f9 6px,#f1f5f9 7px);min-height:420px;display:flex;justify-content:center}
.fcms2-device{width:100%;max-width:300px;background:#fff;border-radius:14px;overflow:hidden;box-shadow:0 14px 32px -16px rgba(16,24,40,.18),0 1px 2px rgba(16,24,40,.04);transition:max-width .3s ease}
.fcms2-device.desk{max-width:100%}
.fcms2-pv-nav{height:22px;position:relative;transition:background .35s}
.fcms2-pv-nav::after{content:"";position:absolute;left:8px;top:6px;right:8px;height:5px;background:rgba(255,255,255,.2);border-radius:3px}
.fcms2-pv-hero{height:140px;position:relative;display:flex;align-items:center;justify-content:center;color:#fff;text-align:center;padding:0 16px;transition:background .35s}
.fcms2-pv-hero h4{margin:0;font-size:13.5px;font-weight:700;letter-spacing:-.01em;line-height:1.2;color:#fff}
.fcms2-pv-hero p{margin:5px 0 0;font-size:10.5px;color:rgba(255,255,255,.78);line-height:1.4}
.fcms2-pv-tiles{display:grid;grid-template-columns:1fr 1fr 1fr;gap:5px;padding:10px}
.fcms2-pv-tile{aspect-ratio:1.1/1;background:#f1f5f9;border-radius:6px;display:grid;place-items:center;font-size:15px}
.fcms2-pv-strip{height:16px;background:#f8fafc;border-top:1px solid #e4e7ec;border-bottom:1px solid #e4e7ec;display:flex;align-items:center;justify-content:center;font-size:8px;color:#667085;font-weight:600;letter-spacing:.06em;text-transform:uppercase}
.fcms2-pv-cards{padding:10px;display:grid;grid-template-columns:1fr 1fr;gap:6px}
.fcms2-pv-card{background:#f8fafc;border:1px solid #e4e7ec;border-radius:7px;padding:7px;height:50px;display:flex;flex-direction:column;justify-content:flex-end;gap:3px}
.fcms2-pv-card .b1{height:5px;border-radius:2px;width:80%;background:#cbd5e1;transition:background .35s}
.fcms2-pv-card .b2{height:4px;background:#e4e7ec;border-radius:2px;width:55%}
.fcms2-pv-foot{padding:10px 12px;font-size:10.5px;color:#667085;text-align:center;border-top:1px dashed #e4e7ec;background:#fafbfc;line-height:1.45}
.fcms2-pv-foot strong{color:#101828}

.fcms2-savebar{position:sticky;bottom:10px;margin-top:18px;background:#0f172a;color:#fff;border-radius:12px;padding:10px 14px 10px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;box-shadow:0 14px 32px -14px rgba(15,23,42,.45);transition:opacity .2s, transform .2s;z-index:5}
.fcms2-savebar.hidden{opacity:0;transform:translateY(8px);pointer-events:none}
.fcms2-savebar-l{display:flex;align-items:center;gap:12px}
.fcms2-savebar-l .dot{width:8px;height:8px;border-radius:50%;background:#fbbf24;box-shadow:0 0 0 3px rgba(251,191,36,.22)}
.fcms2-savebar-l span{font-size:12.5px;color:rgba(255,255,255,.85)}
.fcms2-savebar-l b{color:#fff}
.fcms2-savebar-r{display:flex;gap:8px}
.fcms2-savebar-r .btn{font-size:12.5px;font-weight:600;padding:6px 14px;border-radius:7px;border:0}
.fcms2-btn-discard{background:transparent;color:rgba(255,255,255,.7);border:1px solid rgba(255,255,255,.18)}
.fcms2-btn-discard:hover{color:#fff;border-color:rgba(255,255,255,.4)}
.fcms2-savehint{font-size:11.5px;color:rgba(255,255,255,.7);font-weight:500;display:inline-flex;align-items:center;gap:4px}
.fcms2-savehint b{color:#10b981;font-weight:700}
.fcms2-diff{font-size:11px;color:rgba(255,255,255,.55);font-weight:500}
.fcms2-diff b{color:#fff;font-weight:700}
.fcms2-diff s{color:rgba(255,255,255,.4)}

/* ═══════════════════════════════════════════════════════
   Front CMS v3 — General Variant B (Sectioned Cards) +
                  Social Variant A (Compact Rows)
   Approved 2026-05-13 — see Wfdocs/frontcms-samples.html
═══════════════════════════════════════════════════════ */
.fcms-summary{display:flex;align-items:center;gap:14px;margin:0 0 18px;padding:12px 14px;background:var(--surface-2);border:1px solid var(--border-light);border-radius:10px;}
.fcms-summary .ic{width:32px;height:32px;border-radius:50%;background:var(--green-soft);color:var(--green);display:grid;place-items:center;font-size:13px;flex:none;}
.fcms-summary .ic.dim{background:var(--surface-3);color:var(--faint);}
.fcms-summary .tx{flex:1;min-width:0;font-size:12.5px;color:var(--muted);}
.fcms-summary .tx b{color:var(--ink);font-weight:700;}
.fcms-summary .ac{font-size:11.5px;font-weight:600;color:var(--link);text-decoration:none;display:inline-flex;align-items:center;gap:5px;white-space:nowrap;}

.fcms-modcard{background:var(--surface);border:1px solid var(--border);border-radius:14px;margin-bottom:14px;overflow:hidden;}
.fcms-modcard:last-child{margin-bottom:0;}
.fcms-modcard-h{display:flex;align-items:center;gap:10px;padding:12px 18px;background:var(--surface-2);border-bottom:1px solid var(--border-light);}
.fcms-modcard-h .ic{width:28px;height:28px;border-radius:8px;background:var(--accent);color:#fff;display:grid;place-items:center;font-size:12px;flex:none;}
.fcms-modcard-h .ti{flex:1;min-width:0;}
.fcms-modcard-h .ti .nm{font-size:13px;font-weight:700;color:var(--ink);line-height:1.2;}
.fcms-modcard-h .ti .sb{font-size:11px;color:var(--faint);margin-top:1px;}
.fcms-modcard-h .meta{font-size:10px;font-weight:700;letter-spacing:.04em;padding:3px 9px;border-radius:99px;background:var(--surface-3);color:var(--muted);text-transform:uppercase;white-space:nowrap;}
.fcms-modcard-h .meta.on{background:var(--green-soft);color:var(--green);}
.fcms-modcard-body{padding:14px 20px 16px;}

.fcms-mod-row{display:flex;align-items:center;gap:14px;padding:9px 0;border-bottom:1px solid var(--border-light);}
.fcms-mod-row:last-child{border-bottom:0;padding-bottom:0;}
.fcms-mod-row:first-child{padding-top:0;}
.fcms-mod-icon{width:30px;height:30px;border-radius:8px;color:#fff;display:grid;place-items:center;font-size:11px;flex:none;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16);}
.fcms-mod-body{flex:1;min-width:0;}
.fcms-mod-body .nm{display:flex;align-items:center;gap:8px;font-size:12.5px;font-weight:600;color:var(--ink);line-height:1.2;}
.fcms-mod-body .nm .pill{font-size:9px;font-weight:700;letter-spacing:.04em;padding:2px 7px;border-radius:99px;text-transform:uppercase;}
.fcms-mod-body .nm .pill.on{background:var(--green-soft);color:var(--green);}
.fcms-mod-body .nm .pill.off{background:var(--surface-3);color:var(--faint);}
.fcms-mod-body .sb{font-size:11.5px;color:var(--faint);margin-top:2px;}
.fcms-mod-row .form-check.form-switch{flex:none;margin:0;min-height:auto;padding-left:2.5em;}
.fcms-mod-row .form-check-input{margin-top:0;cursor:pointer;width:2.2em;height:1.25em;}
.fcms-mod-row .form-check-input:checked{background-color:var(--link);border-color:var(--link);}
.fcms-mod-row .form-check-input:focus{box-shadow:0 0 0 .2rem rgba(27,115,232,.15);border-color:var(--link);}

.fcms-checkpill{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;background:var(--surface);border:1.5px solid var(--border);border-radius:99px;cursor:pointer;font-size:12.5px;font-weight:600;color:var(--ink-2);transition:all .15s;user-select:none;margin:0;position:relative;}
.fcms-checkpill:hover{border-color:var(--border-strong);}
.fcms-checkpill input{position:absolute;opacity:0;pointer-events:none;width:0;height:0;}
.fcms-checkpill .ix{width:18px;height:18px;border:1.5px solid var(--border-strong);border-radius:5px;display:grid;place-items:center;color:transparent;font-size:9px;flex:none;background:var(--surface);transition:all .15s;}
.fcms-checkpill input:checked ~ .ix{background:var(--link);border-color:var(--link);color:#fff;}
.fcms-checkpill:has(input:checked){border-color:var(--link);background:var(--blue-soft);color:var(--link);}

.fcms-widget-hints{list-style:none;margin:14px 0 0;padding:12px 14px;background:var(--surface-2);border:1px solid var(--border-light);border-radius:10px;display:flex;flex-direction:column;gap:8px;}
.fcms-widget-hints li{display:flex;align-items:flex-start;gap:10px;font-size:12px;line-height:1.5;color:var(--ink-2);margin:0;}
.fcms-widget-hints-tag{flex:none;font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;padding:2px 8px;border-radius:4px;line-height:1.5;margin-top:1px;}
.fcms-widget-hints code{background:rgba(0,0,0,.06);padding:1px 5px;border-radius:3px;font-size:11px;color:var(--ink);}
.fcms-widget-hints em{color:var(--faint);font-style:normal;}

.fcms-upload{display:flex;align-items:flex-start;gap:14px;padding:10px 0;border-bottom:1px solid var(--border-light);}
.fcms-upload + .fcms-upload{}
.fcms-upload:last-of-type{border-bottom:0;padding-bottom:14px;}
.fcms-upload-thumb{width:84px;height:48px;border-radius:8px;background:var(--surface-2);border:1px dashed var(--border-strong);display:grid;place-items:center;color:var(--faint);font-size:18px;flex:none;overflow:hidden;}
.fcms-upload-thumb.fav{width:48px;}
.fcms-upload-thumb img{max-width:100%;max-height:100%;object-fit:contain;}
.fcms-upload-body{flex:1;min-width:0;padding-top:2px;}
.fcms-upload-body .nm{font-size:13px;font-weight:600;color:var(--ink);line-height:1.2;}
.fcms-upload-body .sb{font-size:11.5px;color:var(--faint);margin:2px 0 6px;}

.fcms-field{margin:14px 0 0;}
.fcms-field:first-child{margin-top:0;}
.fcms-field > label.form-label{font-size:12px;font-weight:600;color:var(--ink-2);margin-bottom:6px;}
.fcms-field > label.form-label small{color:var(--faint);font-weight:400;margin-left:6px;}
.fcms-field textarea.form-control{font-family:monospace;font-size:11.5px;line-height:1.5;}
.fcms-field textarea.form-control:focus,.fcms-field .form-control:focus{border-color:var(--link);box-shadow:0 0 0 3px rgba(27,115,232,.12);}
.fcms-field .hint{font-size:11.5px;color:var(--faint);margin-top:6px;display:flex;align-items:center;gap:6px;}
.fcms-field .hint i{color:var(--link);}

.fcms-soc-row{display:flex;align-items:center;gap:14px;padding:10px 0;border-bottom:1px solid var(--border-light);}
.fcms-soc-row:last-child{border-bottom:0;}
.fcms-soc-icon{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;color:#fff;font-size:15px;flex:none;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16);}
.fcms-soc-body{flex:1;min-width:0;}
.fcms-soc-label{display:flex;align-items:center;gap:8px;font-size:12.5px;font-weight:600;color:var(--ink);margin:0 0 5px;}
.fcms-soc-label .dot{width:7px;height:7px;border-radius:50%;flex:none;}
.fcms-soc-label .dot.on{background:var(--green);box-shadow:0 0 0 3px var(--green-soft);}
.fcms-soc-label .dot.off{background:var(--border-strong);}
.fcms-soc-label .url{font-size:10.5px;font-weight:600;color:var(--faint);text-transform:uppercase;letter-spacing:.04em;margin-left:auto;}
.fcms-soc-input{display:flex;align-items:stretch;border:1px solid var(--border);border-radius:10px;overflow:hidden;background:var(--surface);transition:border-color .15s,box-shadow .15s;}
.fcms-soc-input:focus-within{border-color:var(--link);box-shadow:0 0 0 3px rgba(27,115,232,.12);}
.fcms-soc-input .pfx{display:grid;place-items:center;padding:0 12px;color:var(--faint);background:var(--surface-2);border-right:1px solid var(--border-light);flex:none;}
.fcms-soc-input input{flex:1;border:0;background:transparent;padding:9px 12px;font-size:12.5px;color:var(--ink);outline:none;min-width:0;}
.fcms-soc-input input::placeholder{color:var(--faint);}

/* ─── General tab 2-column grid (left: control cards, right: content cards) ─── */
.fcms-gen-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:start;}
.fcms-gen-grid > div{min-width:0;}
.fcms-gen-grid > div .fcms-modcard:last-child{margin-bottom:0;}
@media(max-width:991.98px){.fcms-gen-grid{grid-template-columns:1fr;}}

/* ── Block 2: Home Sections (.hsec-*) ────────────────────── */
.hsec-shell{display:grid;grid-template-columns:320px 1fr;gap:14px;background:#fff;border:1px solid #e6e9ef;border-radius:10px;overflow:hidden;min-height:600px}
.hsec-side{background:#f7f9fc;border-right:1px solid #e6e9ef;display:flex;flex-direction:column}
.hsec-side-head{padding:12px 14px;border-bottom:1px solid #ecf0f5;background:#fff;display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#5f6b7a;flex-wrap:wrap;gap:6px}
.hsec-side-head b{color:#22a06b;font-weight:700}
.hsec-side-head .hsec-reset-btn{font-size:11px;color:var(--accent);background:transparent;border:0;padding:2px 0;cursor:pointer;font-weight:600}
.hsec-side-help{padding:8px 14px;font-size:11px;color:#5f6b7a;background:#eaf1ff;border-bottom:1px solid #d8e3f7}
.hsec-side-help i{color:var(--accent);margin-right:4px}
.hsec-list{list-style:none;padding:8px;margin:0;overflow-y:auto;flex:1}
.hsec-item{display:grid;grid-template-columns:18px 18px 28px 1fr auto;gap:8px;align-items:center;padding:9px 10px;border-radius:7px;background:#fff;border:1px solid #ecf0f5;margin-bottom:5px;cursor:pointer;transition:all .12s;position:relative}
.hsec-item:hover{border-color:#c8d0da;box-shadow:0 1px 3px rgba(11,37,69,.06)}
.hsec-item.active{background:#eaf1ff;border-color:var(--accent);box-shadow:0 0 0 2px rgba(67,97,238,.15)}
.hsec-item.disabled .hsec-nm{color:#8c93a5}
.hsec-item.disabled .hsec-ic{filter:grayscale(.6);opacity:.55}
.hsec-item.sortable-ghost{opacity:.4;background:#eaf1ff;border-style:dashed !important;border-color:var(--accent) !important}
.hsec-item.sortable-chosen{cursor:grabbing}
.hsec-item.sortable-drag{box-shadow:0 12px 28px rgba(11,37,69,.25);background:#fff !important;transform:rotate(1deg)}
.hsec-item.flash{animation:hsecFlash 1.2s ease}
@keyframes hsecFlash{0%,30%{background:#fff8e6;border-color:#f6a85a}100%{background:#fff;border-color:#ecf0f5}}
.hsec-drag{color:#a3b5c9;cursor:grab;font-size:14px;line-height:1;letter-spacing:-1px;font-weight:700;text-align:center;user-select:none}
.hsec-drag:active{cursor:grabbing}
.hsec-item:hover .hsec-drag{color:#1d3557}
.hsec-pin{color:#f39c12;font-size:11px;text-align:center}
.hsec-num{font-size:11px;color:#5f6b7a;font-weight:700;text-align:center;background:#f0f3f7;border-radius:4px;padding:2px 0;min-width:18px}
.hsec-item.active .hsec-num{background:var(--accent);color:#fff}
.hsec-pinned .hsec-num{background:#fff3cd;color:#7a5904}
.hsec-ic{width:28px;height:28px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:12px;background:var(--accent-soft);color:var(--accent)}
.hsec-nm{font-size:13px;font-weight:600;color:#1a2733;line-height:1.15}
.hsec-nm small{display:block;font-size:10.5px;color:#5f6b7a;font-weight:400;margin-top:2px}
.hsec-item .form-check-input{margin:0;cursor:pointer;width:30px;height:16px}
.hsec-canvas{background:#fff;padding:20px 24px;overflow-y:auto;max-height:80vh}
.hsec-panel{display:none}
.hsec-panel.active{display:block}
.hsec-panel-head{display:flex;align-items:flex-start;gap:12px;padding-bottom:14px;border-bottom:1px solid #ecf0f5;margin-bottom:18px}
.hsec-panel-head .hsec-ic{width:38px;height:38px;border-radius:8px;font-size:15px;flex-shrink:0}
.hsec-panel-head h3{margin:0;font-size:16px;font-weight:700;color:#1a2733}
.hsec-panel-head .sub{font-size:12.5px;color:#5f6b7a;margin-top:2px;line-height:1.4}
.hsec-panel-head .pinned-tag{display:inline-block;background:#fff3cd;color:#7a5904;font-size:10px;font-weight:700;padding:2px 8px;border-radius:99px;letter-spacing:.04em;margin-left:8px;text-transform:uppercase}
@media (max-width: 900px){.hsec-shell{grid-template-columns:1fr}.hsec-side{border-right:0;border-bottom:1px solid #e6e9ef}.hsec-canvas{max-height:none}}

/* Patient panel card — shared border+surface pattern across patient pages */
.sh-patient-card {
    border: 1px solid var(--border);
    background: var(--surface);
}

/* Patient IPD profile — billing chart sections (6 repeats consolidated) */
.sh-ipd-bill-chart-heading {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink);
}
.sh-ipd-progress-thin {
    height: 6px;
}

/* Patient IPD profile — vital cards (repeats consolidated) */
.sh-ipd-vital-card {
    padding: 10px 12px;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--border);
}
.sh-ipd-vital-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: .04em;
}
.sh-ipd-vital-value {
    font-size: 18px;
    font-weight: 800;
    margin-top: 2px;
}
.sh-ipd-vital-range {
    font-size: 11px;
    margin-top: 2px;
}

/* Patient IPD profile — doctor list (repeats consolidated) */
.sh-ipd-doctor-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}
.sh-ipd-doctor-name {
    font-size: 13px;
    color: var(--ink);
}

/* Patient IPD profile — patient banner avatar */
.sh-ipd-patient-avatar {
    width: 52px;
    height: 52px;
    object-fit: cover;
}

/* Patient IPD profile — bcard-grid divider */
.sh-ipd-bcard-divider {
    border-top: 1px solid var(--border-light);
    margin-top: 8px;
}

/* Patient panel — allergies warning rellist (shared by ipdProfile + profile pages) */
.sh-patient-rellist-warn {
    border-color: var(--red);
}
.sh-patient-rellist-head-warn {
    background: var(--red-soft);
}
.sh-patient-rellist-ic-warn {
    background: var(--red);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
}
.sh-patient-allergies-title {
    color: var(--red);
}

/* Patient profile page — repeated section helpers */
.sh-profile-card-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 8px;
}
.sh-profile-flex-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sh-profile-flex-stack-12 {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}
.sh-profile-cell-trunc-160 {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sh-profile-cell-trunc-180 {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Patient profile page — patient banner avatar (circle, distinct from ipdProfile's square) */
.sh-profile-patient-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}

/* Patient profile page — responsive grid layouts */
.sh-profile-grid-autofit-200 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.sh-profile-grid-autofill-130 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

/* Patient profile page — flex helpers */
.sh-profile-flex-row-12 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}
.sh-profile-flex-wrap-10 {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Patient profile page — doctor card section */
.sh-profile-doc-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.sh-profile-doc-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}
.sh-profile-doc-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

/* Patient profile page — small muted text helpers */
.sh-profile-text-muted-11 {
    font-size: 11px;
    color: var(--muted);
}
.sh-profile-text-muted-13 {
    font-size: 13px;
    color: var(--muted);
}

/* Patient appointment page — initially-hidden form sections (jQuery .show()/.hide() compatible) */
#cheque_section {
    display: none;
}
#field_data {
    display: none;
}

/* Patient appearance page — paint-brush icon in title */
.sh-appearance-title-ic {
    color: var(--accent);
}

/* Patient appearance / theme picker — moved from inline <style> in _partials/appearance_card.php */
/* ===== Section heads ===== */
.sh-app-sub-head { margin: 0 0 12px; }
.sh-app-sub-head h3 { font-size: 13px; font-weight: 700; color: var(--ink); margin: 0; letter-spacing: -0.005em; }
.sh-app-section-divider { margin: 22px 0 18px; border: 0; border-top: 1px solid var(--border); }

/* ===== Preset cards with rich mock UI ===== */
.sh-app-preset-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 992px) { .sh-app-preset-grid { grid-template-columns: repeat(2, 1fr); } }
.sh-app-preset-card { position: relative; background: var(--sh-mock-bg, #fff); border: 2px solid var(--border); border-radius: var(--radius-md, 6px); overflow: hidden; cursor: pointer; transition: transform .12s, border-color .15s, box-shadow .15s; }
.sh-app-preset-card:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: 0 4px 14px rgba(15,23,42,.08); }
.sh-app-preset-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sh-app-preset-card.active .sh-app-preset-check { display: grid; }
.sh-app-preset-check { display: none; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink, #fff); place-items: center; font-size: 11px; z-index: 2; }
.sh-app-hospital-star { position: absolute; top: 7px; left: 7px; color: #F59E0B; font-size: 10px; z-index: 2; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }

.sh-app-mock-bar { display: flex; align-items: center; gap: 6px; padding: 7px 9px; background: var(--sh-mock-surface); border-bottom: 1px solid var(--sh-mock-border); }
.sh-app-mock-dot { width: 12px; height: 12px; border-radius: 3px; background: var(--sh-mock-accent); }
.sh-app-mock-line { flex: 1; height: 5px; border-radius: 3px; background: var(--sh-mock-border); }
.sh-app-mock-body { padding: 8px 9px 10px; background: var(--sh-mock-bg); }
.sh-app-mock-row { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.sh-app-mock-row:last-child { margin-bottom: 0; }
.sh-app-mock-btn { height: 16px; padding: 0 7px; border-radius: 3px; background: var(--sh-mock-accent); color: var(--sh-mock-accent-ink); font-size: 8px; font-weight: 700; display: inline-flex; align-items: center; }
.sh-app-mock-badge { height: 12px; padding: 0 6px; border-radius: 999px; background: var(--sh-mock-accent-soft); color: var(--sh-mock-accent); font-size: 7px; font-weight: 800; display: inline-flex; align-items: center; }
.sh-app-mock-badge.warn { background: var(--sh-mock-amber-soft); color: var(--sh-mock-amber); }
.sh-app-mock-badge.danger { background: var(--sh-mock-red-soft); color: var(--sh-mock-red); }
.sh-app-preset-meta { padding: 7px 9px 9px; background: var(--sh-mock-surface); border-top: 1px solid var(--sh-mock-border); }
.sh-app-preset-meta strong { display: block; font-size: 11px; font-weight: 800; color: var(--sh-mock-ink); }
.sh-app-preset-meta small { display: block; font-size: 9px; color: var(--sh-mock-muted); font-weight: 600; margin-top: 1px; }

/* Per-preset mock palette */
.sh-app-preset-card.preset-clinical   { --sh-mock-bg:#F7FAFC; --sh-mock-surface:#FFF; --sh-mock-border:#E2E8F0; --sh-mock-ink:#0F172A; --sh-mock-muted:#64748B; --sh-mock-accent:#00B5AD; --sh-mock-accent-ink:#FFF; --sh-mock-accent-soft:#D4F1EF; --sh-mock-amber-soft:#FEF3C7; --sh-mock-amber:#D97706; --sh-mock-red-soft:#FEE2E2; --sh-mock-red:#DC2626; }
.sh-app-preset-card.preset-slate      { --sh-mock-bg:#F1F5F9; --sh-mock-surface:#FFF; --sh-mock-border:#CBD5E1; --sh-mock-ink:#1E293B; --sh-mock-muted:#64748B; --sh-mock-accent:#4F46E5; --sh-mock-accent-ink:#FFF; --sh-mock-accent-soft:#E0E7FF; --sh-mock-amber-soft:#FEF3C7; --sh-mock-amber:#D97706; --sh-mock-red-soft:#FEE2E2; --sh-mock-red:#DC2626; }
.sh-app-preset-card.preset-midnight   { --sh-mock-bg:#0F172A; --sh-mock-surface:#1E293B; --sh-mock-border:rgba(255,255,255,.10); --sh-mock-ink:#E2E8F0; --sh-mock-muted:#94A3B8; --sh-mock-accent:#4EA2FF; --sh-mock-accent-ink:#0F172A; --sh-mock-accent-soft:rgba(78,162,255,.18); --sh-mock-amber-soft:rgba(251,191,36,.18); --sh-mock-amber:#FBBF24; --sh-mock-red-soft:rgba(248,113,113,.18); --sh-mock-red:#F87171; }
.sh-app-preset-card.preset-oled       { --sh-mock-bg:#000; --sh-mock-surface:#0A0A0A; --sh-mock-border:rgba(255,255,255,.10); --sh-mock-ink:#F1F5F9; --sh-mock-muted:#94A3B8; --sh-mock-accent:#60A5FA; --sh-mock-accent-ink:#000; --sh-mock-accent-soft:rgba(96,165,250,.16); --sh-mock-amber-soft:rgba(251,191,36,.16); --sh-mock-amber:#FBBF24; --sh-mock-red-soft:rgba(248,113,113,.16); --sh-mock-red:#F87171; }
.sh-app-preset-card.preset-nightshift { --sh-mock-bg:#2A1F14; --sh-mock-surface:#3D2F1F; --sh-mock-border:rgba(245,230,211,.14); --sh-mock-ink:#F5E6D3; --sh-mock-muted:#BFA98F; --sh-mock-accent:#F59E0B; --sh-mock-accent-ink:#1A0F05; --sh-mock-accent-soft:rgba(245,158,11,.20); --sh-mock-amber-soft:rgba(251,191,36,.20); --sh-mock-amber:#FBBF24; --sh-mock-red-soft:rgba(251,146,60,.16); --sh-mock-red:#FB923C; }

.sh-app-default-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 10px; }
.sh-app-default-legend i { color: #F59E0B; font-size: 10px; }

/* ===== Text size — A-mark scale ===== */
.sh-app-size-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sh-app-size-btn { flex: 1; min-width: 90px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-md, 5px); cursor: pointer; color: var(--ink); transition: border-color .15s, background .15s; }
.sh-app-size-btn .sh-app-a-mark { font-weight: 800; color: var(--ink); line-height: 1; }
.sh-app-size-btn .sh-app-a-label { font-size: 10px; font-weight: 600; color: var(--muted); }
.sh-app-size-btn:hover { border-color: var(--accent); }
.sh-app-size-btn.active { background: var(--accent-soft); border-color: var(--accent); }
.sh-app-size-btn.active .sh-app-a-mark, .sh-app-size-btn.active .sh-app-a-label { color: var(--accent); }

/* ===== Density — line indicator ===== */
.sh-app-density-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sh-app-density-btn { flex: 1; min-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-md, 5px); cursor: pointer; color: var(--ink); font-size: 11px; font-weight: 600; transition: border-color .15s, background .15s; }
.sh-app-density-btn .sh-app-lines { display: flex; flex-direction: column; gap: 2px; width: 22px; }
.sh-app-density-btn .sh-app-lines span { height: 2px; background: var(--muted); border-radius: 1px; }
.sh-app-density-btn[data-density="compact"]  .sh-app-lines { gap: 1px; }
.sh-app-density-btn[data-density="spacious"] .sh-app-lines { gap: 4px; }
.sh-app-density-btn:hover { border-color: var(--accent); }
.sh-app-density-btn:hover .sh-app-lines span { background: var(--accent); }
.sh-app-density-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.sh-app-density-btn.active .sh-app-lines span { background: var(--accent); }

/* ===== Save bar ===== */
.sh-app-save-bar { display: flex; align-items: center; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); margin-top: 22px; }
.sh-app-save-bar .sh-app-save-info { flex: 1; }
.sh-app-dirty-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; font-size: 11px; font-weight: 700; background: var(--amber-soft); color: var(--amber); border-radius: 999px; }
.sh-app-dirty-pill.clean { background: var(--green-soft); color: var(--green); }

/* Patient IPD profile — billing graph chart */
.sh-ipd-graph-container {
    width: 380px;
    flex-shrink: 0;
    text-align: center;
}
.sh-ipd-graph-canvas-wrap {
    max-width: 380px;
}
.sh-ipd-graph-canvas {
    display: block;
}

/* Patient IPD profile — credit limit labels */
.sh-ipd-credit-label {
    color: var(--ink);
}
.sh-ipd-credit-balance {
    color: var(--link);
}

/* Patient IPD profile — vital details inline spans */
.sh-ipd-vital-unit {
    font-size: 11px;
    color: var(--muted);
}
.sh-ipd-vital-date {
    font-size: 10px;
}

/* Patient IPD profile — diagnosis/lab title with link color */
.sh-ipd-title-link {
    color: var(--link);
}

/* Lab investigation tables — shared by pathology + radiology sub-views */
.sh-lab-th-num {
    width: 40px;
}
.sh-lab-desc-text {
    font-size: 11px;
}

/* Hospital print-header logo img — shared across 4 antenatal/prescription modal sub-views */
.sh-print-header-img {
    height: 100px;
    width: 100%;
}

/* Patient IPD antenatal finding modal — layout helpers */
.sh-ipd-antenatal-spacer-10 {
    height: 10px;
    clear: both;
}
.sh-ipd-antenatal-hr {
    height: 1px;
    clear: both;
    margin-bottom: 10px;
    margin-top: 10px;
}

/* Patient IPD prescription modal */
.sh-ipd-prescription-th-num {
    width: 30px;
}
.sh-ipd-prescription-test-row {
    font-size: 13px;
    padding: 2px 0;
}

/* ── Block 3: Theme adaptation override layer (2026-05-22) ─
   Re-maps Blocks 1+2 hardcoded colors to tokens. MUST come
   after Blocks 1+2 in cascade order. */
.fcms2-config,.fcms2-preview,.fcms2-pv-head,.fcms2-pv-foot,
.hsec-shell,.hsec-side-head,.hsec-canvas,.hsec-item{background:var(--surface);}
.hsec-side{background:var(--surface-2);}
.hsec-num{background:var(--surface-2);color:var(--muted);}
.hsec-side-help{background:var(--surface-2);color:var(--muted);}
.hsec-item.active{background:var(--accent-soft);border-color:var(--accent);}
.hsec-item.active .hsec-num{background:var(--accent);color:var(--accent-ink,#fff);}
.fcms2-tcard,.fcms2-lcard,.fcms2-tcard-foot{background:var(--surface);}
.fcms2-lcard.on{background:var(--accent-soft);}
.fcms2-tcard.on .fcms2-tcard-foot{background:var(--accent-soft);color:var(--ink);}
.fcms2-config,.fcms2-preview,.fcms2-sec,.fcms2-tcard,.fcms2-lcard,.fcms2-swatch,
.fcms2-pv-head,.hsec-shell,.hsec-side,.hsec-item,.hsec-side-head,.hsec-panel-head{border-color:var(--border);}
.fcms2-sec-title,.fcms2-ltitle,.fcms2-sec-cur b,.fcms2-pv-head h3,.fcms2-pv-foot strong,
.hsec-nm,.hsec-panel-head h3{color:var(--ink);}
.fcms2-sec-sub,.fcms2-sec-cur,.fcms2-tcard-foot,.fcms2-pv-foot,
.hsec-side-head,.hsec-nm small,.hsec-panel-head .sub{color:var(--muted);}
#tab-pages .card{background:var(--surface);}
#tab-pages .card[style]{border-color:var(--border)!important;}
#tab-pages .card-header{background:var(--surface-2);}
#fcms-page-list .list-group-item{background:transparent;color:var(--ink);border-color:var(--border-light);}
#fcms-page-list .list-group-item:hover{background:var(--surface-2);color:var(--ink);}
#fcms-page-list .badge{background:var(--surface-2)!important;color:var(--muted)!important;}

/* ── Live preview: realistic front-site mockup ── */
.fcms2-pv-nav{height:26px;display:flex;align-items:center;gap:6px;padding:0 10px}
.fcms2-pv-nav::after{display:none}
.pvnav-logo{font-size:8px;font-weight:800;color:#fff;letter-spacing:.02em;display:flex;align-items:center;gap:3px;white-space:nowrap}
.pvnav-menu{display:flex;gap:5px;margin-left:8px;flex:1}
.pvnav-menu i{width:12px;height:3px;border-radius:2px;background:rgba(255,255,255,.45)}
.pvnav-cta{font-size:7px;font-weight:700;color:#fff;background:rgba(255,255,255,.22);border:1px solid rgba(255,255,255,.45);padding:2px 7px;border-radius:99px;white-space:nowrap}
.fcms2-pv-hero{height:150px;align-items:flex-end;justify-content:flex-start;padding:0 0 14px;overflow:hidden}
.pv-hero-photo{position:absolute;inset:0;z-index:0;background-size:cover;background-position:center}
.pv-hero-photo::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(16,24,40,.30),rgba(16,24,40,.80))}
.pv-hero-inner{position:relative;z-index:1;display:flex;flex-direction:column;align-items:flex-start;text-align:left;padding:0 14px;width:100%}
.fcms2-pv-hero h4,.fcms2-pv-hero p{text-align:left}
.pv-hero-btns{display:flex;gap:6px;margin-top:9px}
.pv-btn-primary{font-size:8px;font-weight:700;color:#fff;background:var(--pv-accent,#0ea5e9);padding:4px 10px;border-radius:99px;white-space:nowrap}
.pv-btn-ghost{font-size:8px;font-weight:700;color:#fff;background:transparent;border:1px solid rgba(255,255,255,.6);padding:4px 10px;border-radius:99px;white-space:nowrap}
.pv-doc{align-items:center;text-align:center}
.pv-doc-ava{width:22px;height:22px;border-radius:50%;background:var(--pv-accent,#cbd5e1);opacity:.9;display:block;margin:0 auto 4px}

/* ── Saffron-ise selected / checked states (were legacy blue var(--accent)/#0D6EFD) ── */
.hsec-item .form-check-input:checked{background-color:var(--accent);border-color:var(--accent);}
.hsec-reset-btn,.hsec-side-help i{color:var(--accent);}
.fcms2-tcard.on,.fcms2-lcard.on{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft);}
.fcms2-swatch.on{border-color:var(--accent);background:var(--accent-soft);color:var(--accent);}
.fcms2-tcard.on .fcms2-tcard-foot{color:var(--accent);}
.fcms2-lpill.on{background:var(--accent);color:var(--accent-ink,#fff);}
/* hover highlight → theme color (was light blue #a3b1f7) */
.fcms2-tcard:hover,.fcms2-lcard:hover,.fcms2-swatch:hover{border-color:color-mix(in srgb, var(--accent) 45%, var(--border));}

/* ── Corner style: route legacy hardcoded radii to Theme Studio tokens ──
   Blocks 1/2 baked in 7–14px corners, so the Theme Studio "Corner style"
   (sharp / soft / rounded → --radius / --radius-md / --radius-lg) never
   reached the Front CMS surfaces. Re-map the structural cards/panels/
   controls onto the tokens here — same Block-3 convention as the colors
   above. Pills (99px), avatars/dots (50%), small icon tiles and the
   live-preview phone mock keep fixed shapes on purpose. */
.fcms-modcard,.fcms2-config,.fcms2-preview,.fcms2-tcard,.fcms2-lcard,
.fcms2-savebar{border-radius:var(--radius-lg);}
.fcms-summary,.fcms-theme-card,.fcms-layout-card,.fcms-faq-item,
.fcms-auto-info,.fcms-widget-hints,.hsec-shell{border-radius:var(--radius-md);}
.fcms-soc-input,.fcms-add-btn,.fcms-chip,.hsec-item,
.fcms2-savebar-r .btn{border-radius:var(--radius);}

/* ============================================================
   P32b — Front CMS inline-style utility classes
   Replaces ~45 of the 62 inline styles in admin/frontcms/index.php
   with reusable .fcms-* classes. Remaining ~10 stay inline:
   PHP-dynamic (e.g., $color_hex) or JS-toggled display:none.
   ============================================================ */

/* Page header title */
.fcms-page-h3 { font-size: 15px; color: var(--ink); }

/* Star highlight inside section heads */
.fcms-star { color: var(--amber); }

/* Hero media section wrapper + flex head row */
.fcms2-hm { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 18px; }
.fcms2-hm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }

/* Subtle label hint inline span (hero media field labels) */
.fcms-label-hint { color: var(--muted); font-weight: 400; }

/* Diff text top spacing under save bar (folds into existing .fcms2-diff usage) */
.fcms2-diff-spaced { margin-top: 3px; }

/* Hint text below section heads (was hardcoded #8c93a5 → token) */
.fcms-hint-text { font-size: 11px; color: var(--faint); margin-bottom: 8px; }

/* Stat-row grid variants */
.fcms-stat-row-locations { grid-template-columns: 1fr 1fr 2fr 1fr 1fr 1fr 36px; }
.fcms-stat-row-2col-top  { grid-template-columns: 1fr 3fr 36px; align-items: start; }
.fcms-stat-row-single    { grid-template-columns: 1fr 36px; }

/* Marquee textarea — font-family REMOVED (memory rule: Theme Studio owns typography) */
.fcms-textarea-marquee { font-size: 13.5px; line-height: 1.55; resize: vertical; min-height: 240px; }

/* Section subtitle suffix (small grey hint after main title) */
.fcms-section-subtitle { font-size: 10.5px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--faint); }

/* Special-pages card with light border */
.fcms-page-card-light { border: 1px solid var(--border-light); }

/* Strong 13px labels */
.fcms-strong-13       { font-size: 13px; display: block; }
.fcms-strong-13-inline{ font-size: 13px; }

/* Small meta / count text */
.fcms-meta-small  { font-size: 11px; color: var(--faint); }
.fcms-count-small { font-size: 11px; color: var(--faint); font-weight: 400; }

/* Success-soft badge */
.fcms-badge-success { background: var(--green-soft); color: var(--green); font-size: 10px; }

/* Auto-info size modifier */
.fcms-auto-info.is-sm { font-size: 12px; }

/* Auto-info green variant (Programs/Events callout) — replaces hardcoded hex inlines */
.fcms-auto-info.is-success-strong { border-color: var(--green-soft); background: var(--green-soft); color: var(--green); }
.fcms-auto-info.is-success-strong strong,
.fcms-auto-info.is-success-strong span,
.fcms-auto-info.is-success-strong i { color: var(--green); }

/* Compact alert */
.fcms-alert-compact { font-size: 12.5px; border-radius: 8px; }

/* Mini-padding button (refines btn-xs) */
.fcms-btn-mini { font-size: 11px; padding: 2px 8px; }

/* CMS-pages list header row (search + count) */
.fcms-list-header { border-bottom: 1px solid var(--border-light); background: var(--surface-2); }

/* Search icon overlay + search input field */
.fcms-search-icon  { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--faint); }
.fcms-search-input { font-size: 12px; padding: 5px 10px 5px 28px; border-radius: 6px; }

/* Page-empty hint (display:none stays inline — JS-toggled) */
.fcms-page-empty-hint { font-size: 11.5px; color: var(--faint); text-align: center; padding: 6px 0 0; }

/* Scrollable page list */
.fcms-page-list-scroll { max-height: 520px; overflow-y: auto; }

/* Editor placeholder font-size */
.fcms-editor-placeholder { font-size: 13px; }

/* Social input prefix icon size */
.fcms-pfx-icon { font-size: 10.5px; }

/* === Pharmacy Search (admin/pharmacy/search) ===
   Migrated 2026-05-26.
   search.php: 3x select.select2 width:100% stripped (global rule covers);
   1x img#medicine_image composite (48px square + object-fit) → .sh-med-img-thumb. */
.sh-med-img-thumb { width: 48px; height: 48px; object-fit: cover; }

/* === Pathology Bill (admin/pathology/gettestreportbatch) ===
   Migrated 2026-05-26.
   reportDetail.php: 1 <style> block (#testreport col widths) + 3 inline styles.
   _assigntestpatho.php: 1 <style> block (#tableID padding/last-col) + 11 inline styles.
   _getPathologyReportDetails.php: 4 TH width inlines + 1 select2 width.
   _getPatientPathologyDetails.php: 3 TH width inlines.
   _getBillDetails.php: SKIP (print view — includes _print_css.php).
   Exceptions kept inline: display:none on .cheque_div (jQuery-toggled). */

/* #testreport DataTable — last 3 cols 80px; last 6 TH right-aligned */
#testreport colgroup col:nth-last-child(1), #testreport th:nth-last-child(1), #testreport td:nth-last-child(1),
#testreport colgroup col:nth-last-child(2), #testreport th:nth-last-child(2), #testreport td:nth-last-child(2),
#testreport colgroup col:nth-last-child(3), #testreport th:nth-last-child(3), #testreport td:nth-last-child(3)
{ width: 80px !important; min-width: 80px !important; max-width: 80px !important; }
#testreport th:nth-last-child(1), #testreport th:nth-last-child(2), #testreport th:nth-last-child(3),
#testreport th:nth-last-child(4), #testreport th:nth-last-child(5), #testreport th:nth-last-child(6)
{ text-align: right !important; }

/* assigntestModal: overflow kill + #tableID full-width + 36px last-col override */
#assigntestModal .modal-body,
#assigntestModal .modal-body .sh-form-card,
#assigntestModal .modal-body .p-2,
#assigntestModal .pup-scroll-area,
#assigntestModal .modal-content,
#assigntestModal .modal-dialog,
#assigntestModal .table-responsive { overflow-x: hidden !important; }
#assigntestModal #tableID { width: 100% !important; }
#assigntestModal #tableID th:last-child,
#assigntestModal #tableID td:last-child { width: 36px !important; min-width: 36px !important; max-width: 36px !important; }
#assigntestModal #tableID th,
#assigntestModal #tableID td { padding: 2px 4px !important; }

/* _getPathologyReportDetails TH widths (sub-view loads into #addReportModal) */
#addReportModal .sh-tests-table th:nth-child(1) { width: 5px; }
#addReportModal .sh-tests-table th:nth-child(2) { width: 100px; }
#addReportModal .sh-tests-table th:nth-child(3),
#addReportModal .sh-tests-table th:nth-child(4) { width: 20%; }

/* _getPatientPathologyDetails TH widths (sub-view loads into #viewDetailReportModal) */
#viewDetailReportModal .sh-tests-table th:nth-child(1) { width: 36px; }
#viewDetailReportModal .sh-tests-table th:nth-child(3) { width: 180px; }
#viewDetailReportModal .sh-tests-table th:last-child   { width: 90px; }

/* Input-group fixed-width for discount-percent group */
.sh-ig-130 { width: 130px; }

/* ============================================================
   P33 — admin/front/* CMS sub-pages (banner, events, gallery,
          media, menus, notice, pages)
   ------------------------------------------------------------
   Migrates ~23 of 53 inline styles across 22 files into reusable
   utility classes. Remaining ~30 stay inline:
   - JS-toggled display (image_preview show/hide, seoDetailBody,
     fee_detail_popover, pg-layout-panel)
   - PHP-conditional display (layout-aware panels in pages/edit)
   - JS-generated runtime values (progress-bar width)

   .fcms-alert-compact REUSED from P32b — no redefinition needed.
   ============================================================ */

/* Image preview wrapper margin (display state stays inline — JS+PHP) */
#image_preview { margin-top: 10px; }

/* Feature image thumbnail height constraint */
.feature_image_url { max-height: 150px; }

/* Floating remove-icon button on team/faq item cards */
.front-btn-remove-floating { top: 8px; right: 8px; padding: 2px 7px; }

/* Split-button pair (left half + right half divider) on pages/index */
.front-btn-split-left  { border-radius: 2px 0 0 2px; }
.front-btn-split-right { border-left: 1px solid rgba(255,255,255,.25); max-height: 35px; }

/* Detail title max-width truncation (media gallery detail modal) */
.front-detail-title-max { max-width: 420px; }

/* Generic link-color text utility (media upload icon, etc.) */
.front-text-link { color: var(--link); }

/* ============================================================
   P34 — Patient panel utility classes
   ------------------------------------------------------------
   Token-disciplined utilities for patient/*.php views.
   First entry in a growing .sh-text-* / .sh-card-* family.
   ============================================================ */

/* Card with token-disciplined border + background */
.sh-card-token { border: 1px solid var(--border); background: var(--surface); }

/* Text color utility (token-based) */
.sh-text-ink { color: var(--ink); }

/* Cursor pointer utility (used in JS-generated HTML for clickable slots) */
.sh-slot-cursor { cursor: pointer; }

/* bloodbankstatus: flex wrapper min-height */
.bb-card-body > .d-flex { min-height: 280px; }
/* modal-header case-ID input-group fixed width */
.sh-ig-180 { width: 180px; }

/* bloodissue: DataTable last-6 column widths + alignment */
#bloodIssueTable colgroup col:nth-last-child(1), #bloodIssueTable th:nth-last-child(1), #bloodIssueTable td:nth-last-child(1),
#bloodIssueTable colgroup col:nth-last-child(2), #bloodIssueTable th:nth-last-child(2), #bloodIssueTable td:nth-last-child(2),
#bloodIssueTable colgroup col:nth-last-child(3), #bloodIssueTable th:nth-last-child(3), #bloodIssueTable td:nth-last-child(3),
#bloodIssueTable colgroup col:nth-last-child(4), #bloodIssueTable th:nth-last-child(4), #bloodIssueTable td:nth-last-child(4),
#bloodIssueTable colgroup col:nth-last-child(5), #bloodIssueTable th:nth-last-child(5), #bloodIssueTable td:nth-last-child(5),
#bloodIssueTable colgroup col:nth-last-child(6), #bloodIssueTable th:nth-last-child(6), #bloodIssueTable td:nth-last-child(6)
{ width: 80px !important; min-width: 80px !important; max-width: 80px !important; }
#bloodIssueTable th:nth-last-child(1),
#bloodIssueTable th:nth-last-child(2),
#bloodIssueTable th:nth-last-child(3),
#bloodIssueTable th:nth-last-child(4),
#bloodIssueTable th:nth-last-child(5),
#bloodIssueTable th:nth-last-child(6) { text-align: right !important; }

/* components: legacy printablea4 billing-table float inputs */
.sh-bb-inp-sm    { width: 30%; float: right; }
.sh-bb-inp-md    { width: 50%; float: right; }
.sh-bb-inp-pct   { width: 70%; float: right; font-size: 12px; }
.sh-bb-pct-label { float: right; font-size: 12px; padding-left: 5px; }

/* ambulance call: DataTable last-6 column widths + alignment */
#ambulanceCallTable colgroup col:nth-last-child(1), #ambulanceCallTable th:nth-last-child(1), #ambulanceCallTable td:nth-last-child(1),
#ambulanceCallTable colgroup col:nth-last-child(2), #ambulanceCallTable th:nth-last-child(2), #ambulanceCallTable td:nth-last-child(2),
#ambulanceCallTable colgroup col:nth-last-child(3), #ambulanceCallTable th:nth-last-child(3), #ambulanceCallTable td:nth-last-child(3),
#ambulanceCallTable colgroup col:nth-last-child(4), #ambulanceCallTable th:nth-last-child(4), #ambulanceCallTable td:nth-last-child(4),
#ambulanceCallTable colgroup col:nth-last-child(5), #ambulanceCallTable th:nth-last-child(5), #ambulanceCallTable td:nth-last-child(5),
#ambulanceCallTable colgroup col:nth-last-child(6), #ambulanceCallTable th:nth-last-child(6), #ambulanceCallTable td:nth-last-child(6)
{ width: 80px !important; min-width: 80px !important; max-width: 80px !important; }
#ambulanceCallTable th:nth-last-child(1),
#ambulanceCallTable th:nth-last-child(2),
#ambulanceCallTable th:nth-last-child(3),
#ambulanceCallTable th:nth-last-child(4),
#ambulanceCallTable th:nth-last-child(5),
#ambulanceCallTable th:nth-last-child(6) { text-align: right !important; }

/* visitors: DataTable fixed-layout + cell overflow */
#visitorTable { table-layout: fixed !important; width: 100% !important; }
#visitorTable td, #visitorTable th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#visitorTable td:last-child, #visitorTable th:last-child { overflow: visible; white-space: nowrap; }

/* birth/death records: DataTable action-column width */
#birthTable colgroup col:last-child,
#birthTable th:last-child,
#birthTable td:last-child { width: 110px !important; min-width: 110px !important; max-width: 110px !important; }
#deathTable colgroup col:last-child,
#deathTable th:last-child,
#deathTable td:last-child { width: 110px !important; min-width: 110px !important; max-width: 110px !important; }

/* datepicker: z-index fix for dropdowns inside modals */
.datepicker.dropdown-menu { z-index: 1020 !important; }

/* staff: card-title decorative icon */
.sh-title-icon { color: var(--link); margin-right: 6px; }

/* staff: social media brand icon colors */
.sh-icon-fb { color: #1877f2; }
.sh-icon-li { color: #0077b5; }
.sh-icon-ig { color: #e4405f; }

/* staff: file input sizing */
.sh-file-input    { height: auto; padding: 4px 10px; }
.sh-file-input-sm { height: auto; padding: 4px 8px; }

/* staff / payroll: narrow index and close-button columns */
.sh-col-num { width: 28px; }
.sh-col-32  { width: 32px; }

/* payroll: scrollable earnings/deductions container */
.sh-scroll-230 { max-height: 230px; overflow-y: auto; }

/* payroll: calculate / add-row button compact sizing */
.sh-btn-calc { height: 26px; padding: 0 10px; font-size: .78rem; white-space: nowrap; }

/* payroll: page-heading font size */
.sh-fs-95 { font-size: .95rem; }

/* ── Payroll Create / Edit ────────────────────────────────────── */
.payroll-info-table { width: 100%; }
.payroll-info-table th {
    width: 130px;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
    padding: 6px 14px 6px 0;
    border: none;
    font-size: .85rem;
}
.payroll-info-table td {
    color: var(--ink);
    padding: 6px 14px 6px 0;
    border: none;
    font-size: .85rem;
}
.payroll-staff-img {
    width: 100px; height: 100px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.payroll-staff-initials {
    width: 100px; height: 100px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 36px;
    letter-spacing: 2px;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
}
.attend-table th, .attend-table td {
    padding: 5px 10px;
    font-size: .8rem;
    text-align: center;
    border-color: var(--border) !important;
    color: var(--ink);
}
.attend-table th:first-child,
.attend-table td:first-child { text-align: left; }
.payroll-section-hdr {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}
.payroll-section-hdr h6 { margin: 0; font-weight: 600; color: var(--ink); font-size: .875rem; }
.btn-row-add {
    margin-left: auto;
    width: 26px; height: 26px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--link);
    display: grid; place-items: center;
    cursor: pointer;
    font-size: .75rem;
    line-height: 1;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.btn-row-add:hover { background: var(--link); color: #fff; border-color: var(--link); }
#tableID td, #tableID2 td { padding: 3px 4px; border: none; }
#tableID input.form-control,
#tableID2 input.form-control {
    border-color: var(--border);
    background: var(--surface);
    color: var(--ink);
    font-size: .84rem;
    height: 32px;
}
.closebtn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--faint);
    width: 28px; height: 32px;
    display: grid; place-items: center;
    cursor: pointer;
    font-size: .8rem;
    transition: color .15s, border-color .15s;
}
.closebtn:hover { color: var(--red); border-color: var(--red); }
.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    border-bottom: 1px solid var(--border-light);
    gap: 10px;
}
.summary-row:last-child { border-bottom: none; }
.summary-label { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.summary-value { flex-shrink: 0; }
.summary-value input.form-control {
    width: 120px;
    text-align: right;
    height: 30px;
    font-size: .84rem;
    border-color: var(--border);
    background: var(--surface-2);
    color: var(--ink);
}
.summary-row.is-deduct .summary-value input.form-control { color: var(--red); }
.summary-divider { border-top: 2px solid var(--border-strong); margin: 0; }
.summary-row.is-net { background: var(--green-soft); }
.summary-row.is-net .summary-label { color: var(--green); font-weight: 600; font-size: .875rem; }
.summary-row.is-net .summary-value input.form-control {
    background: transparent;
    color: var(--green);
    font-weight: 700;
    border-color: var(--green);
}
.sh-maxw-220 { max-width: 220px; }
.sh-meeting-details-col { flex: 1; min-width: 260px; }
.sh-meeting-staff-col   { flex: 0 0 300px; }
/* certificate preview partial (preview_certificate.php → injected into modal) */
.sh-cert-preview { position: relative; text-align: center; font-family: 'arial'; background: #fff; max-width: 100%; margin: 0 auto; }
.sh-cert-preview.sh-cert-empty { aspect-ratio: 1.414 / 1; min-height: 60vh; border: 1px dashed var(--border, #e2e8f0); }
.sh-cert-preview .sh-cert-bg { display: block; width: 100%; height: auto; }
.sh-cert-preview td { vertical-align: bottom; }
.sh-cert-preview h1, .sh-cert-preview h2, .sh-cert-preview h3 { margin-top: 0; font-weight: normal; }
.sh-cert-photo-td { position: absolute; left: 0; }
.sh-cert-body-p { font-size: 14px; text-align: center; line-height: normal; }
.sh-idcard-outer-td { padding: 3px; }
.sh-idcard-addr-td  { padding: 1px 0; }
/* front/pages/index — sortable table + responsive header buttons */
.table-sortable tbody tr { cursor: move; }
@media (max-width: 767px) {
    .ms-auto d-flex gap-1 button, .ms-auto d-flex gap-1 a { margin-top: 0px; }
}
/* front/gallery create + edit — image tile grid */
.sh-gallery-section { margin-top: 8px; }
.sh-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 12px;
}
.sh-gallery-tile { padding: 0; margin: 0; max-width: none; }
.sh-tile-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: box-shadow .18s ease, transform .18s ease;
}
.sh-tile-thumb:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}
.sh-tile-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}
.sh-tile-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 55%);
    opacity: 0;
    transition: opacity .18s ease;
    pointer-events: none;
}
.sh-tile-thumb:hover::after { opacity: 1; }
.sh-tile-chip {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    background: rgba(255,255,255,0.92);
    color: #4b5563;
    font-size: 11px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.sh-tile-chip i { font-size: 11px; }
.sh-tile-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity .18s ease, transform .18s ease;
}
.sh-tile-thumb:hover .sh-tile-actions { opacity: 1; transform: translateY(0); }
.sh-tile-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.95);
    color: #fff !important;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    border: none;
    transition: background .15s ease, transform .15s ease;
}
.sh-tile-delete:hover {
    background: rgb(185, 28, 28);
    color: #fff !important;
    transform: scale(1.06);
}
.sh-tile-delete i { font-size: 12px; }
.sh-tile-name {
    margin: 8px 4px 0;
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.sh-gallery-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 16px;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    color: #9ca3af;
    text-align: center;
    background: #fafafa;
}
.sh-gallery-empty .sh-empty-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.7; }
.sh-gallery-empty p { margin: 0; font-size: 14px; color: #6b7280; font-weight: 500; }
.sh-gallery-empty small { color: #9ca3af; }
.sh-gallery-grid:has(.sh-gallery-tile) .sh-gallery-empty { display: none; }
@media (hover: none) {
    .sh-tile-actions { opacity: 1; transform: none; }
    .sh-tile-thumb::after { opacity: 0.35; }
}
/* front/media — redesigned flex grid (overrides legacy Bootstrap-grid rules at 4097) */
#media_div { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
#media_div .img_div_modal,
#media_div > div {
    flex: 0 0 calc(16.666% - 10px) !important;
    max-width: calc(16.666% - 10px) !important;
    width: calc(16.666% - 10px) !important;
    padding: 0 !important;
    margin: 0 !important;
}
@media (max-width: 991px) {
    #media_div .img_div_modal,
    #media_div > div { flex: 0 0 calc(25% - 9px) !important; max-width: calc(25% - 9px) !important; width: calc(25% - 9px) !important; }
}
@media (max-width: 575px) {
    #media_div .img_div_modal,
    #media_div > div { flex: 0 0 calc(50% - 6px) !important; max-width: calc(50% - 6px) !important; width: calc(50% - 6px) !important; }
}
#media_div .fadeoverlay {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s, border-color .2s;
    cursor: pointer;
    position: relative;
}
#media_div .img_div_modal:hover .fadeoverlay,
#media_div > div:hover .fadeoverlay {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border-strong);
}
#media_div .fadeheight {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 130px;
    overflow: hidden;
    background: var(--bg-2);
    display: flex; align-items: center; justify-content: center;
}
#media_div .fadeheight img { width: 100%; height: 100%; object-fit: cover; display: block; }
#media_div .mediatype-badge {
    position: absolute; top: 7px; right: 7px; z-index: 2;
    padding: 2px 7px; border-radius: 10px;
    font-size: 10px; font-weight: 700; line-height: 1.4;
    display: inline-flex; align-items: center; gap: 3px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,.35);
    pointer-events: none;
}
#media_div .mediatype-img  { background: rgba(26,39,51,.58); color: #fff; }
#media_div .mediatype-video { background: rgba(255,0,0,.82); color: #fff; }
#media_div .overlay3 {
    position: absolute; inset: 0; z-index: 3;
    background: rgba(26,39,51,.48);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    opacity: 0; transition: opacity .2s;
}
#media_div .img_div_modal:hover .overlay3,
#media_div > div:hover .overlay3 { opacity: 1; }
#media_div .overlay3 a {
    width: 36px; height: 36px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px;
    background: rgba(255,255,255,.92);
    transition: transform .15s;
    text-decoration: none;
    border: none;
}
#media_div .overlay3 a:hover { transform: scale(1.1); }
#media_div .overlay3 a.uploadcheckbtn { color: var(--link); }
#media_div .overlay3 a.uploadclosebtn { color: var(--red); }
#media_div .img-caption {
    padding: 6px 8px 7px; margin: 0;
    border-top: 1px solid var(--border-light);
    background: var(--surface);
    display: flex; flex-direction: column; gap: 1px;
}
#media_div .img-caption-name {
    font-size: 11px; color: var(--muted); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: block;
}
#media_div .img-caption-size { font-size: 10px; color: var(--faint); display: block; }
.media-file-count { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
.media-file-count strong { color: var(--ink); }
#media_div .fadeoverlay.active { box-shadow: inset 0 0 0 3px var(--link); }
#media_div .fadeoverlay.active img { opacity: .72; }
#media_div .fadeoverlay.active::before {
    content: '\f00c'; font-family: 'FontAwesome';
    position: absolute; top: 6px; right: 6px;
    width: 22px; height: 22px;
    background: var(--link); color: #fff;
    border-radius: 50%; font-size: 11px; line-height: 22px; text-align: center;
    z-index: 5; pointer-events: none;
}

/* front/menus additem + edititem — nested sortable menu tree */
ol.sortable, ol.sortable ol { margin: 0; padding: 0; list-style: none; }
ol.sortable > li { margin-bottom: 5px; position: relative; }
.menu-item-row {
    display: flex; align-items: center; gap: 5px; padding: 7px 10px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); transition: background .15s, border-color .15s;
    cursor: grab;
}
.menu-item-row:active { cursor: grabbing; }
.menu-item-row:hover { background: var(--rowhover); border-color: var(--border-strong); }
.chevron-btn {
    flex-shrink: 0; border: none; background: none; padding: 2px 5px;
    border-radius: var(--radius); cursor: pointer; color: var(--link);
    line-height: 1; transition: background .15s;
}
.chevron-btn:hover { background: var(--blue-soft); }
.chevron-btn i { font-size: 10px; display: inline-block; transition: transform .22s ease; }
.chevron-btn.open i { transform: rotate(90deg); }
.chevron-btn.no-children { color: var(--faint); cursor: default; pointer-events: none; }
.menu-item-label {
    flex: 1; font-size: 13.5px; font-weight: 500; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sub-count-badge {
    flex-shrink: 0; font-size: 10px; font-weight: 600; line-height: 1;
    padding: 2px 7px; border-radius: 10px;
    background: var(--blue-soft); color: var(--link);
}
.menu-item-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; margin-left: 2px; }
.menu-item-actions .btn { padding: 2px 7px; font-size: 11px; line-height: 1.5; }
ol.submenu-list { display: block; margin: 0; padding: 0; list-style: none; }
.menu-placeholder {
    list-style: none; background: var(--blue-soft);
    border: 1px dashed var(--accent); border-radius: var(--radius-md);
    height: 38px; margin: 4px 0;
}
ol.submenu-list .menu-placeholder { margin-left: 32px; }
ol.submenu-list > li { margin-top: 4px; padding-left: 32px; position: relative; }
ol.submenu-list > li::after {
    content: ''; position: absolute; left: 12px; top: -4px; bottom: 50%;
    width: 1px; border-left: 2px dashed var(--border-strong);
}
ol.submenu-list > li::before {
    content: ''; position: absolute; left: 12px; top: 50%;
    width: 16px; height: 1px; border-top: 2px dashed var(--border-strong);
}
.sub-item-row {
    display: flex; align-items: center; gap: 5px; padding: 6px 10px;
    background: var(--surface-2); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); transition: background .15s, border-color .15s;
}
.sub-item-row:hover { background: var(--rowhover); border-color: var(--border); }
.sub-item-label {
    flex: 1; font-size: 13px; color: var(--ink-2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.menu-empty-state { text-align: center; padding: 24px 0; color: var(--faint); font-size: 13px; }
.menu-empty-state i { display: block; font-size: 28px; margin-bottom: 8px; opacity: .4; }
.menu-item-row.is-editing,
.sub-item-row.is-editing { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* front/banner/index — banner image grid */
#banner_div { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
#banner_div .img_div_modal {
    flex: 0 0 calc(16.666% - 10px) !important;
    max-width: calc(16.666% - 10px) !important;
    width: calc(16.666% - 10px) !important;
    padding: 0 !important; margin: 0 !important;
}
@media (max-width: 991px) {
    #banner_div .img_div_modal { flex: 0 0 calc(25% - 9px) !important; max-width: calc(25% - 9px) !important; width: calc(25% - 9px) !important; }
}
@media (max-width: 575px) {
    #banner_div .img_div_modal { flex: 0 0 calc(50% - 6px) !important; max-width: calc(50% - 6px) !important; width: calc(50% - 6px) !important; }
}
#banner_div .fadeoverlay {
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s, border-color .2s; cursor: pointer;
}
#banner_div .img_div_modal:hover .fadeoverlay { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
#banner_div .fadeheight {
    position: relative; width: 100%; aspect-ratio: 16 / 10; max-height: 130px;
    overflow: hidden; background: var(--bg-2);
    display: flex; align-items: center; justify-content: center;
}
#banner_div .fadeheight img { width: 100%; height: 100%; object-fit: cover; display: block; }
#banner_div .overlay3 {
    position: absolute; inset: 0; z-index: 3;
    background: rgba(26,39,51,.48);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    opacity: 0; transition: opacity .2s;
}
#banner_div .img_div_modal:hover .overlay3 { opacity: 1; }
#banner_div .overlay3 a {
    width: 36px; height: 36px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; background: rgba(255,255,255,.92);
    transition: transform .15s; text-decoration: none; border: none;
}
#banner_div .overlay3 a:hover { transform: scale(1.1); }
#banner_div .overlay3 a.uploadclosebtn { color: var(--red); }
#banner_div .img-caption {
    padding: 6px 8px 7px; margin: 0;
    border-top: 1px solid var(--border-light); background: var(--surface);
    display: flex; flex-direction: column; gap: 1px;
}
#banner_div .img-caption-name {
    font-size: 11px; color: var(--muted); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.banner-file-count { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
.banner-file-count strong { color: var(--ink); }

/* ─── Expiry Medicine / Stock Report ─── */
.carousel-row { margin-bottom: 10px; }
.slide-row {
    padding: 0;
    background-color: #ffffff;
    min-height: 150px;
    border: 1px solid #e7e7e7;
    overflow: hidden;
    height: auto;
    position: relative;
}
.slide-carousel { width: 20%; float: left; display: inline-block; }
.slide-carousel .carousel-indicators { margin-bottom: 0; bottom: 0; background: rgba(0,0,0,.5); }
.slide-carousel .carousel-indicators li { border-radius: 0; width: 20px; height: 6px; }
.slide-carousel .carousel-indicators .active { margin: 1px; }
.slide-content {
    position: absolute;
    top: 0;
    left: 20%;
    display: block;
    float: left;
    width: 80%;
    max-height: 76%;
    padding: 1.5% 2% 2% 2%;
    overflow-y: auto;
}
.slide-content h4 { margin-bottom: 3px; margin-top: 0; }
.slide-footer { position: absolute; bottom: 0; left: 20%; width: 78%; height: 20%; margin: 1%; }
.slide-content::-webkit-scrollbar { width: 5px; }
.slide-content::-webkit-scrollbar-thumb:vertical { margin: 5px; background-color: #999; -webkit-border-radius: 5px; }
.slide-content::-webkit-scrollbar-button:start:decrement,
.slide-content::-webkit-scrollbar-button:end:increment { height: 5px; display: block; }
.printablea4 { width: 100%; }
.printablea4>tbody>tr>th,
.printablea4>tbody>tr>td { padding: 5px 0; line-height: 1.42857143; vertical-align: top; font-size: 12px; }
/* Legend info button (expiry medicine report) */
.btn-legend-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #3c8dbc;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    margin-top: 4px;
    padding: 0;
    outline: none;
}
.btn-legend-info:hover { background-color: #367fa9; }
.btn-legend-info:focus { outline: none; }
.legend-icon { color: #3c8dbc; margin-right: 5px; }
/* Legend popover card */
.legend-popover {
    display: none;
    position: absolute;
    z-index: 1060;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    min-width: 240px;
    padding: 0;
}
.legend-popover .legend-popover-title {
    font-size: 14px;
    font-weight: 600;
    padding: 10px 14px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
}
.legend-popover .legend-popover-body { padding: 10px 14px 12px; }
.legend-popover table { width: 100%; border-collapse: collapse; font-size: 13px; }
.legend-popover table th { font-weight: 600; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--border); }
.legend-popover table td { padding: 5px 6px; color: var(--ink); }
.legend-popover table td .badge { display: inline-block; min-width: 96px; text-align: center; font-size: 12px; font-weight: 600; padding: 4px 8px; letter-spacing: 0.3px; }
.legend-popover .status-expired { color: var(--red); font-weight: 600; }
.legend-popover .status-near    { color: #e67e22; font-weight: 600; }
.legend-popover .status-safe    { color: var(--green); font-weight: 600; }
.legend-popover table tr:not(:last-child) td { border-bottom: 1px solid var(--border); }

/* Radiology report: Select2 dropdown z-index fix */
.select2-container--open { z-index: 1; }

/* ── Layout files — migrated from inline styles 2026-05-27 ── */
/* top_sidemenu.php — quick-links menu items (10× repeats) */
.top-side-menu-item { color: #282828; font-family: 'Roboto-Bold'; padding: 6px 20px; }
.top-side-vertical-menu { min-width: 194px; font-size: 10pt; left: 3px; }

/* routine_update.php — small alert text */
.layout-alert-sm { font-size: 12.5px; }

/* layout/sidebar.php + layout/patient/sidebar.php — brand logo (28×28 rounded) */
.sh-sidebar-logo-img { width: 28px; height: 28px; border-radius: 6px; }

/* ── Layout headers (admin + patient) — migrated from inline <style> blocks 2026-05-27 ── */
/* Common modal/nav-variant overrides (dedup from both header.php files) */
.modal-backdrop { background-color: #000 !important; transition: opacity 0.18s ease-out !important; }
.modal-backdrop.show { opacity: .5 !important; }
.modal-header { border-bottom: 1px solid var(--bs-border-color-translucent) !important; }
.modal-footer, .sticky-footer { border-top: 1px solid var(--bs-border-color-translucent) !important; padding: .75rem 1rem !important; }
.sticky-footer { background-color: transparent !important; }
.modal-content .sticky-footer { position: static !important; width: auto !important; }
.sh-nav-variant-btn { padding:0 10px;height:22px;border-radius:12px;border:none;font-size:.65rem;font-weight:700;cursor:pointer;background:transparent;color:var(--muted);transition:background .15s,color .15s; }
.sh-nav-variant-btn.active { background:var(--link) !important;color:#fff !important; }

/* Admin license banner (from admin header.php <style> block) */
.sh-license-banner { margin: -20px -20px 20px -20px; padding: 10px 20px; display: flex; align-items: center; gap: 12px; color: #fff; font-size: 13px; line-height: 1.4; background: linear-gradient(90deg, var(--red), #b91c1c); box-shadow: 0 2px 4px rgba(228,37,39,.15); }
.sh-license-banner-icon { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; }
.sh-license-banner-text { flex: 1; min-width: 0; }
.sh-license-banner a.purchasemodal { color: #fff !important; text-decoration: underline; font-weight: 700; }
.sh-license-banner a.purchasemodal:hover { opacity: .85; }

/* Topbar shared inline patterns (admin + patient headers) */
.sh-tb-flex-spacer { flex: 1; }
.sh-tb-dropdown-lang { min-width: 180px; max-height: 320px; overflow-y: auto; }
.sh-tb-dropdown-user { min-width: 200px; }

/* Topbar panel-specific */
.sh-tb-home-icon { font-size: 14px; }
.sh-tb-search-form { display: contents; }
.sh-tb-flag-img { border-radius: 2px; display: block; object-fit: cover; }
/* Flag (and globe fallback) shown beside each language in the switcher list */
.sh-lang-flag    { border-radius: 2px; object-fit: cover; vertical-align: -2px; box-shadow: 0 0 0 1px var(--border); }
.sh-lang-flag-ph { display: inline-block; width: 20px; text-align: center; font-size: 13px; }

/* ── Admin footer notification bubble (migrated from inline <style> in layout/footer.php) ──
   Theme-aware via sh-tokens.css. Adapts to all 5 Theme Studio presets.
   Click surface limited to .sh-bubble-view link so body reads don't fire navigation. */
#sh-bubble-stage {
  position: fixed; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 10px; z-index: 9999; pointer-events: none;
  max-width: calc(100vw - 32px);
}
.sh-bubble {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 12px;
  width: 360px; max-width: calc(100vw - 32px);
  padding: 14px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.04);
  position: relative;
  font-family: var(--font);
  opacity: 0; transform: translateX(20px);
  transition: opacity .3s ease, transform .3s cubic-bezier(.2,.9,.3,1.2);
}
.sh-bubble.show { opacity: 1; transform: translateX(0); }
.sh-bubble-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px;
}
/* Action toast type variants (success/error/warn/info) override icon-block color */
.sh-bubble--success .sh-bubble-icon { background: var(--green-soft); color: var(--green); }
.sh-bubble--error   .sh-bubble-icon { background: var(--red-soft);   color: var(--red); }
.sh-bubble--warn    .sh-bubble-icon { background: var(--amber-soft); color: var(--amber); }
.sh-bubble--info    .sh-bubble-icon { background: var(--blue-soft);  color: var(--blue); }
.sh-bubble-body { flex: 1; min-width: 0; padding-right: 18px; }
.sh-bubble-ttl  { font-size: var(--fs-body, 14px); font-weight: var(--fw-bold, 700); color: var(--ink); margin: 0 0 2px; line-height: 1.3; }
.sh-bubble-msg  { font-size: var(--fs-sm, 13px);   color: var(--muted); margin: 0; line-height: 1.45; }
/* Inner <p>/<br> from controller-supplied HTML messages — reset browser defaults so
   they don't blow out the bubble's vertical rhythm. Multiple <p>'s (multi-error
   lists) get a small gap between them. */
.sh-bubble-msg p { margin: 0; }
.sh-bubble-msg p + p { margin-top: 4px; }
.sh-bubble-msg ul, .sh-bubble-msg ol { margin: 4px 0 0; padding-left: 18px; }
.sh-bubble-meta { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: var(--fs-xs, 11px); color: var(--faint); }
.sh-bubble-view {
  color: var(--accent); font-weight: var(--fw-semibold, 600);
  text-decoration: none; cursor: pointer;
}
.sh-bubble-view:hover { color: var(--accent-dark); text-decoration: underline; }
.sh-bubble-x {
  position: absolute; top: 8px; right: 8px;
  background: transparent; border: 0; color: var(--faint);
  font-size: 13px; cursor: pointer;
  padding: 5px 7px; border-radius: var(--radius); line-height: 1;
}
.sh-bubble-x:hover { background: var(--surface-2); color: var(--ink); }

/* Admin transaction details — flex column layout (shared across transaction views) */
.sh-tx-col { flex: 1; min-width: 280px; }

/* Badge size modifier — small variant (10px) */
.sh-badge-sm { font-size: 10px; }

/* Patient payment-gateway redirect pages — page-specific overrides.
   First-use: patient/onlineappointment/<gateway>/index.php (24 files: billplz, cashfree,
   ccavenue, flutterwave, instamojo, ipayafrica, jazzcash, midtrans, mollie, onepay,
   payfast, payhere, paypal, paystack, paytm, payu, pesapal, razorpay, skrill, sslcommerz,
   stripe, toyyibpay, twocheckout, walkingm).
   Scoped under body.sh-gateway-redirect to avoid colliding with the generic class names
   (.title, .product-description, .text-fine) that exist project-wide. */
body.sh-gateway-redirect { background: #ededed; }
body.sh-gateway-redirect .table2 tr.border_bottom td {
  box-shadow: none;
  border-radius: 0;
  border-bottom: 1px solid #e6e6e6;
}
body.sh-gateway-redirect .table2 td {
  padding-bottom: 3px;
  padding-top: 6px;
}
body.sh-gateway-redirect .title {
  color: #0084B4;
  font-weight: 600 !important;
  font-size: 15px !important;
  display: inline;
}
/* .paymentbg card is always white — on dark presets (variant-b) the global
   th/td, form-control rules read var(--ink/surface) which would be near-white.
   Override the tokens at the container level so every existing global rule
   resolves the correct light values without needing per-element !important blocks. */
body.sh-gateway-redirect .table2 {
  --ink:         #1A2733;
  --surface:     #fff;
  --border:      #E4E8ED;
  --accent:      #0084B4;
  --accent-soft: rgba(0, 132, 180, 0.15);
  color-scheme:  light;
}
body.sh-gateway-redirect .product-description {
  display: block;
  color: #999;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
body.sh-gateway-redirect .text-fine { color: #bf4f4d; }

/* Chat modal dialog — fixed-width centered (600px, responsive cap at 92vw).
   First-use: admin/chat/chat.php main message-thread modal. */
.sh-chat-modal-dialog { width: 600px; max-width: 92vw; }

/* Font-size utility — 15px (between Bootstrap fs-6 = 16px and fs-7 = no default).
   First-use: admin/frontoffice/follow_up_modal.php toolbar. Generic — reuse anywhere. */
.sh-fs-15 { font-size: 15px; }

/* RTL-immune right alignment — for currency/amount/numeric columns that should
   stay right-aligned even in RTL mode. BS5's .text-end flips to left in RTL via
   bootstrap.rtl.min.css; this class doesn't. Use .text-end (or .text-end text-rtl-left)
   for direction-aware alignment, .sh-text-right for hard right. */
.sh-text-right { text-align: right !important; }

/* ============================================================================
   Batch 2A — Embedded <style> migration (Phase 2, 2026-05-28)
   Patterns consolidated from 23 standalone <style> blocks across views.
   ============================================================================ */

/* Print-table layout — compact A4-page rows used by report/summary print views.
   First-use group (11 files): admin/operationtheatre/printBill, admin/pathology/printReport,
   admin/patient/{printopdsummary,printsummary,visitBill,visitreport/printBill},
   admin/radio/{printBill,printReport}, admin/deathreport/printBill,
   patient/{printopdSummary,printSummary}. */
.printablea4 { width: 100%; }
.printablea4 > tbody > tr > th,
.printablea4 > tbody > tr > td {
  padding: 2px 0;
  line-height: 1.42857143;
  vertical-align: top;
  font-size: 12px;
}

/* Print-only utility — hide controls when printing. First-use:
   admin/income/transactionReport, admin/staff/designation,
   admin/pathology/views/admin/accountant/accountantList. */
@media print {
  .no-print,
  .no-print * { display: none !important; }
}

/* Conference/Zoom join pages — Bootstrap 3-era navbar styling. Scoped under
   body.sh-conference-join. First-use: admin/conference/join.php + patient/join.php
   (both standalone HTML pages — must add the body class manually). */
body.sh-conference-join { padding-top: 50px; }
body.sh-conference-join .navbar-inverse {
  background-color: #313131;
  border-color: #404142;
}
body.sh-conference-join .navbar-header h4 {
  margin: 0; padding: 15px 15px; color: #c4c2c2;
}
body.sh-conference-join .navbar-right h5 {
  margin: 0; padding: 9px 5px; color: #c4c2c2;
}
body.sh-conference-join .navbar-inverse .navbar-collapse,
body.sh-conference-join .navbar-inverse .navbar-form {
  border-color: transparent;
}

/* easySelectable plugin styling — used by list selectors in:
   admin/birthreport/birth_report.php, admin/deathreport/death_report.php,
   admin/expmedicine/expmedicine_call.php. */
#easySelectable li.es-selected { background: #2196F3; color: #fff; }
.easySelectable {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* OT-search modal — vertically-centered scrollable container (82rem tall).
   First-use: admin/operationtheatre/otsearch.php */
#myModaledit {
  overflow-y: scroll;
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
  margin-left: auto; margin-right: auto;
  height: 82rem;
}

/* Sortable table rows — drag-handle cursor. First-use: admin/front/menus/edit.php */
.table-sortable tbody tr { cursor: move; }

/* #add_prescription modal — findings-section dropdown + select2 + medicine-table
   styling. Shared across admin/patient/_{add,edit}{ipd,opd}prescription.php
   (4 files). Scoped under #add_prescription to avoid global pollution from
   generic .findings-section and .wrapper-dropdown-3 selectors. */
#add_prescription .findings-section .select2-container .select2-selection--multiple {
  min-height: 38px; max-height: 96px; overflow-y: auto;
}
#add_prescription .findings-section .select2-selection__rendered {
  display: flex; flex-wrap: wrap; gap: 2px;
}
#add_prescription .findings-section .wrapper-dropdown-3 {
  width: 100%; position: relative;
}
#add_prescription .findings-section .wrapper-dropdown-3 .filterinput {
  padding-right: 28px; cursor: pointer;
  background-color: var(--surface); color: var(--ink); border-color: var(--border);
}
#add_prescription .findings-section .wrapper-dropdown-3::after {
  content: ""; position: absolute; top: 50%; right: 12px;
  width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  transform: translateY(-50%); pointer-events: none;
  transition: transform 0.15s ease;
}
#add_prescription .findings-section .wrapper-dropdown-3.active::after {
  transform: translateY(-50%) rotate(180deg);
}
#add_prescription .findings-section .wrapper-dropdown-3 .dropdown {
  z-index: 1055; border: 1px solid var(--border); border-radius: 4px;
  box-shadow: 0 6px 16px rgba(0,0,0,.12); background: var(--surface);
  padding: 0; margin: 4px 0 0; list-style: none;
}
#add_prescription .findings-section .wrapper-dropdown-3 .dropdown li {
  padding: 0; border-bottom: 1px solid var(--border);
}
#add_prescription .findings-section .wrapper-dropdown-3 .dropdown li:last-child {
  border-bottom: 0;
}
#add_prescription .findings-section .wrapper-dropdown-3 .dropdown li label {
  display: block; padding: 6px 12px; margin: 0; cursor: pointer;
  font-weight: normal; color: var(--ink);
}
#add_prescription .findings-section .wrapper-dropdown-3 .dropdown li:first-child label {
  font-weight: 600; color: var(--muted); cursor: default;
}
/* Keep Select2 search box compact — avoids large blank gap above option list */
#add_prescription .select2-dropdown .select2-search--dropdown { padding: 4px; }
#add_prescription .select2-dropdown .select2-search__field {
  height: 28px !important; line-height: 1.4 !important;
}
/* OPD medicine-table cell overrides — keep inputs top-aligned even when stock_info
   label grows the cell; restore 10px/12px padding (counter-overrides a pathology-
   billing rule that leaks via ID collision on #tableID); first-row top breathing. */
#add_prescription #tableID td { vertical-align: top; padding: 10px 12px !important; }
#add_prescription #tableID tr:first-child td { padding-top: 22px !important; }

/* Certificate print template — scoped CSS reset + page-specific helpers.
   First-use: admin/certificate/printcertificate.php (the outer .sh-certificate-print
   wrapper limits the * reset to this template only, preventing leak to the
   loading parent layout). Some classes (.tc-container, .tcmybg) are dead CSS
   from a prior revision but preserved here to avoid behavioral surprises. */
.sh-certificate-print * { padding: 0; margin: 0; }
.sh-certificate-print { font-family: 'arial'; }
.sh-certificate-print .tc-container {
  width: 100%; position: relative; text-align: center; padding: 2%;
}
.sh-certificate-print .tc-container tr td { vertical-align: bottom; }
.sh-certificate-print .tcmybg {
  background: top center;
  position: absolute;
  top: 0; left: 0; bottom: 0;
  z-index: 1;
}
.sh-certificate-print .tc-container tr td h1,
.sh-certificate-print .tc-container tr td h2,
.sh-certificate-print .tc-container tr td h3 {
  margin-top: 0; font-weight: normal;
}

/* TPA claim print template (.tpa-claim-wrap) is print-only — its CSS lives INLINE
   in application/views/admin/tpamanagement/_print_tpa_claim.php so it always reaches
   the popup() print iframe (external/cached stylesheets proved unreliable there). */

/* OPD visit-detail modal table — last-column 50px reservation for action buttons.
   First-use: admin/bill/opd/opd_visit_detail.php */
#opdVisitDetailTable th:last-child,
#opdVisitDetailTable td:last-child {
  width: 50px !important; min-width: 50px !important; max-width: 50px !important;
}

/* ── Batch 2B utility classes (2026-05-28) ──────────────────────────────────
   Project-wide inline style→class migration. Each class replaces a high-
   frequency inline style value found in 6–60+ view files.
   ─────────────────────────────────────────────────────────────────────────── */

/* Avatar/image cover — height:100px; width:100%; display:block; object-fit:cover
   Used on patient/staff photo thumbnails. 55 occurrences. */
.sh-avatar-cover { height: 100px; width: 100%; display: block; object-fit: cover; }

/* Section divider — border-bottom + margin spacing below section headers.
   53 occurrences. */
.sh-section-divider { border-bottom: 2px solid #cbd5e1; margin: 8px 0 16px; }

/* Horizontal padding 12px — padding:0 12px used in card/row wrappers. 60 occurrences. */
.sh-px-12 { padding: 0 12px; }

/* Flex row with 18px gap — display:flex; gap:18px; align-items:flex-start
   38 occurrences — used for side-by-side form sections. */
.sh-flex-gap18 { display: flex; gap: 18px; align-items: flex-start; }

/* Flex column 260px min-width — used in transaction/bill detail panels.
   14 occurrences. (.sh-tx-col covers min-width:280px — see line ~15110) */
.sh-flex-col-260 { flex: 1; min-width: 260px; }

/* Max-width 130px — used for narrow action/icon columns. 21 occurrences. */
.sh-mw-130 { max-width: 130px; }

/* Min-width 120px / 160px — column floor widths. 8+6 occurrences. */
.sh-mw-min-120 { min-width: 120px; }
.sh-mw-min-160 { min-width: 160px; }

/* Border accent color — border-color: var(--border) !important. 10 occurrences. */
.sh-border-color { border-color: var(--border) !important; }

/* Danger color text — color: var(--red). BS5 .text-danger uses hardcoded color;
   this uses token. 11 occurrences. */
.sh-text-danger { color: var(--red); }

/* Danger-bold combo — color:#c0392b; font-weight:700. 6 occurrences. */
.sh-text-danger-bold { color: #c0392b; font-weight: 700; }

/* Overflow visible — for Select2 / custom dropdowns inside cells. 8 occurrences. */
.sh-overflow-visible { overflow: visible; }

/* Height 6px — thin progress bar / divider line. 6 occurrences. */
.sh-h-6 { height: 6px; }

/* Summary note — small muted right-aligned text under amount fields.
   margin: 16px 0 0; font-size: 10.5px; color: #111; text-align: right. 6 occurrences. */
.sh-summary-note { margin: 16px 0 0; font-size: 10.5px; color: #111; text-align: right; }

/* Mini label — font-size:10px; font-weight:500; color:#111; margin-bottom:4px.
   6 occurrences — used for field labels in dense grids. */
.sh-label-mini { font-size: 10px; font-weight: 500; color: #111; margin-bottom: 4px; }

/* Micro caption — font-size:9.5px; color:#555; margin-top:2px. 6 occurrences. */
.sh-caption-sm { font-size: 9.5px; color: #555; margin-top: 2px; }

/* Micro muted — font-size:9px; color:#64748b; margin-top:2px. 6 occurrences. */
.sh-caption-xs { font-size: 9px; color: #64748b; margin-top: 2px; }

/* Section heading tag — font-size:11px; text-transform:uppercase; letter-spacing:.05em;
   color:var(--ink). 6 occurrences. */
.sh-tag-heading { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); }

/* Button font override — font-weight:500; text-transform:none. 6 occurrences. */
.sh-btn-normal { font-weight: 500; text-transform: none; }

/* Clear float both — 5 occurrences. */
.sh-clear { clear: both; overflow: hidden; }

/* ── Width+alignment column classes (Next-1 batch, 2026-05-28) ──────────────
   DataTable th/td column widths used alongside .sh-text-right for numeric
   columns (bill/pharmacy/pathology/radio tables). Width-only + alignment
   combo replaces single style="width:X%;text-align:right" inline value.
   ─────────────────────────────────────────────────────────────────────────── */
.sh-col-12 { width: 12%; }
.sh-col-13 { width: 13%; }
.sh-col-16 { width: 16%; }
.sh-col-18 { width: 18%; }
.sh-col-20 { width: 20%; }
.sh-col-22 { width: 22%; }
.sh-col-25 { width: 25%; }
.sh-col-28 { width: 28%; }
.sh-col-80 { width: 80%; }

/* Print float-column layout — legacy float grid used in print templates. */
.sh-print-right-30 { width: 30%; float: right; }
.sh-print-right-50 { width: 50%; float: right; }
.sh-print-right-70 { width: 70%; float: right; font-size: 12px; }
.sh-print-left-40  { width: 40%; float: left; }
.sh-print-left-56  { width: 56%; float: left; margin-left: 5px; }

/* ── Phase 2 utility classes (2026-05-28) ────────────────────────────────────
   Continuation of Batch 2B inline migration for MED-risk files.
   ─────────────────────────────────────────────────────────────────────────── */

/* Token ink color — color:var(--ink). 4 occurrences. */
.sh-text-ink { color: var(--ink); }

/* Flex half-column — flex:1;min-width:45%. 4 occurrences — used in 2-col detail grids. */
.sh-flex-col-45 { flex: 1; min-width: 45%; }

/* Margin utilities (pixel-precise where BS5 spacing doesn't fit) */
.sh-mb-3px  { margin-bottom: 3px; }
.sh-mt-14   { margin-top: 14px; }
.sh-mt-12   { margin-top: 12px; }

/* Font-size utilities — px/pt values not covered by BS5 fs-* scale */
.sh-fs-11   { font-size: 11px; }
.sh-fs-13   { font-size: 13px; }
.sh-fs-10pt { font-size: 10pt; }

/* Fixed-width full table — table-layout:fixed;width:100%. 3 occurrences. */
.sh-table-fixed { table-layout: fixed; width: 100%; }

/* Inline note box — highlighted note/remark block in prescription/bill forms.
   background:#f9fafb; border-left:3px solid #cbd5e1; padding; font-size:10.5px. 7 occurrences. */
.sh-note-box {
  margin: 10px 0 0;
  padding: 8px 10px;
  background: #f9fafb;
  border-left: 3px solid #cbd5e1;
  font-size: 10.5px;
  color: #111;
}

/* Highlighted value cell — fcfcfc bg + left accent + bold text.
   background:#fcfcfc;border-left:2px solid #cbd5e1;padding:4px 10px;
   font-size:11.5px;font-weight:700;color:#111. 8 occurrences (2 variants). */
.sh-value-cell {
  background: #fcfcfc;
  border-left: 2px solid #cbd5e1;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #111;
}

/* Small dashed label — font-size:10px;font-weight:500;color:#111;
   margin-bottom:6px;border-bottom:1px dashed #a1a1aa;padding-bottom:2px.
   4 occurrences — section sub-labels. */
.sh-label-dashed {
  font-size: 10px;
  font-weight: 500;
  color: #111;
  margin-bottom: 6px;
  border-bottom: 1px dashed #a1a1aa;
  padding-bottom: 2px;
}

/* Compact caption bold — font-size:9.5px;font-weight:500;color:#111;margin-bottom:3px.
   4 occurrences. */
.sh-caption-bold { font-size: 9.5px; font-weight: 500; color: #111; margin-bottom: 3px; }

/* Inline list — margin:0;padding:0;list-style:none;font-size:11.5px;
   font-weight:700;color:#111. 4 occurrences — summary amount lists. */
.sh-list-inline-bold {
  margin: 0; padding: 0; list-style: none;
  font-size: 11.5px; font-weight: 700; color: #111;
}

/* Flex text — flex:1;font-size:11px;color:#1e293b;line-height:1.6. 4 occurrences. */
.sh-flex-text { flex: 1; font-size: 11px; color: #1e293b; line-height: 1.6; }

/* Compact cell padding — padding:6px 8px;font-size:10.5px. 4 occurrences. */
.sh-cell-sm { padding: 6px 8px; font-size: 10.5px; }

/* Tiny spacer — height:10px;clear:both. 3 occurrences. */
.sh-spacer-10 { height: 10px; clear: both; }

/* Padding bottom 5px. 3 occurrences. */
.sh-pb-5px { padding-bottom: 5px; }

/* Bootstrap 3 col-sm-* print grid — BS5 dropped these rules; antenatal
   finding views use BS3 col-sm columns for print layout. Added globally so
   any page using .col-sm-X columns prints correctly (was already global —
   the <style> block in patient/antenatalfinding.php sits before <html>
   which makes it a global stylesheet anyway).
   Migration: patient/antenatalfinding.php + patient/ipdantenatalfinding.php */
@media print {
  .col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,
  .col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12 { float: left; }
  .col-sm-12 { width: 100%; }
  .col-sm-11 { width: 91.66666667%; }
  .col-sm-10 { width: 83.33333333%; }
  .col-sm-9  { width: 75%; }
  .col-sm-8  { width: 66.66666667%; }
  .col-sm-7  { width: 58.33333333%; }
  .col-sm-6  { width: 50%; }
  .col-sm-5  { width: 41.66666667%; }
  .col-sm-4  { width: 33.33333333%; }
  .col-sm-3  { width: 25%; }
  .col-sm-2  { width: 16.66666667%; }
  .col-sm-1  { width: 8.33333333%; }
  .col-sm-pull-12 { right: 100%; }    .col-sm-pull-0  { right: auto; }
  .col-sm-push-12 { left: 100%; }     .col-sm-push-0  { left: auto; }
  .offset-sm-12   { margin-left: 100%; } .offset-sm-0 { margin-left: 0%; }
  .offset-sm-11   { margin-left: 91.66666667%; }
  .offset-sm-10   { margin-left: 83.33333333%; }
  .offset-sm-9    { margin-left: 75%; }
  .offset-sm-8    { margin-left: 66.66666667%; }
  .offset-sm-7    { margin-left: 58.33333333%; }
  .offset-sm-6    { margin-left: 50%; }
  .offset-sm-5    { margin-left: 41.66666667%; }
  .offset-sm-4    { margin-left: 33.33333333%; }
  .offset-sm-3    { margin-left: 25%; }
  .offset-sm-2    { margin-left: 16.66666667%; }
  .offset-sm-1    { margin-left: 8.33333333%; }
  .visible-xs { display: none !important; }
  .hidden-xs  { display: block !important; }
  table.hidden-xs { display: table; }
  tr.hidden-xs    { display: table-row !important; }
  th.hidden-xs, td.hidden-xs { display: table-cell !important; }
  .hidden-xs.hidden-print { display: none !important; }
  .hidden-sm  { display: none !important; }
  .visible-sm { display: block !important; }
  table.visible-sm { display: table; }
  tr.visible-sm    { display: table-row !important; }
  th.visible-sm, td.visible-sm { display: table-cell !important; }
}

/* ── ID Card print templates ────────────────────────────────────────────────
   Shared CSS for all 4 ID card views:
     admin/staffidcard/staffidcardpreview.php
     admin/patientidcard/patientidcardpreview.php
     admin/generatestaffidcard/generatemultiplestaffidcard.php
     admin/patientidcard/generatemultiple.php

   Dynamic color theming uses CSS custom property --idcard-header set as
   inline style on the outer table:
     <table class="tc-container" style="--idcard-header: <?= $color ?>">
   For preview files the fallback #453278 is the default template color.
   ─────────────────────────────────────────────────────────────────────────── */
.sh-idcard-print * { margin: 0; padding: 0; }
.sh-idcard-print table {
  font-family: 'arial'; margin: 0; padding: 0; font-size: 12px; color: #000;
}
.sh-idcard-print .tc-container {
  width: 100%; position: relative; text-align: center;
  margin-bottom: 60px; padding-bottom: 10px;
}
.sh-idcard-print .tcmybg {
  background: top center;
  background-size: contain;
  position: absolute; left: 0; bottom: 10px;
  width: 160px; height: 160px;
  margin-left: auto; margin-right: auto;
  right: 0; opacity: 0.10;
}
.sh-idcard-print .patientmain { background: #efefef; width: 100%; margin-bottom: 30px; }
.sh-idcard-print .patienttop img { vertical-align: initial; }
.sh-idcard-print .patienttop {
  background: var(--idcard-header, #453278);
  padding: 2px; color: #fff; overflow: hidden;
  position: relative; z-index: 1;
}
.sh-idcard-print .sttext1 { font-size: 24px; font-weight: bold; line-height: 30px; }
.sh-idcard-print .stgray { background: #efefef; padding-top: 5px; padding-bottom: 10px; }
.sh-idcard-print .staddress { margin-bottom: 0; padding-top: 2px; }
.sh-idcard-print .stdivider { border-bottom: 2px solid #000; margin-top: 5px; margin-bottom: 5px; }
.sh-idcard-print .stlist { padding: 0; margin: 0; list-style: none; }
.sh-idcard-print .stlist li {
  text-align: left; display: inline-block; width: 100%; padding: 0 5px;
}
.sh-idcard-print .stlist li span { width: 65%; float: right; }
.sh-idcard-print .stimg { width: 80px; height: auto; }
.sh-idcard-print .stimg img { width: 100%; height: auto; border-radius: 2px; display: block; }
.sh-idcard-print .staround { padding: 3px 10px 3px 0; position: relative; overflow: hidden; }
.sh-idcard-print .staround2 { position: relative; z-index: 9; }
.sh-idcard-print .stbottom {
  background: var(--idcard-header, #453278);
  height: 20px; width: 100%; clear: both; margin-bottom: 5px;
}
.sh-idcard-print .principal { margin-top: -40px; margin-right: 10px; float: right; }
.sh-idcard-print .stred { color: #000; }
.sh-idcard-print .spanlr { padding-left: 5px; padding-right: 5px; }
.sh-idcard-print .cardleft { width: 20%; float: left; }
.sh-idcard-print .cardright { width: 77%; float: right; }
.sh-idcard-print .width32 { width: 32.75%; padding: 3px; float: left; }
.sh-idcard-print .barcode { display: block; text-align: center; margin-top: 1px; }
.sh-idcard-print .vertlist { padding: 0; margin: 0; list-style: none; }
.sh-idcard-print .vertlist li {
  text-align: left; display: inline-block; width: 100%; color: #000; padding-bottom: 2px;
}
.sh-idcard-print .vertlist li span { width: 55%; float: right; }
.sh-idcard-print .barcodeimg { width: 80px; height: auto; display: block; margin-top: 2px; text-align: center; }
.sh-idcard-print .barcodeimg img { width: 100%; height: auto; border-radius: 2px; display: block; margin-top: 2px; }
/* Title td — uses CSS var so it picks up the same header_color as .patienttop */
.sh-idcard-print .sh-idcard-title-td {
  color: #fff; font-size: 16px; padding: 2px 0 0;
  position: relative; z-index: 1;
  background: var(--idcard-header, #453278);
  text-transform: uppercase;
}

/* table.example column-layout modifiers — used where a DataTable needs fixed
   column proportions. Add one modifier class directly on the <table>.
   Group I migration (2026-05-28). */

/* 1-column: first col fills all available space. First-use:
   admin/expensehead/expenseheadList, admin/finding/categorylist */
table.example.sh-ex-col1-full th:nth-child(1),
table.example.sh-ex-col1-full td:nth-child(1) { width: 100% !important; }

/* 3-column: 25% / 20% / 55%. First-use: admin/finding/findinglist */
table.example.sh-ex-cols-25-20-55 th:nth-child(1),
table.example.sh-ex-cols-25-20-55 td:nth-child(1) { width: 25% !important; }
table.example.sh-ex-cols-25-20-55 th:nth-child(2),
table.example.sh-ex-cols-25-20-55 td:nth-child(2) { width: 20% !important; }
table.example.sh-ex-cols-25-20-55 th:nth-child(3),
table.example.sh-ex-cols-25-20-55 td:nth-child(3) { width: 55% !important; }

/* 4-column: 25% / 20% / 40% / 15% action. First-use: admin/finding/findinglist (action col added) */
table.example.sh-ex-cols-25-20-40-15 th:nth-child(1),
table.example.sh-ex-cols-25-20-40-15 td:nth-child(1) { width: 25% !important; }
table.example.sh-ex-cols-25-20-40-15 th:nth-child(2),
table.example.sh-ex-cols-25-20-40-15 td:nth-child(2) { width: 20% !important; }
table.example.sh-ex-cols-25-20-40-15 th:nth-child(3),
table.example.sh-ex-cols-25-20-40-15 td:nth-child(3) { width: 40% !important; }
table.example.sh-ex-cols-25-20-40-15 th:nth-child(4),
table.example.sh-ex-cols-25-20-40-15 td:nth-child(4) { width: 15% !important; }

/* 2-column: 85% / 15% action. First-use: admin/finding/categorylist (action col added) */
table.example.sh-ex-cols-85-15 th:nth-child(1),
table.example.sh-ex-cols-85-15 td:nth-child(1) { width: 85% !important; }
table.example.sh-ex-cols-85-15 th:nth-child(2),
table.example.sh-ex-cols-85-15 td:nth-child(2) { width: 15% !important; }

/* 2-column fixed: 25% / 75% with table-layout:fixed. First-use:
   admin/frontoffice/complainttypeview, admin/frontoffice/sourceview */
table.example.sh-ex-cols-25-75 { table-layout: fixed !important; }
table.example.sh-ex-cols-25-75 th:nth-child(1),
table.example.sh-ex-cols-25-75 td:nth-child(1) { width: 25% !important; }
table.example.sh-ex-cols-25-75 th:nth-child(2),
table.example.sh-ex-cols-25-75 td:nth-child(2) { width: 75% !important; }

/* 3-column variant (source list): name / description / action.
   Separate from .sh-ex-cols-25-75 which is shared with the 2-col complaint-type list. */
table.example.sh-ex-cols-25-60-15 { table-layout: fixed !important; }
table.example.sh-ex-cols-25-60-15 th:nth-child(1),
table.example.sh-ex-cols-25-60-15 td:nth-child(1) { width: 25% !important; }
table.example.sh-ex-cols-25-60-15 th:nth-child(2),
table.example.sh-ex-cols-25-60-15 td:nth-child(2) { width: 60% !important; }
table.example.sh-ex-cols-25-60-15 th:nth-child(3),
table.example.sh-ex-cols-25-60-15 td:nth-child(3) { width: 15% !important; }

/* ── Next-4 utility classes (2026-05-28) ─────────────────────────────────────
   Bespoke combos from patient/prescription/IPD profile heavy files.
   ─────────────────────────────────────────────────────────────────────────── */
.sh-ipd-vital-card-sm { padding:10px 12px; background:var(--surface-2); border-radius:var(--radius-md); border-left:3px solid var(--border); }
.sh-text-11-5    { font-size:11.5px; color:#111; }
.sh-caption-11-top { font-size:11px; margin-top:2px; }
.sh-scroll-flex  { overflow-y:auto; flex:1; }
.sh-flex-row-g20-mb14 { display:flex; gap:20px; margin-bottom:14px; }
.sh-flex-row-g20-mb10 { display:flex; gap:20px; margin-bottom:10px; }
.sh-divider-light   { border-bottom:1px solid #e2e8f0; margin:0 0 12px; }
.sh-divider-light-12 { border-bottom:1px solid #e2e8f0; margin:12px 0; }
.sh-vital-value  { font-size:18px; font-weight:800; margin-top:2px; }
.sh-text-11-line { font-size:11px; color:#111; line-height:1.6; }
.sh-label-11-bold { font-size:11px; font-weight:600; margin-bottom:4px; }
.sh-list-12      { margin:0; padding-left:18px; font-size:12px; }
.sh-tag-muted    { font-size:10px; text-transform:uppercase; color:var(--muted); font-weight:600; letter-spacing:.04em; }
.sh-label-10-bold { font-size:10px; font-weight:600; color:#111; margin-bottom:4px; }
.sh-border-top-light { border-top:1px solid var(--border-light); margin-top:8px; }
.sh-badge-warn   { font-size:9px; font-weight:600; color:#92400e; background:#fef3c7; padding:1px 5px; border-radius:3px; }
.sh-text-11-pad  { font-size:11px; color:#111; line-height:1.6; margin-bottom:14px; padding:0 4px; }
.sh-header-bold  { font-weight:700; font-size:13px; margin-left:8px; letter-spacing:1px; }
.sh-text-upper-bold { text-transform:uppercase; letter-spacing:2px; font-weight:700; }
.sh-fs-10        { font-size:10px; }
.sh-fs-11-c111   { font-size:11px; color:#1e293b; line-height:1.6; }
.sh-mb-12-11     { margin-bottom:12px; font-size:11px; }
.sh-mb-12        { margin-bottom:12px; }
.sh-pt-8         { padding-top:8px; }

/* ── Radiology edit table (admin/bill/radiology/_editradiology.php
   + admin/radio/_editradiology.php) ──────────────────────────────────────── */
.sh-radio-edit-table th,
.sh-radio-edit-table td { padding: 2px 4px !important; }
.sh-radio-edit-table th:last-child,
.sh-radio-edit-table td:last-child { width: 20px !important; min-width: 20px !important; max-width: 20px !important; }

/* Fixed width 130px (companion utility to existing sh-mw-130 max-width) */
.sh-w-130 { width: 130px; }

/* ── Radiology edit table — wide variant (admin/radio/_editradiology.php)
   Last column is 36px (vs 20px in .sh-radio-edit-table) to fit the
   .btn-sm delete button without overflow / horizontal scrollbar. ───────── */
.sh-radio-edit-table-wide th,
.sh-radio-edit-table-wide td { padding: 2px 4px !important; }
.sh-radio-edit-table-wide th:last-child,
.sh-radio-edit-table-wide td:last-child { width: 36px !important; min-width: 36px !important; max-width: 36px !important; }

/* Generic overflow utility — no BS5 equivalent for x-axis only */
.sh-overflow-x-hidden { overflow-x: hidden; }

/* ── Vital tiles (patient/profile.php vital-strip grid).
   Dynamic per-tile colors via --vital-border / --vital-label / --vital-value
   set inline on each element. Distinct from .sh-vital-card (which is 16px
   value + single --v-col shared color). ──────────────────────────────────── */
.sh-vital-tile        { padding:10px 12px; background:var(--surface-2); border-radius:6px; border-left:3px solid var(--vital-border); }
.sh-vital-tile-label  { font-size:10px; text-transform:uppercase; color:var(--vital-label); font-weight:600; }
.sh-vital-tile-value  { font-size:18px; font-weight:800; margin-top:2px; color:var(--vital-value); }

/* ── Payment success confirmation (patient/pay/successinvoice → patient/invoice.php).
   Centered success card with an animated green check. Replaces the old plain
   .alert-success banner. Token-driven so it themes for all 3 variants. ───────── */
.sh-pay-success {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 24px 16px;
}
.sh-pay-success-card {
  width: 100%;
  max-width: 460px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 32px 36px;
  animation: sh-pay-success-rise .45s cubic-bezier(.21,.61,.35,1) both;
}
.sh-pay-success-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-soft);
  color: var(--green);
  font-size: 38px;
  position: relative;
  animation: sh-pay-success-pop .5s .12s cubic-bezier(.18,1.25,.4,1) both;
}
/* Expanding ring pulse behind the check */
.sh-pay-success-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--green);
  opacity: 0;
  animation: sh-pay-success-ring 1.4s .35s ease-out infinite;
}
.sh-pay-success-title {
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: var(--ls-tight);
}
.sh-pay-success-text {
  font-size: var(--fs-body);
  color: var(--muted);
  margin: 0 0 26px;
  line-height: var(--lh-normal);
}
.sh-pay-success-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
@keyframes sh-pay-success-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sh-pay-success-pop {
  0%   { transform: scale(.4); opacity: 0; }
  100% { transform: scale(1);  opacity: 1; }
}
@keyframes sh-pay-success-ring {
  0%   { transform: scale(.85); opacity: .55; }
  100% { transform: scale(1.4); opacity: 0; }
}
/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .sh-pay-success-card,
  .sh-pay-success-icon { animation: none; }
  .sh-pay-success-icon::after { display: none; }
}

/* ─────────────────────────────────────────────────────────────
   TWOCHECKOUT PAY FORM  ·  patient/payment/twocheckout/index.php
   The amount/phone/email rows live in an auto-layout <table>, which
   collapses the value column to its (tiny) content — squashing the
   Phone/Email inputs. Switch to fixed layout so the input column
   keeps a usable width regardless of content length.
   ───────────────────────────────────────────────────────────── */
.sh-2co-pay-table { table-layout: fixed; width: 100%; }
.sh-2co-pay-table th { width: 42%; vertical-align: middle; }
.sh-2co-pay-table td { width: 58%; vertical-align: middle; }
.sh-2co-pay-table td .form-control { width: 100%; display: inline-block; }
.sh-2co-pay-table td .alert-danger { display: block; margin-top: 4px; background: transparent; }

/* ─────────────────────────────────────────────────────────────
   BLOOD ISSUE / COMPONENT ISSUE MODAL HEADER  ·  admin/bloodbankstatus
   The "Apply TPA" checkbox label sits in the modal header next to the
   title; force it white so it reads clearly against the header.
   ───────────────────────────────────────────────────────────── */
#bloodIssueModal .modal-header .form-check-label,
#componentIssueModal .modal-header .form-check-label { color: #fff; }
