@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap");
/* ==========================================================================
   Clinic Pro — App UI (dashboards for all roles)
   Visual language: "CALM MEDICAL GLASS"
   - soft mint → sky → lavender backdrop with blurred blobs
   - frosted-glass surfaces, 20–24px radii, airy spacing
   - floating vertical icon dock (right) + glass top bar
   - bottom glass tab bar + "المزيد" sheet on phones
   Builds on ../../../shared/css/base.css
   ========================================================================== */

:root {
  --font: "Noto Sans Arabic", "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;

  /* palette */
  --brand: #0f9b8e;
  --brand-600: #0b867a;
  --brand-700: #0a6b62;
  --brand-soft: #e1f5f1;
  --sky: #3b82f6;
  --sky-soft: #e6f0fe;
  --accent: #3b82f6;
  --accent-soft: #e6f0fe;
  --coral: #f2706b;
  --coral-soft: #fde8e6;
  --lavender: #8b7cf6;
  --lavender-soft: #efecfd;

  --success: #12a37a; --success-soft: #e0f6ee;
  --warning: #d98a1c; --warning-soft: #fdf1dc;
  --danger:  #e5534b; --danger-soft:  #fde7e5;
  --info:    #3b82f6; --info-soft:    #e6f0fe;

  --text: #1e293b;
  --text-2: #64748b;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, .22);
  --line: rgba(148, 163, 184, .18);
  --bg: rgba(241, 247, 250, .7);
  --surface: rgba(255, 255, 255, .72);
  --surface-2: rgba(248, 251, 253, .75);

  /* glass */
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .86);
  --glass-border: rgba(255, 255, 255, .85);
  --glass-blur: blur(18px) saturate(150%);
  --glass-shadow: 0 10px 30px -12px rgba(30, 64, 90, .18), 0 2px 6px rgba(30, 64, 90, .04);
  --shadow-sm: 0 1px 2px rgba(30, 64, 90, .05);
  --shadow: 0 10px 30px -12px rgba(30, 64, 90, .18);
  --shadow-lg: 0 24px 60px -18px rgba(30, 64, 90, .28);

  --radius: 20px;
  --radius-lg: 24px;

  /* shell metrics */
  --dock-w: 76px;
  --dock-w-open: 252px;
  --dock-gap: 16px;
  --header-h: 72px;
  --tabbar-h: 70px;
  --gradient-brand: linear-gradient(135deg, #2cc4b2 0%, #0f9b8e 48%, #3b82f6 100%);

  /* legacy aliases (page-level inline styles may reference these) */
  --sidebar: #1e293b;
  --sidebar-2: #334155;
  --sidebar-text: #94a3b8;
  --sidebar-w: calc(var(--dock-w) + var(--dock-gap) * 2);
}

/* ---------- Backdrop ---------- */
body.app {
  font-family: var(--font);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  background: linear-gradient(135deg, #e6f7f3 0%, #e8f1fd 52%, #f1edfb 100%) fixed;
  background-color: #eaf4f8;
}
body.app::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vw 38vw at 92% 6%, rgba(15, 155, 142, .20), transparent 62%),
    radial-gradient(34vw 34vw at 6% 30%, rgba(59, 130, 246, .16), transparent 62%),
    radial-gradient(40vw 40vw at 60% 104%, rgba(139, 124, 246, .16), transparent 62%),
    radial-gradient(22vw 22vw at 40% 40%, rgba(255, 255, 255, .55), transparent 70%);
  filter: blur(20px);
}
.hidden { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }

/* Glass surface mixin. Floating chrome (dock, top bar, menus, sheets, modals) gets a real
   backdrop blur. In-page cards only sit on the already-blurred backdrop, so they use the
   translucent fill without backdrop-filter: cheaper, and it keeps in-card dropdowns
   (ICD search, row menus...) free of extra stacking contexts. */
.card, .dock, .topbar-app, .dropdown-menu, .search-panel, .modal, .tabbar, .more-sheet, .dock-tip {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.dock, .topbar-app, .dropdown-menu, .search-panel, .modal, .tabbar, .more-sheet {
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

/* ---------- Layout ---------- */
.main {
  margin-right: calc(var(--dock-w) + var(--dock-gap) * 2);
  min-height: 100vh; display: flex; flex-direction: column;
  transition: margin .28s cubic-bezier(.2, .8, .2, 1);
}
body.dock-pinned .main { margin-right: calc(var(--dock-w-open) + var(--dock-gap) * 2); }
.content { padding: 26px 28px 48px 28px; padding-right: 4px; flex: 1; width: 100%; max-width: 1600px; margin-inline: auto; }

/* ---------- Floating dock ---------- */
.dock {
  position: fixed; z-index: 40; right: var(--dock-gap); top: var(--dock-gap); bottom: var(--dock-gap);
  width: var(--dock-w); border-radius: 30px; padding: 12px 10px;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  transition: width .28s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}
body.dock-pinned .dock { width: var(--dock-w-open); }
.dock-label { white-space: nowrap; opacity: 0; width: 0; overflow: hidden; transition: opacity .18s ease; }
body.dock-pinned .dock-label { opacity: 1; width: auto; }

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 4px 10px; color: var(--text); flex-shrink: 0; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 50%; background: var(--gradient-brand);
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 10px 22px -6px rgba(15, 155, 142, .55), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.brand-mark svg { width: 22px; height: 22px; color: #fff; }
/* Product logo (Clinic Pro) */
.brand-logo { width: 48px; height: 48px; flex-shrink: 0; display: block; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(15,155,142,.22)); }
.brand-name { font-weight: 700; font-size: 17px; line-height: 1.15; }
.brand-name small { display: block; font-size: 11px; font-weight: 500; color: var(--text-2); margin-top: 2px; }
.role-chip { display: none; }
body.dock-pinned .role-chip {
  display: flex; margin: 0 4px 6px; padding: 9px 12px; border-radius: 16px; background: rgba(15, 155, 142, .08);
  align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); flex-shrink: 0;
}
.role-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(18, 163, 122, .16); flex-shrink: 0; }
.role-chip b { color: var(--text); font-weight: 600; }

