:root { --app-scale:1; --app-primary:#0071E3; --app-font:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; }
body,button,input,textarea,select { font-family:var(--app-font)!important; }
[data-app-text] { font-size:calc(var(--app-scale) * var(--app-base-size))!important; }
:root[data-theme='dark'] { color-scheme:dark; --bg-canvas:#101722; --bg-card:#182230; --bg-subtle:#202d3d; --bg-hover:#293b50; --text-primary:#f1f5f9; --text-secondary:#cbd5e1; --text-muted:#aab8cb; --border-color:#3a4b60; --border-strong:#526780; --dct-surface:#101722; --dct-card:#182230; --dct-text:#f1f5f9; --dct-muted:#aab8cb; --dct-border:#3a4b60; }
[data-theme='dark'] body { background:#101722!important; color:#f1f5f9!important; }
[data-theme='dark'] :is(.card,.soc-post-card,.soc-floating-panel,.msgr-thread,.msgr-sidebar,.msgr-info-panel,.modal-content,.form-control,.btn-outline,.cal-grid-wrap,.cal-month-cell,header,nav,[class*='bg-white'],[class*='bg-slate-50']) { background-color:#182230!important; color:#f1f5f9!important; border-color:#3a4b60!important; }
[data-theme='dark'] :is(.soc-post-card,.soc-floating-panel,.msgr-thread,.msgr-sidebar,.modal-content,header,nav) :is(strong,p,h1,h2,h3,h4,label,span,div) { color:inherit!important; }
[data-theme='dark'] [class*='text-slate-'],[data-theme='dark'] [class*='text-[#1D1D1F]'],[data-theme='dark'] [class*='text-[#0B1220]'] { color:#dce6f3!important; }
[data-theme='dark'] :is(input,textarea,select) { background-color:#111c2a!important; color:#f1f5f9!important; border-color:#526780!important; }
[data-theme='dark'] :is(.cal-time-col,.cal-slot,.cal-month-cell) { background:#182230!important; color:#dce6f3!important; border-color:#3a4b60!important; }
[data-theme='dark'] .cal-slot.is-today { background:#1d3554!important; }
[data-theme='dark'] :is(.cal-event,.cal-event div) { color:white!important; }
:root :is(.btn-primary,.soc-floating-button,[class*='bg-[#0071E3]'],[class*='bg-blue-700']) { background-color:var(--app-primary)!important; color:white!important; }
/* Normalize legacy light inline surfaces, including prescription rows and hover states. */
[data-theme='dark'] :is([style*="background:#f8fafc" i],[style*="background: #f8fafc" i],[style*="background:#f5f5f7" i],[style*="background:#f1f5f9" i],[style*="background:#fff" i],[style*="background: #fff" i],[style*="background: white" i],[style*="background:#eff6ff" i]) { background:#202d3d!important; color:#e5edf8!important; border-color:#40536c!important; }
[data-theme='dark'] :is(.prescription-card,.rx-card,.patient-card,.table tbody tr):hover { background:#293b50!important; }
[data-theme='dark'] :is([style*="color:#1d1d1f" i],[style*="color:#0b1220" i],[style*="color:#3a3a3c" i],[style*="color:#475569" i],[style*="color:#6e6e73" i],[style*="color:#64748b" i]) { color:#dce6f3!important; }
[data-theme='dark'] .sticky-board-shell { background-color:#111c2a!important; }
[data-theme='dark'] .sticky-note :is(input,textarea), .sticky-note :is(input,textarea) { background:transparent!important; color:var(--note-ink)!important; border-color:transparent!important; box-shadow:none!important; }
[data-theme='dark'] .sticky-note :is(input,textarea)::placeholder { color:var(--note-ink)!important; opacity:0.6; }
[data-theme='dark'] .sticky-note :is(.sticky-meta-time,.sticky-drag-handle) { color:var(--note-ink)!important; }
/* Compact icon buttons participate in the header layout; no overlay over the doctor identity. */
.dct-generated-icon { width:24px; height:24px; object-fit:contain; flex-shrink:0; }
.dct-icon-badge { position:absolute; top:-5px; right:-5px; min-width:18px; height:18px; padding:0 4px; display:flex; align-items:center; justify-content:center; border-radius:10px; background:#d92344; color:#fff!important; border:2px solid var(--bg-card,#fff); font-size:10px!important; font-weight:800; line-height:1; }
.topbar-right { gap:10px; }
@media(max-width:1100px) { .topbar-right .topbar-btn-label { display:none; } }
#dct-ai-fab { right:94px!important; bottom:24px!important; width:56px!important; height:56px!important; min-width:56px!important; padding:14px!important; border-radius:50%!important; font-size:0!important; display:flex;align-items:center;justify-content:center; }
#dct-ai-fab svg { width:26px;height:26px; }
#dct-ai-drawer { right:24px!important; bottom:90px!important; max-height:calc(100vh - 130px)!important; width:min(410px,calc(100vw - 36px))!important; }
[data-theme='dark'] #dct-ai-drawer,[data-theme='dark'] #dct-ai-messages,[data-theme='dark'] #dct-ai-drawer [style*='background:#f' i],[data-theme='dark'] #dct-ai-drawer [style*='background: #f' i] { background:#182230!important;color:#edf5ff!important; }
[data-theme='dark'] #dct-ai-drawer :is(p,div,span,strong) { color:#edf5ff; }
[data-theme='dark'] #dct-ai-drawer textarea { background:#111c2a!important;color:#edf5ff!important; }
:root[data-theme='dark'] .mail-address-row input,:root[data-theme='dark'] .mail-message-input,:root[data-theme='dark'] .mail-search input { background:transparent!important; }
[data-theme='dark'] .dct-chat-avatar,[data-theme='dark'] .dct-chat-avatar>span { color:#1744a2!important; }
[data-theme='dark'] .dct-license-pill { background:#1d3554!important;color:#b8d7ff!important;border-color:#40536c!important; }
[data-theme='dark'] :is(.dct-ai-msgs,.dct-ai-foot,.dct-ai-msg.bot) { background:#202d3d!important;color:#edf5ff!important;border-color:#40536c!important; }
[data-theme='dark'] .dct-ai-head { background:#0b1420!important;color:#edf5ff!important; }
[data-theme='dark'] :is(.badge-blue,.badge-info,.badge-green,.badge-success) { background:#223d63!important;color:#d4e6ff!important;border-color:#40536c!important; }
[data-theme='dark'] :is(.badge-orange,.badge-yellow,.badge-warning) { background:#47351b!important;color:#f7d58c!important; }
[data-theme='dark'] :is(.badge-red,.badge-danger) { background:#48252d!important;color:#ffb8c5!important; }
[data-theme='dark'] :is(.data-table,.data-table td,.data-table th,.table,.table td,.table th) { background:#182230!important;color:#e5edf8!important;border-color:#3a4b60!important; }
[data-theme='dark'] :is(.data-table tbody tr:hover,.table tbody tr:hover) :is(td,th){background:#293b50!important;}
[data-theme='dark'] :is(.form-group label,.form-label,.card-title,.patient-name,.section-title,.modal-title) { color:#edf5ff!important; }
[data-theme='dark'] ::placeholder { color:#aab8cb!important;opacity:1; }
[data-theme='dark'] .sticky-note ::placeholder { color:var(--note-ink)!important;opacity:.6; }
[data-theme='dark'] :is(.stat-card,.stat-value,.kpi-card,.empty-state,.modal-header,.modal-footer,.dropdown-menu,.global-search-dropdown,.global-search-result) { background-color:#182230!important;color:#edf5ff!important;border-color:#3a4b60!important; }
[data-theme='dark'] .btn-cream { background:#30415a!important;color:#edf5ff!important;border-color:#526780!important; }
[data-theme='dark'] input[type='checkbox'],[data-theme='dark'] input[type='radio'] { accent-color:var(--app-primary); }
[data-theme='dark'] .sticky-note [style*='background'] { color:var(--note-ink); }
@media(max-width:1200px){ .topbar-right #btn-quick-consult,.topbar-right #btn-quick-rx{display:none;} }

/* ───────────── Top bar utilities: icon-only tour, theme shortcut and notification bell (far right) ───────────── */
.dct-topbar-utilities { display:inline-flex; align-items:center; gap:8px; flex-shrink:0; }
.dct-icon-button { position:relative; display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px; min-width:38px; padding:0; border-radius:12px; border:1px solid var(--border-color,#e2e8f0); background:var(--bg-card,#fff); color:var(--text-primary,#1d1d1f); cursor:pointer; transition:background .15s,border-color .15s; }
.dct-icon-button:hover { background:var(--bg-hover,#e8ecf2); border-color:var(--border-strong,#cbd5e1); }
.dct-icon-button:focus-visible { outline:2px solid var(--app-primary); outline-offset:2px; }
.dct-icon-button svg { width:18px; height:18px; }
.dct-theme-icon-sun,[data-theme='dark'] .dct-theme-icon-moon { display:none; }
[data-theme='dark'] .dct-theme-icon-sun { display:block; }
#dct-notification-panel { top:calc(var(--topbar-height,60px) + 8px)!important; right:16px; bottom:auto!important; }

/* ───────────── Brand: DCT.tn logo & name ───────────── */
.brand-logo.dct-brand-logo,.loading-medical-badge.dct-brand-badge { background:none!important; box-shadow:none!important; padding:0; overflow:hidden; }
.dct-brand-logo img { width:36px; height:36px; display:block; }
.dct-brand-badge img { width:68px; height:68px; display:block; }
.sidebar .nav-link.active .nav-link-left,.sidebar .nav-link.active .nav-link-left span,.sidebar .nav-link.active svg { color:#fff!important; }

/* ───────────── Paramètres → Affichage ───────────── */
.dct-display-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px 20px; }
.dct-display-grid .form-group { margin:0; }
@media(max-width:1100px){ .dct-display-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px){ .dct-display-grid { grid-template-columns:1fr; } }

/* ───────────── Dark theme: design tokens (soft surfaces, borders, semantic tints) ───────────── */
:root[data-theme='dark'] {
  --text-light:#8fa0b6; --text-on-dark:#f1f5f9;
  --primary-active:#9cc8ff; --primary-light:#1f3f63; --primary-Soft:#182f4a; --primary-soft:#182f4a; --primary-border:#2f5a85;
  --secondary-hover:#2dd4bf; --secondary-light:#17403f; --secondary-soft:#143433; --secondary-border:#256562;
  --danger-dark:#ffb4b4; --danger-light:#3a2027; --danger-border:#7a3541;
  --warning-dark:#f7d58c; --warning-light:#3b2f17; --warning-border:#7a5c1e;
  --success-dark:#8ee6b8; --success-light:#143a2d; --success-border:#216b50;
  --purple-light:#2b2450; --purple-border:#52459b;
  --bg-sidebar:#0b1220; --bg-sidebar-hover:#182230;
  --shadow-xs:0 1px 2px rgba(0,0,0,.3); --shadow-sm:0 1px 3px rgba(0,0,0,.35); --shadow-md:0 4px 10px rgba(0,0,0,.35); --shadow-lg:0 10px 25px rgba(0,0,0,.4); --shadow-xl:0 20px 40px rgba(0,0,0,.5);
}
[data-theme='dark'] .btn-danger:hover { background:#b91c1c; }
[data-theme='dark'] .btn-soft-danger:hover { background:#4a2630; }
[data-theme='dark'] .sidebar,[data-theme='dark'] .sidebar nav { background-color:#0b1220!important; }
[data-theme='dark'] ::-webkit-scrollbar-thumb { background:#3a4b60; }

/* ───────────── Dark theme: components with hard-coded light colours ───────────── */
[data-theme='dark'] :is(.clinical-table tbody tr:hover,.waiting-item:hover,.cal-slot:hover,.msgr-conv-item:hover,.soc-action-btn:hover) { background:#293b50!important; }
[data-theme='dark'] .clinical-table tbody tr.row-abnormal,[data-theme='dark'] .vital-mini-card.abnormal { background:#3a2027!important; }
[data-theme='dark'] .clinical-table tbody tr.row-abnormal:hover { background:#4a2630!important; }
[data-theme='dark'] .patient-avatar.female { background:#4a2340!important; color:#ffc2e2!important; }
[data-theme='dark'] .dossier-allergy-strip { background:linear-gradient(90deg,#3a2027 0%,#3b2f17 100%)!important; color:#ffd9d9!important; }
[data-theme='dark'] .svg-chart-stage { background:linear-gradient(180deg,#202d3d 0%,#182230 100%)!important; }
[data-theme='dark'] .svg-chart-stage text { fill:#cbd5e1; }
[data-theme='dark'] :is(.file-card-footer,.modal-header,.modal-footer,.dct-modal-box,.dct-ai-foot,.msgr-shell,.msgr-composer,.msgr-typing,.msgr-messages,.msgr-attachment-bar,.soc-comment,.soc-action-btn,.sticky-search-input,.cal-time-col) { background-color:#182230!important; color:#edf5ff!important; border-color:#3a4b60!important; }
[data-theme='dark'] :is(.cal-view-switch,.soc-tabs,.sticky-filter-pills,.msgr-composer input[type="text"],.soc-post-img) { background-color:#111c2a!important; border-color:#3a4b60!important; }
[data-theme='dark'] :is(.cal-view-btn,.soc-tab,.sticky-filter-pill) { color:#cbd5e1!important; }
[data-theme='dark'] :is(.cal-view-btn.active,.soc-tab.active,.sticky-filter-pill.active) { background:#30415a!important; color:#fff!important; }
[data-theme='dark'] :is(.msgr-conv-item.active,.soc-action-btn.liked,.msgr-icon-btn,.dct-chat-avatar,.mail-sender-avatar) { background:#1f3f63!important; color:#cfe4ff!important; }
[data-theme='dark'] .msgr-bubble-row.peer :is(.msgr-bubble,.msgr-file-card) { background:#293b50!important; color:#edf5ff!important; }
[data-theme='dark'] :is(.soc-post-body,.sticky-board-heading h3,.msgr-ctrl-btn.muted) { color:#edf5ff!important; }
[data-theme='dark'] .dct-banner { background:#182f4a!important; color:#dbeafe!important; border-color:#2f5a85!important; }
[data-theme='dark'] :is(.dct-banner.readonly,.dct-license-pill.danger,.dct-ai-voice-status,.dct-voice-button.recording) { background:#3a2027!important; color:#ffb4b4!important; border-color:#7a3541!important; }
[data-theme='dark'] .dct-license-pill.active { background:#143a2d!important; color:#8ee6b8!important; border-color:#216b50!important; }
[data-theme='dark'] .mail-lab-tag { background:#3b2f17!important; color:#f7d58c!important; }
[data-theme='dark'] .mail-lab-tag.imported { background:#143a2d!important; color:#8ee6b8!important; }
[data-theme='dark'] :is(.badge-teal,.badge-purple,.badge-gray,.badge-slate) { border-color:#40536c!important; }
[data-theme='dark'] a:not(.btn):not(.nav-link) { color:#8ec5ff; }

/* Legacy inline colours injected by JS templates (not covered by the token layer). */
[data-theme='dark'] :is([style*="background:#faf8fc" i],[style*="background: #faf8fc" i],[style*="background:#faf7fd" i],[style*="background:#ffffff" i],[style*="background: #ffffff" i],[style*="background-color:#fff" i],[style*="background:#fef2f2" i],[style*="background:#e0f2fe" i]) { background:#202d3d!important; color:#e5edf8!important; border-color:#40536c!important; }
[data-theme='dark'] [style*="linear-gradient(135deg,var(--primary-soft" i],[data-theme='dark'] [style*="linear-gradient(135deg, var(--primary-soft" i] { background:linear-gradient(135deg,#182f4a,#17364d)!important; }
[data-theme='dark'] :is([style*="color:#6c5a7e" i],[style*="color: #6c5a7e" i],[style*="color:#334155" i],[style*="color:#8e8e93" i],[style*="color:#94a3b8" i]) { color:#b6c4d6!important; }
[data-theme='dark'] :is([style*="color:#4c0974" i],[style*="color: #4c0974" i],[style*="color:#270442" i],[style*="color: #270442" i],[style*="color:#0f172a" i],[style*="color: #0f172a" i],[style*="color:#1e3a8a" i],[style*="color:#1d4ed8" i],[style*="color:#1b639e" i]) { color:#e5edf8!important; }
[data-theme='dark'] :is([style*="color:#b91c1c" i],[style*="color: #b91c1c" i],[style*="color:#991b1b" i]) { color:#ffb4b4!important; }
[data-theme='dark'] :is([style*="color:#0071e3" i],[style*="color: #0071e3" i]):not(.btn):not([style*="background"]) { color:#8ec5ff!important; }
/* Elements that deliberately keep their own colours: gold update button, solid CTAs. */
[data-theme='dark'] [style*="background:#efe1ae" i] { color:#270442!important; }
[data-theme='dark'] :is([style*="background:#0071e3" i],[style*="background:#0b1220" i],[style*="background:#dc2626" i],[style*="background:#ef4444" i],[style*="background:#0f766e" i]) { color:#fff!important; }

/* Printable A4 documents stay paper-white with dark ink in every theme. */
[data-theme='dark'] :is(.a4-ordonnance-page,.print-only-container) { background-color:#fff!important; color:#0f172a!important; border-color:#cbd5e1!important; }
[data-theme='dark'] :is(.a4-ordonnance-page,.print-only-container) :is(p,span,div,strong,h1,h2,h3,h4,td,th,li,small,em) { color:#0f172a!important; background-color:transparent!important; border-color:#cbd5e1!important; }
@media print { :root[data-theme='dark'] { color-scheme:light; } [data-theme='dark'] body { background:#fff!important; color:#000!important; } }

/* Top bar never overflows: secondary labels collapse before anything gets clipped. */
.topbar { min-width:0; }
.topbar-right { min-width:0; flex-shrink:0; }
@media(max-width:1600px){ .topbar-right .session-mode-action { display:none; } }
@media(max-width:1500px){ .topbar-right .doctor-mini-info { display:none; } .topbar-right .topbar-doctor-pill { padding:3px; } }
@media(max-width:1380px){ .topbar-right .session-mode-text,.topbar-right .topbar-clock-date { display:none; } }

/* ── Generated: same inline-colour rules for styles the browser re-serialised to rgb() ── */
[data-theme='dark'] :is([style*="background: rgb(248, 250, 252)" i],[style*="background: rgb(248, 250, 252)" i],[style*="background: rgb(245, 245, 247)" i],[style*="background: rgb(241, 245, 249)" i],[style*="background: rgb(255, 255, 255)" i],[style*="background: rgb(255, 255, 255)" i],[style*="background: white" i],[style*="background: rgb(239, 246, 255)" i]) { background:#202d3d!important; color:#e5edf8!important; border-color:#40536c!important; }
[data-theme='dark'] :is([style*="; color: rgb(29, 29, 31)" i],[style*="; color: rgb(11, 18, 32)" i],[style*="; color: rgb(58, 58, 60)" i],[style*="; color: rgb(71, 85, 105)" i],[style*="; color: rgb(110, 110, 115)" i],[style*="; color: rgb(100, 116, 139)" i]) { color:#dce6f3!important; }
[data-theme='dark'] :is([style^="color: rgb(29, 29, 31)" i],[style^="color: rgb(11, 18, 32)" i],[style^="color: rgb(58, 58, 60)" i],[style^="color: rgb(71, 85, 105)" i],[style^="color: rgb(110, 110, 115)" i],[style^="color: rgb(100, 116, 139)" i]) { color:#dce6f3!important; }
[data-theme='dark'] :is([style*="background: rgb(250, 248, 252)" i],[style*="background: rgb(250, 248, 252)" i],[style*="background: rgb(250, 247, 253)" i],[style*="background: rgb(255, 255, 255)" i],[style*="background: rgb(255, 255, 255)" i],[style*="background-color: rgb(255, 255, 255)" i],[style*="background: rgb(254, 242, 242)" i],[style*="background: rgb(224, 242, 254)" i]) { background:#202d3d!important; color:#e5edf8!important; border-color:#40536c!important; }
[data-theme='dark'] :is([style*="; color: rgb(108, 90, 126)" i],[style*="; color: rgb(108, 90, 126)" i],[style*="; color: rgb(51, 65, 85)" i],[style*="; color: rgb(142, 142, 147)" i],[style*="; color: rgb(148, 163, 184)" i]) { color:#b6c4d6!important; }
[data-theme='dark'] :is([style^="color: rgb(108, 90, 126)" i],[style^="color: rgb(108, 90, 126)" i],[style^="color: rgb(51, 65, 85)" i],[style^="color: rgb(142, 142, 147)" i],[style^="color: rgb(148, 163, 184)" i]) { color:#b6c4d6!important; }
[data-theme='dark'] :is([style*="; color: rgb(76, 9, 116)" i],[style*="; color: rgb(76, 9, 116)" i],[style*="; color: rgb(39, 4, 66)" i],[style*="; color: rgb(39, 4, 66)" i],[style*="; color: rgb(15, 23, 42)" i],[style*="; color: rgb(15, 23, 42)" i],[style*="; color: rgb(30, 58, 138)" i],[style*="; color: rgb(29, 78, 216)" i],[style*="; color: rgb(27, 99, 158)" i]) { color:#e5edf8!important; }
[data-theme='dark'] :is([style^="color: rgb(76, 9, 116)" i],[style^="color: rgb(76, 9, 116)" i],[style^="color: rgb(39, 4, 66)" i],[style^="color: rgb(39, 4, 66)" i],[style^="color: rgb(15, 23, 42)" i],[style^="color: rgb(15, 23, 42)" i],[style^="color: rgb(30, 58, 138)" i],[style^="color: rgb(29, 78, 216)" i],[style^="color: rgb(27, 99, 158)" i]) { color:#e5edf8!important; }
[data-theme='dark'] :is([style*="; color: rgb(185, 28, 28)" i],[style*="; color: rgb(185, 28, 28)" i],[style*="; color: rgb(153, 27, 27)" i]) { color:#ffb4b4!important; }
[data-theme='dark'] :is([style^="color: rgb(185, 28, 28)" i],[style^="color: rgb(185, 28, 28)" i],[style^="color: rgb(153, 27, 27)" i]) { color:#ffb4b4!important; }
[data-theme='dark'] :is([style*="; color: rgb(0, 113, 227)" i],[style*="; color: rgb(0, 113, 227)" i]):not(.btn):not([style*="background"]) { color:#8ec5ff!important; }
[data-theme='dark'] :is([style^="color: rgb(0, 113, 227)" i],[style^="color: rgb(0, 113, 227)" i]):not(.btn):not([style*="background"]) { color:#8ec5ff!important; }
[data-theme='dark'] [style*="background: rgb(239, 225, 174)" i] { color:#270442!important; }
[data-theme='dark'] :is([style*="background: rgb(0, 113, 227)" i],[style*="background: rgb(11, 18, 32)" i],[style*="background: rgb(220, 38, 38)" i],[style*="background: rgb(239, 68, 68)" i],[style*="background: rgb(15, 118, 110)" i]) { color:#fff!important; }

/* ───────────── Sidebar: collapsible sections (each one remembers its own state) ───────────── */
.nav-group { display:flex; flex-direction:column; }
.nav-group + .nav-group { margin-top:6px; }
.nav-group-toggle { display:flex; align-items:center; justify-content:space-between; width:100%; background:transparent; border:0; border-radius:8px; cursor:pointer; color:#8696ad; padding:8px 10px 6px; text-align:left; transition:color .15s,background .15s; }
.nav-group-toggle:hover { color:#e2e8f0; background:rgba(255,255,255,.05); }
.nav-group-toggle:focus-visible { outline:2px solid #5aa9ff; outline-offset:1px; }
.nav-group-chevron { flex-shrink:0; transition:transform .18s ease; }
.nav-group.collapsed .nav-group-chevron { transform:rotate(-90deg); }
.nav-group-items { display:flex; flex-direction:column; gap:3px; }
.nav-group.collapsed .nav-group-items { display:none; }
.nav-group.collapsed.has-active .nav-group-toggle { color:#fff; }
.nav-group.collapsed.has-active .nav-group-toggle span::after { content:''; display:inline-block; width:6px; height:6px; margin-left:8px; border-radius:50%; background:var(--app-primary,#0071e3); vertical-align:middle; }
.nav-group.nav-group-empty { display:none; }
[data-theme='dark'] kbd { background:#111c2a!important; color:#e5edf8!important; border-color:#526780!important; }

/* ───────────── Vector icons (replace the former bitmap icons; inherit text colour in both themes) ───────────── */
.dct-svg-icon { width:22px; height:22px; flex-shrink:0; display:inline-block; vertical-align:middle; }
.dct-icon-button .dct-svg-icon { width:19px; height:19px; }
#dct-ai-fab,#soc-floating-button { color:#fff; }
#dct-ai-fab .dct-svg-icon,#soc-floating-button .dct-svg-icon { width:26px; height:26px; }
.dct-chat-avatar .dct-svg-icon { width:20px; height:20px; }
.sidebar .nav-link svg,.card-title svg { stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }

/* Guided tour card is always dark: its secondary buttons must stay readable in both themes. */
.dct-tour-card .btn-outline,[data-theme='dark'] .dct-tour-card .btn-outline { background:rgba(255,255,255,.08)!important; color:#fff!important; border-color:rgba(148,163,184,.45)!important; }
.dct-tour-card .btn-outline:hover { background:rgba(255,255,255,.18)!important; }
.dct-tour-card .btn-outline:disabled { opacity:.45; }

/* ───────────── Public site (Tailwind utilities): dark theme ───────────── */
[data-theme='dark'] :is([class~='bg-[#F5F5F7]'],[class~='bg-[#F8FAFC]'],[class~='bg-slate-100'],[class~='bg-[#F5F5F7]/60'],[class~='bg-slate-50/70']) { background-color:#101722!important; }
[data-theme='dark'] :is([class~='bg-slate-200/70'],[class~='bg-slate-200/60']) { background-color:#293b50!important; }
[data-theme='dark'] :is([class~='bg-[#EFF6FF]'],[class~='bg-[#EFF6FF]/60']) { background-color:#182f4a!important; border-color:#2f5a85!important; }
[data-theme='dark'] :is([class~='bg-[#F0FDFA]'],[class~='bg-emerald-50/70'],[class~='bg-emerald-100']) { background-color:#143433!important; border-color:#256562!important; }
[data-theme='dark'] :is([class~='bg-rose-50'],[class~='bg-red-50']) { background-color:#3a2027!important; border-color:#7a3541!important; }
[data-theme='dark'] [class~='bg-amber-50'] { background-color:#3b2f17!important; border-color:#7a5c1e!important; }
[data-theme='dark'] [class*='border-slate-'] { border-color:#3a4b60!important; }
[data-theme='dark'] [class~='text-[#0071E3]'] { color:#8ec5ff!important; }
[data-theme='dark'] [class~='text-[#0D9488]'] { color:#5eead4!important; }
[data-theme='dark'] :is([class~='text-red-700'],[class~='text-rose-700']) { color:#ffb4b4!important; }
[data-theme='dark'] [class~='text-amber-700'] { color:#f7d58c!important; }
[data-theme='dark'] [class~='text-emerald-800'] { color:#8ee6b8!important; }
[data-theme='dark'] :is([class~='hover:bg-[#F5F5F7]'],[class~='hover:bg-slate-100'],[class~='hover:bg-[#EFF6FF]']):hover { background-color:#293b50!important; }
[data-theme='dark'] :is([class~='hover:text-[#1D1D1F]'],[class~='hover:text-[#0B1220]']):hover { color:#fff!important; }
[data-theme='dark'] :is([class~='bg-[#0071E3]'],[class~='bg-[#0D9488]'],[class~='bg-[#0B1220]'],[class~='bg-[#0F766E]']) { color:#fff; }

/* ───────────── Visionneuse d'examen : Avis IA DCT ───────────── */
.pacs-ai-btn { background:linear-gradient(135deg,#6d28d9,#0071e3)!important; border-color:#8b5cf6!important; color:#fff!important; }
.pacs-ai-btn:hover { filter:brightness(1.12); }
.pacs-ai-btn:disabled { opacity:.7; cursor:progress; }
.pacs-ai-btn .dct-svg-icon { width:15px; height:15px; }
.viewer-ai-card { border:1px solid var(--purple-border,#ddd6fe); background:var(--purple-light,#f5f3ff); border-radius:12px; padding:12px 14px; }
.viewer-ai-card.hidden { display:none; }
.viewer-ai-card.is-error { border-color:var(--danger-border,#fecaca); background:var(--danger-light,#fef2f2); }
.viewer-ai-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.viewer-ai-head h4 { margin:0; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; color:var(--text-primary,#1d1d1f); }
.viewer-ai-body { font-size:13px; line-height:1.55; white-space:pre-line; color:var(--text-primary,#1d1d1f); overflow-wrap:anywhere; }
.viewer-ai-card.is-error .viewer-ai-body { color:var(--danger-dark,#b91c1c); }
.viewer-ai-disclaimer { margin:10px 0 0; padding-top:8px; border-top:1px solid var(--purple-border,#ddd6fe); font-size:11px; color:var(--text-muted,#6e6e73); }
.viewer-ai-loading { display:inline-flex; gap:4px; margin-right:6px; vertical-align:middle; }
.viewer-ai-loading span { width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.35; animation:viewerAiPulse 1s infinite ease-in-out; }
.viewer-ai-loading span:nth-child(2){ animation-delay:.15s; } .viewer-ai-loading span:nth-child(3){ animation-delay:.3s; }
@keyframes viewerAiPulse { 0%,80%,100%{opacity:.25;transform:scale(.85);} 40%{opacity:1;transform:scale(1.1);} }
@media (prefers-reduced-motion:reduce){ .viewer-ai-loading span{ animation:none; opacity:.7; } }

/* ───────────── Outils par spécialité (dossier patient) ───────────── */
.spec-tools { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin-bottom:14px; }
.spec-tool { display:flex; flex-direction:column; align-items:flex-start; gap:2px; padding:10px 12px; border-radius:12px; border:1px solid var(--border-color,#e2e8f0); background:var(--bg-card,#fff); color:var(--text-primary,#1d1d1f); cursor:pointer; text-align:left; transition:border-color .15s,background .15s; }
.spec-tool strong { font-size:13px; } .spec-tool span { font-size:11.5px; color:var(--text-muted,#6e6e73); }
.spec-tool:hover { border-color:var(--border-strong,#cbd5e1); background:var(--bg-hover,#e8ecf2); }
.spec-tool.active { border-color:var(--app-primary,#0071e3); box-shadow:inset 0 0 0 1px var(--app-primary,#0071e3); background:var(--primary-Soft,#eff6ff); }
.spec-tool:focus-visible,.spec-tooth:focus-visible,.spec-brush:focus-visible,.spec-seg button:focus-visible { outline:2px solid var(--app-primary,#0071e3); outline-offset:2px; }
.spec-body { display:flex; flex-direction:column; gap:14px; }
.spec-card { border:1px solid var(--border-color,#e2e8f0); border-radius:14px; background:var(--bg-card,#fff); padding:16px; display:flex; flex-direction:column; gap:12px; }
.spec-card > header { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.spec-card h4 { margin:0; font-size:14.5px; font-weight:700; color:var(--text-primary,#1d1d1f); }
.spec-muted { color:var(--text-muted,#6e6e73); font-size:12px; }
.spec-note { margin:0; font-size:11.5px; color:var(--text-muted,#6e6e73); }
.spec-empty { margin:0; padding:18px; text-align:center; font-size:13px; color:var(--text-muted,#6e6e73); background:var(--bg-subtle,#f5f5f7); border-radius:10px; }
.spec-error { padding:12px; border-radius:10px; background:var(--danger-light,#fef2f2); color:var(--danger-dark,#b91c1c); font-size:13px; }
.spec-form { display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; }
.spec-form label { flex:1 1 140px; display:flex; flex-direction:column; gap:4px; font-size:12px; font-weight:600; color:var(--text-secondary,#3a3a3c); }
.spec-form-col label { flex-basis:45%; }
.spec-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.spec-inline { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; }
.spec-inline select { width:auto; padding:4px 8px; }
.spec-seg { display:inline-flex; padding:3px; border-radius:10px; background:var(--bg-subtle,#f2f4f8); }
.spec-seg button { border:0; background:transparent; padding:5px 14px; border-radius:8px; font-size:12.5px; font-weight:600; color:var(--text-secondary,#3a3a3c); cursor:pointer; }
.spec-seg button.active { background:var(--bg-card,#fff); color:var(--text-primary,#1d1d1f); box-shadow:0 1px 3px rgba(0,0,0,.15); }
.spec-chart svg { width:100%; height:auto; display:block; color:var(--text-muted,#6e6e73); }
.spec-grid { stroke:currentColor; stroke-opacity:.18; stroke-width:1; }
.spec-tick,.spec-axis { fill:currentColor; font-size:11px; } .spec-axis { font-weight:600; }
.spec-legend { display:flex; flex-wrap:wrap; gap:12px; justify-content:center; font-size:11.5px; color:var(--text-secondary,#3a3a3c); margin-top:4px; }
.spec-legend-item i { display:inline-block; width:14px; height:3px; border-radius:2px; margin-right:5px; vertical-align:middle; }
.spec-palette { display:flex; flex-wrap:wrap; gap:6px; }
.spec-brush { display:inline-flex; align-items:center; gap:6px; padding:5px 10px; border-radius:999px; border:1px solid var(--border-color,#e2e8f0); background:var(--bg-card,#fff); color:var(--text-primary,#1d1d1f); font-size:12px; cursor:pointer; }
.spec-brush i { width:12px; height:12px; border-radius:50%; border:1px solid rgba(0,0,0,.2); }
.spec-brush.active { border-color:var(--app-primary,#0071e3); box-shadow:inset 0 0 0 1px var(--app-primary,#0071e3); font-weight:700; }
.spec-teeth { display:flex; flex-direction:column; gap:8px; align-items:center; overflow-x:auto; padding:6px 0; }
.spec-teeth-row { display:flex; align-items:center; gap:10px; } .spec-teeth-row > div { display:flex; gap:4px; }
.spec-teeth-mid { width:2px; height:34px; background:var(--border-strong,#cbd5e1); }
.spec-tooth { width:34px; height:38px; border-radius:8px 8px 12px 12px; border:1px solid rgba(0,0,0,.25); font-size:11.5px!important; font-weight:700; cursor:pointer; }
.spec-quote-table input { min-width:64px; } .spec-quote-table td:first-child input { min-width:220px; }
.spec-quotes { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:10px; }
.spec-quote { border:1px solid var(--border-color,#e2e8f0); border-radius:12px; padding:12px; display:flex; flex-direction:column; gap:8px; background:var(--bg-subtle,#f5f5f7); }
.spec-quote header,.spec-quote footer { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }
.spec-quote ul { margin:0; padding-left:18px; font-size:12.5px; color:var(--text-secondary,#3a3a3c); }
.spec-body-layout { display:grid; grid-template-columns:240px minmax(0,1fr); gap:18px; align-items:start; }
.spec-bodymap { width:100%; max-width:240px; display:block; margin:0 auto; cursor:crosshair; border-radius:14px; background:var(--bg-subtle,#f5f5f7); }
.spec-body-shape { fill:var(--border-strong,#cbd5e1); } .spec-body-spine { stroke:var(--bg-card,#fff); stroke-width:2; stroke-dasharray:4 4; }
.spec-dot { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; color:#fff; font-size:11px!important; font-weight:700; }
.spec-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.spec-kpis > div { padding:10px 12px; border-radius:10px; background:var(--bg-subtle,#f5f5f7); display:flex; flex-direction:column; gap:2px; }
.spec-kpis span { font-size:11px; color:var(--text-muted,#6e6e73); } .spec-kpis strong { font-size:15px; color:var(--text-primary,#1d1d1f); font-variant-numeric:tabular-nums; }
.spec-progress { height:10px; border-radius:999px; background:var(--bg-subtle,#f2f4f8); overflow:hidden; }
.spec-progress i { display:block; height:100%; border-radius:999px; background:linear-gradient(90deg,#0d9488,var(--app-primary,#0071e3)); }
.spec-steps { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.spec-step { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; border:1px solid var(--border-color,#e2e8f0); }
.spec-step > div { flex:1; min-width:0; } .spec-step strong { font-size:13px; }
.spec-step-dot { width:10px; height:10px; border-radius:50%; background:var(--border-strong,#cbd5e1); flex-shrink:0; }
.spec-step.done .spec-step-dot { background:#16a34a; } .spec-step.now .spec-step-dot { background:#d97706; box-shadow:0 0 0 4px rgba(217,119,6,.25); }
.spec-step.now { border-color:#d97706; }
@media(max-width:900px){ .spec-tools{grid-template-columns:repeat(2,minmax(0,1fr));} .spec-kpis{grid-template-columns:repeat(2,minmax(0,1fr));} .spec-body-layout{grid-template-columns:1fr;} }
[data-theme='dark'] .spec-body-shape { fill:#40536c; } [data-theme='dark'] .spec-tooth { border-color:rgba(255,255,255,.25); }
[data-theme='dark'] .spec-seg button.active { background:#30415a; color:#fff; }
/* All dossier tabs stay visible (the specialty tab would otherwise sit off-screen). */
.dossier-tabs { flex-wrap:wrap; overflow-x:visible; row-gap:0; }

/* ───────────── Date fields (Vanilla Calendar Pro) ───────────── */
.dct-date-native { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; border:0!important; opacity:0!important; pointer-events:none!important; overflow:hidden; clip-path:inset(50%); }
.dct-date-field { position:relative; display:inline-flex; align-items:center; width:100%; min-width:132px; }
.dct-date-field .dct-date-display { width:100%; padding-right:34px!important; font-variant-numeric:tabular-nums; }
.dct-date-icon { position:absolute; right:10px; display:inline-flex; color:var(--text-muted,#6e6e73); cursor:pointer; }
.dct-date-icon svg { width:16px; height:16px; }
.dct-date-field:focus-within .dct-date-icon { color:var(--app-primary,#0071e3); }
.vc[data-vc-input] { z-index:6000!important; box-shadow:0 14px 40px rgba(0,0,0,.22); border:1px solid var(--border-color,#e2e8f0); font-family:var(--app-font); }
.vc [data-vc-date-selected] [data-vc-date-btn],.vc [data-vc-months-month-selected],.vc [data-vc-years-year-selected] { background-color:var(--app-primary,#0071e3)!important; color:#fff!important; }
[data-theme='dark'] .vc :is(button,[data-vc-date-btn]) { border-color:transparent!important; }
[data-theme='dark'] .vc[data-vc-input] { border-color:#3a4b60; }

/* ───────────── Agenda: status colours (legend + events) and visible grid lines ───────────── */
:root { --cal-line:#d5dbe5; --cal-line-strong:#b8c1cf; --st-planifie:#0071e3; --st-confirme:#6d28d9; --st-attente:#d97706; --st-consultation:#0d9488; --st-termine:#64748b; --st-annule:#dc2626; --st-demande:#be185d; }
:root[data-theme='dark'] { --cal-line:#33455c; --cal-line-strong:#4a6080; }
.cal-status-legend { list-style:none; display:flex; flex-wrap:wrap; gap:6px 16px; margin:0 0 10px; padding:0; font-size:12px; font-weight:600; color:var(--text-secondary,#3a3a3c); }
.cal-status-legend li { display:inline-flex; align-items:center; gap:6px; }
.cal-legend-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; background:var(--st-planifie); }
.cal-legend-dot.status-confirme,.cal-event.status-confirme { background:var(--st-confirme)!important; }
.cal-legend-dot.status-en_salle_attente { background:var(--st-attente); }
.cal-legend-dot.status-en_consultation { background:var(--st-consultation); }
.cal-legend-dot.status-termine { background:var(--st-termine); }
.cal-legend-dot.status-annule { background:var(--st-annule); }
.cal-event.status-annule { background:var(--st-annule)!important; opacity:.8; text-decoration:line-through; }
.cal-event.status-demande { background:var(--st-demande)!important; }
.cal-grid-wrap { border:1px solid var(--cal-line-strong)!important; }
.cal-row { border-bottom:1px solid var(--cal-line)!important; }
.cal-slot { border-left:1px solid var(--cal-line)!important; }
.cal-time-col { border-right:1px solid var(--cal-line-strong)!important; }
.cal-month-cell { border-right:1px solid var(--cal-line)!important; border-bottom:1px solid var(--cal-line)!important; }
.cal-head-cell { border-left:1px solid rgba(255,255,255,.22)!important; }

/* ───────────── Démo publique en lecture seule ───────────── */
.dct-demo-banner { display:flex; align-items:center; justify-content:center; gap:14px; flex-wrap:wrap; padding:8px 16px; font-size:13px; background:linear-gradient(90deg,#6d28d9,#0071e3); color:#fff; }
.dct-demo-banner strong { color:#fff; }
.dct-demo-banner .btn { background:#fff!important; color:#0b1220!important; border-color:#fff!important; }
