

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root{
  
  --nk-teal-50:#F1F7F7;
  --nk-teal-100:#DCEBEB;
  --nk-teal-200:#BFDCDC;
  --nk-teal-300:#A4CDCE;
  --nk-teal-400:#89BCBD;   
  --nk-teal-500:#6FAAAB;
  --nk-teal-600:#5A9495;
  --nk-teal-700:#467878;
  --nk-teal-800:#345B5B;

--nk-pink-50:#FFF1F5;
  --nk-pink-100:#FFE0EB;
  --nk-pink-200:#FFC2D9;
  --nk-pink-300:#FFA6C5;
  --nk-pink-400:#FE84A4;        
  --nk-pink-500:#F46A8E;
  --nk-pink-600:#D94E74;
  --nk-pink-700:#B53A5B;

  --nk-orange-400:#F9A945;      
  --nk-orange-500:#E89331;
  --nk-yellow-400:#FED960;      
  --nk-yellow-500:#F2C73F;
  --nk-purple-400:#CE7ED4;      
  --nk-purple-500:#B864BE;
  --nk-lime-400:#C0CF56;        
  --nk-lime-500:#A8B948;
  --nk-blush:#FFEEEF;           

--nk-ink:#0F2E3A;             
  --nk-ink-2:#1F3A4A;
  --nk-text:#1E293B;
  --nk-muted:#64748B;
  --nk-border:#D9E6E6;          
  --nk-border-soft:#E8F0F0;
  --nk-surface:#F7FAFA;         
  --nk-card:#ffffff;
  --nk-row-hover:#F1F7F7;

--nk-shadow-xs: 0 1px 2px rgba(15,46,58,.04);
  --nk-shadow-sm: 0 1px 2px rgba(15,46,58,.05), 0 4px 14px -6px rgba(15,46,58,.08);
  --nk-shadow-md: 0 4px 12px -2px rgba(15,46,58,.08), 0 16px 32px -12px rgba(15,46,58,.14);
  --nk-shadow-lg: 0 24px 48px -16px rgba(15,46,58,.22), 0 4px 10px rgba(15,46,58,.07);
  --nk-ring-primary: 0 0 0 4px rgba(137,188,189,.25);

--nk-radius-sm: 10px;
  --nk-radius:    14px;
  --nk-radius-card: 18px;
  --nk-radius-lg: 22px;
  --nk-radius-pill: 999px;

--nk-grad-primary: linear-gradient(135deg, var(--nk-teal-400) 0%, var(--nk-teal-600) 100%);
  --nk-grad-hero:    linear-gradient(135deg, var(--nk-teal-400) 0%, var(--nk-teal-500) 55%, var(--nk-pink-400) 100%);
  --nk-grad-soft:    linear-gradient(180deg, #F4FAFA 0%, #FFFFFF 100%);

--np-primary: var(--nk-teal-400);
  --np-primary-600: var(--nk-teal-600);
  --np-blue: var(--nk-teal-500);
  --np-mint: var(--nk-teal-100);
  --np-cream: var(--nk-blush);
  --np-coral: var(--nk-pink-400);
  --np-ink: var(--nk-ink);
  --np-surface: var(--nk-surface);
  --np-border: var(--nk-border);
  --np-muted: var(--nk-muted);
  --np-text: var(--nk-text);
  --np-card-shadow: var(--nk-shadow-sm);
  --np-card-shadow-hover: var(--nk-shadow-md);
  --np-radius-card: 18px;

  /* Legacy alias family used by older page stylesheets. Aliased to the
     --nk-* tokens — the single source of truth — so a hardcoded light
     hex can never leak through during a theme swap. */
  --np-surface-2: #F6F8FB;
  --np-text-mut: var(--nk-muted);
}

html,body{
  background: var(--nk-surface);
  color: var(--nk-text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11','ss01','ss03';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.np-sidebar__title,
.np-login__title,
.np-header__page-title,
.np-panel__title,
.np-modal__title,
.np-drawer__title,
.np-kpi__value,
.np-doc-card__name,
h1,h2,h3{
  font-family: 'Poppins','Inter', system-ui, sans-serif;
  letter-spacing: -.01em;
}
.np-kpi__value{ font-weight:700; }

:focus-visible{
  outline: 2px solid var(--nk-teal-500);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection{ background: var(--nk-teal-100); color: var(--nk-teal-800); }

*::-webkit-scrollbar{ width:10px; height:10px; }
*::-webkit-scrollbar-thumb{
  background: #C3DBDB;
  border-radius: 999px;
  border:2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover{ background:#9CC4C5; background-clip: padding-box; border:2px solid transparent; }
*::-webkit-scrollbar-track{ background: transparent; }

.np-sidebar__logo,
.np-login__logo{
  background: linear-gradient(135deg, var(--nk-teal-400) 0%, var(--nk-teal-600) 60%, var(--nk-pink-400) 100%);
  box-shadow: 0 8px 22px -6px rgba(137,188,189,.55), 0 2px 6px -2px rgba(15,46,58,.15);
  position: relative;
}
.np-sidebar__logo::after,
.np-login__logo::after{
  content:"";
  position:absolute; inset:-1px;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.45), transparent 60%);
  pointer-events:none;
}

.np-sidebar{
  background: #ffffff;
  border-right: 1px solid var(--nk-border-soft);
}
.np-sidebar__brand{
  border-bottom: 1px solid var(--nk-border-soft);
  background: linear-gradient(180deg, #F1F7F7, transparent);
}
.np-nav-item{
  border-radius: 12px;
  font-weight: 500;
  color: #334155;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease;
}
.np-nav-item:hover{
  background: var(--nk-teal-50);
  color: var(--nk-teal-700);
}
.np-nav-item.active{
  background: linear-gradient(135deg, rgba(137,188,189,.18), rgba(137,188,189,.06));
  color: var(--nk-teal-700);
  border-color: rgba(137,188,189,.35);
  box-shadow: inset 0 0 0 1px rgba(137,188,189,.18);
}
.np-nav-item.active .np-nav-item__icon{ color: var(--nk-teal-600); }
.np-nav-badge{
  background: var(--nk-pink-400);   
  color: #fff;
  font-weight: 600;
}
.np-sidebar__section{
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .68rem;
  color: var(--nk-teal-700);
}
.np-sidebar__footer{ border-top: 1px solid var(--nk-border-soft); }

.np-header{
  background: #ffffff;
  border-bottom: 1px solid var(--nk-border-soft);
  backdrop-filter: saturate(180%) blur(6px);
}
.np-header__page-title{ color: var(--nk-ink); font-weight: 700; letter-spacing: -.015em; }

.np-iconbtn{
  border: 1px solid var(--nk-border);
  border-radius: 12px;
  background:#fff;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
}
.np-iconbtn:hover{
  background: var(--nk-teal-50);
  color: var(--nk-teal-700);
  border-color: var(--nk-teal-200);
}

.np-profile__trigger{ transition: background .15s ease, border-color .15s ease; }
.np-profile__trigger:hover{
  background: var(--nk-teal-50);
  border-color: var(--nk-teal-200);
}
.np-profile__avatar{
  background: linear-gradient(135deg, var(--nk-teal-400), var(--nk-teal-600));
  box-shadow: 0 2px 6px -1px rgba(15,46,58,.18);
}
.np-profile__menu{
  border-radius: 14px;
  border-color: var(--nk-border);
  box-shadow: var(--nk-shadow-md);
  overflow: hidden;
}
.np-profile__menu-item:hover{
  background: var(--nk-teal-50);
  color: var(--nk-teal-700);
}

/* "Who am I logged in as" block, shown at the top of the profile dropdown.
   Exists because .np-profile__meta (name/role next to the avatar) is hidden
   on narrow screens to save header space -- this is the one place identity
   is guaranteed visible at every screen size, since the dropdown only opens
   on tap and isn't subject to the header's width crunch. */
.np-profile__id{
  display:flex;
  align-items:center;
  gap:.65rem;
  padding: .85rem .9rem;
  border-bottom: 1px solid var(--nk-border-soft);
}
.np-profile__id-avatar{
  flex-shrink:0;
  width:38px; height:38px;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  font-weight:700; font-size:.8rem; color:#fff;
  background: linear-gradient(135deg, var(--nk-teal-400), var(--nk-teal-600));
}
.np-profile__id-avatar img{ width:100%; height:100%; object-fit:cover; }
.np-profile__id-text{ min-width:0; }
.np-profile__id-name{
  font-weight:700; font-size:.9rem; color: var(--nk-ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.np-profile__id-role{
  font-size:.76rem; color: var(--nk-teal-700); font-weight:600;
}
.np-profile__id-email{
  font-size:.76rem; color: var(--nk-muted);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

.np-panel{
  background:#fff;
  border:1px solid var(--nk-border-soft);
  border-radius: var(--nk-radius-card);
  box-shadow: var(--nk-shadow-sm);
}
.np-panel__title{ color: var(--nk-ink); font-weight:700; letter-spacing:-.01em; }

.np-kpi{
  background:#fff;
  border:1px solid var(--nk-border-soft);
  border-radius: 20px;
  padding: 1.2rem 1.3rem;
  box-shadow: var(--nk-shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
  overflow: hidden;
}
.np-kpi:hover{
  transform: translateY(-2px);
  box-shadow: var(--nk-shadow-md);
  border-color: var(--nk-teal-200);
}
.np-kpi::before{
  width: 5px;
  border-radius: 5px 0 0 5px;
  background: var(--nk-teal-400);
}

.np-kpi--blue::before  { background: linear-gradient(180deg, var(--nk-teal-400),  var(--nk-teal-600));  }
.np-kpi--mint::before  { background: linear-gradient(180deg, var(--nk-teal-300),  var(--nk-teal-500));  }
.np-kpi--coral::before { background: linear-gradient(180deg, var(--nk-pink-400),  var(--nk-pink-500));  }
.np-kpi--cream::before { background: linear-gradient(180deg, var(--nk-yellow-400),var(--nk-orange-400));}
.np-kpi--violet::before{ background: linear-gradient(180deg, var(--nk-purple-400),#9F5BA8);             }
.np-kpi--rose::before  { background: linear-gradient(180deg, var(--nk-pink-400),  var(--nk-pink-600));  }
.np-kpi--green::before { background: linear-gradient(180deg, #34D399, #10B981); }
.np-kpi--amber::before { background: linear-gradient(180deg, #FBBF24, #F59E0B); }
.np-kpi--red::before   { background: linear-gradient(180deg, #F87171, #DC2626); }
.np-kpi__value{ color: var(--nk-ink); }
.np-kpi__label{ color: var(--nk-muted); font-weight:500; }

/* ── Dashboard analytics panels — shared across Doctor/Admin/Receptionist/
   Pharmacy. A "rich panel" (big number + breakdown + trend chip, optionally
   a sparkline) replacing rows of small flat KPI tiles that fragment related
   numbers and truncate their labels on mobile. auto-fit lets a portal use
   2 or 3 panels without a separate grid rule per portal. ── */
.np-analytics{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr));
  gap:1rem; margin:0 0 1rem;
}
.np-analytics-card{
  background:var(--nk-card); border:1px solid var(--np-border, var(--nk-border));
  border-radius:var(--np-radius-card, var(--nk-radius-card)); box-shadow:var(--np-card-shadow, var(--nk-shadow-sm));
  padding:1.15rem 1.25rem; min-width:0;
  border-top:3px solid transparent;
}
.np-analytics-card--today{    border-top-color:var(--nk-teal-400); }
.np-analytics-card--revenue{  border-top-color:var(--nk-orange-400); }
.np-analytics-card--warn{     border-top-color:var(--nk-pink-400); }
.np-analytics-card__head{
  display:flex; align-items:center; justify-content:space-between;
  gap:.6rem; flex-wrap:wrap;
}
.np-analytics-card__eyebrow{
  font-size:.72rem; font-weight:700; letter-spacing:.06em;
  text-transform:uppercase; color:var(--nk-muted);
}
.np-analytics-card__value{
  font-family:'Poppins','Inter',system-ui,sans-serif;
  font-size:2.15rem; font-weight:700; color:var(--nk-ink);
  line-height:1.1; margin-top:.3rem;
}
.np-analytics-card__breakdown{
  display:flex; flex-wrap:wrap; align-items:center; gap:.35rem .9rem;
  margin-top:.85rem; padding-top:.85rem; border-top:1px solid var(--nk-border-soft);
  font-size:.85rem; color:var(--nk-text);
}
.np-analytics-card__split{
  display:flex; flex-direction:column; gap:.4rem;
  margin-top:.7rem; font-size:.82rem; color:var(--nk-text);
}
.np-analytics-card__split-row{ display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.np-analytics-card__foot{
  margin-top:.7rem; padding-top:.6rem; border-top:1px solid var(--nk-border-soft);
  font-size:.76rem; color:var(--nk-muted);
}
.np-dot{
  display:inline-block; width:8px; height:8px; border-radius:50%;
  margin-right:.15rem; vertical-align:middle;
}
/* A dot + its label built as "<span class=np-dot></span>text" inside a
   flex-wrap container turns the bare text into its own anonymous flex
   item — flex-wrap can then wrap the text onto the next line while the
   dot stays on the one before it, looking like the bullet floated away
   from its own label. Wrapping both in one inline-flex unit makes the
   pair a single flex item that wraps as a whole or not at all. */
.np-dot-item{ display:inline-flex; align-items:center; white-space:nowrap; }
.np-dot--mint{ background:var(--nk-teal-400); }
.np-dot--amber{ background:var(--nk-orange-400); }
.np-dot--blue{ background:#3b82f6; }
.np-dot--red{ background:#DC2626; }

.np-trend{
  display:inline-flex; align-items:center; gap:.3rem;
  font-size:.76rem; font-weight:700; padding:.2rem .55rem; border-radius:999px;
  white-space:nowrap;
}
.np-trend--up{ color:#0f7a4d; background:rgba(16,185,129,.12); }
.np-trend--down{ color:#b42318; background:rgba(239,68,68,.10); }
.np-trend--flat{ color:var(--nk-muted); background:var(--nk-surface); }

.np-sparkline{
  display:flex; align-items:flex-end; gap:.3rem;
  height:36px; margin-top:.9rem;
}
.np-sparkline__bar{
  flex:1 1 0; min-width:4px; border-radius:3px 3px 0 0;
  background:var(--nk-grad-primary);
  opacity:.85;
  cursor:pointer;
}

/* ============================================================
   Dashboard: rich SVG daily trend chart — gridlines, axis labels,
   peak highlight, average reference line, hover/tap tooltips.
   Originally Admin-only (defined again in admin/styles.css, loaded
   by Admin/Receptionist/Pharmacy); copied here too so Doctor (which
   does not load admin/styles.css) also has it for NPDailyChart.
   ============================================================ */
.np-chart{ position:relative; width:100%; }
.np-chart__svg{ display:block; width:100%; height:auto; }
.np-chart__grid{ stroke: var(--np-border); stroke-width:1; }
.np-chart__axis{ stroke: var(--np-border); stroke-width:1; }
.np-chart__avgline{ stroke: var(--np-coral); stroke-width:1; stroke-dasharray:4 3; opacity:.55; }
.np-chart__avglabel{ fill: var(--np-coral); font-size:10px; font-weight:600; opacity:.85; }
.np-chart__ylabel{ fill: var(--np-muted); font-size:10px; }
.np-chart__xlabel{ fill: var(--np-muted); font-size:10px; }
.np-chart__xlabel--today{ fill: var(--np-primary-600); font-weight:700; }
.np-chart__bar{ fill: var(--np-primary); transition: opacity .15s ease; }
.np-chart__bar--muted{ fill: var(--np-muted); opacity:.3; transition: opacity .15s ease; }
.np-chart__bar--peak{ fill: var(--np-coral); transition: opacity .15s ease; }
.np-chart__peaklabel{ fill: var(--np-coral); font-size:11px; font-weight:700; }
.np-chart__hit{ fill: transparent; cursor:pointer; }
.np-chart__col.is-active .np-chart__bar,
.np-chart__col.is-active .np-chart__bar--muted,
.np-chart__col.is-active .np-chart__bar--peak{ opacity:.75; }
.np-chart__col:focus{ outline:none; }
.np-chart__col:focus-visible .np-chart__hit{
  outline:2px solid var(--np-primary); outline-offset:-2px; border-radius:4px;
}
.np-chart__col--today .np-chart__bar,
.np-chart__col--today .np-chart__bar--muted{
  stroke: var(--np-primary-600); stroke-width:1.5;
}
.np-chart__tooltip{
  position:absolute; z-index:5;
  transform: translate(-50%, calc(-100% - 12px));
  background: var(--nk-card);
  border:1px solid var(--np-border);
  border-radius:10px;
  box-shadow: var(--np-card-shadow-hover);
  padding:.5rem .65rem;
  min-width:150px;
  pointer-events:none;
  opacity:0; visibility:hidden;
  transition: opacity .12s ease;
}
.np-chart__tooltip.is-visible{ opacity:1; visibility:visible; }
.np-chart__tooltip.is-pinned{ pointer-events:auto; }
.np-chart__tooltip-date{ font-size:.72rem; font-weight:700; color:var(--np-ink); margin-bottom:.15rem; }
.np-chart__tooltip-main{ font-size:.82rem; font-weight:700; color:var(--np-primary-600); }
.np-chart__tooltip-sub{ font-size:.72rem; color:var(--np-muted); margin-top:.1rem; }
.np-chart__tooltip-link{
  display:block; width:100%; margin-top:.4rem; padding-top:.4rem; border:0; border-top:1px dashed var(--np-border);
  background:transparent; color:var(--np-primary-600); font-size:.72rem; font-weight:700; text-align:left; cursor:pointer;
}
.np-chart__tooltip-link:hover{ text-decoration:underline; }
.np-chart__legend{
  display:flex; flex-wrap:wrap; align-items:center; gap:.35rem .9rem;
  margin-top:.6rem; padding-top:.6rem; border-top:1px solid var(--np-border);
}
.np-chart__legend-item{ display:inline-flex; align-items:center; gap:.35rem; font-size:.72rem; color:var(--np-muted); }
.np-chart__legend-swatch{ width:8px; height:8px; border-radius:2px; background: var(--np-primary); display:inline-block; }
.np-chart__legend-swatch--peak{ background: var(--np-coral); }
.np-chart__legend-note{ margin-left:auto; color:var(--np-text); font-weight:600; }
@media (max-width:460px){ .np-chart__legend-note{ margin-left:0; width:100%; } }

@media (max-width:720px){
  .np-analytics{ grid-template-columns:1fr; gap:.85rem; }
  .np-analytics-card{ padding:1rem 1.1rem; }
  .np-analytics-card__value{ font-size:1.85rem; }
}

[data-theme="dark"] .np-trend--up{ color:#4ade80; background:rgba(74,222,128,.12); }
[data-theme="dark"] .np-trend--down{ color:#f87171; background:rgba(248,113,113,.14); }

.np-content{ background: transparent; }

/* ==========================================================================
   CANONICAL BUTTON COMPONENT
   Single source of truth for every button across the Admin Panel and
   Doctor Panel (primary/secondary/outline/filter/apply/clear/refresh/
   save/cancel/modal actions). Page stylesheets must not redeclare size,
   color, padding, radius or display for `.np-btn` — only layout placement
   (e.g. "stack full-width inside this specific mobile card") belongs there.
   ========================================================================== */
.np-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: auto;
  min-width: 96px;
  min-height: 40px;
  padding: .55rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--nk-border);
  background: #fff;
  color: var(--nk-text);
  font-weight: 600;
  font-size: .88rem;
  letter-spacing: .005em;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.np-btn:active{ transform: translateY(1px); }
.np-btn--sm{ min-height: 32px; min-width: 0; padding: .4rem .75rem; font-size: .8rem; }
.np-btn--block{ width: 100%; }
.np-action-list{ display: flex; flex-direction: column; gap: .5rem; }
.np-tab{ min-height: 36px; }
.np-btn:disabled, .np-btn--disabled, .np-btn[disabled]{
  opacity: .5;
  pointer-events: none;
  cursor: not-allowed;
  filter: grayscale(.15);
}
.np-btn--primary{
  background: linear-gradient(135deg, var(--nk-teal-400) 0%, var(--nk-teal-600) 100%);
  border-color: var(--nk-teal-600);
  color:#fff;
  box-shadow: 0 6px 18px -6px rgba(90,148,149,.55);
}
.np-btn--primary:hover{
  background: linear-gradient(135deg, var(--nk-teal-500) 0%, var(--nk-teal-700) 100%);
  border-color: var(--nk-teal-700);
  box-shadow: 0 10px 22px -6px rgba(70,120,120,.65);
  transform: translateY(-1px);
}
.np-btn:hover{
  background: var(--nk-teal-50);
  color: var(--nk-teal-700);
  border-color: var(--nk-teal-200);
}
.np-btn--success{
  background: linear-gradient(135deg, #2AB99A, #189B82);
  border-color:#189B82;
  color:#fff;
}
.np-btn--success:hover{
  background: linear-gradient(135deg, #189B82, #0F7A66);
  border-color:#0F7A66;
  color:#fff;
}
.np-btn--danger{
  background: linear-gradient(135deg, #EF6F87, #D94E74);
  border-color:#D94E74;
  color:#fff;
}
.np-btn--danger:hover{
  background: linear-gradient(135deg, #D94E74, #B53A5B);
  color:#fff;
}
.np-btn--ghost{ background:#fff; border-color: var(--nk-border); color: var(--nk-text); }
.np-btn--ghost:hover{ background: var(--nk-teal-50); color: var(--nk-teal-700); border-color: var(--nk-teal-200); }
/* Icon-only button variant (e.g. the delete-doctor trash icon). Declared
   here — the canonical .np-btn source of truth — with explicit min-width/
   min-height so it isn't clamped back up by the base .np-btn's 96px/40px
   minimums at equal selector specificity. */
.np-btn--icon{
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  flex-shrink: 0;
  border-radius: 8px;
  font-size: .95rem;
}
.np-btn--ghost.np-btn--icon.np-btn--danger{
  color:#DC2626;
  border-color:rgba(220,38,38,.25);
  background:transparent;
}
.np-btn--ghost.np-btn--icon.np-btn--danger:hover{
  background:#FEF2F2; border-color:#DC2626;
}
/* Plain (non-icon) ghost+danger combo — e.g. the "Deactivate" buttons on
   Medical Centres/Receptionists/Pharmacy Users. .np-btn--ghost and
   .np-btn--danger are equal-specificity single-class rules, so which one
   wins for background/color/border when both are applied together came
   down to source order alone (.np-btn--ghost is declared later above and
   was winning, leaving Deactivate looking like a plain neutral button).
   This compound selector outranks both and makes the result deterministic,
   reusing the same red palette as the icon-only variant. */
.np-btn--ghost.np-btn--danger{
  color:#DC2626;
  border-color:rgba(220,38,38,.25);
  background:transparent;
}
.np-btn--ghost.np-btn--danger:hover{
  background:#FEF2F2; border-color:#DC2626;
}
.np-btn--add-doctor{
  box-shadow: 0 8px 22px -6px rgba(90,148,149,.55);
  background: linear-gradient(135deg, var(--nk-teal-400), var(--nk-teal-600));
  border-color: var(--nk-teal-600);
  color:#fff;
}
.np-btn--add-doctor:hover{
  box-shadow: 0 12px 26px -6px rgba(70,120,120,.65);
  background: linear-gradient(135deg, var(--nk-teal-500), var(--nk-teal-700));
}

.text-brand-primary{ color: var(--nk-teal-600) !important; }
.bg-brand-primary  { background: var(--nk-teal-400) !important; }
.bg-brand-surface  { background: var(--nk-surface) !important; }
.border-brand-primary{ border-color: var(--nk-teal-400) !important; }
.hover\:text-brand-primary:hover{ color: var(--nk-teal-600) !important; }
.hover\:bg-brand-primary:hover  { background: var(--nk-teal-500) !important; }
.from-brand-primary{ --tw-gradient-from: var(--nk-teal-400) !important; }
.to-brand-primary  { --tw-gradient-to:   var(--nk-teal-600) !important; }

/* ==========================================================================
   CANONICAL FORM CONTROL COMPONENT
   Single source of truth for every text input, select and textarea across
   both panels. Previously declared three times with different padding,
   border-radius and chevron reservations — the root cause of clipped
   dropdown text ("All ty…") and mismatched control heights. Page
   stylesheets must not redeclare this box model.
   ========================================================================== */
.np-input, .np-select, .np-textarea, .np-select-native,
input.np-input, select.np-select, textarea.np-textarea, select.np-select-native{
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: .6rem .8rem;
  border-radius: 10px;
  border: 1px solid var(--nk-border);
  background: var(--nk-card);
  font-size: .88rem;
  line-height: 1.4;
  color: var(--nk-text);
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.np-input:focus, .np-select:focus, .np-textarea:focus, .np-select-native:focus{
  border-color: var(--nk-teal-400);
  box-shadow: var(--nk-ring-primary);
  outline: none;
}
/* One select treatment everywhere: custom chevron + guaranteed right-hand
   clearance so the selected option never renders under the arrow. The
   background shorthand is deliberate — a later background-color on :focus
   can never reset the image layer (that reset was the "jumping chevron"
   regression in Previous Records). */
select.np-select, select.np-input, .np-select{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.35rem;
  background: var(--nk-card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right .85rem center;
  background-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}
select.np-select:focus, select.np-input:focus, .np-select:focus{
  background: var(--nk-card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right .85rem center;
  background-size: 12px;
}
/* Native-arrow selects (hour/AM-PM pickers) keep the OS glyph but still
   reserve room so the value never sits underneath it. */
.np-select-native{ appearance: auto; -webkit-appearance: auto; padding-right: 2rem; }
/* Native date/time inputs everywhere (not just filter bars): the visible
   calendar glyph is now a drawn icon rather than the native picker
   indicator — see the "CANONICAL DATE/TIME ICON" block at the end of this
   file for the full app-wide treatment (Admin, Doctor, Receptionist and
   Pharmacy all share it). Cursor stays pointer here since the field is
   clickable everywhere via NPDatePicker in np-ui.js. */
.np-input[type="date"], .np-input[type="time"], .np-input[type="datetime-local"],
input.np-input[type="date"], input.np-input[type="time"], input.np-input[type="datetime-local"]{
  cursor: pointer;
}
/* File inputs (KYC docs, doctor photo/signature, historical-record
   attachments) were inheriting the same fixed padding/height box model
   as text inputs. That model fights the browser's own internal
   button+filename layout instead of sizing around it, which is what
   was clipping the filename to things like "No fi...osen". File inputs
   get their own, lighter treatment plus a themed selector button so it
   reads as part of the design system instead of raw OS chrome. */
.np-textarea{ min-height: 80px; resize: vertical; }
/* Date/time pickers: explicit height keeps them level with text inputs
   and buttons; color-scheme keeps the calendar/clock indicator visible
   in dark mode (previously rendered black-on-dark). */
.np-input[type="date"], .np-input[type="time"], .np-input[type="datetime-local"]{
  min-height: 40px;
}
html[data-theme="dark"] .np-input[type="date"],
html[data-theme="dark"] .np-input[type="time"],
html[data-theme="dark"] .np-input[type="datetime-local"]{
  color-scheme: dark;
}
/* ==========================================================================
   CANONICAL FILE FIELD COMPONENT
   Native <input type="file"> chrome styled once for both themes — the
   OS-rendered "No file chosen" text and the file-selector button were the
   mismatched, low-contrast controls reported in the KYC upload section.
   ========================================================================== */
input[type="file"].np-input{
  display: flex;
  align-items: center;
  height: auto;
  min-height: 40px;
  overflow: hidden;
  padding: .45rem .5rem;
  color: var(--nk-text);
  font-size: .82rem;
}
input[type="file"].np-input::-webkit-file-upload-button,
input[type="file"].np-input::file-selector-button{
  background: var(--nk-card);
  color: var(--nk-text);
  border: 1px solid var(--nk-border);
  border-radius: 8px;
  padding: .4rem .75rem;
  margin-right: .6rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
input[type="file"].np-input::-webkit-file-upload-button:hover,
input[type="file"].np-input::file-selector-button:hover{
  background: var(--nk-teal-50);
  border-color: var(--nk-teal-200);
  color: var(--nk-teal-700);
}
.np-field__label{ color: var(--nk-ink); font-weight: 600; font-size: .82rem; overflow-wrap: normal; word-break: normal; white-space: normal; }
.np-field__hint { color: var(--nk-muted); font-size: .76rem; }
.np-error{
  background:#FFF1F3; border:1px solid #FCC7D2; color:#9F1E36;
  border-radius: 12px;
  padding: .6rem .8rem;
  font-size: .85rem;
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}
.np-search input{
  border-radius: 12px;
  border-color: var(--nk-border);
}
.np-search input:focus{
  border-color: var(--nk-teal-400);
  box-shadow: var(--nk-ring-primary);
}

/* ==========================================================================
   CANONICAL DIVIDER COMPONENT
   A thin, intentional section rule — used inside forms/panels to separate
   sub-sections. Previously redefined per-page (an invisible height-only
   spacer on the Admin panel, a visible line with different color/margin on
   the Doctor panel), which is why the same markup looked different in each
   panel. It is no longer placed between the dashboard KPI grid and the
   analytics card — that gap is handled by `.np-kpi-grid`'s own spacing
   below, which is what actually produced the stray "blue line" there.
   ========================================================================== */
.np-divider{
  height: 1px;
  background: var(--nk-border-soft);
  border: 0;
  margin: 1rem 0;
}

/* Consistent vertical rhythm between the dashboard KPI grid and whatever
   follows it (analytics/snapshot panels), on both panels — fixes "KPI
   cards too close to analytics" / inconsistent section spacing at the
   source instead of per-page margin patches. */
.np-kpi-grid{ margin-bottom: 1.5rem; }

/* ==========================================================================
   CANONICAL BADGE / PILL / CHIP COMPONENT
   Single source of truth for every status pill, chip and badge across the
   Admin Panel and Doctor Panel. Do not redeclare `.np-badge`, `.np-pill` or
   `.np-chip` base rules anywhere else — page stylesheets may only add
   layout placement (e.g. margins relative to a specific container).
   ========================================================================== */
/* ==========================================================================
   CANONICAL PAGINATION COMPONENT
   Used anywhere a list can be paged (Notification Logs, tables, etc).
   Dark-mode styling already existed for this component further below —
   this is the missing light-mode base that makes it actually usable.
   ========================================================================== */
.np-pagination{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:.6rem;
  padding-top: .85rem;
  margin-top: .85rem;
  border-top: 1px solid var(--nk-border-soft);
}
.np-pagination__info{ font-size:.8rem; color: var(--nk-muted); }
.np-pagination__controls{ display:flex; align-items:center; gap:.35rem; }
.np-pagination button,
.np-pager button,
.np-page-btn,
.np-pagination__btn{
  display:inline-flex; align-items:center; justify-content:center;
  min-width: 34px; height: 34px;
  padding: 0 .55rem;
  border-radius: 9px;
  border: 1px solid var(--nk-border);
  background: #fff;
  color: var(--nk-text);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.np-pagination button:hover:not(:disabled),
.np-pager button:hover:not(:disabled),
.np-page-btn:hover:not(:disabled),
.np-pagination__btn:hover:not(:disabled){
  background: var(--nk-teal-50);
  color: var(--nk-teal-700);
  border-color: var(--nk-teal-200);
}
.np-pagination button.is-active,
.np-pager button.is-active,
.np-page-btn.is-active,
.np-pagination__btn.is-active{
  background: var(--nk-teal-400);
  border-color: var(--nk-teal-400);
  color: #fff;
}
.np-pagination button:disabled,
.np-pager button:disabled,
.np-page-btn:disabled,
.np-pagination__btn:disabled{
  opacity: .45;
  cursor: not-allowed;
}
/* On narrow screens the split info/controls layout drifted apart and read as
   detached from the list above it. Stack them, keep the divider, and give the
   controls full-width equal buttons so the block stays visually tied to its
   table/card list. */
@media (max-width:640px){
  .np-pagination{
    flex-direction:column;
    align-items:stretch;
    gap:.5rem;
    text-align:center;
  }
  .np-pagination__info{ order:2; }
  .np-pagination__controls{ order:1; justify-content:center; gap:.5rem; }
  .np-pagination__controls .np-pagination__btn{ flex:1 1 auto; min-height:40px; }
}

.np-badge, .np-pill, .np-chip{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  font-weight: 600;
  padding: .22rem .65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .74rem;
  line-height: 1.4;
  letter-spacing: .01em;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  /* Root fix for the app-wide "stretched pill" bug: whenever a badge/pill/chip
     sits directly inside a flex or grid container (card lists, mobile
     data-label rows, KPI rows, bill-line rows, etc.) the container's default
     stretch alignment was pulling it to fill the full cross-axis size,
     turning a small rounded pill into a tall/wide smear. Pills must always
     size to their own content, in every context, everywhere in the app —
     so this is fixed once here instead of re-patched per screen. */
  flex: 0 0 auto;
  align-self: flex-start;
  width: fit-content;
}
.np-pill{ font-size:.8rem; }
.np-badge__dot{ width:6px; height:6px; border-radius:999px; background: currentColor; flex: 0 0 auto; }

.np-badge--green , .np-pill--green { background:#DCF5EE; color:#0F7A66; border-color:#BBE5C8; }
.np-badge--mint  , .np-pill--mint  { background: var(--nk-teal-100); color: var(--nk-teal-700); border-color: var(--nk-teal-200); }
.np-badge--blue  , .np-pill--blue  { background:#DBEAFE; color:#1E40AF; border-color:#BFD7F0; }
.np-badge--violet, .np-pill--violet{ background:#F1E4F3; color:#7A3D85; border-color:#E4CBE9; }
.np-badge--amber , .np-pill--amber { background:#FEF3CC; color:#8A5A0F; border-color:#F4D9A3; }
.np-badge--red   , .np-pill--red   { background:#FEE2E5; color:#9F1E36; border-color:#F5BFBF; }
.np-badge--slate , .np-pill--slate { background:#EEF2F4; color:#475569; border-color:#D7DEE8; }
.np-badge--pink  , .np-pill--pink  { background: var(--nk-pink-100); color: var(--nk-pink-700); border-color: var(--nk-pink-200); }

/* Badges/pills sitting next to each other (e.g. Status + audience pill in
   the Notification Logs table) always keep a consistent, breathable gap —
   never rely on a page-level inline margin. */
.np-badge-group{ display:inline-flex; align-items:center; gap:.4rem; flex-wrap:wrap; }

.np-callout{
  display:flex;
  align-items:flex-start;
  gap:.65rem;
  padding:.75rem .9rem;
  border-radius: var(--nk-radius-sm);
  border:1px solid transparent;
  font-size:.85rem;
  line-height:1.45;
}
.np-callout svg{ flex:none; margin-top:.1rem; }
.np-callout--info{ background: var(--nk-teal-50); border-color: var(--nk-teal-200); color: var(--nk-ink); }
.np-callout--info svg{ color: var(--nk-teal-600); }
.np-callout--success{ background:#EAFBF3; border-color:#BBE5C8; color:#0F7A66; }
.np-callout--success svg{ color:#0F7A66; }
.np-callout--warning{ background:#FEF3CC; border-color:#F4D9A3; color:#8A5A0F; }
.np-callout--warning svg{ color:#8A5A0F; }
.np-callout--danger{ background:#FEE2E5; border-color:#F5BFBF; color:#9F1E36; }
.np-callout--danger svg{ color:#9F1E36; }

html[data-theme="dark"] .np-callout--success{ background: rgba(16,185,129,.14); border-color: rgba(16,185,129,.3); color:#6EE7B7; }
html[data-theme="dark"] .np-callout--success svg{ color:#6EE7B7; }
html[data-theme="dark"] .np-callout--warning{ background: rgba(249,169,69,.16); border-color: rgba(249,169,69,.32); color:#FBC97A; }
html[data-theme="dark"] .np-callout--warning svg{ color:#FBC97A; }
html[data-theme="dark"] .np-callout--danger{ background: rgba(225,29,72,.16); border-color: rgba(225,29,72,.32); color:#FECDD3; }
html[data-theme="dark"] .np-callout--danger svg{ color:#FECDD3; }

/* (Pill/badge/chip stretch prevention now lives once, at the base
   .np-badge/.np-pill/.np-chip rule above — see the note there. This
   table/appt-specific override is no longer needed and was removed so the
   rule isn't duplicated in two places. */

.np-table-wrap{
  border:1px solid var(--nk-border-soft);
  border-radius: 16px;
  background:#fff;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 70vh;
  -webkit-overflow-scrolling: touch;
}
.np-table th{
  background: var(--nk-teal-50);
  color: var(--nk-teal-700);
  border-bottom: 1px solid var(--nk-border);
  font-weight:700;
  text-transform: uppercase;
  letter-spacing:.04em;
  font-size:.72rem;
}
.np-table td{ border-bottom: 1px solid var(--nk-border-soft); }
.np-table tr:hover td{ background: var(--nk-row-hover); }
.np-table .np-empty{ background:#FBFDFD; }

/* ==========================================================================
   CANONICAL LOGIN SCREEN
   One definition for both panels. This used to be split three ways —
   theme.css set radius/shadow/logo size, while admin/styles.css and
   doctor/styles.css each separately set width/padding/background (with
   different values: 420px vs 440px card width, 56px vs 64px logo,
   flat card vs glassmorphism) — which is why the two login pages looked
   like different sizes and different designs.
   ========================================================================== */
.np-login{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(137,188,189,.28), transparent 60%),
    radial-gradient(900px 600px at 0% 110%, rgba(254,132,164,.18), transparent 60%),
    radial-gradient(700px 500px at 50% 50%, rgba(254,217,96,.10), transparent 70%),
    var(--nk-surface);
}
.np-login__card{
  width: 100%;
  max-width: 430px;
  padding: 2rem;
  border-radius: 28px;
  box-shadow: var(--nk-shadow-lg);
  border:1px solid #E2EEEE;
  background: #fff;
  position: relative;
  overflow: hidden;
}
.np-login__card::before{
  content:""; position:absolute; inset:0 0 auto 0; height:6px;
  background: linear-gradient(90deg, var(--nk-teal-400), var(--nk-pink-400), var(--nk-yellow-400));
}
.np-login__logo{
  width: 60px; height: 60px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .9rem;
  color: #fff;
  background: var(--nk-grad-primary);
  box-shadow: 0 12px 26px -8px rgba(137,188,189,.5);
}
.np-login__title{ color: var(--nk-ink); font-weight: 700; letter-spacing:-.01em; font-size:1.35rem; text-align:center; }
.np-login__subtitle{ color: var(--nk-muted); font-size:.85rem; text-align:center; margin-top:.2rem; margin-bottom:1.25rem; }
/* Real spacing for the login form's fields/buttons — replaces the
   undefined `space-y-3` / `space-y-4` classes that used to be on the
   <form>, which is why Sign in and Forgot password had no gap between
   them at all. */
#loginForm{ display:flex; flex-direction:column; gap:.85rem; }
#loginForm .np-field{ margin-bottom:0; }
@media (max-width:480px){
  .np-login__card{ padding: 1.5rem; border-radius: 22px; }
}

.np-empty__icon{
  background: linear-gradient(135deg, rgba(137,188,189,.22), rgba(254,132,164,.16));
  color: var(--nk-teal-700);
  border-radius: 16px;
}
.np-empty__title{ color: var(--nk-ink); }
.np-empty__sub  { color: var(--nk-muted); }

.np-doc-card{
  border:1.5px solid var(--nk-border-soft);
  border-radius: 18px;
  box-shadow: var(--nk-shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease, transform .15s ease;
}
.np-doc-card:hover{
  border-color: var(--nk-teal-200);
  box-shadow: var(--nk-shadow-md);
  transform: translateY(-2px);
}
.np-doc-card__avatar{
  background: linear-gradient(135deg, var(--nk-teal-400), var(--nk-teal-600));
  box-shadow: 0 0 0 1.5px rgba(137,188,189,.25), 0 2px 6px -2px rgba(15,46,58,.25);
}
.np-doc-card__stats{
  background: linear-gradient(180deg, #F4FAFA, #FBFDFD);
  border:1px solid var(--nk-border-soft);
  border-radius: 12px;
}
.np-doc-card__name{ color: var(--nk-ink); }
.np-doc-card__pill--ok  { background:#DCF5EE; color:#0F7A66; }
.np-doc-card__pill--warn{ background:#FEF3CC; color:#8A5A0F; }
.np-doc-card__pill--kyc { background: var(--nk-teal-100); color: var(--nk-teal-700); }
.np-doc-card__clinic    { background: var(--nk-teal-50); color: var(--nk-teal-700); }

.np-modal{ background: rgba(15,46,58,.55); backdrop-filter: blur(4px); }
.np-modal__panel{ border-radius: 22px; box-shadow: var(--nk-shadow-lg); }
/* Canonical modal header rhythm — single source of truth for head padding
   and the title/subtitle stack, so a subtitle can never crowd the divider
   (the Edit Previous Record "Update the fields below…" defect). */
.np-modal__head{
  padding: 1.05rem 1.25rem 1rem;
  border-bottom: 1px solid var(--nk-border-soft);
}
.np-modal__title{ color: var(--nk-ink); }
.np-modal__subtitle{
  margin-top: .3rem;
  line-height: 1.45;
  font-size: .85rem;
  color: var(--nk-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.np-modal__close:hover{ background: var(--nk-teal-50); color: var(--nk-teal-700); }

.np-drawer__backdrop{ background: rgba(15,46,58,.55); backdrop-filter: blur(4px); }
.np-drawer__panel{ border-top-left-radius: 22px; border-bottom-left-radius: 22px; box-shadow: var(--nk-shadow-lg); }
.np-drawer__head{ border-bottom: 1px solid var(--nk-border-soft); }

.np-appt-row:hover{ background: var(--nk-row-hover); }
.np-appt-row{ border-bottom: 1px solid var(--nk-border-soft); transition: background .15s ease; }

#consultWorkspace .np-pm-tab.active{
  color: var(--nk-teal-700);
  border-bottom-color: var(--nk-teal-400);
}
#consultWorkspace .np-pm-tab:hover{ color: var(--nk-teal-700); }

.np-bars__bar{
  background: linear-gradient(180deg, var(--nk-teal-400), var(--nk-teal-600));
  border-radius: 6px 6px 0 0;
}

.np-content code{
  background: var(--nk-teal-50);
  color: var(--nk-teal-700);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: .85em;
}

.np-theme-toggle{
  background: linear-gradient(135deg, var(--nk-teal-400), var(--nk-teal-600)) !important;
  box-shadow: 0 10px 26px -8px rgba(70,120,120,.55) !important;
  transition: background .2s ease, transform .15s ease, box-shadow .2s ease !important;
}
.np-theme-toggle:hover{
  background: linear-gradient(135deg, var(--nk-teal-500), var(--nk-teal-700)) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 14px 32px -8px rgba(70,120,120,.7) !important;
}

.np-chip{
  background: var(--nk-teal-50);
  border-color: var(--nk-teal-200);
  color: var(--nk-teal-700);
  border-radius: 999px;
}
.np-palette{
  border-radius: 16px !important;
  box-shadow: var(--nk-shadow-lg) !important;
}
.np-palette__item.is-active{ background: var(--nk-teal-50); color: var(--nk-teal-700); }
.np-daterange__btn{ border-radius: 10px; }
.np-daterange__btn.is-active{ background: var(--nk-teal-400); border-color: var(--nk-teal-400); color:#fff; }
.np-dropzone{
  border-radius: 14px;
  border-style: dashed;
  background:#FBFDFD;
}
.np-dropzone:hover, .np-dropzone.is-drag{
  background: var(--nk-teal-50);
  border-color: var(--nk-teal-400);
  color: var(--nk-teal-700);
}

@keyframes np-fade-in   { from{opacity:0; transform:translateY(4px)} to{opacity:1; transform:none} }
@keyframes np-pulse-soft{ 0%,100%{opacity:1} 50%{opacity:.6} }
.np-panel, .np-card, .np-kpi, .np-doc-card{ animation: np-fade-in .25s ease both; }
.np-skeleton{ animation: np-pulse-soft 1.4s ease-in-out infinite; background:#EEF3F3; border-radius:8px; }

html[data-theme="dark"]{
  --nk-ink:       #F4F9FA;
  --nk-ink-2:     #DDE7EA;
  --nk-text:      #E6EEF1;
  --nk-muted:     #91A6B0;
  --nk-surface:   #0A1216;
  --nk-card:      #11202A;
  --nk-border:    #234551;
  --nk-border-soft:#1A323C;
  --nk-row-hover: #18303A;

--nk-teal-50:   rgba(137,188,189,.10);
  --nk-teal-100:  rgba(137,188,189,.18);
  --nk-teal-200:  rgba(137,188,189,.32);
  --nk-teal-300:  #B4D7D7;
  --nk-teal-400:  #A4CDCE;
  --nk-teal-500:  #89BCBD;
  --nk-teal-600:  #6FAAAB;
  --nk-teal-700:  #5A9495;

--nk-pink-50:   rgba(254,132,164,.10);
  --nk-pink-100:  rgba(254,132,164,.18);
  --nk-pink-200:  rgba(254,132,164,.32);
  --nk-pink-400:  #FE9CB7;
  --nk-pink-600:  #F46A8E;
  --nk-pink-700:  #FE9CB7;

  --nk-blush:     #1A323C;
  --nk-shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 6px 16px -6px rgba(0,0,0,.55);
  --nk-shadow-md: 0 4px 12px -2px rgba(0,0,0,.5),  0 16px 32px -12px rgba(0,0,0,.6);
  --nk-shadow-lg: 0 30px 60px -16px rgba(0,0,0,.75);
  --nk-ring-primary: 0 0 0 4px rgba(164,205,206,.28);

--np-surface: var(--nk-surface);
  --np-border:  var(--nk-border);
  --np-muted:   var(--nk-muted);
  --np-text:    var(--nk-text);
  --np-ink:     var(--nk-ink);
  --np-primary: var(--nk-teal-500);
  --np-primary-600: var(--nk-teal-400);
  --np-blue: var(--nk-teal-500);
  --np-mint: rgba(137,188,189,.18);
  --np-card-shadow: var(--nk-shadow-sm);
  --np-card-shadow-hover: var(--nk-shadow-md);
  --np-surface-2: #12222C;
  --np-text-mut: var(--nk-muted);

  color-scheme: dark;
}

html[data-theme="dark"] body{
  background: var(--nk-surface);
  color: var(--nk-text);
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb{ background:#2C4A56; }
html[data-theme="dark"] *::-webkit-scrollbar-thumb:hover{ background:#406877; }

html[data-theme="dark"] .np-sidebar{
  background: #0D1A21;
  border-right-color: var(--nk-border) !important;
}
html[data-theme="dark"] .np-sidebar__brand{
  background: linear-gradient(180deg, rgba(137,188,189,.12), transparent);
  border-bottom-color: var(--nk-border-soft);
}
html[data-theme="dark"] .np-sidebar__title{ color: var(--nk-ink); }
html[data-theme="dark"] .np-sidebar__subtitle,
html[data-theme="dark"] .np-sidebar__footer{ color: var(--nk-muted); }
html[data-theme="dark"] .np-sidebar__section{ color: var(--nk-teal-400); }
html[data-theme="dark"] .np-sidebar__footer{ border-top-color: var(--nk-border-soft); }

html[data-theme="dark"] .np-nav-item{ color:#C8D5DB; }
html[data-theme="dark"] .np-nav-item:hover{
  background: rgba(137,188,189,.14);
  color: var(--nk-teal-300);
}
html[data-theme="dark"] .np-nav-item.active{
  background: linear-gradient(135deg, rgba(137,188,189,.28), rgba(137,188,189,.10));
  color: var(--nk-teal-300);
  border-color: rgba(137,188,189,.45);
  box-shadow: inset 0 0 0 1px rgba(137,188,189,.30);
}
html[data-theme="dark"] .np-nav-item.active .np-nav-item__icon{ color: var(--nk-teal-300); }
html[data-theme="dark"] .np-nav-badge{ background: var(--nk-pink-400); color:#1A0E14; }

html[data-theme="dark"] .np-header,
html[data-theme="dark"] .np-topbar{
  background: var(--nk-card) !important;
  border-bottom-color: var(--nk-border) !important;
}
html[data-theme="dark"] .np-header__page-title{ color: var(--nk-ink); }
html[data-theme="dark"] .np-header__page-subtitle{ color: var(--nk-muted); }

html[data-theme="dark"] .np-iconbtn{
  background: var(--nk-card);
  color: var(--nk-text);
  border-color: var(--nk-border);
}
html[data-theme="dark"] .np-iconbtn:hover{
  background: rgba(137,188,189,.14);
  color: var(--nk-teal-300);
  border-color: rgba(137,188,189,.40);
}

html[data-theme="dark"] .np-profile__trigger{ color: var(--nk-text); }
html[data-theme="dark"] .np-profile__trigger:hover{
  background: rgba(137,188,189,.12);
  border-color: rgba(137,188,189,.40);
}
html[data-theme="dark"] .np-profile__name{ color: var(--nk-ink); }
html[data-theme="dark"] .np-profile__role{ color: var(--nk-muted); }
html[data-theme="dark"] .np-profile__menu{
  background: var(--nk-card) !important;
  border-color: var(--nk-border) !important;
}
html[data-theme="dark"] .np-profile__menu-item{ color: var(--nk-text); }
html[data-theme="dark"] .np-profile__menu-item:hover{
  background: rgba(137,188,189,.14);
  color: var(--nk-teal-300);
}
html[data-theme="dark"] .np-profile__menu-item.is-danger{ color:#FCA5A5; }
html[data-theme="dark"] .np-profile__menu-item.is-danger:hover{ background: rgba(252,165,165,.12); }
html[data-theme="dark"] .np-profile__menu-divider{ background: var(--nk-border-soft); }
html[data-theme="dark"] .np-profile__id{ border-bottom-color: var(--nk-border-soft); }
html[data-theme="dark"] .np-profile__id-name{ color: var(--nk-ink); }
html[data-theme="dark"] .np-profile__id-role{ color: var(--nk-teal-300); }
html[data-theme="dark"] .np-profile__id-email{ color: var(--nk-muted); }

html[data-theme="dark"] .np-panel,
html[data-theme="dark"] .np-card,
html[data-theme="dark"] .np-kpi,
html[data-theme="dark"] .np-table-wrap,
html[data-theme="dark"] .np-modal__panel,
html[data-theme="dark"] .np-modal__card,
html[data-theme="dark"] .np-drawer__panel,
html[data-theme="dark"] .np-doc-card{
  background: var(--nk-card) !important;
  color: var(--nk-text) !important;
  border-color: var(--nk-border) !important;
  box-shadow: var(--nk-shadow-sm);
}
html[data-theme="dark"] .np-panel__title,
html[data-theme="dark"] .np-modal__title,
html[data-theme="dark"] .np-drawer__title,
html[data-theme="dark"] .np-kpi__value,
html[data-theme="dark"] .np-doc-card__name,
html[data-theme="dark"] .np-ink{
  color: var(--nk-ink) !important;
}
html[data-theme="dark"] .np-panel__subtitle,
html[data-theme="dark"] .np-kpi__label,
html[data-theme="dark"] .np-kpi__sub,
html[data-theme="dark"] .np-doc-card__role,
html[data-theme="dark"] .np-doc-card__qual,
html[data-theme="dark"] .np-doc-card__contact,
html[data-theme="dark"] .np-mut,
html[data-theme="dark"] .np-empty,
html[data-theme="dark"] .np-empty__sub{
  color: var(--nk-muted) !important;
}
html[data-theme="dark"] .np-empty__title{ color: var(--nk-ink) !important; }
html[data-theme="dark"] .np-doc-card__avatar{ border-color: var(--nk-card); }
html[data-theme="dark"] .np-doc-card__stats{
  background:#0E1A22;
  border-color: var(--nk-border);
}
html[data-theme="dark"] .np-doc-card__stat-label{ color: var(--nk-muted); }
html[data-theme="dark"] .np-doc-card__stat-value{ color: var(--nk-ink); }
html[data-theme="dark"] .np-doc-card__clinic{ background: rgba(137,188,189,.16); color: var(--nk-teal-300); }
html[data-theme="dark"] .np-doc-card__pill--ok{ background: rgba(34,197,148,.18); color:#7AE0BE; }
html[data-theme="dark"] .np-doc-card__pill--warn{ background: rgba(249,169,69,.18); color:#FBC97A; }
html[data-theme="dark"] .np-doc-card__pill--kyc{ background: rgba(137,188,189,.18); color: var(--nk-teal-300); }
html[data-theme="dark"] .np-doc-card__actions{ border-top-color: var(--nk-border); }

html[data-theme="dark"] .np-kpi::before{ filter: brightness(1.18) saturate(1.1); }

html[data-theme="dark"] .np-table{ color: var(--nk-text); }
html[data-theme="dark"] .np-table th{
  background:#0E1A22 !important;
  color: var(--nk-teal-300) !important;
  border-bottom-color: var(--nk-border) !important;
}
html[data-theme="dark"] .np-table td{
  border-bottom-color: var(--nk-border-soft) !important;
  color: var(--nk-text);
}
html[data-theme="dark"] .np-table tr:hover td{ background: var(--nk-row-hover) !important; }
html[data-theme="dark"] .np-table .np-empty{ background:#0E1A22; }

html[data-theme="dark"] .np-input,
html[data-theme="dark"] .np-select,
html[data-theme="dark"] .np-textarea,
html[data-theme="dark"] input:not([type=button]):not([type=submit]):not([type=checkbox]):not([type=radio]):not([type=range]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background-color:#0E1A22 !important;
  color: var(--nk-text) !important;
  border-color: var(--nk-border) !important;
}
html[data-theme="dark"] .np-input::placeholder,
html[data-theme="dark"] .np-textarea::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{ color:#6F8693 !important; }
html[data-theme="dark"] .np-input:focus,
html[data-theme="dark"] .np-select:focus,
html[data-theme="dark"] .np-textarea:focus,
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus{
  border-color: var(--nk-teal-400) !important;
  box-shadow: var(--nk-ring-primary) !important;
}
html[data-theme="dark"] .np-field__label{ color:#DEE6EA; }
html[data-theme="dark"] .np-field__hint{ color: var(--nk-muted); }
html[data-theme="dark"] .np-error{
  background: rgba(225,29,72,.14) !important;
  border-color: rgba(225,29,72,.45) !important;
  color:#FECDD3 !important;
}
/* .np-search input's actual dark background/color come from the
   !important rule in the "v3.3.1 DEFINITIVE dark-mode consolidation"
   block further down — that rule is last in source order among three
   identical-specificity !important declarations, so it always won.
   This rule never rendered; kept only the unique .np-search svg color. */
html[data-theme="dark"] .np-search svg{ color: var(--nk-muted); }
html[data-theme="dark"] select option{ background:#0E1A22; color: var(--nk-text); }

html[data-theme="dark"] .np-btn{
  background:#142531;
  color: var(--nk-text);
  border-color: var(--nk-border);
}
html[data-theme="dark"] .np-btn:hover{
  background: rgba(137,188,189,.16);
  color: var(--nk-teal-300);
  border-color: rgba(137,188,189,.4);
}
html[data-theme="dark"] .np-btn--ghost{ background: transparent; }
html[data-theme="dark"] .np-btn--primary{
  background: linear-gradient(135deg, var(--nk-teal-500), var(--nk-teal-700));
  border-color: var(--nk-teal-700);
  color:#fff;
}
html[data-theme="dark"] .np-btn--primary:hover{
  background: linear-gradient(135deg, var(--nk-teal-400), var(--nk-teal-600));
  color:#fff;
}
html[data-theme="dark"] .np-btn--success{
  background: linear-gradient(135deg, #2AB99A, #0F7A66);
  color:#fff;
}
html[data-theme="dark"] .np-btn--danger{
  background: linear-gradient(135deg, #EF6F87, #B53A5B);
  color:#fff;
  border-color:#B53A5B;
}
html[data-theme="dark"] .np-btn--add-doctor{
  background: linear-gradient(135deg, var(--nk-teal-500), var(--nk-teal-700));
  color:#fff;
  border-color: var(--nk-teal-700);
}
html[data-theme="dark"] .np-btn--ghost.np-btn--icon.np-btn--danger{
  color:#FCA5A5;
  border-color: rgba(252,165,165,.35);
}
html[data-theme="dark"] .np-btn--ghost.np-btn--icon.np-btn--danger:hover{
  background: rgba(252,165,165,.12);
  border-color:#FCA5A5;
}
html[data-theme="dark"] .np-btn--ghost.np-btn--danger{
  background: transparent;
  color:#FCA5A5;
  border-color: rgba(252,165,165,.35);
}
html[data-theme="dark"] .np-btn--ghost.np-btn--danger:hover{
  background: rgba(252,165,165,.12);
  border-color:#FCA5A5;
}

html[data-theme="dark"] .np-appt-row{ border-bottom-color: var(--nk-border-soft); }
html[data-theme="dark"] .np-appt-row:hover{ background: var(--nk-row-hover); }
html[data-theme="dark"] .np-appt-row__time-h,
html[data-theme="dark"] .np-appt-row__name{ color: var(--nk-ink); }
html[data-theme="dark"] .np-appt-row__time-d,
html[data-theme="dark"] .np-appt-row__meta{ color: var(--nk-muted); }
html[data-theme="dark"] #consultWorkspace .np-pm-tab{ color: var(--nk-muted); }
html[data-theme="dark"] #consultWorkspace .np-pm-tab.active{
  color: var(--nk-teal-300);
  border-bottom-color: var(--nk-teal-400);
}

html[data-theme="dark"] .np-modal{ background: rgba(2,8,12,.7); }
html[data-theme="dark"] .np-modal__head{ border-bottom-color: var(--nk-border); }
html[data-theme="dark"] .np-modal__close{ color: var(--nk-muted); }
html[data-theme="dark"] .np-modal__close:hover{ background: rgba(137,188,189,.16); color: var(--nk-teal-300); }
html[data-theme="dark"] .np-drawer__backdrop{ background: rgba(2,8,12,.65); }
html[data-theme="dark"] .np-drawer__head{ border-bottom-color: var(--nk-border); }

html[data-theme="dark"] .np-badge--green,
html[data-theme="dark"] .np-badge--mint  { background: rgba(34,197,148,.18); color:#7AE0BE; }
html[data-theme="dark"] .np-badge--blue  { background: rgba(137,188,189,.20); color: var(--nk-teal-300); }
html[data-theme="dark"] .np-badge--amber { background: rgba(249,169,69,.22); color:#FBC97A; }
html[data-theme="dark"] .np-badge--red   { background: rgba(225,29,72,.22);  color:#FECDD3; }
html[data-theme="dark"] .np-badge--slate { background: rgba(148,163,184,.18); color:#CBD5E1; }
html[data-theme="dark"] .np-badge--violet{ background: rgba(206,126,212,.22); color:#E9C2EE; }
html[data-theme="dark"] .np-badge--pink  { background: rgba(254,132,164,.20); color:#FFC2D5; }

html[data-theme="dark"] .np-empty__icon{
  background: linear-gradient(135deg, rgba(137,188,189,.22), rgba(254,132,164,.16));
  color: var(--nk-teal-300);
}

html[data-theme="dark"] .np-login{
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(137,188,189,.28), transparent 60%),
    radial-gradient(900px 600px at 0% 110%, rgba(254,132,164,.18), transparent 60%),
    #060B0F;
}
html[data-theme="dark"] .np-login__card{
  background: var(--nk-card) !important;
  border:1px solid var(--nk-border);
  color: var(--nk-text);
}
html[data-theme="dark"] .np-login__title{ color: var(--nk-ink); }
html[data-theme="dark"] .np-login__subtitle{ color: var(--nk-muted); }

html[data-theme="dark"] .text-slate-300{ color:#A3B4BD !important; }
html[data-theme="dark"] .text-slate-400,
html[data-theme="dark"] .text-slate-500{ color: var(--nk-muted) !important; }
html[data-theme="dark"] .text-slate-600,
html[data-theme="dark"] .text-slate-700,
html[data-theme="dark"] .text-slate-800,
html[data-theme="dark"] .text-slate-900{ color: var(--nk-text) !important; }
html[data-theme="dark"] .bg-white{ background: var(--nk-card) !important; }
html[data-theme="dark"] .bg-brand-surface,
html[data-theme="dark"] .bg-slate-50,
html[data-theme="dark"] .bg-slate-100{ background: var(--nk-surface) !important; }
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-slate-200,
html[data-theme="dark"] .border-slate-300{ border-color: var(--nk-border) !important; }
html[data-theme="dark"] .text-brand-primary{ color: var(--nk-teal-300) !important; }
html[data-theme="dark"] .hover\:text-brand-primary:hover{ color: var(--nk-teal-300) !important; }
html[data-theme="dark"] .bg-brand-primary{ background: var(--nk-teal-500) !important; }

html[data-theme="dark"] .np-content code,
html[data-theme="dark"] code{
  background: rgba(137,188,189,.14);
  color: var(--nk-teal-300);
}

html[data-theme="dark"] .np-palette{ background: var(--nk-card); color: var(--nk-text); }
html[data-theme="dark"] .np-palette__input{ border-bottom-color: var(--nk-border); color: var(--nk-text); }
html[data-theme="dark"] .np-palette__item{ color: var(--nk-text); }
html[data-theme="dark"] .np-palette__item.is-active{ background: rgba(137,188,189,.20); color: var(--nk-teal-300); }
html[data-theme="dark"] .np-chip{ background: rgba(137,188,189,.20); color: var(--nk-teal-300); border-color: rgba(137,188,189,.40); }
html[data-theme="dark"] .np-daterange__btn{ background:#142531; color: var(--nk-text); border-color: var(--nk-border); }
html[data-theme="dark"] .np-daterange__btn.is-active{ background: var(--nk-teal-500); color:#fff; border-color: var(--nk-teal-500); }
html[data-theme="dark"] .np-dropzone{ background:#0E1A22; color: var(--nk-muted); border-color: var(--nk-border); }
html[data-theme="dark"] .np-dropzone:hover,
html[data-theme="dark"] .np-dropzone.is-drag{
  background: rgba(137,188,189,.10); border-color: var(--nk-teal-400); color: var(--nk-teal-300);
}

html[data-theme="dark"] .np-notif-row td.np-notif-error{ color:#FECACA; }

html[data-theme="dark"] input[type=checkbox],
html[data-theme="dark"] input[type=radio]{ accent-color: var(--nk-teal-400); }

html[data-theme="dark"] .np-skeleton{ background:#1B2F39; }

@media (max-width:600px){
  .np-login__card{ border-radius: 22px; padding: 1.5rem; }
  .np-kpi__value{ font-size:1.4rem; }
  .np-header__inner{ padding:.75rem 1rem; }
  .np-panel{ border-radius: 14px; }
}

html[data-theme="dark"] [style*="color:#0F2A47"],
html[data-theme="dark"] [style*="color: #0F2A47"],
html[data-theme="dark"] [style*="color:#0F2E3A"],
html[data-theme="dark"] [style*="color: #0F2E3A"]{ color: var(--nk-ink) !important; }
html[data-theme="dark"] [style*="color:#6B7280"],
html[data-theme="dark"] [style*="color: #6B7280"],
html[data-theme="dark"] [style*="color:#64748B"],
html[data-theme="dark"] [style*="color: #64748B"]{ color: var(--nk-muted) !important; }

html[data-theme="dark"] [style*="background:#FFFBEB"],
html[data-theme="dark"] [style*="background: #FFFBEB"]{
  background: rgba(249,169,69,.12) !important;
  border-color: rgba(249,169,69,.35) !important;
  color:#FBC97A !important;
}
html[data-theme="dark"] [style*="background:#FEF2F2"],
html[data-theme="dark"] [style*="background: #FEF2F2"]{
  background: rgba(225,29,72,.12) !important;
  border-color: rgba(225,29,72,.4) !important;
  color:#FECDD3 !important;
}

html[data-theme="dark"] svg[style*="color:#64748B"]{ color: var(--nk-muted) !important; }

/* .np-setting-card base box model (padding, border-radius, box-shadow,
   hover transform) is defined once in styles.css. This block only adds
   the dark-mode override — the duplicate light-mode definition that used
   to live here (different border-radius source, no padding/box-shadow)
   was fighting the styles.css rule and is the root cause of the
   Consultation Fees / Appearance card layout inconsistency. */
html[data-theme="dark"] .np-setting-card{
  background: var(--nk-card) !important;
  border-color: var(--nk-border) !important;
  color: var(--nk-text) !important;
}
html[data-theme="dark"] .np-setting-card__icon{ box-shadow: 0 8px 22px -8px rgba(0,0,0,.6); }

html[data-theme="dark"] #statsBar > *{
  background: var(--nk-card) !important;
  color: var(--nk-text) !important;
}

html[data-theme="dark"] .border-b,
html[data-theme="dark"] .border-t,
html[data-theme="dark"] .border-r,
html[data-theme="dark"] .border-l{ border-color: var(--nk-border) !important; }
html[data-theme="dark"] .bg-amber-50  { background: rgba(249,169,69,.12) !important; color:#FBC97A !important; }
html[data-theme="dark"] .text-amber-700{ color:#FBC97A !important; }
html[data-theme="dark"] .bg-red-50    { background: rgba(225,29,72,.14) !important; }
html[data-theme="dark"] .text-red-500,
html[data-theme="dark"] .text-red-600 { color:#FCA5A5 !important; }
html[data-theme="dark"] .text-green-600{ color:#7AE0BE !important; }
html[data-theme="dark"] .border-amber-200{ border-color: rgba(249,169,69,.35) !important; }
html[data-theme="dark"] .border-red-100,
html[data-theme="dark"] .border-red-200{ border-color: rgba(225,29,72,.35) !important; }
html[data-theme="dark"] .bg-pink-50{ background: rgba(254,132,164,.12) !important; }
html[data-theme="dark"] .text-pink-600,
html[data-theme="dark"] .text-pink-700{ color:#FFC2D5 !important; }

.np-ui-toast{
  border-radius: 14px !important;
  box-shadow: var(--nk-shadow-md) !important;
}
html[data-theme="dark"] .np-ui-toast{
  background:#0F1A22 !important; color: var(--nk-text) !important;
  border:1px solid var(--nk-border) !important;
}
html[data-theme="dark"] .np-ui-modal{ background: rgba(2,8,12,.7) !important; }
html[data-theme="dark"] .np-ui-modal__panel{
  background: var(--nk-card) !important;
  color: var(--nk-text) !important;
  border:1px solid var(--nk-border) !important;
}
html[data-theme="dark"] .np-ui-modal__input{
  background:#0E1A22 !important; color: var(--nk-text) !important;
  border-color: var(--nk-border) !important;
}
html[data-theme="dark"] .np-ui-modal__title,
html[data-theme="dark"] .np-ui-empty__title{ color: var(--nk-ink) !important; }
html[data-theme="dark"] .np-ui-modal__message,
html[data-theme="dark"] .np-ui-empty__msg{ color: var(--nk-muted) !important; }

/* Default "no photo yet" avatar icon in Settings > Profile photo (admin,
   receptionist, pharmacy) — force the muted dark-mode color so it never
   renders as a plain black silhouette on the dark card background. */
html[data-theme="dark"] #ownPhotoPlaceholder{ color: var(--nk-muted) !important; }

html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="datetime-local"]{
  color-scheme: dark;
}

@media print{
  html, body{ background:#fff !important; color:#000 !important; }
  .np-sidebar, .np-header, .np-theme-toggle, .np-profile, .np-iconbtn{ display:none !important; }
  .np-panel, .np-card, .np-kpi, .np-table-wrap{
    box-shadow:none !important; border-color:#ddd !important;
  }
}

.np-accent-pink   { color: var(--nk-pink-500); }
.np-accent-orange { color: var(--nk-orange-500); }
.np-accent-yellow { color: var(--nk-yellow-500); }
.np-accent-purple { color: var(--nk-purple-500); }
.np-accent-lime   { color: var(--nk-lime-500); }
.np-bg-pink-soft  { background: var(--nk-pink-100); color: var(--nk-pink-700); }
.np-bg-mint-soft  { background: var(--nk-teal-100); color: var(--nk-teal-700); }

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible{
  outline: 2px solid var(--nk-teal-500);
  outline-offset: 2px;
  border-radius: 6px;
}
html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] [role="button"]:focus-visible{
  outline-color: var(--nk-teal-300);
}

.np-inline-panel{
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  color: var(--nk-text);
}
html[data-theme="dark"] .np-inline-panel{
  background: #0E1A22 !important;
  border-color: var(--nk-border) !important;
  color: var(--nk-text) !important;
}

html[data-theme="dark"] [style*="background:#FFF7ED"],
html[data-theme="dark"] [style*="background: #FFF7ED"]{
  background: rgba(249,169,69,.12) !important;
  border-color: rgba(249,169,69,.35) !important;
  color:#FBC97A !important;
}
html[data-theme="dark"] [style*="border:1px solid #FED7AA"],
html[data-theme="dark"] [style*="border: 1px solid #FED7AA"]{
  border-color: rgba(249,169,69,.35) !important;
}
html[data-theme="dark"] [style*="border:1px solid #FDE68A"],
html[data-theme="dark"] [style*="border: 1px solid #FDE68A"]{
  border-color: rgba(249,169,69,.35) !important;
}
html[data-theme="dark"] [style*="border:1px solid #FECACA"],
html[data-theme="dark"] [style*="border: 1px solid #FECACA"]{
  border-color: rgba(225,29,72,.4) !important;
}
html[data-theme="dark"] [style*="border:1px solid #E5E7EB"],
html[data-theme="dark"] [style*="border: 1px solid #E5E7EB"]{
  border-color: var(--nk-border) !important;
}
html[data-theme="dark"] [style*="color:#B91C1C"],
html[data-theme="dark"] [style*="color: #B91C1C"]{ color:#FCA5A5 !important; }
html[data-theme="dark"] [style*="color:#92400E"],
html[data-theme="dark"] [style*="color: #92400E"]{ color:#FBC97A !important; }

html[data-theme="dark"] [style*="color:#0F172A"],
html[data-theme="dark"] [style*="color: #0F172A"],
html[data-theme="dark"] [style*="color:#111827"],
html[data-theme="dark"] [style*="color: #111827"],
html[data-theme="dark"] [style*="color:#1E293B"],
html[data-theme="dark"] [style*="color: #1E293B"]{ color: var(--nk-ink) !important; }
html[data-theme="dark"] [style*="color:#374151"],
html[data-theme="dark"] [style*="color: #374151"],
html[data-theme="dark"] [style*="color:#475569"],
html[data-theme="dark"] [style*="color: #475569"]{ color: var(--nk-text) !important; }

html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="url"]{
  background-color:#0E1A22 !important;
  color: var(--nk-text) !important;
  border-color: var(--nk-border) !important;
}

html[data-theme="dark"] .np-pagination button,
html[data-theme="dark"] .np-pager button,
html[data-theme="dark"] .np-page-btn{
  background:#142531 !important;
  color: var(--nk-text) !important;
  border-color: var(--nk-border) !important;
}
html[data-theme="dark"] .np-pagination button:hover,
html[data-theme="dark"] .np-pager button:hover,
html[data-theme="dark"] .np-page-btn:hover{
  background: rgba(137,188,189,.14) !important;
  border-color: rgba(137,188,189,.40) !important;
  color: var(--nk-teal-300) !important;
}
html[data-theme="dark"] .np-pagination button.is-active,
html[data-theme="dark"] .np-pager button.is-active,
html[data-theme="dark"] .np-page-btn.is-active{
  background: var(--nk-teal-500) !important;
  border-color: var(--nk-teal-500) !important;
  color:#fff !important;
}

html[data-theme="dark"] .np-tooltip,
html[data-theme="dark"] [data-tooltip]::after{
  background:#11202A !important;
  color: var(--nk-text) !important;
  border:1px solid var(--nk-border) !important;
}

html[data-theme="dark"] svg text{ fill: var(--nk-text); }
html[data-theme="dark"] svg .np-chart-grid,
html[data-theme="dark"] svg .np-chart-axis{ stroke: var(--nk-border); }

html[data-theme="dark"] .bg-gray-50,
html[data-theme="dark"] .bg-gray-100,
html[data-theme="dark"] .bg-neutral-50,
html[data-theme="dark"] .bg-neutral-100{ background: var(--nk-surface) !important; }
html[data-theme="dark"] .bg-gray-200{ background:#1B2F39 !important; }
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-neutral-500,
html[data-theme="dark"] .text-neutral-600{ color: var(--nk-muted) !important; }
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-neutral-700,
html[data-theme="dark"] .text-neutral-800,
html[data-theme="dark"] .text-neutral-900{ color: var(--nk-text) !important; }
html[data-theme="dark"] .border-gray-100,
html[data-theme="dark"] .border-gray-200,
html[data-theme="dark"] .border-gray-300,
html[data-theme="dark"] .border-neutral-200,
html[data-theme="dark"] .border-neutral-300{ border-color: var(--nk-border) !important; }

.np-inline-note{
  background:#FFF7ED;
  border:1px solid #FED7AA;
  color: var(--nk-text);
}
html[data-theme="dark"] .np-inline-note{
  background: rgba(249,169,69,.12) !important;
  border-color: rgba(249,169,69,.35) !important;
  color:#FBC97A !important;
}

.np-settlement-card{
  border-radius:10px;
  padding:.75rem .9rem;
  border:1px solid transparent;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.np-settlement-card[data-settlement-status="PAID"]{
  background:#ECFDF5; border-color:#A7F3D0; color:#065F46;
}
.np-settlement-card[data-settlement-status="GENERATED"]{
  background:#FEF3C7; border-color:#FCD34D; color:#92400E;
}
.np-settlement-card[data-settlement-status="NOT_GENERATED"],
.np-settlement-card:not([data-settlement-status]){
  background:#F4F8FB; border-color:#E5E7EB; color:#475569;
}
html[data-theme="dark"] .np-settlement-card[data-settlement-status="PAID"]{
  background: rgba(34,197,148,.14) !important;
  border-color: rgba(34,197,148,.35) !important;
  color:#7AE0BE !important;
}
html[data-theme="dark"] .np-settlement-card[data-settlement-status="GENERATED"]{
  background: rgba(249,169,69,.14) !important;
  border-color: rgba(249,169,69,.40) !important;
  color:#FBC97A !important;
}
html[data-theme="dark"] .np-settlement-card[data-settlement-status="NOT_GENERATED"],
html[data-theme="dark"] .np-settlement-card:not([data-settlement-status]){
  background:#0E1A22 !important;
  border-color: var(--nk-border) !important;
  color: var(--nk-muted) !important;
}
html[data-theme="dark"] .np-settlement-card code{
  background: rgba(137,188,189,.14);
  color: var(--nk-teal-300);
  padding:1px 6px;
  border-radius:4px;
}

.np-success-card{
  background:#ECFDF5;
  border:1px solid #10B981;
  color:#065F46;
}
.np-success-card__title{ color:#065F46; }
html[data-theme="dark"] .np-success-card{
  background: rgba(34,197,148,.14) !important;
  border-color: rgba(34,197,148,.40) !important;
  color:#7AE0BE !important;
}
html[data-theme="dark"] .np-success-card__title{ color:#9DEAC9 !important; }

html[data-theme="dark"] [style*="border-top:1px dashed #E5E7EB"],
html[data-theme="dark"] [style*="border-top: 1px dashed #E5E7EB"],
html[data-theme="dark"] [style*="border-bottom:1px dashed #E5E7EB"],
html[data-theme="dark"] [style*="border-bottom: 1px dashed #E5E7EB"],
html[data-theme="dark"] [style*="border-left:1px dashed #E5E7EB"],
html[data-theme="dark"] [style*="border-right:1px dashed #E5E7EB"]{
  border-color: var(--nk-border-soft) !important;
}

/* ===================================================================
   Design System v3.2 additions
   Consolidated into the single theme file (no new patch/CSS files).
   Adds: standardized theme switch, unified badges/pills, filter action
   buttons, overflow-menu appearance, dashboard grid dark-mode polish.
   =================================================================== */

/* ---------- Theme switch (Settings page) ---------- */
.np-theme-switch{
  display: inline-flex;
  gap: .35rem;
  padding: .3rem;
  border-radius: 999px;
  background: var(--nk-teal-50);
  border: 1px solid var(--nk-border-soft);
}
.np-theme-switch__opt{
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .95rem;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--nk-muted);
  font: 600 .84rem/1 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.np-theme-switch__opt:hover{ color: var(--nk-teal-700); }
.np-theme-switch__opt.is-active{
  background: #fff;
  color: var(--nk-teal-700);
  box-shadow: 0 1px 2px rgba(15,46,58,.06), 0 4px 12px -6px rgba(15,46,58,.14);
}
.np-setting-card__hint{
  font-size: .78rem;
  color: var(--nk-muted);
  margin: .75rem 0 0;
}
html[data-theme="dark"] .np-theme-switch{
  background: rgba(137,188,189,.10);
  border-color: var(--nk-border);
}
html[data-theme="dark"] .np-theme-switch__opt{ color: var(--nk-muted); }
html[data-theme="dark"] .np-theme-switch__opt.is-active{
  background: var(--nk-card);
  color: var(--nk-teal-300);
  box-shadow: 0 1px 2px rgba(0,0,0,.5), 0 6px 18px -8px rgba(0,0,0,.6);
}
html[data-theme="dark"] .np-setting-card__hint{ color: var(--nk-muted); }

/* ---------- Standardized filter action buttons ---------- */
/* Compact Apply/Clear \u2014 never stretched to full row width */
.np-filter-actions,
.np-filter-actions--right{
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}
/* Sizing here matches the canonical .np-btn base — this block only exists
   to guarantee Apply/Clear never stretch full-width on wider viewports. */
@media (max-width: 520px){
  .np-filter-actions,
  .np-filter-actions--right{ width: 100%; justify-content: flex-end; }
  .np-filter-actions .np-btn,
  .np-filter-actions--right .np-btn{ min-width: 0; flex: 0 1 auto; }
}

/* ---------- Overflow / dropdown / popover ---------- */
.np-overflow-menu{
  min-width: 200px;
  max-width: min(260px, calc(100vw - 24px));
  max-height: min(60vh, 360px);
  overflow: auto;
  border-radius: 12px;
  box-shadow: 0 14px 40px -8px rgba(15,46,58,.22), 0 2px 6px rgba(15,46,58,.08);
  background: #fff;
  border: 1px solid var(--nk-border-soft);
}
html[data-theme="dark"] .np-overflow-menu{
  background: var(--nk-card) !important;
  border-color: var(--nk-border) !important;
  box-shadow: 0 20px 48px -12px rgba(0,0,0,.75), 0 2px 6px rgba(0,0,0,.4);
}
html[data-theme="dark"] .np-overflow-item{ color: var(--nk-text); }
html[data-theme="dark"] .np-overflow-item:hover{
  background: rgba(137,188,189,.14);
  color: var(--nk-teal-300);
}
html[data-theme="dark"] .np-overflow-item.is-danger{ color: #FCA5A5; }
html[data-theme="dark"] .np-overflow-item.is-danger:hover{
  background: rgba(252,165,165,.12);
  color: #FECDD3;
}
html[data-theme="dark"] .np-overflow-trigger{
  background: transparent;
  color: var(--nk-muted);
  border-color: var(--nk-border);
}
html[data-theme="dark"] .np-overflow-trigger:hover{
  background: rgba(137,188,189,.12);
  color: var(--nk-teal-300);
  border-color: rgba(137,188,189,.4);
}

/* Button sizing/anti-stretch rules live in one place only — see the
   canonical .np-btn definition near the top of this file. */

/* Badge/pill/chip base rule lives in one place only — see the canonical
   definition near the top of this file. (Duplicate block removed as part
   of the Finance/Notifications UI consistency audit.) */

/* ---------- Empty states dark polish ---------- */
html[data-theme="dark"] .np-empty__icon{
  background: linear-gradient(135deg, rgba(137,188,189,.20), rgba(254,132,164,.14));
  color: var(--nk-teal-300);
}

/* ---------- Sidebar sticky helpers ---------- */
html[data-theme="dark"] .np-sidebar__nav::-webkit-scrollbar-thumb{ background:#2C4A56; }

/* ---------- Table dark polish ---------- */
html[data-theme="dark"] .np-table-wrap{
  background: var(--nk-card) !important;
  border-color: var(--nk-border) !important;
}
html[data-theme="dark"] .np-table thead th{
  position: sticky;
  top: 0;
  z-index: 1;
}

/* ---------- Inputs dark placeholder polish ---------- */
html[data-theme="dark"] input::-webkit-datetime-edit,
html[data-theme="dark"] input::-webkit-datetime-edit-fields-wrapper{ color: var(--nk-text); }

/* ---------- Toast / tooltip / notification dark polish ----------
   .np-tooltip's actual dark colors come from the !important rule
   near the top of the file (html[data-theme="dark"] .np-tooltip,
   [data-tooltip]::after) — that rule always wins over this one, so
   only the [role="tooltip"] selector here was ever doing anything. */
html[data-theme="dark"] [role="tooltip"]{
  background: #0F1A22;
  color: var(--nk-text);
  border: 1px solid var(--nk-border);
}

/* ---------- Skeleton loader dark polish ---------- */
html[data-theme="dark"] .np-skeleton{
  background: rgba(137,188,189,.12);
}

/* Calendar/clock icon color is already handled by `color-scheme: dark` on
   the input itself (see the canonical date/time block below) — the browser
   draws a light glyph for a dark field automatically. A filter:invert()
   used to be layered on top of that here, which inverted the already-light
   icon straight back to black and was the actual cause of the "invisible
   in dark mode" report. Do not reintroduce it. */

/* ---------- Charts / bars dark polish ---------- */
html[data-theme="dark"] .np-bars__bar{
  background: linear-gradient(180deg, var(--nk-teal-500), var(--nk-teal-700));
  box-shadow: 0 6px 14px -6px rgba(0,0,0,.55);
}
html[data-theme="dark"] .np-bars{ color: var(--nk-muted); }

/* ---------- Hard kill any lingering hardcoded white surfaces in dark ---------- */
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#FFFFFF"],
html[data-theme="dark"] [style*="background: #FFFFFF"],
html[data-theme="dark"] [style*="background: white"]{
  background: var(--nk-card) !important;
  color: var(--nk-text) !important;
}
html[data-theme="dark"] [style*="color:#000"],
html[data-theme="dark"] [style*="color: #000"],
html[data-theme="dark"] [style*="color: black"]{
  color: var(--nk-text) !important;
}

/* Signature surfaces (preview box, draw pad, live preview) live in
   .np-sig-surface, defined once near the other v3.3.7 signature rules
   below. That component is never themed in the first place — it does
   not use inline `style="background:#fff"` and is not matched by the
   "hard kill hardcoded white surfaces" rule above — so no dark-mode
   override, and no duplicate copy of one, is needed here at all. This
   replaces the old #sigDrawWrap / #sigCanvas / #sigLiveWrap override
   chain (and its previously-hidden bug: `color: var(--nk-ink)` resolves
   to a near-white color in dark mode, so the "Clear drawing" button was
   rendering near-invisible light text on the forced-white surface). */

/* ===================================================================
   Signature surfaces (v3.3.7)
   The signature preview box, the draw pad, and the live preview are
   all functional white-paper-and-ink surfaces, not themed chrome — a
   saved signature PNG is dark ink on a transparent background, so it
   must always sit on a light backdrop to stay visible, and a doctor
   drawing a signature needs a light page with a dark pen regardless of
   which theme the rest of the app is in. Defined ONCE, unscoped by
   `html[data-theme]`, so it can never drift from the other and never
   needs a dark-mode override (see removed #sigDrawWrap rules above).
   =================================================================== */
.np-sig-surface{
  background:#fff;
  border:1px solid #D9E6E6;
  border-radius:12px;
  padding:.6rem;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:72px;
  box-sizing:border-box;
}
.np-sig-empty{ color:#64748B; font-size:.85rem; }
/* Signature preview images — one rule, reused for the saved-signature
   preview, the file-upload live preview, and (via object-fit) any
   future preview state, so scaling can never drift between them. Fixed
   height + object-fit:contain preserves the source aspect ratio and
   never stretches, squashes, or crops. */
.np-sig-img{
  display:block;
  height:56px;
  width:auto;
  max-width:100%;
  object-fit:contain;
}
#sigCanvas{
  background:#fff;
  width:100%;
  max-width:640px;
  height:180px;
  border:1px solid #D9E6E6;
  border-radius:10px;
  touch-action:none;
  display:block;
}
/* v3.3.9: distinct sub-headings for the Upload vs Draw workflows inside
   the Digital Signature card, so the two are visually separate sections
   rather than a single run-on block of mixed controls. */
.np-sig-section__title{
  font-weight:700;
  font-size:.82rem;
  letter-spacing:.02em;
  text-transform:uppercase;
  color: var(--nk-muted);
  margin-bottom:.6rem;
}

/* ---------- Focus rings visible in both themes ---------- */
.np-btn:focus-visible,
.np-tab:focus-visible,
.np-overflow-trigger:focus-visible,
.np-theme-switch__opt:focus-visible{
  outline: 2px solid var(--nk-teal-500);
  outline-offset: 2px;
}
html[data-theme="dark"] .np-btn:focus-visible,
html[data-theme="dark"] .np-tab:focus-visible,
html[data-theme="dark"] .np-overflow-trigger:focus-visible,
html[data-theme="dark"] .np-theme-switch__opt:focus-visible{
  outline-color: var(--nk-teal-300);
}

/* ---------- Ensure legacy floating theme toggle is invisible ---------- */
#np-theme-toggle,
.np-theme-toggle{ display: none !important; }

/* ---------- Consistent card surfaces in dark for panels holding forms ---------- */
html[data-theme="dark"] .np-panel__body{ color: var(--nk-text); }
html[data-theme="dark"] .np-panel__body input,
html[data-theme="dark"] .np-panel__body select,
html[data-theme="dark"] .np-panel__body textarea{
  color: var(--nk-text) !important;
}

/* ---------- Global horizontal-overflow guard ---------- */
html, body{ max-width: 100%; }
body{ overflow-x: hidden; }
.np-content{ min-width: 0; }
.np-content > *{ min-width: 0; max-width: 100%; }

/* ---------- Mobile appointment card polish (unified doctor & admin) ---------- */
@media (max-width: 720px){
  .np-appt__time{
    padding: .5rem .55rem !important;
    min-width: 76px !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }
  .np-appt__time-h{ font-size: .95rem !important; }
  .np-appt__time-d{ font-size: .64rem !important; letter-spacing: .04em !important; }
  .np-appt__badges .np-badge,
  .np-appt__badges .np-pill{
    flex: 0 0 auto !important;
    width: auto !important;
  }
}

/* ---------- Late dark-mode polish for remaining hardcoded light surfaces ---------- */
html[data-theme="dark"] .np-history-row,
html[data-theme="dark"] .np-history-rx{
  background: var(--nk-card) !important;
  border-color: var(--nk-border) !important;
  color: var(--nk-text) !important;
}
html[data-theme="dark"] .np-history-row__date{
  background: rgba(137,188,189,.16);
  color: var(--nk-teal-300);
}
html[data-theme="dark"] #rxSuccessCard{
  background: rgba(34,197,148,.14) !important;
  border-color: rgba(34,197,148,.40) !important;
  color: #7AE0BE !important;
}
html[data-theme="dark"] #rxSuccessSub{ color: #9DEAC9 !important; }
html[data-theme="dark"] .np-appt__cancel-reason{
  background: rgba(225,29,72,.14) !important;
  border-color: rgba(225,29,72,.40) !important;
  color: #FECDD3 !important;
}
html[data-theme="dark"] .np-uuid-card{
  background: linear-gradient(180deg, rgba(137,188,189,.10) 0%, rgba(137,188,189,.04) 100%) !important;
  border-color: var(--nk-border) !important;
}

/* ===================================================================
   v3.3 — Root-cause fixes (single consolidated block)
   ------------------------------------------------------------------
   The shared theme is the single source of truth for:
   - Sticky sidebar behaviour (desktop + mobile drawer)
   - Dark-mode contrast across every shared component
   Do NOT re-patch these rules in the admin/ or doctor/ local stylesheets.
   =================================================================== */

.np-sidebar{
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 40;
}
.np-sidebar__brand,
.np-sidebar__footer{ flex: 0 0 auto; }
.np-sidebar__nav{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.np-sidebar__nav::-webkit-scrollbar{ width: 6px; }
@media (max-width: 1023px){
  .np-sidebar{
    position: fixed;
    left: 0; top: 0; bottom: 0;
    height: 100vh;
    height: 100dvh;
    /* v3.3.3: this shared rule set previously reset z-index to 40 at ALL
       widths (see base .np-sidebar rule above), which silently overrode the
       admin/ and doctor/ panel-level mobile fix that raised the drawer to
       z-index:50. Because .np-backdrop sits at z-index:44 on mobile, the
       sidebar was landing BELOW the backdrop — the backdrop then visually
       dimmed the drawer and (with pointer-events:auto while open) intercepted
       every tap meant for the nav links. Re-asserting z-index:50 here, in the
       single source of truth, keeps the drawer above the backdrop again. */
    z-index: 50;
  }
}

.np-header__inner{ min-width: 0; }
.np-header__title{ min-width: 0; flex: 1 1 auto; }
.np-header__page-title,
.np-header__page-subtitle{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-profile{ flex-shrink: 0; }
.np-profile__trigger{ max-width: 100%; }

.np-appt{
  background: var(--nk-card);
  border-color: var(--nk-border-soft);
  color: var(--nk-text);
}
html[data-theme="dark"] .np-appt{
  background: var(--nk-card) !important;
  border-color: var(--nk-border) !important;
  color: var(--nk-text) !important;
}
html[data-theme="dark"] .np-appt:hover{
  border-color: rgba(137,188,189,.45) !important;
  box-shadow: var(--nk-shadow-md);
}
html[data-theme="dark"] .np-appt__name,
html[data-theme="dark"] .np-appt__title{ color: var(--nk-ink) !important; }
html[data-theme="dark"] .np-appt__meta,
html[data-theme="dark"] .np-appt__problem,
html[data-theme="dark"] .np-appt__sub{ color: var(--nk-muted) !important; }
html[data-theme="dark"] .np-appt__time{
  background: rgba(137,188,189,.16);
  color: var(--nk-teal-300);
}
html[data-theme="dark"] .np-appt__time-h{ color: var(--nk-teal-300); }
html[data-theme="dark"] .np-appt__time-d{ color: var(--nk-muted); }
html[data-theme="dark"] .np-appt__age{
  background: rgba(137,188,189,.18);
  color: var(--nk-teal-300);
}
html[data-theme="dark"] .np-appt__actions .np-btn:not(.np-btn--primary){
  background: transparent;
  border-color: var(--nk-border);
  color: var(--nk-text);
}
html[data-theme="dark"] .np-appt__actions .np-btn:not(.np-btn--primary):hover{
  background: rgba(137,188,189,.14);
  border-color: rgba(137,188,189,.4);
  color: var(--nk-teal-300);
}

.np-code-block{
  background: var(--nk-surface);
  border: 1px solid var(--nk-border);
  color: var(--nk-text);
}
html[data-theme="dark"] .np-code-block,
html[data-theme="dark"] pre.np-code-block,
html[data-theme="dark"] pre code{
  background: #0B1519 !important;
  border-color: var(--nk-border) !important;
  color: #C7E2E4 !important;
}
html[data-theme="dark"] .np-code-block::-webkit-scrollbar-thumb{ background: #2C4A56; }

/* .np-pill / .np-slot-btn base, hover, and active colors are set by the
   !important rules in the "v3.3.1 DEFINITIVE dark-mode consolidation"
   block further down (they always won this cascade anyway, since
   !important beats a plain declaration regardless of source order —
   this block previously just described a color that never rendered).
   box-shadow and :disabled aren't set there, so they stay here. */
html[data-theme="dark"] .np-pill.active,
html[data-theme="dark"] .np-pill.is-active,
html[data-theme="dark"] .np-pill[aria-pressed="true"]{
  box-shadow: 0 4px 10px -3px rgba(0,0,0,.5);
}
html[data-theme="dark"] .np-slot-btn:disabled{ opacity: .35; }

html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"]{
  accent-color: var(--nk-teal-500);
  background-color: #0E1A22;
  border-color: var(--nk-border);
}

html[data-theme="dark"] .np-history-rx,
html[data-theme="dark"] .np-rx-card{
  background: var(--nk-card) !important;
  border-color: var(--nk-border) !important;
  color: var(--nk-text) !important;
}
html[data-theme="dark"] .np-history-rx__title,
html[data-theme="dark"] .np-history-rx__meta,
html[data-theme="dark"] .np-rx-card__title{ color: var(--nk-text); }
html[data-theme="dark"] .np-history-rx__date,
html[data-theme="dark"] .np-rx-card__sub{ color: var(--nk-muted); }
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"]{
  background-color: #0E1A22 !important;
  border-color: var(--nk-border) !important;
  color: var(--nk-text) !important;
  color-scheme: dark;
}

html[data-theme="dark"] .np-appt,
html[data-theme="dark"] .np-appt-row,
html[data-theme="dark"] .np-pill,
html[data-theme="dark"] .np-slot-btn,
html[data-theme="dark"] .np-iconbtn,
html[data-theme="dark"] .np-profile__trigger{
  background-color: var(--nk-card);
}

html[data-theme="dark"] .np-search{
  background: #0E1A22 !important;
  border-color: var(--nk-border) !important;
}
html[data-theme="dark"] ::-webkit-scrollbar-track{ background: transparent; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb{
  background: #2C4A56;
  border: 2px solid var(--nk-surface);
  border-radius: 999px;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover{ background: #406877; }

html[data-theme="dark"] .np-modal__panel,
html[data-theme="dark"] .np-modal__card{
  background: var(--nk-card) !important;
  color: var(--nk-text) !important;
  border: 1px solid var(--nk-border) !important;
}
html[data-theme="dark"] .np-modal__body,
html[data-theme="dark"] .np-modal__head{
  color: var(--nk-text);
  border-color: var(--nk-border);
}

html[data-theme="dark"] .np-datepicker,
html[data-theme="dark"] .np-datepicker__day{
  background: var(--nk-card);
  color: var(--nk-text);
  border-color: var(--nk-border);
}
html[data-theme="dark"] .np-datepicker__day:hover{
  background: rgba(137,188,189,.14);
  color: var(--nk-teal-300);
}
html[data-theme="dark"] .np-datepicker__day.is-selected{
  background: var(--nk-teal-500);
  color: #fff;
}

html[data-theme="dark"] .np-pagination__btn{
  background: var(--nk-card);
  border-color: var(--nk-border);
  color: var(--nk-text);
}
html[data-theme="dark"] .np-pagination__btn:hover:not(:disabled){
  background: rgba(137,188,189,.14);
  color: var(--nk-teal-300);
}
html[data-theme="dark"] .np-pagination__btn.is-active{
  background: var(--nk-teal-500);
  color: #fff;
  border-color: transparent;
}

html[data-theme="dark"] .np-empty__desc{ color: var(--nk-muted); }

/* ===================================================================
   v3.3.1 — DEFINITIVE dark-mode / responsive consolidation
   -------------------------------------------------------------------
   Root cause fixed above (in admin/ + doctor/ local stylesheets):
   all hardcoded #fff / white / #ffffff / #F4F8FB / #E5E7EB tokens
   have been converted to theme CSS variables so that dark mode is
   INHERITED automatically instead of overridden per-selector.

   This block is the single source of truth for the remaining
   mobile-only components (mobile card conversions of tables,
   payload panels, notification detail modal, doctor header, slot /
   working-day pills, prescription archive). It targets every
   selector the mobile media queries create, at any viewport.

   Do NOT add another override layer below this. If a component
   still looks wrong in dark mode, fix its base rule to use the
   token, don't patch it here.
   =================================================================== */

/* --- 1. Mobile table-to-card conversions (admin) ------------------ */
html[data-theme="dark"] #apptsView .np-table tr,
html[data-theme="dark"] #notifView .np-table tr,
html[data-theme="dark"] #notifView .np-table tr.np-notif-row,
html[data-theme="dark"] #settlementsView .np-table tr,
html[data-theme="dark"] #invoicesView .np-table tr,
html[data-theme="dark"] #revenueView .np-table tr,
html[data-theme="dark"] #centresView .np-table tr,
html[data-theme="dark"] #receptionistsView .np-table tr,
html[data-theme="dark"] #pharmUsersView .np-table tr,
html[data-theme="dark"] #certsView .np-table tr,
html[data-theme="dark"] #pharmBillsView .np-table tr,
html[data-theme="dark"] #invView .np-table tr,
html[data-theme="dark"] #billsView .np-table tr,
html[data-theme="dark"] #recInvoicesView .np-table tr,
html[data-theme="dark"] #auditView .np-table tr{
  background: var(--nk-card) !important;
  border-color: var(--nk-border) !important;
  color: var(--nk-text) !important;
  box-shadow: var(--nk-shadow-sm);
}
html[data-theme="dark"] #apptsView .np-table td[data-label],
html[data-theme="dark"] #notifView .np-table td[data-label],
html[data-theme="dark"] #settlementsView .np-table td[data-label],
html[data-theme="dark"] #invoicesView .np-table td[data-label],
html[data-theme="dark"] #revenueView .np-table td[data-label],
html[data-theme="dark"] #centresView .np-table td[data-label],
html[data-theme="dark"] #receptionistsView .np-table td[data-label],
html[data-theme="dark"] #pharmUsersView .np-table td[data-label],
html[data-theme="dark"] #certsView .np-table td[data-label],
html[data-theme="dark"] #pharmBillsView .np-table td[data-label],
html[data-theme="dark"] #invView .np-table td[data-label],
html[data-theme="dark"] #billsView .np-table td[data-label],
html[data-theme="dark"] #recInvoicesView .np-table td[data-label],
html[data-theme="dark"] #auditView .np-table td[data-label]{
  border-bottom-color: var(--nk-border-soft) !important;
  color: var(--nk-text) !important;
}
html[data-theme="dark"] #apptsView .np-table td[data-label]::before,
html[data-theme="dark"] #notifView .np-table td[data-label]::before,
html[data-theme="dark"] #settlementsView .np-table td[data-label]::before,
html[data-theme="dark"] #invoicesView .np-table td[data-label]::before,
html[data-theme="dark"] #revenueView .np-table td[data-label]::before,
html[data-theme="dark"] #centresView .np-table td[data-label]::before,
html[data-theme="dark"] #receptionistsView .np-table td[data-label]::before,
html[data-theme="dark"] #pharmUsersView .np-table td[data-label]::before,
html[data-theme="dark"] #certsView .np-table td[data-label]::before,
html[data-theme="dark"] #pharmBillsView .np-table td[data-label]::before,
html[data-theme="dark"] #invView .np-table td[data-label]::before,
html[data-theme="dark"] #billsView .np-table td[data-label]::before,
html[data-theme="dark"] #recInvoicesView .np-table td[data-label]::before,
html[data-theme="dark"] #auditView .np-table td[data-label]::before{
  color: var(--nk-muted) !important;
}

/* --- 2. Payload / JSON code blocks (notification details) --------- */
html[data-theme="dark"] pre,
html[data-theme="dark"] pre.np-code-block,
html[data-theme="dark"] .np-code-block,
html[data-theme="dark"] .np-payload,
html[data-theme="dark"] .np-json,
html[data-theme="dark"] [data-role="payload"],
html[data-theme="dark"] [data-role="json"]{
  background: #0B1519 !important;
  border: 1px solid var(--nk-border) !important;
  color: #C7E2E4 !important;
}

/* --- 3. Notification detail modal (mobile + desktop) -------------- */
html[data-theme="dark"] #notifDetailModal .np-modal__panel,
html[data-theme="dark"] .np-notif-detail,
html[data-theme="dark"] .np-notif-detail__card,
html[data-theme="dark"] .np-notif-detail__section,
html[data-theme="dark"] .np-notif-card{
  background: var(--nk-card) !important;
  border-color: var(--nk-border) !important;
  color: var(--nk-text) !important;
}
html[data-theme="dark"] .np-notif-detail__label,
html[data-theme="dark"] .np-notif-card__meta{ color: var(--nk-muted) !important; }
html[data-theme="dark"] .np-notif-detail__value,
html[data-theme="dark"] .np-notif-card__title{ color: var(--nk-ink) !important; }

/* --- 4. Appointment cards prescription tab ----------------------- */
html[data-theme="dark"] .np-appt,
html[data-theme="dark"] .np-appt-card,
html[data-theme="dark"] .np-rx-card,
html[data-theme="dark"] .np-prescription-card,
html[data-theme="dark"] #rxArchiveList .np-appt,
html[data-theme="dark"] #rxArchiveList .np-history-row,
html[data-theme="dark"] #rxArchiveList .np-history-rx{
  background: var(--nk-card) !important;
  border-color: var(--nk-border) !important;
  color: var(--nk-text) !important;
}

/* --- 5. Doctor profile / header ---------------------------------- */
html[data-theme="dark"] .np-doc-header,
html[data-theme="dark"] .np-doctor-header,
html[data-theme="dark"] .np-doc-profile,
html[data-theme="dark"] .np-doctor-profile,
html[data-theme="dark"] .np-doc-card__header{
  background: var(--nk-card) !important;
  border-color: var(--nk-border) !important;
  color: var(--nk-text) !important;
}
html[data-theme="dark"] .np-doc-header *:not(.np-btn):not(.np-btn *):not(.np-badge):not(.np-badge *){
  color: inherit;
}

/* --- 6. Availability slots + working-day pills (mobile) ---------- */
html[data-theme="dark"] .np-slot-btn,
html[data-theme="dark"] .np-availability-slot,
html[data-theme="dark"] .np-working-day,
html[data-theme="dark"] .np-workday-pill,
html[data-theme="dark"] .np-pill{
  background: #142531 !important;
  border-color: var(--nk-border) !important;
  color: var(--nk-text) !important;
}
html[data-theme="dark"] .np-slot-btn.active,
html[data-theme="dark"] .np-slot-btn.is-selected,
html[data-theme="dark"] .np-availability-slot.active,
html[data-theme="dark"] .np-working-day.active,
html[data-theme="dark"] .np-workday-pill.active,
html[data-theme="dark"] .np-pill.active,
html[data-theme="dark"] .np-pill.is-active,
html[data-theme="dark"] .np-pill[aria-pressed="true"]{
  background: linear-gradient(135deg, var(--nk-teal-500), var(--nk-teal-700)) !important;
  border-color: transparent !important;
  color: #fff !important;
}
html[data-theme="dark"] .np-slot-btn:hover:not(:disabled),
html[data-theme="dark"] .np-availability-slot:hover:not(:disabled),
html[data-theme="dark"] .np-working-day:hover:not(:disabled),
html[data-theme="dark"] .np-workday-pill:hover:not(:disabled),
html[data-theme="dark"] .np-pill:hover:not(.active):not(.is-active){
  background: rgba(137,188,189,.14) !important;
  border-color: rgba(137,188,189,.4) !important;
  color: var(--nk-teal-300) !important;
}

/* --- 7. Shared inputs / dropdowns EVERYWHERE (mobile too) -------- */
html[data-theme="dark"] .np-input,
html[data-theme="dark"] .np-select,
html[data-theme="dark"] .np-textarea,
html[data-theme="dark"] .np-search,
html[data-theme="dark"] .np-search input,
html[data-theme="dark"] input:not([type=button]):not([type=submit]):not([type=checkbox]):not([type=radio]):not([type=range]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background-color: #0E1A22 !important;
  color: var(--nk-text) !important;
  border-color: var(--nk-border) !important;
}

/* --- 8. Universal safety net -------------------------------------
   Any element still styled with a hardcoded light background at any
   viewport width falls back to a card surface in dark mode.
   Kept AFTER the mobile media queries so it wins the cascade.
   ---------------------------------------------------------------- */
@media (max-width: 1023px){
  html[data-theme="dark"] [class*="np-"][class*="card"],
  html[data-theme="dark"] [class*="np-"][class*="row"],
  html[data-theme="dark"] [class*="np-"][class*="panel"],
  html[data-theme="dark"] [class*="np-"][class*="modal__panel"],
  html[data-theme="dark"] [class*="np-"][class*="drawer__panel"]{
    background-color: var(--nk-card);
    color: var(--nk-text);
    border-color: var(--nk-border);
  }
  html[data-theme="dark"] .np-content [style*="background:#fff"],
  html[data-theme="dark"] .np-content [style*="background: #fff"],
  html[data-theme="dark"] .np-content [style*="background:#FFFFFF"],
  html[data-theme="dark"] .np-content [style*="background: #FFFFFF"],
  html[data-theme="dark"] .np-content [style*="background: white"]{
    background: var(--nk-card) !important;
    color: var(--nk-text) !important;
  }
  /* No mobile-scoped copy of the signature-surface override needed —
     .np-sig-surface (defined once, below) is unthemed at every
     viewport width, so there is nothing for this block to fight. */
}

/* --- 9. Sticky sidebar reaffirmed at all sizes ------------------- */
@media (min-width: 1024px){
  .np-sidebar{
    position: sticky !important;
    top: 0 !important;
    height: 100vh;
    height: 100dvh;
    align-self: start;
  }
}

/* ===================================================================
   v3.5 — Full design-system unification
   Dark select chevron, KYC upload cards, and the Medical Certificates
   card list. All colors come from --nk-* tokens; nothing below uses a
   hardcoded light surface.
   =================================================================== */

/* Dark-mode select chevron — a lighter glyph, swapped via background-image
   only (dark input rules above set background-color, so the light-theme
   image layer would otherwise survive with a low-contrast stroke). */
html[data-theme="dark"] select.np-select,
html[data-theme="dark"] select.np-input,
html[data-theme="dark"] .np-select{
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2391A6B0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}

/* ---------- KYC upload cards (admin doctor modal) ---------- */
html[data-theme="dark"] .np-kyc-card{
  background: #0E1A22;
  border-color: var(--nk-border);
}
html[data-theme="dark"] .np-kyc-card__title{ color: var(--nk-ink); }
html[data-theme="dark"] .np-kyc-card__status{ color: var(--nk-muted); }
html[data-theme="dark"] .np-kyc-card__link{ color: var(--nk-teal-300); }

/* ---------- Medical Certificates card list (admin oversight) ---------- */
.np-cert-list{ display: flex; flex-direction: column; gap: .65rem; }
.np-cert-card{
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  background: var(--nk-card);
  border: 1px solid var(--nk-border-soft);
  border-radius: var(--nk-radius);
  padding: .85rem 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.np-cert-card:hover{
  border-color: var(--nk-teal-200);
  box-shadow: var(--nk-shadow-sm);
}
.np-cert-card__icon{
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--nk-teal-50);
  color: var(--nk-teal-600);
  border: 1px solid var(--nk-border-soft);
}
.np-cert-card__main{ flex: 1 1 auto; min-width: 0; }
.np-cert-card__top{
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.np-cert-card__name{
  font-weight: 700;
  color: var(--nk-ink);
  overflow-wrap: anywhere;
}
.np-cert-card__meta{
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .75rem;
  margin-top: .25rem;
  font-size: .8rem;
  color: var(--nk-muted);
}
.np-cert-card__num{
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .76rem;
}
.np-cert-card__reason{
  margin-top: .35rem;
  font-size: .84rem;
  color: var(--nk-text);
  overflow-wrap: anywhere;
}
.np-cert-card__actions{ flex: none; align-self: center; }
@media (max-width: 560px){
  .np-cert-card{ flex-wrap: wrap; }
  .np-cert-card__actions{ width: 100%; align-self: stretch; }
  .np-cert-card__actions .np-btn{ width: 100%; }
}
html[data-theme="dark"] .np-cert-card{
  background: var(--nk-card);
  border-color: var(--nk-border);
}
html[data-theme="dark"] .np-cert-card__icon{
  background: rgba(137,188,189,.14);
  color: var(--nk-teal-300);
  border-color: var(--nk-border);
}
html[data-theme="dark"] .np-cert-card__reason{ color: var(--nk-text); }

/* ==========================================================================
   Pharmacy / reception "New bill" line items (.bill-line).
   Root cause of the squashed medicine dropdown: this row used to be a bare
   .np-row (display:flex, nowrap) with a `style="flex:2"` hint on the medicine
   column and no flex value on Qty/Price. Flex items with no explicit flex
   value size to their own max-content first, and only the flex:2 column had
   flex-basis:0 — so Qty/Price claimed their full intrinsic width and the
   medicine dropdown was squeezed into whatever was left (a sliver, on any
   modal narrower than ~700px, i.e. basically always). Fixing it here with an
   explicit grid so every column's width is a deliberate decision, not a
   side-effect of the other two columns' content. Single source of truth —
   used by both the receptionist and pharmacy portals.
   ========================================================================== */
.bill-line{
  display: grid;
  grid-template-columns: 84px minmax(0,1fr) minmax(0,1fr);
  gap: .5rem;
  align-items: end;
  margin-bottom: .6rem;
}
.bill-line__med,
.bill-line__qty,
.bill-line__price{
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
}
.bill-line .np-select,
.bill-line .np-input{ min-width: 0; }
.bill-line__remove{
  align-self: end;
  width: 34px;
  height: 38px;
  flex: none;
  border: 1px solid var(--nk-border);
  background: var(--nk-card);
  border-radius: 8px;
  color: var(--nk-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.bill-line__remove:hover{ background: #FEE2E2; color: #DC2626; border-color: #FCA5A5; }
html[data-theme="dark"] .bill-line__remove:hover{ background: rgba(220,38,38,.18); border-color: #DC2626; color: #FCA5A5; }
@media (max-width: 480px){
  /* Below ~480px the three fields (Qty / Price / Line total) no longer fit on
     one row without the Price and Line-total labels colliding. Qty takes the
     first row full width; Price and Line total share the second row. */
  .bill-line{
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "qty   qty"
      "price total";
  }
  .bill-line__qty{ grid-area: qty; }
  .bill-line__price:nth-child(2){ grid-area: price; }
  .bill-line__price:nth-child(3){ grid-area: total; }
}

/* ==========================================================================
   Unified billing (v4.1) — searchable medicine combobox, manual vs inventory
   line modes, bill totals break, and DRAFT/PAID lifecycle helpers.
   ========================================================================== */
.np-combo{ position:relative; }
.np-combo__menu{
  position:absolute;
  top:calc(100% + 4px);
  left:0; right:0;
  max-height:230px;
  overflow-y:auto;
  background:var(--nk-card);
  border:1px solid var(--nk-border);
  border-radius:10px;
  box-shadow:0 14px 34px rgba(15,23,42,.16);
  z-index:40;
  padding:.25rem;
  display:none;
}
.np-combo__menu.is-open{ display:block; }
.np-combo__opt{
  width:100%;
  text-align:left;
  border:0;
  background:transparent;
  border-radius:8px;
  padding:.5rem .6rem;
  cursor:pointer;
  font:inherit;
  color:var(--nk-text);
  display:flex;
  flex-direction:column;
  gap:.1rem;
}
.np-combo__opt:hover,
.np-combo__opt.is-active{ background:var(--nk-teal-50); }
.np-combo__opt__name{ font-weight:600; font-size:.84rem; display:flex; justify-content:space-between; gap:.5rem; }
.np-combo__opt__meta{ font-size:.74rem; color:var(--nk-muted); }
.np-combo__empty{ padding:.6rem; color:var(--nk-muted); font-size:.82rem; text-align:center; }
.np-seg{ display:inline-flex; background:var(--nk-border-soft); border-radius:10px; padding:3px; gap:3px; }
.np-seg__btn{
  flex:1 1 0; min-width:0;
  border:0; background:transparent; padding:.42rem .7rem;
  border-radius:8px; font:600 .8rem/1 inherit; color:var(--nk-muted); cursor:pointer;
  white-space:nowrap; text-align:center;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.np-seg__btn:hover{ color:var(--nk-ink); }
.np-seg__btn.is-active{ background:var(--nk-card); color:var(--nk-text); box-shadow:0 1px 3px rgba(15,23,42,.12); }
/* .np-seg--fit: for segments with uneven label lengths (e.g. "Inventory"
   vs "Manual item") — flex:1 1 0 + min-width:0 on the base .np-seg__btn
   forces every segment to the exact same width, so the longer label's own
   padding gets squeezed away first. This variant sizes each segment to
   its own content instead, so no label ever crowds its edge. Left as an
   opt-in modifier rather than changed on the base class because other
   .np-seg usages (e.g. the doctor portal's long/short responsive labels)
   rely on the shrink behavior. */
.np-seg--fit .np-seg__btn{ flex:0 1 auto; min-width:max-content; }
.np-bill-line{ border:1px solid var(--nk-border-soft); border-radius:12px; padding:.7rem; margin-bottom:.6rem; }
.np-bill-line__head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:.55rem; gap:.5rem; }
.np-bill-line__kind{ font-size:.66rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--nk-muted); }
.np-bill-stock{ font-size:.74rem; color:var(--nk-muted); }
.np-bill-stock.is-low{ color:#b45309; }
.np-bill-stock.is-out{ color:#dc2626; font-weight:700; }
.np-bill-total{
  display:flex; justify-content:space-between; align-items:center;
  background:var(--nk-teal-50); border:1px solid var(--nk-border-soft);
  border-radius:10px; padding:.7rem .8rem; margin-top:.35rem; font-weight:700;
}
html[data-theme="dark"] .np-bill-total{ background:rgba(137,188,189,.12); }

/* ==========================================================================
   Feature-table horizontal scrolling + sticky actions column (v4.1).
   Tables that can overflow horizontally keep a scroll affordance instead of
   being clipped, and the last (actions) column pins so Edit/Deactivate/PDF
   stay reachable without scrolling back. On the mobile stacked-card layout
   the sticky rule is inert (cells are grid children, not table cells).
   ========================================================================== */
.np-table--scroll-x{ min-width: 920px; }
/* np-table--fixed already gives every column a fluid % width via its own
   <colgroup> — forcing a 920px minimum on top of that fights the very
   responsiveness the fixed layout exists for, leaving the table stuck
   horizontally scrollable at any width narrower than 920px even on tablet
   widths where the mobile card transform hasn't kicked in yet (the Medical
   Centres table hit exactly this). Two classes beats one, so this wins
   over the plain .np-table--scroll-x rule above without touching any
   table that uses scroll-x WITHOUT fixed layout. */
.np-table--scroll-x.np-table--fixed{ min-width: 0; }
.np-table--scroll-x th:last-child,
.np-table--scroll-x td:last-child{
  position: sticky;
  right: 0;
  background: var(--nk-card);
  box-shadow: -8px 0 12px -8px rgba(15,23,42,.18);
  z-index: 2;
}
.np-table--scroll-x th:last-child{ z-index: 3; }
.np-table--scroll-x td.np-table__nowrap{ white-space: nowrap; }
@media (max-width:720px){
  .np-table-wrap{ max-height:none; }
}

/* ==========================================================================
   v29 CONSISTENCY AUDIT — one ruleset, every module
   The rules below close the remaining gaps found in the platform-wide audit:
   buttons, dropdowns, date pickers, badges, file inputs, cards/modals and
   mobile rounding now resolve to the same --nk-* tokens everywhere.
   ========================================================================== */

/* ── Buttons ───────────────────────────────────────────────────────────────
   .np-btn above is the single source of truth; these guards stop the
   recurring "stretched Apply/Clear/Filter/Save/Reset" class of bug without
   touching the intentional full-width mobile rules in the page sheets. */
.np-btn{ box-sizing: border-box; flex: 0 0 auto; }
.np-filterbar .np-btn, .np-filter-actions .np-btn, .np-modal__foot .np-btn{
  width: auto; /* desktop: buttons size to their label, never to the row */
}

/* ── Dropdowns & date pickers ──────────────────────────────────────────────
   Every control shares one 40px box, one radius, one border token. */
.np-input, .np-select, .np-select-native, input.np-input, select.np-select{
  min-height: 40px;
}
/* A verbose placeholder ("Search by patient name, phone, or problem…") on a
   narrow mobile search box was getting hard-clipped mid-word with no visual
   cue it was cut off at all — reads as broken rather than intentional.
   Ellipsis doesn't fix the narrow box, but it makes the truncation look
   deliberate instead of like the input is rendering wrong. */
input.np-input, .np-search input{
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
/* Date/time icon treatment now lives in one place — see the "CANONICAL
   DATE/TIME ICON" block at the end of this file. That block supersedes the
   native-picker-indicator approach that used to live here (it was the
   reason mobile browsers showed no calendar glyph at all: the native
   indicator renders inconsistently, or not at all, on mobile WebKit). */
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="datetime-local"]{
  background-color: #0E1A22;
  color: #E6EEF1;
  border-color: #234551;
}

/* ── Stock & warning badges ────────────────────────────────────────────────
   .np-error is a block-level error CARD style; it was being applied to an
   inline <b> inside the inventory table's Stock cell, where the card padding
   and 12px radius made it clip against the cell and header edges. Compact
   pill treatment for inline use; the card treatment stays for real errors.
   Scoped to the <b>/<span> tags themselves (not `td .np-error`/`.np-table
   .np-error`): those ancestor-based selectors also matched the full-message
   `<div class="np-error">` error rows used for failed table loads (colspan
   cells across admin/pharmacy/receptionist), forcing a long API error
   message onto one `white-space:nowrap` line and overflowing the table. */
b.np-error, span.np-error{
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 999px;
  font-size: .78rem;
  line-height: 1.5;
  white-space: nowrap;
}
/* Billing stock hint (In stock / low / out) gets the same padded pill so it
   never touches the edge of its line container. */
.np-bill-stock{
  display: inline-block;
  margin-top: .35rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--nk-teal-50);
  color: var(--nk-teal-700);
  border: 1px solid var(--nk-teal-100);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Same "stretched pill" root cause .np-badge already guards against
     (see that rule's comment): sitting inside a flex/grid ancestor (the
     mobile bill-line card layout) let the default cross-axis stretch pull
     this into a tall/wide smear instead of a compact pill on narrow
     screens. Size to content in every context, like every other badge. */
  flex: 0 0 auto;
  align-self: flex-start;
  width: fit-content;
}
/* Before a medicine is picked the hint has no text — collapse it entirely so
   an empty padded pill doesn't render as a stray artifact under the search. */
.np-bill-stock:empty{ display: none; }
.np-bill-stock.is-low{ background:#FEF3CC; color:#8A5A0F; border-color:#F4D9A3; }
.np-bill-stock.is-out{ background:#FEE2E5; color:#9F1E36; border-color:#F5BFBF; }
html[data-theme="dark"] .np-bill-stock{ background:rgba(137,188,189,.14); color:#B4D7D7; border-color:rgba(137,188,189,.3); }
html[data-theme="dark"] .np-bill-stock.is-low{ background:rgba(249,169,69,.18); color:#FBC97A; border-color:rgba(249,169,69,.35); }
html[data-theme="dark"] .np-bill-stock.is-out{ background:rgba(225,29,72,.2); color:#FECDD3; border-color:rgba(225,29,72,.35); }

/* ── File upload presentation (KYC and every other uploader) ───────────────
   The filename is user content: it wraps instead of truncating, and the
   control keeps the shared 40px/radius/border tokens. */
input[type="file"].np-input{
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.np-dropzone__hint, .np-file-name, [data-file-name]{
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

/* ── Cards, modals & mobile rounding ───────────────────────────────────────
   Rounded outer card + square inner strip was the most visible mobile defect
   (Today's Snapshot and siblings). Inner header/footer strips now inherit the
   parent radius on their touching corners, and every card clips its own
   content so nothing square can ever poke past a rounded edge. */
.np-panel, .np-kpi, .np-modal__panel, .np-drawer, .np-doc-card{
  overflow: hidden;
}
.np-panel__head, .np-card__head, .np-widget__head{
  border-radius: calc(var(--nk-radius-card) - 1px) calc(var(--nk-radius-card) - 1px) 0 0;
}
.np-panel__foot, .np-card__foot, .np-modal__foot{
  border-radius: 0 0 calc(var(--nk-radius-card) - 1px) calc(var(--nk-radius-card) - 1px);
}
@media (max-width: 600px){
  /* One radius scale on phones: slightly tighter than desktop, consistent
     across every card/modal/widget instead of desktop values squeezed down. */
  .np-panel, .np-kpi, .np-doc-card{ border-radius: var(--nk-radius); }
  .np-modal__panel{ border-radius: var(--nk-radius-card); }
  .np-panel__head, .np-card__head, .np-widget__head{
    border-radius: calc(var(--nk-radius) - 1px) calc(var(--nk-radius) - 1px) 0 0;
  }
  .np-panel__body, .np-card__body{ padding-left: 1rem; padding-right: 1rem; }
}

/* ==========================================================================
   CANONICAL DATE/TIME ICON — one calendar glyph, every module, every input,
   mobile and desktop (v30).
   Every previous attempt at a date-icon fix (see the superseded comments
   earlier in this file, plus the per-module filter-bar rules in
   admin/styles.css and doctor/styles.css) relied on styling the browser's
   own ::-webkit-calendar-picker-indicator. That pseudo-element is where the
   "icons missing on mobile" bug actually comes from: mobile WebKit renders
   it inconsistently — sometimes invisible, sometimes mis-sized — and it
   doesn't exist at all outside Chromium/WebKit, so Firefox never matched
   either. Each module also nudged its margin/opacity slightly differently,
   which is the "spacing differs from other dropdowns" complaint.
   Fix: stop drawing the browser's glyph entirely. Every date/time field
   gets appearance:none and a drawn SVG calendar icon as a background-image,
   positioned with the exact same right-inset (.85rem) and box model
   (2.35rem right padding) as the .np-select chevron, so date pickers and
   dropdowns finally match. The native picker-indicator is kept in the DOM
   (for keyboard/screen-reader users) but made invisible and full-width, so
   clicking anywhere still opens the picker — this doubles up with (and
   never conflicts with) the whole-field-click handled by NPDatePicker in
   np-ui.js. This one block wins the cascade everywhere because this file
   loads after admin/styles.css and doctor/styles.css on every module page.
   ========================================================================== */
input[type="date"], input[type="time"], input[type="datetime-local"]{
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--nk-card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>") no-repeat right .85rem center;
  background-size: 16px;
  padding-right: 2.35rem !important;
  color-scheme: light;
  cursor: pointer; /* whole field opens the picker, see NPDatePicker in np-ui.js */
}
input[type="time"]{
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><polyline points='12 7 12 12 16 14'/></svg>");
}
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="datetime-local"]{
  color-scheme: dark;
  background-color: #0E1A22;
  color: #E6EEF1;
  border-color: #234551;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2391A6B0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  background-size: 16px;
}
html[data-theme="dark"] input[type="time"]{
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2391A6B0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><polyline points='12 7 12 12 16 14'/></svg>");
}
/* Keep the native indicator in the hit-testing tree (screen readers, and a
   fallback native tap-target) but make it invisible and stretch it over the
   whole field so it never shows a second, misaligned glyph next to ours. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator{
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  cursor: pointer;
}

/* Reusable mobile card-transform for any data table — add the
   .np-table--cards class to the <table> and give every <td> a
   data-label="Column Name" attribute. Used across Admin (Medical
   Centres, Receptionists, Pharmacy Users, Data Management, Revenue
   Reports, Settlements, Invoices), Receptionist and Pharmacy portals.
   Shared here (not per-portal styles.css) so it works everywhere without
   duplicating the same ~40 lines per portal. */
@media (max-width:720px){
  .np-table--cards.np-table-wrap,
  .np-table-wrap:has(> .np-table--cards){ overflow:visible; max-height:none; border:0; border-radius:0; background:transparent; }
  .np-table--cards,
  .np-table--cards tbody{ display:block; width:100%; min-width:0; }
  .np-table--cards thead{
    position:absolute; width:1px;height:1px;margin:-1px;padding:0;
    overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;
  }
  .np-table--cards tr{
    display:block; width:100%; box-sizing:border-box; margin:0 0 .75rem; padding:.9rem 1rem;
    background:var(--nk-card); border:1px solid var(--nk-border); border-left-width:3px;
    border-radius:14px; box-shadow:var(--nk-shadow-sm);
  }
  .np-table--cards.np-table--danger tr{ border-left-color:#DC2626; }
  .np-table--cards td[data-label]{
    display:grid; grid-template-columns:minmax(76px,.55fr) minmax(0,1.45fr); gap:.7rem; align-items:start;
    width:100%; min-width:0; padding:.52rem 0; text-align:left !important; border-bottom:1px dashed var(--nk-border-soft);
  }
  .np-table--cards td[data-label]::before{
    content:attr(data-label); color:var(--nk-muted); font-size:.68rem; font-weight:700;
    letter-spacing:.045em; line-height:1.35; text-transform:uppercase;
  }
  .np-table--cards td[data-label] > *{ min-width:0; max-width:100%; overflow-wrap:anywhere; }
  .np-table--cards td[data-label]:last-child{ border-bottom:0; }
  .np-table--cards td[data-label="Name"],
  .np-table--cards td[data-label="Doctor"],
  .np-table--cards td[data-label="Patient"],
  .np-table--cards td[data-label="Medicine"]{ grid-template-columns:1fr; gap:.2rem; }
  /* Actions cell: was a single-column grid with every button forced to
     width:100%. With more than one action (e.g. Invoice + Certificate) that
     produced one full-width stretched button followed by others that,
     depending on button count/order, ended up cramped in a corner instead
     of lining up as a matching row. Switched to a wrapping flex row so
     every action button keeps its natural size and they sit evenly spaced,
     right-aligned, wrapping to a new line only when they don't fit. */
  .np-table--cards td[data-label="Action"],
  .np-table--cards td[data-label="Actions"]{
    display:flex; flex-wrap:wrap; gap:.4rem; justify-content:flex-end; align-items:center;
    text-align:right !important;
  }
  .np-table--cards td[data-label="Action"]::before,
  .np-table--cards td[data-label="Actions"]::before{ flex:1 0 100%; }
  .np-table--cards td[data-label="Action"] .np-btn,
  .np-table--cards td[data-label="Actions"] .np-btn{ width:auto; flex:0 0 auto; margin:0; }
  .np-table--cards td[colspan]{ display:block; padding:.5rem 0; text-align:center; border:0; }
  .np-table--cards tr:hover td{ background:transparent; }
  html[data-theme="dark"] .np-table--cards tr{ background:var(--nk-card) !important; border-color:var(--nk-border) !important; }
}