.nav-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -6px; padding: 4px 6px;
  display: flex; flex-direction: column; gap: 4px;
  scrollbar-width: none;
  mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 14px), transparent 100%);
}
.nav-scroll::-webkit-scrollbar { display: none; }
.nav-section { height: 14px; display: grid; place-items: center; flex-shrink: 0; }
.nav-section span { display: none; }
.nav-section::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: rgba(100, 116, 139, .22); }
body.dock-pinned .nav-section { height: auto; place-items: start; padding: 12px 14px 4px; }
body.dock-pinned .nav-section::before { display: none; }
body.dock-pinned .nav-section span { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .2px; }

.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 4px; border-radius: 999px; position: relative;
  color: var(--text-2); font: inherit; font-weight: 500; font-size: 14px; background: none; border: 0; cursor: pointer;
  text-align: right; width: 100%; flex-shrink: 0; transition: background .18s, color .18s;
}
.dock-ic {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; position: relative; flex-shrink: 0;
  transition: background .18s, color .18s, box-shadow .18s, transform .18s;
}
.dock-ic svg { width: 21px; height: 21px; }
.nav-link:hover .dock-ic { background: rgba(15, 155, 142, .09); color: var(--brand); }
body.dock-pinned .nav-link:hover { background: rgba(255, 255, 255, .55); }
.nav-link:focus-visible { outline: none; }
.nav-link:focus-visible .dock-ic { box-shadow: 0 0 0 3px rgba(15, 155, 142, .3); }
.nav-link.active { color: var(--text); font-weight: 600; }
.nav-link.active .dock-ic {
  background: linear-gradient(145deg, #19b3a3, #0f9b8e 60%, #0b867a); color: #fff;
  box-shadow: 0 10px 20px -8px rgba(15, 155, 142, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}
body.dock-pinned .nav-link.active { background: rgba(15, 155, 142, .1); }
.nav-link .ext { width: 14px; height: 14px; opacity: .45; margin-right: auto; margin-left: 10px; display: none; }
body.dock-pinned .nav-link .ext { display: block; }
.nav-link .count {
  position: absolute; top: 2px; left: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--coral); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid #fff; line-height: 1;
}
.nav-link .count.soft { background: #f6b04a; }
.nav-link.active .count { border-color: #e8f6f3; }

.sidebar-foot { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); flex-shrink: 0; }
.by-almgrat { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 11px; padding: 6px 0 2px; }
body.dock-pinned .sidebar-foot .by-almgrat { justify-content: flex-start; padding-inline: 16px; }
.by-almgrat img { width: 20px; height: 20px; opacity: .85; }

/* Dock tooltip (floating, outside the scroll area) */
.dock-tip {
  position: fixed; z-index: 90; transform: translateY(-50%) translateX(6px); pointer-events: none;
  background: rgba(30, 41, 59, .9); color: #fff; border-color: rgba(255, 255, 255, .12);
  font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  opacity: 0; visibility: hidden; transition: opacity .15s, transform .15s;
}
.dock-tip.show { opacity: 1; visibility: visible; transform: translateY(-50%); }

/* ---------- Glass top bar ---------- */
.topbar-app {
  position: sticky; top: var(--dock-gap); z-index: 30; height: var(--header-h);
  margin: var(--dock-gap) 0 0 28px; border-radius: 24px;
  display: flex; align-items: center; gap: 18px; padding: 0 14px 0 14px; padding-right: 22px;
}
.menu-toggle { display: none !important; }
.tb-brand { display: none; }
.tb-brand .brand-mark { width: 40px; height: 40px; }
.tb-brand .brand-mark svg { width: 19px; height: 19px; }
.tb-brand .brand-logo { width: 40px; height: 40px; }
.tb-greet { display: flex; flex-direction: column; min-width: 0; flex-shrink: 0; }
.tb-greet b { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.3; white-space: nowrap; }
.tb-greet small { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.tb-greet small svg { width: 13px; height: 13px; color: var(--brand); }
.tb-greet .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); display: inline-block; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .6); display: grid; place-items: center; color: var(--text-2);
  cursor: pointer; position: relative; transition: .18s;
}
.icon-btn:hover { color: var(--brand); background: #fff; box-shadow: 0 6px 16px -6px rgba(15, 155, 142, .35); }
.icon-btn .dot-count {
  position: absolute; top: -3px; left: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--coral); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff;
}

.global-search { position: relative; flex: 1; min-width: 0; max-width: 520px; margin-inline: auto; }
.global-search input {
  width: 100%; height: 46px; border: 1px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .55);
  border-radius: 999px; padding: 0 46px 0 64px; font: inherit; font-size: 14px; color: var(--text); transition: .18s;
}
.global-search input::placeholder { color: var(--muted); }
.global-search input:focus { outline: none; background: #fff; border-color: rgba(15, 155, 142, .45); box-shadow: 0 0 0 5px rgba(15, 155, 142, .12); }
.global-search > svg { position: absolute; right: 17px; top: 50%; transform: translateY(-50%); color: var(--brand); }
.global-search kbd {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font: 600 11px var(--font); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 1px 8px; background: rgba(255, 255, 255, .8);
}
.search-results { position: absolute; top: calc(100% + 10px); inset-inline: 0; z-index: 60; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.user-btn {
  display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; padding-right: 4px; padding-left: 12px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .55);
  cursor: pointer; font: inherit; text-align: right; transition: .18s;
}
.user-btn:hover { background: #fff; }
.user-btn .meta b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.25; }
.user-btn .meta small { font-size: 11.5px; color: var(--text-2); }
.user-btn > svg { color: var(--muted); width: 16px; }

/* ---------- Dropdowns ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 12px); left: 0; min-width: 250px; z-index: 50;
  background: rgba(255, 255, 255, .96); border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top left; transition: .18s ease;
}
.dropdown.open > .dropdown-menu, .dropdown-menu.show { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a, .dropdown-menu button.item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 14px; color: var(--text);
  font: inherit; font-size: 14px; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: right;
}
.dropdown-menu a:hover, .dropdown-menu button.item:hover { background: rgba(15, 155, 142, .08); }
.dropdown-menu a svg, .dropdown-menu button.item svg { color: var(--text-2); }
.dropdown-menu .danger, .dropdown-menu .danger svg { color: var(--danger); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.dropdown-head { padding: 12px 12px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dropdown-head b { font-size: 15px; font-weight: 700; }
.notif-menu { width: 390px; padding: 0; overflow: hidden; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); position: relative; }
.notif-item.unread { background: rgba(15, 155, 142, .06); }
.notif-item.unread::after { content: ""; position: absolute; left: 16px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(15, 155, 142, .15); }
.notif-item p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.notif-item b { font-size: 14px; display: block; font-weight: 600; }
.notif-item small { font-size: 12px; color: var(--muted); }
.notif-foot { display: block; text-align: center; padding: 13px; border-top: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--brand); }

.search-panel { background: rgba(255, 255, 255, .96); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 8px; max-height: 440px; overflow-y: auto; }
.search-group { font-size: 11px; font-weight: 600; color: var(--muted); padding: 10px 12px 4px; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 16px; color: var(--text); }
.search-item:hover, .search-item.focus { background: rgba(15, 155, 142, .08); }
.search-item .sub { font-size: 12px; color: var(--text-2); }
.search-item .tail { margin-right: auto; }
.search-empty { padding: 26px; text-align: center; color: var(--text-2); font-size: 14px; }

/* ---------- Mobile tab bar + "المزيد" sheet ---------- */
.tabbar, .more-sheet { display: none; }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(30, 41, 59, .28); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: 55; opacity: 0; visibility: hidden; transition: .22s; }

/* ---------- Page header ---------- */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb svg { width: 14px; height: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; padding-inline: 4px; }
.page-head h1 { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -.2px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons (extend base) ---------- */
.btn { border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 600; transition: .18s; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 999px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 13px 24px; font-size: 15px; border-radius: 999px; }
.btn-primary { background: linear-gradient(135deg, #14ad9e, #0f9b8e 55%, #0b867a); color: #fff; box-shadow: 0 10px 22px -10px rgba(15, 155, 142, .8); }
.btn-primary:hover { background: linear-gradient(135deg, #12a092, #0b867a); }
.btn-outline { background: rgba(255, 255, 255, .6); border-color: rgba(148, 163, 184, .35); color: var(--text); }
.btn-outline:hover { background: #fff; border-color: rgba(15, 155, 142, .5); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(15, 155, 142, .08); color: var(--brand-700); }
.btn-soft { background: rgba(15, 155, 142, .1); color: var(--brand-700); }
.btn-soft:hover { background: rgba(15, 155, 142, .17); }
.btn-dark { background: var(--text); color: #fff; }
.btn-dark:hover { background: #334155; }
.btn-danger { background: var(--coral); color: #fff; box-shadow: 0 10px 22px -10px rgba(242, 112, 107, .8); }
.btn-danger:hover { background: #e65f5a; }
.btn-accent { background: linear-gradient(135deg, #60a5fa, #3b82f6); color: #fff; box-shadow: 0 10px 22px -10px rgba(59, 130, 246, .8); }
.btn-icon {
  width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid rgba(148, 163, 184, .28);
  background: rgba(255, 255, 255, .65); color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; transition: .18s;
}
.btn-icon:hover { color: var(--brand); border-color: rgba(15, 155, 142, .4); background: #fff; }
.btn-icon svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }
button:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 22px; }
.grid > *, .stack > *, .row-between > *, .card { min-width: 0; } /* let wide tables scroll inside .table-wrap instead of stretching the page */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--muted); } .text-2 { color: var(--text-2); }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); } .text-brand { color: var(--brand); }
.fw-7 { font-weight: 700; } .fw-8 { font-weight: 700; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

/* ---------- Cards (frosted glass) ---------- */
.card { border-radius: 22px; }
a.card { transition: transform .2s ease, box-shadow .2s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -16px rgba(30, 64, 90, .28); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.card-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.card-body { padding: 20px 24px; }
.card-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }

/* KPI — gradient icon bubble + soft sparkline area */
.kpi { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; isolation: isolate; }
.kpi > * { position: relative; z-index: 1; }
.kpi::after {
  content: ""; position: absolute; z-index: 0; left: 0; bottom: 0; width: 62%; height: 58px; pointer-events: none; opacity: .9;
  background: linear-gradient(to top, color-mix(in srgb, var(--c, var(--brand)) 4%, transparent), color-mix(in srgb, var(--c, var(--brand)) 60%, transparent));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 46 C18 40 26 30 44 34 S70 50 90 38 S118 14 138 22 S168 40 200 12 V60 H0Z' fill='%23000' fill-opacity='.28'/%3E%3Cpath d='M0 46 C18 40 26 30 44 34 S70 50 90 38 S118 14 138 22 S168 40 200 12' fill='none' stroke='%23000' stroke-width='2.4'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 46 C18 40 26 30 44 34 S70 50 90 38 S118 14 138 22 S168 40 200 12 V60 H0Z' fill='%23000' fill-opacity='.28'/%3E%3Cpath d='M0 46 C18 40 26 30 44 34 S70 50 90 38 S118 14 138 22 S168 40 200 12' fill='none' stroke='%23000' stroke-width='2.4'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-icon {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--c, var(--brand));
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .9), transparent 55%),
    linear-gradient(145deg, var(--c-soft, var(--brand-soft)), color-mix(in srgb, var(--c, var(--brand)) 26%, #fff));
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--c, var(--brand)) 60%, transparent), inset 0 0 0 1px rgba(255, 255, 255, .8);
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 700; line-height: 1.05; letter-spacing: -.4px; color: var(--text); }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--text-2); margin-right: 4px; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.trend svg { width: 13px; height: 13px; }
.trend.up { color: #0d8a67; background: rgba(18, 163, 122, .12); }
.trend.down { color: #d6443d; background: rgba(242, 112, 107, .14); }
.trend.flat { color: var(--text-2); background: rgba(148, 163, 184, .16); }
.kpi-foot { font-size: 12px; color: var(--text-2); }
.c-green  { --c: #12a37a; --c-soft: #dcf5ec; }
.c-blue   { --c: #3b82f6; --c-soft: #e3eefe; }
.c-amber  { --c: #e0951f; --c-soft: #fdf0d8; }
.c-red    { --c: #e5534b; --c-soft: #fde4e2; }
.c-violet { --c: #8b7cf6; --c-soft: #eeebfe; }
.c-slate  { --c: #475569; --c-soft: #eaeff5; }
.c-teal   { --c: #0f9b8e; --c-soft: #dcf4f0; }
.c-orange { --c: #f08a4b; --c-soft: #fdeadd; }
.c-cyan   { --c: #0ea5c4; --c-soft: #dcf3f8; }
.c-coral  { --c: #f2706b; --c-soft: #fde6e4; }
.c-pink   { --c: #e46aa6; --c-soft: #fce8f2; }
.c-indigo { --c: #6574f0; --c-soft: #e6e9fd; }

/* Hero/welcome banner — luminous teal → sky glass */
.welcome {
  border-radius: 26px; padding: 30px 32px; color: #fff; position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(60% 120% at 100% 0%, rgba(255, 255, 255, .28), transparent 60%),
    radial-gradient(50% 90% at 0% 100%, rgba(139, 124, 246, .45), transparent 65%),
    linear-gradient(120deg, #13a596 0%, #0f9b8e 35%, #2f8ee8 75%, #3b82f6 100%);
  box-shadow: 0 24px 50px -24px rgba(15, 155, 142, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.welcome::after { content: ""; position: absolute; left: -70px; bottom: -90px; width: 300px; height: 300px; border-radius: 50%; background: rgba(255, 255, 255, .1); filter: blur(2px); z-index: -1; }
.welcome h2 { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.welcome p { margin: 0; opacity: .9; }
.welcome .btn-outline { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .4); color: #fff; box-shadow: none; }
.welcome .btn-outline:hover { background: rgba(255, 255, 255, .3); color: #fff; }

/* ---------- Badges / status pills (soft-tinted) ---------- */
.badge {
  font-size: 12px; font-weight: 600; padding: 4px 11px; gap: 6px; white-space: nowrap; border-radius: 999px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 16%, transparent);
}
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.badge-success { background: rgba(18, 163, 122, .11); color: #0d8a67; }
.badge-warning { background: rgba(224, 149, 31, .13); color: #b06d0a; }
.badge-danger  { background: rgba(229, 83, 75, .11); color: #cc3d36; }
.badge-info    { background: rgba(59, 130, 246, .11); color: #2563eb; }
.badge-brand   { background: rgba(15, 155, 142, .11); color: var(--brand-700); }
.badge-slate   { background: rgba(100, 116, 139, .11); color: #475569; }
.badge-violet  { background: rgba(139, 124, 246, .13); color: #6a59e0; }
.badge-accent  { background: rgba(59, 130, 246, .11); color: #2563eb; }
.badge-coral   { background: rgba(242, 112, 107, .13); color: #d6443d; }
.badge-lg { font-size: 13px; padding: 6px 13px; }

/* ---------- Avatars ---------- */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; font-size: 14px;
  color: #fff; flex-shrink: 0; background: var(--av, var(--brand));
  background-image: linear-gradient(145deg, rgba(255, 255, 255, .28), transparent 60%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
}
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 96px; height: 96px; font-size: 34px; border: 4px solid #fff; box-shadow: var(--shadow); }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person b { display: block; font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person small { display: block; font-size: 12px; color: var(--text-2); }
a.person:hover b { color: var(--brand); }

/* ---------- Tables — airy, rounded rows that lift into cards on hover ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 16px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .search-input { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.toolbar .search-input input { padding-right: 42px; }
.toolbar .search-input svg { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--brand); width: 17px; }
.toolbar .spacer { flex: 1; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th {
  text-align: right; font-weight: 600; font-size: 12px; color: var(--text-2); background: rgba(15, 155, 142, .055);
  padding: 11px 16px; border-bottom: 0; white-space: nowrap;
}
.table thead th:first-child { border-start-start-radius: 14px; border-end-start-radius: 14px; }
.table thead th:last-child { border-start-end-radius: 14px; border-end-end-radius: 14px; }
.table-wrap { padding: 8px 10px 4px; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .92); border-bottom-color: transparent; }
.table tbody tr:hover td:first-child { border-start-start-radius: 16px; border-end-start-radius: 16px; }
.table tbody tr:hover td:last-child { border-start-end-radius: 16px; border-end-end-radius: 16px; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .num { font-weight: 600; font-variant-numeric: tabular-nums; }
.table .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--text-2); direction: ltr; display: inline-block; }
.pagination { display: flex; align-items: center; gap: 6px; }
.pagination button { min-width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(148, 163, 184, .28); background: rgba(255, 255, 255, .6); font: inherit; font-size: 13px; cursor: pointer; color: var(--text-2); }
.pagination button.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 16px -8px rgba(15, 155, 142, .8); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; height: 44px; border: 1px solid rgba(148, 163, 184, .3); border-radius: 14px; padding: 0 14px;
  font: inherit; font-size: 14px; background: rgba(255, 255, 255, .7); color: var(--text); transition: .18s;
}
.textarea { height: auto; min-height: 96px; padding: 11px 14px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%230f9b8e' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 13px center; padding-left: 36px; }
.toolbar .select { width: auto; min-width: 140px; border-radius: 999px; }
.toolbar .input { border-radius: 999px; }
.input:focus, .select:focus, .textarea:focus { outline: none; background-color: #fff; border-color: rgba(15, 155, 142, .5); box-shadow: 0 0 0 5px rgba(15, 155, 142, .12); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: rgba(148, 163, 184, .45); border-radius: 999px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; right: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 2px 6px rgba(30, 41, 59, .2); }
.switch input:checked + span { background: linear-gradient(135deg, #14ad9e, #0f9b8e); }
.switch input:checked + span::before { transform: translateX(-20px); }
.check { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.choice { border: 1.5px solid rgba(255, 255, 255, .9); border-radius: 20px; padding: 16px; cursor: pointer; transition: .18s; background: rgba(255, 255, 255, .6); position: relative; text-align: center; }
.choice:hover { border-color: rgba(15, 155, 142, .4); background: #fff; }
.choice.selected { border-color: var(--brand); background: rgba(15, 155, 142, .08); box-shadow: 0 0 0 4px rgba(15, 155, 142, .12); }
.choice.selected::after { content: "✓"; position: absolute; top: 8px; left: 10px; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; display: grid; place-items: center; }
.choice .emoji { font-size: 30px; line-height: 1; margin-bottom: 8px; display: block; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; padding: 0 4px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 12px 16px; font: inherit; font-size: 14px; font-weight: 500; color: var(--text-2); background: none; border: 0; border-bottom: 2.5px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-700); border-bottom-color: var(--brand); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .2s ease; }
.seg { display: inline-flex; padding: 4px; background: rgba(148, 163, 184, .14); border-radius: 999px; gap: 2px; }
.seg button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; color: var(--text-2); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.seg button.active { background: #fff; color: var(--brand-700); font-weight: 600; box-shadow: 0 3px 10px -3px rgba(30, 64, 90, .2); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(30, 41, 59, .3); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .18s; }
.modal-backdrop.show { opacity: 1; }
.modal { background: var(--glass-strong); border-radius: 26px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 40px 90px -20px rgba(30, 41, 59, .4); transform: translateY(12px) scale(.98); transition: transform .2s ease; }
.modal-backdrop.show .modal { transform: none; }
.modal.lg { max-width: 820px; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-start; }
.success-mark { width: 80px; height: 80px; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #fff, transparent 60%), linear-gradient(145deg, #dcf5ec, #b7ead6); color: var(--success); display: grid; place-items: center; margin: 4px auto 16px; animation: pop .35s ease; box-shadow: 0 14px 30px -12px rgba(18, 163, 122, .6); }
.success-mark svg { width: 38px; height: 38px; stroke-width: 2.5; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 24px; left: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 280px; max-width: 380px; background: rgba(30, 41, 59, .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; border-radius: 20px; padding: 13px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-lg); font-size: 14px; animation: toastIn .25s ease; }
.toast .t-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(45, 212, 191, .2); color: #5eead4; flex-shrink: 0; }
.toast.error .t-icon { background: rgba(242, 112, 107, .22); color: #fca5a5; }
.toast.info .t-icon { background: rgba(96, 165, 250, .22); color: #93c5fd; }
.toast.warning .t-icon { background: rgba(245, 158, 11, .2); color: #fbbf24; }
.toast.hide { animation: toastOut .25s ease forwards; }

/* ---------- Lists / Feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed rgba(148, 163, 184, .3); }
.feed li:last-child { border-bottom: 0; }
.feed .f-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.feed p { margin: 0; font-size: 14px; }
.feed small { color: var(--muted); font-size: 12px; }
.t-info { background: rgba(59, 130, 246, .12); color: #2563eb; }
.t-success { background: rgba(18, 163, 122, .12); color: var(--success); }
.t-warning { background: rgba(224, 149, 31, .14); color: #c27c0e; }
.t-danger { background: rgba(242, 112, 107, .14); color: #e0524b; }
.t-brand { background: rgba(15, 155, 142, .12); color: var(--brand); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px; margin-inline: -10px; border-radius: 16px; border-bottom: 1px solid var(--line); transition: background .15s; }
.list-row:hover { background: rgba(255, 255, 255, .75); }
.list-row:last-child { border-bottom: 0; }

/* Progress */
.progress { height: 8px; background: rgba(148, 163, 184, .18); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--c, linear-gradient(90deg, #3b82f6, #0f9b8e)); transition: width .6s ease; }
.ring { --p: 75; --c: var(--brand); width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(148, 163, 184, .18) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 12px; background: #fff; border-radius: 50%; box-shadow: inset 0 2px 6px rgba(30, 64, 90, .06); }
.ring > * { position: relative; text-align: center; }
.ring b { font-size: 26px; font-weight: 700; display: block; line-height: 1; }
.ring small { font-size: 12px; color: var(--text-2); }

/* Chart containers */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.chart-box.lg { height: 340px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Empty state */
.empty-state { padding: 48px 24px; }
.empty-state .empty-icon { background: radial-gradient(circle at 30% 25%, #fff, transparent 60%), linear-gradient(145deg, #e1f5f1, #cfe6fb); color: var(--brand); border-radius: 50%; }

/* Info list */
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.info-list div small { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 2px; }
.info-list div b { font-size: 14px; font-weight: 600; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal .day { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 500; background: rgba(255, 255, 255, .6); color: var(--text-2); position: relative; }
.cal .day.p { background: rgba(18, 163, 122, .14); color: #0d8a67; }
.cal .day.a { background: rgba(242, 112, 107, .16); color: #d6443d; }
.cal .day.today { outline: 2px solid var(--brand); outline-offset: 2px; }
.cal .day.future { background: transparent; color: #cbd5e1; }
.cal .day.empty { background: transparent; }

/* Schedule timeline — time rail on the side */
.session {
  display: flex; gap: 16px; padding: 14px 16px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .6); align-items: center; position: relative; transition: .18s;
}
.session:hover { background: #fff; box-shadow: var(--shadow); }
.session .time { text-align: center; min-width: 66px; padding-inline-end: 14px; border-inline-end: 2px solid color-mix(in srgb, var(--c, var(--brand)) 45%, transparent); }
.session .time b { display: block; font-size: 16px; font-weight: 700; color: var(--c, var(--brand)); }
.session .time small { font-size: 12px; color: var(--text-2); }
.session h4 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.session .meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.session .meta span { display: inline-flex; align-items: center; gap: 4px; }
.session .meta svg { width: 14px; height: 14px; }

/* Icon tile (department / service) — .sport-tile kept as alias */
.sport-tile { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: color-mix(in srgb, var(--c, var(--brand)) 12%, #fff); flex-shrink: 0; }

/* QR (pseudo) */
.qr { width: 132px; height: 132px; background: #fff; padding: 8px; border-radius: 16px; display: grid; grid-template-columns: repeat(21, 1fr); gap: 0; }
.qr i { display: block; aspect-ratio: 1; }
.qr i.on { background: #1e293b; }

/* Animations */
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.fade-in { animation: fade .3s ease both; }

/* ==========================================================================
   Clinic Pro — medical components (shared by all role pages)
   ========================================================================== */
/* Soft "plus" pattern on the welcome banner */
.welcome::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55; z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M20 14h4v6h6v4h-6v6h-4v-6h-6v-4h6z' fill='%23ffffff' fill-opacity='.09'/%3E%3C/svg%3E");
  mask-image: linear-gradient(90deg, transparent 10%, #000 70%);
}
.ecg-line { position: absolute; left: 0; right: 0; bottom: 18px; height: 40px; opacity: .28; pointer-events: none; }
.ecg-line path { fill: none; stroke: #fff; stroke-width: 2; stroke-dasharray: 600; animation: ecg 3.2s linear infinite; }
@keyframes ecg { from { stroke-dashoffset: 600; } to { stroke-dashoffset: 0; } }

/* Department / service tile with a Lucide icon */
.dept-tile { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: var(--c, var(--brand)); background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .9), transparent 60%), color-mix(in srgb, var(--c, var(--brand)) 15%, #fff); }
.dept-tile svg { width: 21px; height: 21px; }
.dept-tile.sm { width: 32px; height: 32px; }
.dept-tile.sm svg { width: 16px; height: 16px; }
.dept-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.dept-tag i, .dept-tag svg { width: 15px; height: 15px; color: var(--c, var(--brand)); }

/* Live indicator */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; position: relative; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--success); opacity: 0; animation: livePulse 1.6s ease-out infinite; }
@keyframes livePulse { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

/* Queue */
.queue-num { display: inline-grid; place-items: center; min-width: 58px; height: 38px; padding: 0 12px; border-radius: 999px; background: rgba(15, 155, 142, .1); color: var(--brand-700); font-weight: 700; font-size: 15px; direction: ltr; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.queue-num.now { background: linear-gradient(135deg, #14ad9e, #0f9b8e 55%, #2f8ee8); color: #fff; box-shadow: 0 10px 20px -8px rgba(15, 155, 142, .7); }
.queue-num.lg { min-width: 120px; height: 72px; font-size: 32px; border-radius: 26px; }
.queue-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.queue-item:last-child { border-bottom: 0; }
.queue-item .wait { margin-right: auto; text-align: left; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.queue-item .wait b { display: block; font-size: 14px; color: var(--text); }
.now-serving { border-radius: 22px; padding: 16px; background: linear-gradient(135deg, rgba(15, 155, 142, .12), rgba(59, 130, 246, .08)); border: 1px solid rgba(255, 255, 255, .9); display: flex; align-items: center; gap: 14px; }

/* Vitals */
.vitals { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.vital { border: 1px solid rgba(255, 255, 255, .9); border-radius: 20px; padding: 14px 16px; background: rgba(255, 255, 255, .62); display: flex; flex-direction: column; gap: 6px; }
.vital .v-top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-2); font-weight: 500; }
.vital .v-top svg { width: 18px; height: 18px; color: var(--c, var(--brand)); }
.vital b { font-size: 22px; font-weight: 700; line-height: 1.1; direction: ltr; unicode-bidi: embed; }
.vital b small { font-size: 12px; color: var(--text-2); font-weight: 500; margin-inline-start: 3px; }
.vital .v-flag { font-size: 11px; font-weight: 600; }
.v-normal { color: var(--success); } .v-high { color: var(--danger); } .v-low { color: var(--warning); }

/* Medical tags (allergies, chronic conditions) */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: rgba(100, 116, 139, .11); color: #475569; white-space: nowrap; }
.tag svg { width: 13px; height: 13px; }
.tag-danger { background: rgba(242, 112, 107, .14); color: #cc3d36; }
.tag-warning { background: rgba(224, 149, 31, .14); color: #b06d0a; }
.tag-brand { background: rgba(15, 155, 142, .11); color: var(--brand-700); }
.tag-success { background: rgba(18, 163, 122, .12); color: #0d8a67; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Lab result flags */
.lab-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.lab-flag.high { background: rgba(242, 112, 107, .15); color: #cc3d36; }
.lab-flag.low { background: rgba(224, 149, 31, .15); color: #b06d0a; }
.lab-flag.normal { background: rgba(18, 163, 122, .12); color: #0d8a67; }
.range-bar { position: relative; height: 6px; border-radius: 999px; background: linear-gradient(90deg, #fde3b0 0 20%, #bfeedd 20% 80%, #fcc9c6 80%); min-width: 110px; }
.range-bar i { position: absolute; top: -4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--text); transform: translateX(50%); }

/* Timeline (visits / medical record) */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; top: 6px; bottom: 6px; right: 18px; width: 2px; border-radius: 2px; background: linear-gradient(to bottom, rgba(15, 155, 142, .45), rgba(59, 130, 246, .3), rgba(139, 124, 246, .2)); }
.timeline li { position: relative; padding: 0 54px 22px 0; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .t-dot { position: absolute; right: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 0; color: var(--c, var(--brand)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--brand)) 16%, transparent), 0 6px 14px -6px rgba(30, 64, 90, .3); }
.timeline .t-dot svg { width: 16px; height: 16px; }
.timeline h4 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.timeline small { color: var(--text-2); font-size: 12px; }
.timeline p { margin: 4px 0 0; font-size: 14px; color: var(--text-2); }

/* Prescription item */
.rx { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid rgba(255, 255, 255, .9); border-radius: 20px; background: rgba(255, 255, 255, .62); align-items: flex-start; }
.rx .rx-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, #efecfd, #ddd7fd); color: #6a59e0; flex-shrink: 0; }
.rx h4 { margin: 0; font-size: 15px; font-weight: 600; direction: ltr; text-align: right; }
.rx .rx-dose { font-size: 13px; color: var(--text-2); }
.rx-paper { border: 1px dashed rgba(15, 155, 142, .35); border-radius: 22px; padding: 20px; background: rgba(255, 255, 255, .7); position: relative; }
.rx-paper::before { content: "℞"; position: absolute; left: 18px; top: 10px; font-size: 40px; font-weight: 700; color: rgba(15, 155, 142, .14); }

/* Doctor card */
.doc-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.doc-card .doc-top { display: flex; gap: 12px; align-items: center; }
.doc-card .doc-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.doc-card .doc-meta span { display: inline-flex; align-items: center; gap: 4px; }
.doc-card .doc-meta svg { width: 14px; height: 14px; }
.stars { color: #f0a020; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; font-size: 13px; }
.stars svg { width: 14px; height: 14px; fill: #f5b13d; color: #f5b13d; }

/* Booking time slots */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot { border: 1.5px solid rgba(255, 255, 255, .95); background: rgba(255, 255, 255, .65); border-radius: 999px; padding: 8px 6px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; color: var(--text); transition: .18s; }
.slot:hover { border-color: var(--brand); color: var(--brand); background: #fff; }
.slot.selected { background: linear-gradient(135deg, #14ad9e, #0f9b8e); border-color: var(--brand); color: #fff; box-shadow: 0 8px 16px -8px rgba(15, 155, 142, .8); }
.slot.taken { background: rgba(148, 163, 184, .12); color: #b6c0cc; text-decoration: line-through; cursor: not-allowed; border-color: transparent; }

/* Appointment time cell — reads as a time rail */
.appt-time { text-align: center; min-width: 62px; padding-inline-end: 12px; border-inline-end: 2px solid rgba(15, 155, 142, .3); }
.appt-time b { display: block; font-size: 15px; font-weight: 700; line-height: 1.1; color: var(--text); }
.appt-time small { font-size: 11px; color: var(--text-2); }

/* Insurance share split */
.split-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: rgba(148, 163, 184, .18); }
.split-bar span { display: block; height: 100%; }

/* Patient pages ship their own phone bottom nav; the shell's glass tab bar replaces it */
body.app .p-nav { display: none !important; }

/* Segmented controls never widen the page on phones */
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex-shrink: 0; }
.page-actions { max-width: 100%; }

/* ---------- No backdrop-filter support: fall back to near-opaque surfaces ---------- */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  :root { --glass: rgba(255, 255, 255, .94); --glass-strong: rgba(255, 255, 255, .98); }
  .sidebar-overlay, .modal-backdrop { background: rgba(30, 41, 59, .45); }
  .toast, .dock-tip { background: #1e293b; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-greet small .sep, .tb-greet small .tb-role { display: none; }
}
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-greet { display: none; }
  .global-search { margin-inline: 0; }
}
@media (max-width: 1024px) {
  /* tablet: dock stays a slim floating rail; pinned/expanded mode becomes an overlay */
  body.dock-pinned .main { margin-right: calc(var(--dock-w) + var(--dock-gap) * 2); }
  body.dock-pinned .dock { box-shadow: var(--shadow-lg); }
  .topbar-app { margin-left: 20px; gap: 12px; }
  .content { padding: 22px 20px 40px 20px; padding-right: 2px; }
  .user-btn .meta { display: none; }
  .user-btn { padding: 3px; }
}
@media (max-width: 720px) {
  :root { --dock-gap: 10px; --header-h: 62px; }
  .dock, .dock-tip { display: none; }
  .main, body.dock-pinned .main { margin-right: 0; }
  .topbar-app { margin: 10px 10px 0; padding: 0 10px; gap: 8px; border-radius: 22px; }
  .tb-brand { display: block; flex-shrink: 0; }
  .icon-btn { width: 40px; height: 40px; }
  .global-search input { height: 42px; padding: 0 40px 0 14px; font-size: 13px; }
  .global-search > svg { right: 14px; }
  .global-search kbd { display: none; }
  .search-results { position: fixed; top: calc(var(--header-h) + 18px); inset-inline: 10px; }
  .content { padding: 20px 14px calc(var(--tabbar-h) + 34px); }
  .header-actions { gap: 6px; }
  .header-actions .hide-sm { display: none; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .info-list { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 22px; }
  .card-pad, .card-body { padding: 18px 16px; }
  .card-head, .toolbar, .card-foot { padding-inline: 16px; }
  .notif-menu { position: fixed; top: calc(var(--header-h) + 18px); left: 10px; right: 10px; width: auto; }
  #userDrop .dropdown-menu { position: fixed; top: calc(var(--header-h) + 18px); left: 10px; }
  .toast-wrap { left: 14px; right: 14px; bottom: calc(var(--tabbar-h) + 22px) !important; }
  .toast { max-width: none; }
  .welcome { padding: 22px 20px; border-radius: 22px; }
  .welcome h2 { font-size: 22px; }
  .vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .queue-num.lg { min-width: 96px; height: 60px; font-size: 26px; }
  body.app .visit-bar { bottom: calc(var(--tabbar-h) + 18px); }

  /* bottom glass tab bar */
  .tabbar {
    display: flex; position: fixed; z-index: 50; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    height: var(--tabbar-h); border-radius: 26px; padding: 6px; gap: 2px; background: var(--glass-strong);
  }
  .tabbar-item {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; font: inherit; font-size: 10.5px; font-weight: 600; color: var(--text-2); border-radius: 20px; cursor: pointer; padding: 0 2px;
  }
  .tb-ic { position: relative; width: 38px; height: 30px; border-radius: 999px; display: grid; place-items: center; transition: .18s; }
  .tb-ic svg { width: 20px; height: 20px; }
  .tb-lbl { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabbar-item.active { color: var(--brand-700); }
  .tabbar-item.active .tb-ic { background: linear-gradient(145deg, #19b3a3, #0f9b8e); color: #fff; width: 48px; box-shadow: 0 8px 16px -8px rgba(15, 155, 142, .8); }
  .tb-count { position: absolute; top: -4px; left: -2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; line-height: 1; }
  .tb-count.soft { background: #f6b04a; }

  /* "المزيد" sheet */
  .more-sheet {
    display: flex; flex-direction: column; position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-height: 82vh;
    border-radius: 28px 28px 0 0; background: var(--glass-strong); padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
  }
  body.nav-open .more-sheet { transform: none; visibility: visible; }
  body.nav-open .sidebar-overlay { opacity: 1; visibility: visible; }
  .sheet-handle { width: 42px; height: 5px; border-radius: 999px; background: rgba(100, 116, 139, .3); margin: 2px auto 10px; flex-shrink: 0; }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
  .sheet-grid { overflow-y: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 6px 0 12px; }
  .sheet-section { grid-column: 1 / -1; font-size: 11px; font-weight: 600; color: var(--muted); padding: 10px 4px 0; }
  .sheet-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 12px 4px; border-radius: 20px; color: var(--text); font-size: 12px; font-weight: 500; line-height: 1.35; background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .9); }
  .sheet-item.active { background: rgba(15, 155, 142, .1); color: var(--brand-700); font-weight: 600; border-color: rgba(15, 155, 142, .25); }
  .sheet-ic { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(15, 155, 142, .1); color: var(--brand); }
  .sheet-item.active .sheet-ic { background: linear-gradient(145deg, #19b3a3, #0f9b8e); color: #fff; }
  .sheet-ic svg { width: 20px; height: 20px; }
  .sheet-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); flex-shrink: 0; }
  .sheet-foot .by-almgrat { margin-right: auto; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 16px; }
  .kpi::after { height: 40px; }
  .kpi-value { font-size: 22px; }
  .kpi-icon { width: 40px; height: 40px; }
  .kpi-icon svg { width: 19px; height: 19px; }
  .user-btn > svg { display: none; }
}
@media (max-width: 380px) {
  .tb-brand { display: none; }
}
@media print {
  .dock, .dock-tip, .tabbar, .more-sheet, .topbar-app, .page-actions, .toolbar, .toast-wrap { display: none !important; }
  .main, body.dock-pinned .main { margin: 0; }
  body.app { background: #fff; }
  body.app::before { display: none; }
  .card { background: #fff; box-shadow: none; border-color: #e2e8f0; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
