/* Aude — UI Modern (vanilla) */
:root{
  --brand:#2fb3a8;       /* teal */
  --sun:#ff9f5f;         /* orange */
  --berry:#7c5cff;       /* playful accent */
  --lemon:#ffd36b;       /* warm accent */

  --bg:#f7fafb;
  --bg-soft:#eef2f7;

  --card:#ffffff;
  --cardGlass: rgba(255,255,255,.86);

  --text:#0f172a;
  --muted:#64748b;

  --border:rgba(15, 23, 42, .08);
  --shadow: 0 12px 34px rgba(2, 8, 23, .08);
  --shadow-sm: 0 3px 12px rgba(2, 8, 23, .08);

  --radius: 22px;
  --radius-sm: 14px;
  --max: 1250px;

  --grad: linear-gradient(135deg, rgba(47,179,168,1), rgba(255,159,95,1));
  --grad-soft: linear-gradient(90deg, rgba(47,179,168,.28), rgba(255,159,95,.14));
  --focus: 0 0 0 4px rgba(255,159,95,.18);

  /* Aliases (legacy tokens already used in the app CSS) */
  --accent: var(--brand);
  --accent-2:#1f8f86;
  --bg0: var(--bg);
  --bg1: var(--bg-soft);

  --danger:#ef4444;
  --danger-2:#b91c1c;
  --danger-bg:#fff1f2;

  /* Used by auth styles */
  --panel: var(--cardGlass);
}


*{box-sizing:border-box}
html,body{min-height:100%}
html{background: linear-gradient(180deg, var(--bg0), var(--bg1));}

body{
  margin:0;
  position:relative;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:none;
}
/* Fixed background layer: avoids visible "banding" when scrolling past the main card */
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  background:
    radial-gradient(1100px 680px at 12% 0%, rgba(47,179,168,.18), transparent 58%),
    radial-gradient(900px 640px at 92% 6%, rgba(124,92,255,.14), transparent 62%),
    radial-gradient(720px 520px at 88% 88%, rgba(255,159,95,.10), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

/* Top bar */
.btn-ghost{
  background: rgba(255,255,255,.78);
  border-color: rgba(15,23,42,.10);
}


.topbar{
  position:sticky;
  top:0;
  z-index:90;
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(15,23,42,.06);
}
.topbar::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:var(--grad-soft);opacity:.9}

.topbar-inner{
  height:80px;
  max-width:1600px;
  margin:0 auto;
  padding:0 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.topbar-left{display:flex; align-items:center; gap:12px; min-width:260px;}
.brandmark{width:56px;height:56px;border-radius:18px;background:linear-gradient(135deg, rgba(47,179,168,.20), rgba(47,179,168,.10));display:flex;align-items:center;justify-content:center; box-shadow: var(--shadow-sm); border:1px solid rgba(47,179,168,.18)}
.logo{width:42px;height:42px;object-fit:contain;filter:saturate(1.05)}
.brand-block,.brandblock{display:flex;flex-direction:column;gap:2px;line-height:1.1}
.brand{font-size:18px;font-weight:950;letter-spacing:.2px}
body:not(.theme-dark) .brand{background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent}
.tagline{font-size:12px;color:rgba(15,23,42,.62);font-weight:700}

.link-btn{
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.78);
  border-radius:999px;
  padding:10px 14px;
  font-weight:900;
  cursor:pointer;
  box-shadow: var(--shadow-sm);
}
.link-btn:hover{transform:translateY(-1px); box-shadow: var(--shadow);}
.link-btn:active{transform:translateY(0)}

/* Layout */
.container{max-width:1600px;margin:0 auto;padding:22px 24px 28px}
.layout{display:grid;grid-template-columns: 300px 1fr; gap:22px; align-items:start}
@media (max-width: 1024px){.layout{grid-template-columns:1fr}}

.card{
  background:var(--cardGlass);
  border:1px solid rgba(15,23,42,.08);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
}
.card-pad{padding:20px}

/* Sidebar */
.sidebar-header{padding:18px 18px 14px; border-bottom:1px solid rgba(15,23,42,.06)}
.sidebar-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.sidebar-title{font-size:18px;font-weight:900;color:rgba(15,23,42,.88)}
.sidebar-controls{margin-top:12px;display:flex;flex-direction:column;gap:10px}

.input, .select, .date-input, .field-input{
  width:100%;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.82);
  border-radius:14px;
  padding:11px 12px;
  font-size:14px;
  outline:none;
  box-shadow: 0 1px 0 rgba(15,23,42,.03);
  font-family: "Plus Jakarta Sans", Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}
.input::placeholder,.textarea::placeholder{color:rgba(15,23,42,.42)}
.select{cursor:pointer}
.input.has-icon-right{padding-right:44px}

.select{cursor:pointer}

.input.has-icon-right{padding-right:44px;}
.search-wrap{position:relative}
.search-icon-right{position:absolute; right:12px; top:50%; transform:translateY(-50%); color:rgba(15,23,42,.40); font-size:14px; pointer-events:none}

.input:focus, .select:focus, .textarea:focus, .date-input:focus, .field-input:focus{
  border-color: rgba(47,179,168,.55);
  box-shadow: var(--focus);
}
.search-wrap{position:relative}

.icon-btn{
  width:38px;height:38px;border-radius:14px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.80);
  cursor:pointer;
  font-size:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow: var(--shadow-sm);
}
.icon-btn:hover{transform:translateY(-1px)}
.icon-btn:active{transform:translateY(0)}

.dossier-list{max-height:72vh; overflow:auto; padding:10px}
.dossier-wrap{border:0}
.dossier-item{
  width:100%;
  text-align:left;
  padding:12px 12px;
  border:1px solid rgba(15,23,42,.07);
  background: rgba(255,255,255,.72);
  cursor:pointer;
  border-radius:16px;
  margin:0 0 10px 0;
  box-shadow: 0 10px 22px rgba(15,23,42,.06);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.dossier-item:hover{transform:translateY(-1px); box-shadow: 0 14px 30px rgba(15,23,42,.08)}
.dossier-item.active{background: rgba(47,179,168,.10); border-color: rgba(47,179,168,.20)}
.dossier-item.active::before{display:none}
.dossier-row{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.dossier-title{font-weight:900;font-size:14px}
.dossier-meta{margin-top:6px; font-size:12px; color:rgba(15,23,42,.55); font-weight:700}
.dossier-empty{padding:18px 16px; color:rgba(15,23,42,.55); font-size:14px}
.dossier-title-row{display:flex;align-items:center;justify-content:space-between;gap:10px}

.count-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:28px;
  height:24px;
  padding:0 9px;
  border-radius:999px;
  border:1px solid rgba(47,179,168,.22);
  background: rgba(47,179,168,.14);
  color: rgba(15,23,42,.74);
  font-size:12px;
  font-weight:950;
  box-shadow: 0 10px 22px rgba(15,23,42,.05);
  overflow:hidden;
  overflow-y:auto;
}



/* Main top */
.main-pad{padding:18px 18px 16px}
.titlebar{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;flex-wrap:wrap}
.titlebar-left{display:flex;gap:14px;flex:1;min-width:320px;flex-wrap:wrap}
.titlebar-right{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
.field{display:flex;flex-direction:column;gap:6px;min-width:220px;flex:1}
.consult-field{min-width:260px;flex:0 0 260px}
.motif-field{min-width:260px;flex:0 0 260px}
.field-label{font-size:12px;font-weight:900;color:rgba(15,23,42,.62)}
.dt-field{min-width:240px;flex:0 0 auto}
.dt-inline{display:flex;gap:10px;align-items:center}
.dt-inline .date-input{min-width:150px}

@media (max-width: 560px){.dt-inline{flex-direction:column;align-items:stretch}.dt-inline .date-input{min-width:0}}

/* Menu */
.menu-wrap{position:relative}
.menu{
  position:absolute;
  right:0;
  top:48px;
  width:280px;
  background: rgba(255,255,255,.92);
  border:1px solid rgba(15,23,42,.08);
  border-radius:18px;
  box-shadow: 0 18px 46px rgba(15,23,42,.14);
  padding:8px;
  z-index:100;
  backdrop-filter: blur(10px);
}
.menu-head{padding:10px 10px 6px;font-size:11px;font-weight:900;color:rgba(15,23,42,.45);text-transform:uppercase;letter-spacing:.08em}
.menu-head.danger{color:rgba(185,28,28,.9)}
.menu-item{width:100%;border:0;background:transparent;text-align:left;padding:11px 10px;border-radius:14px;cursor:pointer;font-size:13px;font-weight:900;color:rgba(15,23,42,.90)}
.menu-item:hover{background: rgba(15,23,42,.04)}
.menu-item:disabled{color:rgba(15,23,42,.35);cursor:not-allowed}
.menu-item.danger{color:var(--danger-2)}
.menu-item.danger:hover{background: var(--danger-bg)}
.menu-sep{height:1px;background: rgba(15,23,42,.06);margin:6px 6px}

/* Toolbar */
.toolbar-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:14px}
.toolbar-left{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.toolbar-right{display:flex;align-items:center;gap:10px}
.tool-split{width:1px;height:30px;background: rgba(15,23,42,.10);margin:0 6px}

.btn{
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.78);
  border-radius:999px;
  padding:10px 14px;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
  box-shadow: var(--shadow-sm);
  display:inline-flex;
  align-items:center;
  gap:8px;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover{transform:translateY(-1px); box-shadow: var(--shadow)}
.btn:active{transform:translateY(0)}
.btn:disabled{opacity:.55; cursor:not-allowed; transform:none; box-shadow: var(--shadow-sm)}

.btn-primary{background: var(--grad); border-color: rgba(47,179,168,.18); color:#fff;}
.btn-primary:hover{filter:brightness(1.02)}

.btn-secondary{background: rgba(239,246,255,.85); border-color: rgba(59,130,246,.18); color:#1d4ed8;}
.btn-secondary.paused{background: rgba(236,253,245,.92); border-color: rgba(34,197,94,.20); color:#047857;}

.btn-danger{background: var(--danger-bg); border-color: rgba(239,68,68,.22); color: var(--danger-2);}

.btn-record{padding:10px 16pxmin-width:140px;}
.btn-record.recording{background: rgba(254,242,242,.95); border-color: rgba(239,68,68,.28); color: var(--danger-2);}

.timer{font-size:18px;font-weight:950;letter-spacing:.4px;min-width:72px;text-align:center;color:rgba(15,23,42,.86)font-variant-numeric:tabular-nums;}

.status-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 12px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-sm);
  font-size:13px;
  font-weight:950;
}
.status-pill .dot{width:10px;height:10px;border-radius:999px;background: rgba(15,23,42,.35)}
.status-pill.is-idle{border-color: rgba(47,179,168,.20); background: rgba(240,253,250,.90)}
.status-pill.is-idle .dot{background: var(--accent-2)}
.status-pill.is-recording{border-color: rgba(239,68,68,.22); background: rgba(254,242,242,.92)}
.status-pill.is-recording .dot{background: var(--danger)}
.status-pill.is-recording .dot{animation:pulse 1.1s ease-in-out infinite}
.status-pill.is-processing{border-color: rgba(124,58,237,.18); background: rgba(250,245,255,.92)}
.status-pill.is-processing .dot{background: rgba(124,58,237,.9); animation:spin 1s linear infinite; border-radius:3px}
.status-pill.is-uploading{border-color: rgba(59,130,246,.18); background: rgba(239,246,255,.92)}
.status-pill.is-uploading .dot{background: rgba(29,78,216,.9)}
.status-pill.is-completed{border-color: rgba(34,197,94,.20); background: rgba(236,253,245,.92)}
.status-pill.is-completed .dot{background: rgba(22,163,74,.92)}
.status-pill.is-paused{border-color: rgba(245,158,11,.20); background: rgba(255,251,235,.92)}
.status-pill.is-paused .dot{background: rgba(180,83,9,.92)}
.status-pill.is-error{border-color: rgba(239,68,68,.22); background: rgba(254,242,242,.92)}
.status-pill.is-error .dot{background: var(--danger)}

@keyframes pulse{0%,100%{transform:scale(1);opacity:.75}50%{transform:scale(1.35);opacity:1}}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion: reduce){.status-pill.is-recording .dot,.status-pill.is-processing .dot{animation:none}.btn,.dossier-item,.icon-btn,.link-btn{transition:none}}

.substatus{margin-top:12px;display:flex;flex-wrap:wrap;gap:10px;align-items:center;font-size:13px;color:rgba(15,23,42,.58);font-weight:700}
.subtle{color:rgba(15,23,42,.45);font-size:12px;font-weight:800}
.badge{border-radius:999px;padding:7px 10px;font-size:12px;font-weight:950;border:1px solid rgba(15,23,42,.10);background: rgba(255,255,255,.78)}
.badge-amber{color:rgba(180,83,9,.95);background: rgba(255,251,235,.92);border-color: rgba(245,158,11,.22)}

.error{margin-top:12px;border:1px solid rgba(239,68,68,.25);background: rgba(254,242,242,.92);color: var(--danger-2);border-radius:16px;padding:12px 14px;font-size:13px;display:none;font-weight:800}

/* Sections */
.grid{display:grid;grid-template-columns: 1.35fr .65fr;gap:18px;margin-top:16px}
@media (max-width: 1024px){.grid{grid-template-columns:1fr}}

.panel{border:1px solid rgba(15,23,42,.07);background: rgba(255,255,255,.72);border-radius:20px;padding:14px 14px 12px;box-shadow: 0 12px 24px rgba(15,23,42,.06)}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 10px}
.section-actions{display:flex;align-items:center;gap:10px}
.h2{font-size:14px;font-weight:950;color:var(--accent);margin:0}
.meta{font-size:12px;color:rgba(15,23,42,.45);font-weight:800}

.copy-pill{border:1px solid rgba(15,23,42,.10);background: rgba(255,255,255,.82);border-radius:999px;padding:8px 12px;font-weight:950;font-size:12px;cursor:pointer;box-shadow: var(--shadow-sm)}
.copy-pill:hover{transform:translateY(-1px);box-shadow: var(--shadow)}
.copy-pill:active{transform:translateY(0)}

.textarea{
  width:100%;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.85);
  border-radius:18px;
  padding:14px;
  font-size:13px;
  line-height:1.6;
  outline:none;
  resize:none;
  min-height:220px;
  box-shadow: 0 10px 22px rgba(15,23,42,.05);
  overflow:hidden;
  font-family: "Plus Jakarta Sans", Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}


/* Notes editor: contenteditable behaves like textarea + placeholder */
.notes-editor[contenteditable="true"]{
  white-space: pre-wrap;
}
.notes-editor[contenteditable="true"]:empty:before{
  content: attr(data-placeholder);
  color: rgba(15,23,42,.42);
}
body.theme-dark .notes-editor[contenteditable="true"]:empty:before{
  color: rgba(229,231,235,.55);
}


/* Notes toolbar (Mes notes) */
.notes-toolbar{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  margin:0 0 8px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.72);
  border-radius:14px;
  box-shadow: var(--shadow-sm);
}
.nt-btn{
  height:34px;
  min-width:34px;
  padding:0 10px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.88);
  cursor:pointer;
  font-weight:950;
}
.nt-btn:hover{transform:translateY(-1px); box-shadow: var(--shadow-sm);}
.nt-btn:active{transform:translateY(0);}
.nt-select{
  height:34px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.88);
  padding:0 10px;
  font-weight:850;
}

.nt-color{
  height:34px;
  width:34px;
  padding:0;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.88);
  cursor:pointer;
}
.nt-color::-webkit-color-swatch-wrapper{padding:0;}
.nt-color::-webkit-color-swatch{border:none;border-radius:10px;}
.nt-sep{width:1px;height:18px;background:rgba(15,23,42,.12); margin:0 2px;}
textarea.notes-editor{line-height:1.65;}
.textarea.big{min-height:260px}
.right-stack{display:flex;flex-direction:column;gap:14px}

/* Footer */
.footer{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:14px;color:rgba(15,23,42,.45);font-size:12px;font-weight:800}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}

/* Toast */
.toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%) translateY(8px);background:#0f172a;color:#fff;padding:10px 14px;border-radius:999px;box-shadow:0 18px 46px rgba(15,23,42,.18);font-size:13px;font-weight:950;opacity:0;pointer-events:none;transition:opacity .18s ease,transform .18s ease;z-index:999;display:none}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast.success{background:#065f46}
.toast.error{background:#b91c1c}
.toast.info{background:#0f172a}

/* Focus ring */
.icon-btn:focus-visible,.btn:focus-visible,.input:focus-visible,.select:focus-visible,.textarea:focus-visible,.date-input:focus-visible,.field-input:focus-visible,.copy-pill:focus-visible,.link-btn:focus-visible{
  outline:none;
  box-shadow: var(--focus);
}

/* Scrollbars (webkit) */
*::-webkit-scrollbar{height:10px;width:10px}
*::-webkit-scrollbar-thumb{background:rgba(15,23,42,.18);border-radius:999px;border:3px solid rgba(255,255,255,.55)}
*::-webkit-scrollbar-track{background:transparent}

.icon-btn-sm{width:36px;height:36px;border-radius:14px;font-size:16px;}
.btn-small{padding:8px 12px;font-size:12px;}
.btn-newconsult{padding:10px 14px;}

/* Consultation select sizing */
.consult-select{min-width:220px;max-width:310px;}
#dateInput{width:150px;}
#timeInput{width:92px;}

/* Compact controls (top bar) */
#consultSelect, #dateInput, #timeInput{height:40px; padding:10px 12px;}



/* Modal */
.modal-overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(15,23,42,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index:1000;
  padding:18px;
}
.modal{
  width:min(560px, 100%);
  background: rgba(255,255,255,.92);
  border:1px solid rgba(15,23,42,.10);
  border-radius:24px;
  box-shadow: 0 26px 70px rgba(15,23,42,.24);
  overflow:hidden;
}
.modal-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:16px 16px 12px;
  border-bottom:1px solid rgba(15,23,42,.06);
}
.modal-title{font-size:16px;font-weight:950;}
.modal-subtitle{font-size:12px;color:rgba(15,23,42,.55);font-weight:800;margin-top:2px}
.modal-body{padding:14px 16px 6px;}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media (max-width:560px){.form-grid{grid-template-columns:1fr}}
.form-field{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:900;color:rgba(15,23,42,.60)}
.form-field input{margin-top:0}
.toggle-row{margin-top:12px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 12px;border:1px solid rgba(15,23,42,.08);background: rgba(15,23,42,.02);border-radius:18px}
.toggle-title{font-size:13px;font-weight:950;color:rgba(15,23,42,.90)}
.toggle-sub{font-size:12px;color:rgba(15,23,42,.55);font-weight:800;margin-top:2px}
.modal-footer{padding:12px 16px 16px;display:flex;justify-content:flex-end;gap:10px}



/* Dark mode */
body.theme-dark{
  --bg0:#0b1220;
  --bg1:#070b14;
  --cardGlass: rgba(15,23,42,.62);
  --panel: rgba(15,23,42,.92);

  --text:#e5e7eb;
  --muted:#94a3b8;
  --border: rgba(148,163,184,.18);

  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --shadow-sm: 0 10px 28px rgba(0,0,0,.35);
}

body.theme-dark::before{
  background:
    radial-gradient(1200px 700px at 12% 0%, rgba(47,179,168,.14), transparent 58%),
    radial-gradient(1000px 650px at 92% 6%, rgba(124,92,255,.12), transparent 62%),
    radial-gradient(800px 520px at 88% 88%, rgba(255,159,95,.08), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}
body.theme-dark .topbar{background: rgba(15,23,42,.62);border-bottom:1px solid rgba(148,163,184,.12)}
body.theme-dark .btn-ghost, body.theme-dark .btn, body.theme-dark .icon-btn{background: rgba(15,23,42,.55);border-color: rgba(148,163,184,.18);color: var(--text)}
body.theme-dark .card{border-color: rgba(148,163,184,.12)}
body.theme-dark .panel{background: rgba(15,23,42,.45);border-color: rgba(148,163,184,.12)}
body.theme-dark .input, body.theme-dark .select, body.theme-dark .date-input, body.theme-dark .field-input, body.theme-dark .textarea{
  background: rgba(15,23,42,.55);
  border-color: rgba(148,163,184,.18);
  color: var(--text);
}
body.theme-dark .input::placeholder, body.theme-dark .textarea::placeholder{color: rgba(229,231,235,.55)}
body.theme-dark .sidebar-title, body.theme-dark .brand{color: rgba(229,231,235,.92)}
body.theme-dark .tagline, body.theme-dark .field-label, body.theme-dark .meta, body.theme-dark .dossier-meta{color: rgba(229,231,235,.60)}
body.theme-dark .dossier-item{background: rgba(15,23,42,.40)}
body.theme-dark .dossier-item.active{background: rgba(47,179,168,.14)}
body.theme-dark .modal{background: rgba(15,23,42,.92);border-color: rgba(148,163,184,.14)}
body.theme-dark .modal-subtitle, body.theme-dark .form-field{color: rgba(229,231,235,.65)}
body.theme-dark .toggle-row{background: rgba(255,255,255,.04);border-color: rgba(148,163,184,.14)}

/* Dark mode — contrast fixes */
body.theme-dark .timer{color: rgba(229,231,235,.92)}
body.theme-dark .status-pill{
  background: rgba(15,23,42,.55);
  border-color: rgba(148,163,184,.18);
  color: rgba(229,231,235,.92);
}
body.theme-dark .status-pill .dot{background: rgba(229,231,235,.55)}
body.theme-dark .status-pill.is-idle{background: rgba(47,179,168,.14);border-color: rgba(47,179,168,.28)}
body.theme-dark .status-pill.is-recording{background: rgba(239,68,68,.14);border-color: rgba(239,68,68,.28)}
body.theme-dark .status-pill.is-processing{background: rgba(124,58,237,.14);border-color: rgba(124,58,237,.26)}
body.theme-dark .status-pill.is-uploading{background: rgba(59,130,246,.14);border-color: rgba(59,130,246,.26)}
body.theme-dark .status-pill.is-completed{background: rgba(34,197,94,.14);border-color: rgba(34,197,94,.26)}
body.theme-dark .status-pill.is-paused{background: rgba(245,158,11,.14);border-color: rgba(245,158,11,.26)}
body.theme-dark .status-pill.is-error{background: rgba(239,68,68,.14);border-color: rgba(239,68,68,.26)}
body.theme-dark .search-icon-right{color: rgba(229,231,235,.55)}
body.theme-dark .count-badge{color: rgba(229,231,235,.92);border-color: rgba(47,179,168,.30);background: rgba(47,179,168,.18)}




/* ===================== PATCH — Dark contrast + Preview mode + Busy feedback ===================== */

/* Timer as a chip (better contrast & scan) */
.timer{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:40px;
  min-width:86px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-sm);
  color: rgba(15,23,42,.92);
}

/* Status pill stack (sub-step text) */
.status-wrap{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.status-sub{font-size:12px;font-weight:850;color:rgba(15,23,42,.58);min-height:16px}

/* Durée max as compact chip */
.dur-chip{
  display:inline-flex;
  align-items:center;
  gap:10px;
  height:40px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-sm);
}
.dur-label{font-size:12px;font-weight:950;color:rgba(15,23,42,.62)}
.dur-select{
  height:32px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.85);
}

/* Segmented toggle (Aperçu / Édition) */
.segmented{
  display:inline-flex;
  align-items:center;
  gap:2px;
  padding:2px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.08);
  background: rgba(15,23,42,.03);
}
.seg-btn{
  border:0;
  background: transparent;
  padding:7px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:950;
  color: rgba(15,23,42,.60);
  cursor:pointer;
  line-height:1;
}
.seg-btn:hover{filter:brightness(.98)}
.seg-btn.is-active{
  background: rgba(255,255,255,.80);
  border:1px solid rgba(15,23,42,.08);
  color: rgba(15,23,42,.92);
  box-shadow: var(--shadow-sm);
}
.seg-btn:disabled{opacity:.55;cursor:not-allowed}

/* IO wrapper: allows preview + skeleton overlay */
.io-wrap{position:relative}
.md-preview{
  width:100%;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.85);
  border-radius:18px;
  padding:14px;
  font-size:13px;
  line-height:1.65;
  min-height:220px;
  box-shadow: 0 10px 22px rgba(15,23,42,.05);
  overflow:hidden;
font-family: "Plus Jakarta Sans", Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}
.md-preview.big{min-height:260px}
.md-preview h1{font-size:18px;margin:6px 0 10px}
.md-preview h2{font-size:16px;margin:6px 0 10px}
.md-preview h3{font-size:14px;margin:6px 0 8px}
.md-preview h4{font-size:13px;margin:6px 0 8px;font-weight:900}
.md-preview h5{font-size:12px;margin:6px 0 8px;font-weight:900;opacity:.92}
.md-preview h6{font-size:12px;margin:6px 0 8px;font-weight:900;opacity:.86}
.md-preview p{margin:0 0 10px}
.md-preview ul,.md-preview ol{margin:0 0 10px 18px;padding:0}
.md-preview li{margin:0 0 6px}
.md-preview hr{border:0;border-top:1px solid rgba(15,23,42,.10);margin:12px 0}
.md-preview code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 10px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(15,23,42,.04);
}
.md-preview blockquote{
  margin:0 0 10px;
  padding:10px 12px;
  border-left:3px solid rgba(47,179,168,.55);
  background: rgba(47,179,168,.08);
  border-radius: 14px;
}
.md-empty{color: rgba(15,23,42,.45); font-weight:800; padding:10px}

/* Busy overlay in editors (dossier / consultation / analyse) */
.editor-loading{
  position:absolute;
  inset:0;
  z-index:3;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  border-radius:18px;
  pointer-events:auto;
  background: rgba(255,255,255,.58);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.is-busy .editor-loading{display:flex}

.editor-loading-card{
  display:inline-flex;
  align-items:center;
  gap:10px;
  max-width:min(100%, 320px);
  padding:12px 14px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-sm);
  color: rgba(15,23,42,.82);
  font-size:13px;
  font-weight:900;
  text-align:center;
}

.editor-loading-text{
  line-height:1.2;
}
  100%{transform:translateX(45%)}
}

/* ---------------- Dark mode refinements ---------------- */
body.theme-dark .timer{
  background: rgba(2,6,23,.42);
  border-color: rgba(148,163,184,.26);
  color: rgba(229,231,235,.96);
}
body.theme-dark .status-sub{color: rgba(229,231,235,.70)}
body.theme-dark .dur-chip{
  background: rgba(2,6,23,.42);
  border-color: rgba(148,163,184,.26);
}
body.theme-dark .dur-label{color: rgba(229,231,235,.72)}
body.theme-dark .dur-select{
  background: rgba(15,23,42,.55);
  border-color: rgba(148,163,184,.18);
  color: rgba(229,231,235,.92);
}

body.theme-dark .segmented{
  background: rgba(255,255,255,.04);
  border-color: rgba(148,163,184,.14);
}
body.theme-dark .seg-btn{color: rgba(229,231,235,.70)}
body.theme-dark .seg-btn.is-active{
  background: rgba(15,23,42,.65);
  border-color: rgba(148,163,184,.18);
  color: rgba(229,231,235,.95);
}

body.theme-dark .md-preview{
  background: rgba(15,23,42,.55);
  border-color: rgba(148,163,184,.18);
  color: rgba(229,231,235,.92);
}
body.theme-dark .md-preview hr{border-top-color: rgba(148,163,184,.18)}
body.theme-dark .md-preview code{
  background: rgba(255,255,255,.05);
  border-color: rgba(148,163,184,.18);
  color: rgba(229,231,235,.92);
}
body.theme-dark .md-preview blockquote{
  background: rgba(47,179,168,.10);
  border-left-color: rgba(47,179,168,.65);
}
body.theme-dark .md-empty{color: rgba(229,231,235,.65)}

/* Stronger dark contrast for status pill (Prêt / État) */
body.theme-dark .status-pill{
  background: rgba(2,6,23,.42);
  border-color: rgba(148,163,184,.26);
  color: rgba(229,231,235,.92);
}
body.theme-dark .status-pill .dot{background: rgba(229,231,235,.70)}
body.theme-dark .status-pill.is-idle{background: rgba(47,179,168,.18);border-color: rgba(47,179,168,.40)}
body.theme-dark .status-pill.is-recording{background: rgba(239,68,68,.18);border-color: rgba(239,68,68,.38)}
body.theme-dark .status-pill.is-processing{background: rgba(124,58,237,.18);border-color: rgba(124,58,237,.34)}
body.theme-dark .status-pill.is-uploading{background: rgba(59,130,246,.18);border-color: rgba(59,130,246,.34)}
body.theme-dark .status-pill.is-completed{background: rgba(34,197,94,.18);border-color: rgba(34,197,94,.34)}
body.theme-dark .status-pill.is-paused{background: rgba(245,158,11,.18);border-color: rgba(245,158,11,.34)}
body.theme-dark .status-pill.is-error{background: rgba(239,68,68,.18);border-color: rgba(239,68,68,.34)}

/* Dark busy overlay tint */
body.theme-dark .editor-loading{
  background: rgba(2,6,23,.48);
}
body.theme-dark .editor-loading-card{
  background: rgba(15,23,42,.88);
  border-color: rgba(148,163,184,.18);
  color: rgba(229,231,235,.92);
}

/* ================================================================================================ */


/* ================= Auth page ================= */
.auth-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:32px 16px;
}
.auth-shell{
  width:min(980px, 100%);
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap:22px;
  align-items:stretch;
}
@media (max-width: 900px){
  .auth-shell{ grid-template-columns: 1fr; }
}
.auth-brand{
  border-radius: 26px;
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow:hidden;
  position:relative;
}
.auth-brand::before{
  content:"";
  position:absolute;
  inset:-40px;
  background: radial-gradient(400px 220px at 12% 10%, rgba(38,214,206,.28), transparent 60%),
              radial-gradient(520px 320px at 90% 40%, rgba(124,92,255,.18), transparent 58%);
  pointer-events:none;
}
.auth-brand > * { position:relative; }
.auth-logo{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}
.auth-logo img{
  width:44px;height:44px;border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.08);
}
.auth-h1{
  font-size: 30px;
  letter-spacing:-.02em;
  margin:0;
}
.auth-p{
  margin:10px 0 0 0;
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.55;
}

.auth-card{
  border-radius: 26px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.auth-tabs{
  display:flex;
  gap:8px;
  margin-bottom:14px;
}
.auth-tab{
  flex:1;
  padding:10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor:pointer;
}
.auth-tab.is-active{
  background: rgba(38,214,206,.12);
  border-color: rgba(38,214,206,.35);
}
.auth-form{
  display:grid;
  gap:12px;
}
.auth-actions{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  margin-top:6px;
}
.auth-msg{
  margin-top:10px;
  color: var(--muted);
  font-size: 13px;
}
.auth-error{
  margin-top:10px;
  color: #ff8aa0;
  font-size: 13px;
}
.theme-mini{
  position:absolute;
  top: 14px;
  right: 14px;
}
.input:disabled{
  opacity:.75;
  cursor:not-allowed;
}



/* Dossiers — pagination */
.dossier-footer{padding:0 10px 10px}
.dossier-more-btn{width:100%}

/* ===== Patch V3.3 — Sidebar + contrastes dark + Mes notes ===== */

/* Sidebar un peu moins haute */
.sidebar, .leftcol, .dossiers-card {
  max-height: calc(100vh - 180px);
}

/* Liste dossiers : scroll plus tôt */
.dossier-list {
  max-height: 52vh;
  overflow: auto;
}

/* Contraste titres dossiers en dark */
.theme-dark .dossier-title {
  color: rgba(248, 250, 252, 0.92) !important;
}
.theme-dark .dossier-meta {
  color: rgba(226, 232, 240, 0.78) !important;
}

/* Contraste modal profil en dark */
.theme-dark .modal,
.theme-dark .modal * {
  color: rgba(248, 250, 252, 0.92);
}
.theme-dark .modal .muted,
.theme-dark .modal .hint,
.theme-dark .modal .subtle {
  color: rgba(226, 232, 240, 0.78) !important;
}


/* Icons (inline SVG) */
.i{width:16px;height:16px;display:inline-block;vertical-align:-2px;color:currentColor}
.icon-btn .i{width:18px;height:18px;vertical-align:0}
.search-icon-right .i{width:16px;height:16px}
.btn .i{width:16px;height:16px}

/* Section title with icon bubble */
.section-title{display:flex;align-items:center;gap:10px;min-width:0}
.section-ico{
  width:30px;height:30px;border-radius:14px;
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid rgba(15,23,42,.08);
  box-shadow: var(--shadow-sm);
  flex:0 0 auto;
}
.section-ico.is-synth{background: linear-gradient(135deg, rgba(47,179,168,.22), rgba(255,159,95,.12)); border-color: rgba(47,179,168,.18)}
.section-ico.is-sug{background: linear-gradient(135deg, rgba(124,92,255,.18), rgba(47,179,168,.14)); border-color: rgba(124,92,255,.16)}
.section-ico.is-plan{background: linear-gradient(135deg, rgba(255,211,107,.24), rgba(255,159,95,.10)); border-color: rgba(255,159,95,.16)}
.section-ico .i{width:16px;height:16px}

/* Accent bar on panels */
.panel{position:relative}
.panel::before{
  content:"";
  position:absolute;
  left:14px; right:14px; top:10px;
  height:3px;
  border-radius:999px;
  background: var(--grad-soft);
  opacity:.9;
}
.panel.accent-sug::before{background: linear-gradient(90deg, rgba(124,92,255,.28), rgba(47,179,168,.14))}
.panel.accent-plan::before{background: linear-gradient(90deg, rgba(255,211,107,.30), rgba(255,159,95,.14))}
.panel .section-head{margin-top:6px}

/* Menu items with icons */
.menu-item{display:flex;align-items:center;gap:10px}
.menu-item .i{width:16px;height:16px;opacity:.92}

/* Historique (plein largeur) */
.panel-full{grid-column:1 / -1}
.section-ico.is-hist{
  background: linear-gradient(135deg, rgba(59,130,246,.16), rgba(47,179,168,.14));
  border-color: rgba(59,130,246,.16)
}
.panel.accent-hist::before{
  background: linear-gradient(90deg, rgba(59,130,246,.22), rgba(47,179,168,.14))
}
.md-preview.historique{min-height:88px;}
.md-preview.historique.is-empty{min-height:58px;}


/* === Patch Aude UI (V16) === */

/* Bouton Enregistrer (orange) */
.btn-record{
  background:#ff9f5f !important;
  border-color:#ff9f5f !important;
  color:#fff !important;
}
.btn-record:hover{ filter: brightness(.96); }

/* Loader dossiers (affiché uniquement au chargement initial) */
.dossier-loader{
  padding:14px 12px;
  display:flex;
  gap:10px;
  align-items:center;
  color: inherit;     /* s’adapte dark/light */
  opacity:.85;
}
.spinner{
  width:18px;height:18px;
  border-radius:999px;
  border:2px solid rgba(127,127,127,.35);
  border-top-color: currentColor;
  animation: spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* Boutons Copier: icône seule */
.copy-btn.icon-only{
  padding:10px !important;
  min-width:40px;
  justify-content:center;
}
.copy-btn.icon-only .i{ margin:0 !important; }

/* ===== AUDE patch (UI) — 2026-02-28 ===== */

/* Sidebar: make the “Nouveau dossier” button explicit */
.btn-newdossier{
  padding: 9px 12px;
  font-weight: 950;
  border-radius: 999px;
}

/* Dossier selected: green notch on the left */
.dossier-item{ position: relative; overflow: hidden; }
.dossier-item.active::before{
  content:"";
  position:absolute;
  left:-2px;
  top:10px;
  bottom:10px;
  width:6px;
  border-radius:999px;
  background: rgba(22,163,74,.92);
  box-shadow: 0 0 0 4px rgba(22,163,74,.10);
  display:block;
}

/* Keep “Patient / dossier” + “Consultation” on one line on desktop */
@media (min-width: 920px){
  .titlebar-left{ flex-wrap: nowrap; align-items: flex-end; }
  .titlebar-left .field{ min-width: 0; }
}

/* ===== AUDE patch (Titlebar layout) — 2026-02-28 ===== */

/* Two-row layout:
   Row 1: Patient / dossier + Consultation
   Row 2: Date / heure + Nouvelle consultation + ... */
.titlebar{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:flex-start;
  gap:12px;
  flex-wrap:nowrap;
}

.titlebar-left{
  min-width:0;
}

.titlebar-right{
  width:100%;
  justify-content:flex-start;
  align-items:flex-end;
}

@media (min-width: 920px){
  .titlebar-left{ flex-wrap: nowrap; }
  .titlebar-right{ flex-wrap: nowrap; }
}


/* ===== Profile modal (Mon profil) — tabs + micro-polish ===== */
.modal-profile{width:min(680px, 100%);}

.profile-tabs{
  display:flex;
  gap:6px;
  padding:6px;
  border:1px solid rgba(15,23,42,.08);
  background: rgba(15,23,42,.03);
  border-radius:999px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

.profile-tab{
  flex:0 0 auto;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid transparent;
  background: transparent;
  font-size:12px;
  font-weight:950;
  color: rgba(15,23,42,.60);
  cursor:pointer;
  white-space:nowrap;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.profile-tab:hover{
  background: rgba(255,255,255,.65);
  border-color: rgba(15,23,42,.08);
}

.profile-tab.is-active{
  background: rgba(255,255,255,.92);
  border-color: rgba(15,23,42,.10);
  color: rgba(15,23,42,.92);
  box-shadow: var(--shadow-sm);
}

.profile-panel{margin-top:12px}

.profile-card{
  padding:12px;
  border:1px solid rgba(15,23,42,.08);
  background: rgba(15,23,42,.02);
  border-radius:18px;
}

.profile-hints{margin-top:10px}

.profile-actions{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.profile-actions .btn{
  justify-content:flex-start;
  gap:10px;
}

.profile-card-danger{
  border-color: rgba(185,28,28,.18);
  background: rgba(185,28,28,.04);
}
.profile-card-danger .panel-section-title{
  color:#991b1b;
}
.profile-danger-lead{
  font-size:13px;
  line-height:1.65;
  font-weight:800;
  color: rgba(15,23,42,.72);
}
.profile-danger-actions{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:14px;
}
.profile-danger-actions .btn{
  justify-content:flex-start;
}
.profile-danger-note{
  color: rgba(15,23,42,.58);
}

.profile-divider{
  height:1px;
  background: rgba(15,23,42,.08);
  border-radius:999px;
  margin:4px 0;
}

.btn-danger{
  color:#b91c1c;
  border-color: rgba(185,28,28,.25) !important;
  background: rgba(185,28,28,.06) !important;
}
.btn-danger:hover{background: rgba(185,28,28,.10) !important;}

body.theme-dark .profile-tabs{
  background: rgba(255,255,255,.04);
  border-color: rgba(148,163,184,.14);
}
body.theme-dark .profile-tab{color: rgba(226,232,240,.70)}
body.theme-dark .profile-tab:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(148,163,184,.14);
}
body.theme-dark .profile-tab.is-active{
  background: rgba(15,23,42,.62);
  border-color: rgba(148,163,184,.18);
}
body.theme-dark .profile-card{
  background: rgba(255,255,255,.04);
  border-color: rgba(148,163,184,.14);
}
body.theme-dark .profile-card-danger{
  background: rgba(127,29,29,.14);
  border-color: rgba(248,113,113,.24);
}
body.theme-dark .profile-card-danger .panel-section-title{
  color: rgba(254,202,202,.96);
}
body.theme-dark .profile-danger-lead,
body.theme-dark .profile-danger-note{
  color: rgba(226,232,240,.78);
}
body.theme-dark .profile-divider{background: rgba(148,163,184,.18)}
body.theme-dark .btn-danger{
  color: rgba(248,113,113,.92);
  border-color: rgba(248,113,113,.25) !important;
  background: rgba(248,113,113,.08) !important;
}


/* Profile modal — form helpers */
.req{color: rgba(239,68,68,.95); font-weight:950; margin-left:2px;}
.field-error{margin-top:6px; font-size:12px; font-weight:800; color: var(--danger-2);}
.input.is-invalid{border-color: rgba(239,68,68,.55) !important; box-shadow: 0 0 0 4px rgba(239,68,68,.12) !important;}

.input-row{display:flex; gap:8px; align-items:center;}
.input-row .input{flex:1;}
.icon-btn-xs{width:32px;height:32px;border-radius:12px;font-size:14px;}
.icon-btn-xs .i{width:16px;height:16px;}

.profile-footer{display:flex; align-items:center; justify-content:space-between; gap:12px;}
.profile-footer-left{display:flex; align-items:center; gap:10px; min-width:0;}
.profile-footer-right{display:flex; align-items:center; gap:10px;}
.profile-link{font-size:12px; font-weight:900; color: rgba(15,23,42,.62); text-decoration:none;}
.profile-link:hover{text-decoration:underline; color: rgba(15,23,42,.82);}
.profile-dot{color: rgba(15,23,42,.38);}

body.theme-dark .field-error{color: rgba(254,202,202,.92);}
body.theme-dark .profile-link{color: rgba(229,231,235,.65);}
body.theme-dark .profile-link:hover{color: rgba(229,231,235,.88);}
body.theme-dark .profile-dot{color: rgba(229,231,235,.35);}

/* Focus visibility (WCAG-friendly) */
.btn:focus-visible,
.btn-ghost:focus-visible,
.icon-btn:focus-visible,
.profile-tab:focus-visible,
.profile-link:focus-visible,
.copy-pill:focus-visible{
  outline: 2px solid rgba(47,179,168,.85);
  outline-offset: 2px;
}


/* Toolbar responsive refinements */
@media (max-width: 640px){
  .toolbar-row{gap:10px}
  .toolbar-left{width:100%}
  .toolbar-right{width:100%; justify-content:flex-end}
  .tool-split{display:none}
}


.patient-combobox-field{position:relative}
.patient-combobox{position:relative}
.patient-combobox-control{position:relative}
.patient-combobox-input{padding-right:84px}
.patient-combobox-clear,
.patient-combobox-toggle{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:32px;
  height:32px;
  border:0;
  background:transparent;
  color:rgba(15,23,42,.48);
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.patient-combobox-clear{right:40px}
.patient-combobox-toggle{right:8px}
.patient-combobox-clear:hover,
.patient-combobox-toggle:hover{background:rgba(15,23,42,.05);color:rgba(15,23,42,.72)}
.patient-combobox-clear[hidden]{display:none}
.patient-combobox-toggle .i,
.patient-combobox-clear .i{width:16px;height:16px}
.patient-combobox.is-open .patient-combobox-toggle .i{transform:rotate(180deg)}
.patient-combobox-menu{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  right:0;
  z-index:30;
  background:rgba(255,255,255,.98);
  border:1px solid rgba(15,23,42,.10);
  border-radius:18px;
  box-shadow:0 20px 44px rgba(15,23,42,.16);
  padding:8px;
  max-height:268px;
  overflow:auto;
}
.patient-combobox-option{
  width:100%;
  border:0;
  background:transparent;
  text-align:left;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.patient-combobox-option + .patient-combobox-option{margin-top:2px}
.patient-combobox-option:hover,
.patient-combobox-option.is-active{background:rgba(15,23,42,.05)}
.patient-combobox-option.is-selected{background:rgba(47,179,168,.10)}
.patient-combobox-option-main{font-size:14px;font-weight:900;color:rgba(15,23,42,.92)}
.patient-combobox-option-meta{font-size:12px;font-weight:700;color:rgba(15,23,42,.52)}
.patient-combobox-empty,
.patient-combobox-more{padding:10px 12px;font-size:12px;font-weight:800;color:rgba(15,23,42,.55)}
.patient-combobox-native{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:0 !important;
  opacity:0 !important;
  pointer-events:none !important;
}
body.theme-dark .patient-combobox-clear,
body.theme-dark .patient-combobox-toggle{color:rgba(229,231,235,.58)}
body.theme-dark .patient-combobox-clear:hover,
body.theme-dark .patient-combobox-toggle:hover{background:rgba(255,255,255,.06);color:rgba(229,231,235,.86)}
body.theme-dark .patient-combobox-menu{
  background:rgba(15,23,42,.98);
  border-color:rgba(148,163,184,.18);
  box-shadow:0 24px 50px rgba(0,0,0,.42);
}
body.theme-dark .patient-combobox-option:hover,
body.theme-dark .patient-combobox-option.is-active{background:rgba(255,255,255,.06)}
body.theme-dark .patient-combobox-option.is-selected{background:rgba(47,179,168,.18)}
body.theme-dark .patient-combobox-option-main{color:rgba(229,231,235,.94)}
body.theme-dark .patient-combobox-option-meta,
body.theme-dark .patient-combobox-empty,
body.theme-dark .patient-combobox-more{color:rgba(229,231,235,.62)}


.patient-combobox-field{gap:0}
.patient-combobox-input{padding-right:84px;cursor:text}
.patient-combobox-menu{margin-top:0}
.patient-combobox-control:has(.patient-combobox-input:focus-visible){border-radius:18px}

#audiogramDropZone{
  position:relative;
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}
#audiogramDropZone.is-dragover{
  border-color:rgba(47,179,168,.42);
  background:linear-gradient(180deg, rgba(47,179,168,.08), rgba(47,179,168,.03));
  box-shadow:0 0 0 4px rgba(47,179,168,.12);
}
#audiogramDropZone.is-dragover .audiogram-empty,
#audiogramDropZone.is-dragover .audiogram-file-card,
#audiogramDropZone.is-dragover .audiogram-preview-wrap{
  border-color:rgba(47,179,168,.38) !important;
  background:rgba(47,179,168,.06) !important;
}
body.theme-dark #audiogramDropZone.is-dragover{
  border-color:rgba(94,234,212,.34);
  background:linear-gradient(180deg, rgba(45,212,191,.12), rgba(45,212,191,.04));
  box-shadow:0 0 0 4px rgba(45,212,191,.12);
}


/* ===== Patch V26 — rebords un peu moins arrondis ===== */
:root{
  --radius: 18px;
  --radius-sm: 12px;
  --focus: 0 0 0 3px rgba(255,159,95,.16);
}

.card,
.modal,
.modal-card,
.modal-inner,
.panel,
.textarea,
.md-preview,
.patient-combobox-control,
.patient-combobox-menu,
.audiogram-empty,
.audiogram-file-card,
.audiogram-preview-wrap,
.notes-block,
.toggle-row,
.profile-card{
  border-radius:16px;
}

.input,
.select,
.date-input,
.field-input,
.notes-toolbar,
.nt-btn,
.nt-select,
.nt-color,
.icon-btn,
.icon-btn-sm,
.icon-btn-xs,
.menu-item,
.patient-combobox-option,
.dossier-item,
.section-ico,
.patient-combobox-clear,
.patient-combobox-toggle{
  border-radius:12px;
}

.btn,
.link-btn,
.copy-pill,
.status-pill,
.badge,
.timer,
.dur-chip,
.btn-newdossier,
.profile-tabs,
.profile-tab,
.segmented,
.seg-btn,
.count-badge{
  border-radius:14px;
}

.brandmark{border-radius:14px;}
.menu{border-radius:16px;}
body.theme-dark .menu{border-radius:16px;}
.patient-combobox-control:has(.patient-combobox-input:focus-visible){border-radius:16px;}

/* ===== Patch V26 — Dark mode contrast polish ===== */
body.theme-dark{
  --cardGlass: rgba(9,16,31,.84);
  --panel: rgba(8,14,28,.94);
  --border: rgba(148,163,184,.24);
  --shadow: 0 20px 56px rgba(0,0,0,.42);
  --shadow-sm: 0 12px 30px rgba(0,0,0,.30);
}

body.theme-dark .card,
body.theme-dark .panel,
body.theme-dark .notes-block,
body.theme-dark .profile-card,
body.theme-dark .toggle-row,
body.theme-dark .audiogram-empty,
body.theme-dark .audiogram-file-card,
body.theme-dark .audiogram-preview-wrap,
body.theme-dark .patient-combobox-control{
  background: rgba(8,14,28,.86);
  border-color: rgba(148,163,184,.22);
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
}

body.theme-dark .topbar{
  background: rgba(6,12,25,.78);
  border-bottom-color: rgba(94,234,212,.16);
}

body.theme-dark .sidebar-title,
body.theme-dark .brand,
body.theme-dark .dossier-title,
body.theme-dark .patient-combobox-option-main,
body.theme-dark .toggle-title,
body.theme-dark .menu-item,
body.theme-dark .h2,
body.theme-dark .section-head,
body.theme-dark .section-title,
body.theme-dark .toolbar-row,
body.theme-dark .footer,
body.theme-dark .substatus,
body.theme-dark .copy-pill,
body.theme-dark .badge{
  color: rgba(248,250,252,.96);
}

body.theme-dark .tagline,
body.theme-dark .field-label,
body.theme-dark .meta,
body.theme-dark .dossier-meta,
body.theme-dark .toggle-sub,
body.theme-dark .subtle,
body.theme-dark .status-sub,
body.theme-dark .patient-combobox-option-meta,
body.theme-dark .patient-combobox-empty,
body.theme-dark .patient-combobox-more,
body.theme-dark .md-empty,
body.theme-dark .footer,
body.theme-dark .menu-head,
body.theme-dark .menu-head.danger,
body.theme-dark .section-ico,
body.theme-dark .copy-pill,
body.theme-dark .badge,
body.theme-dark .modal-subtitle,
body.theme-dark .form-field{
  color: rgba(226,232,240,.78) !important;
}

body.theme-dark .input,
body.theme-dark .select,
body.theme-dark .date-input,
body.theme-dark .field-input,
body.theme-dark .textarea,
body.theme-dark .dur-select,
body.theme-dark .patient-combobox-input,
body.theme-dark .patient-combobox-control,
body.theme-dark .notes-toolbar,
body.theme-dark .nt-btn,
body.theme-dark .nt-select,
body.theme-dark .nt-color,
body.theme-dark .copy-pill,
body.theme-dark .menu,
body.theme-dark .timer,
body.theme-dark .dur-chip,
body.theme-dark .segmented,
body.theme-dark .seg-btn.is-active,
body.theme-dark .status-pill,
body.theme-dark .btn-ghost,
body.theme-dark .btn,
body.theme-dark .icon-btn,
body.theme-dark .icon-btn-sm,
body.theme-dark .icon-btn-xs,
body.theme-dark .link-btn{
  background: rgba(15,23,42,.88);
  border-color: rgba(148,163,184,.24);
  color: rgba(248,250,252,.96);
}

body.theme-dark .input::placeholder,
body.theme-dark .textarea::placeholder,
body.theme-dark .notes-editor[contenteditable="true"]:empty:before,
body.theme-dark .patient-combobox-input::placeholder{
  color: rgba(226,232,240,.46);
}

body.theme-dark .input:hover,
body.theme-dark .select:hover,
body.theme-dark .date-input:hover,
body.theme-dark .field-input:hover,
body.theme-dark .textarea:hover,
body.theme-dark .patient-combobox-control:hover,
body.theme-dark .btn:hover,
body.theme-dark .icon-btn:hover,
body.theme-dark .link-btn:hover,
body.theme-dark .copy-pill:hover,
body.theme-dark .nt-btn:hover,
body.theme-dark .nt-select:hover{
  border-color: rgba(94,234,212,.28);
}

body.theme-dark .input:focus,
body.theme-dark .select:focus,
body.theme-dark .date-input:focus,
body.theme-dark .field-input:focus,
body.theme-dark .textarea:focus,
body.theme-dark .patient-combobox-control:has(.patient-combobox-input:focus),
body.theme-dark .patient-combobox-control:has(.patient-combobox-input:focus-visible){
  border-color: rgba(94,234,212,.42);
  box-shadow: 0 0 0 3px rgba(45,212,191,.12);
}

body.theme-dark .segmented{
  background: rgba(15,23,42,.72);
}
body.theme-dark .seg-btn{
  color: rgba(226,232,240,.78);
}
body.theme-dark .seg-btn.is-active{
  background: rgba(30,41,59,.94);
  color: rgba(248,250,252,.98);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 8px 18px rgba(0,0,0,.22);
}

body.theme-dark .textarea,
body.theme-dark .md-preview,
body.theme-dark .notes-editor,
body.theme-dark .editor-loading-card,
body.theme-dark .menu,
body.theme-dark .modal{
  color: rgba(248,250,252,.96);
}

body.theme-dark .textarea,
body.theme-dark .md-preview{
  background: rgba(4,10,22,.78);
  border-color: rgba(148,163,184,.22);
}

body.theme-dark .notes-toolbar{
  background: rgba(11,18,32,.90);
}

body.theme-dark .notes-editor,
body.theme-dark .textarea,
body.theme-dark .md-preview,
body.theme-dark .md-preview p,
body.theme-dark .md-preview li,
body.theme-dark .md-preview strong,
body.theme-dark .md-preview h1,
body.theme-dark .md-preview h2,
body.theme-dark .md-preview h3,
body.theme-dark .md-preview h4,
body.theme-dark .md-preview h5,
body.theme-dark .md-preview h6{
  color: rgba(248,250,252,.96);
}

body.theme-dark #synthesePreview,
body.theme-dark #notesTa,
body.theme-dark #emailTa{
  color:#f8fafc !important;
  caret-color:#f8fafc;
}

body.theme-dark #synthesePreview *,
body.theme-dark #notesTa *,
body.theme-dark #emailTa *{
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
}

body.theme-dark #synthesePreview .md-empty,
body.theme-dark #notesTa:empty:before,
body.theme-dark #emailTa:empty:before{
  color:rgba(226,232,240,.68) !important;
  -webkit-text-fill-color:rgba(226,232,240,.68) !important;
}

body.theme-dark #synthesePreview code,
body.theme-dark #notesTa code,
body.theme-dark #emailTa code{
  color:#f8fafc !important;
  background:rgba(255,255,255,.08);
  border-color:rgba(148,163,184,.22);
}

body.theme-dark #synthesePreview blockquote,
body.theme-dark #notesTa blockquote,
body.theme-dark #emailTa blockquote{
  color:#f8fafc !important;
  border-left-color:rgba(45,212,191,.72);
  background:rgba(45,212,191,.10);
}

body.theme-dark .dossier-item{
  background: rgba(7,15,30,.92);
  border-color: rgba(148,163,184,.16);
  box-shadow: 0 12px 28px rgba(0,0,0,.22);
}
body.theme-dark .dossier-item:hover{
  background: rgba(10,19,36,.96);
  border-color: rgba(94,234,212,.22);
}
body.theme-dark .dossier-item.active{
  background: linear-gradient(180deg, rgba(10,31,40,.95), rgba(8,24,36,.95));
  border-color: rgba(45,212,191,.30);
  box-shadow: inset 3px 0 0 rgba(45,212,191,.90), 0 14px 30px rgba(0,0,0,.24);
}
body.theme-dark .dossier-item.active .dossier-meta,
body.theme-dark .dossier-item.active .dossier-title{
  color: rgba(240,253,250,.98) !important;
}

body.theme-dark .count-badge{
  background: rgba(45,212,191,.16);
  border-color: rgba(45,212,191,.30);
  color: rgba(240,253,250,.96);
}

body.theme-dark .status-pill,
body.theme-dark .timer,
body.theme-dark .dur-chip{
  background: rgba(10,18,34,.92);
  border-color: rgba(148,163,184,.24);
}

body.theme-dark .status-pill.is-idle{background: rgba(6,78,59,.34); border-color: rgba(45,212,191,.34)}
body.theme-dark .status-pill.is-recording{background: rgba(127,29,29,.34); border-color: rgba(248,113,113,.34)}
body.theme-dark .status-pill.is-processing{background: rgba(76,29,149,.34); border-color: rgba(167,139,250,.32)}
body.theme-dark .status-pill.is-uploading{background: rgba(30,64,175,.34); border-color: rgba(96,165,250,.32)}
body.theme-dark .status-pill.is-completed{background: rgba(20,83,45,.34); border-color: rgba(74,222,128,.32)}
body.theme-dark .status-pill.is-paused{background: rgba(120,53,15,.34); border-color: rgba(251,191,36,.32)}
body.theme-dark .status-pill.is-error{background: rgba(127,29,29,.36); border-color: rgba(248,113,113,.34)}

body.theme-dark .btn-primary{
  background: linear-gradient(135deg, rgba(47,179,168,.96), rgba(255,159,95,.96));
  border-color: rgba(94,234,212,.20);
  color: #fff;
}
body.theme-dark .btn-secondary{
  background: rgba(30,64,175,.34);
  border-color: rgba(96,165,250,.28);
  color: rgba(239,246,255,.96);
}
body.theme-dark .btn-secondary.paused{
  background: rgba(6,78,59,.34);
  border-color: rgba(74,222,128,.26);
  color: rgba(236,253,245,.96);
}
body.theme-dark .btn-danger{
  background: rgba(127,29,29,.32) !important;
  border-color: rgba(248,113,113,.26) !important;
  color: rgba(254,242,242,.96) !important;
}

body.theme-dark .menu{
  background: rgba(8,14,28,.98);
  border-color: rgba(148,163,184,.20);
  box-shadow: 0 24px 54px rgba(0,0,0,.40);
}
body.theme-dark .menu-item:hover{
  background: rgba(255,255,255,.06);
}
body.theme-dark .menu-sep,
body.theme-dark .tool-split,
body.theme-dark .nt-sep,
body.theme-dark .profile-divider{
  background: rgba(148,163,184,.18);
}

body.theme-dark .copy-pill,
body.theme-dark .badge{
  background: rgba(15,23,42,.82);
  border-color: rgba(148,163,184,.22);
}

body.theme-dark .section-ico{
  background: rgba(15,23,42,.72);
  border-color: rgba(148,163,184,.18);
}

body.theme-dark .modal,
body.theme-dark .modal-card,
body.theme-dark .modal-inner{
  background: rgba(9,16,31,.97);
  border-color: rgba(148,163,184,.20);
}

body.theme-dark *::-webkit-scrollbar-thumb{
  background: rgba(148,163,184,.34);
  border-color: rgba(8,14,28,.92);
}
body.theme-dark *::-webkit-scrollbar-track{
  background: transparent;
}


/* ===== Patch V27 — dark mode contrast pass from screenshots ===== */
body.theme-dark .card,
body.theme-dark .panel{
  background: rgba(8,14,28,.92);
  border-color: rgba(94,234,212,.12);
}

body.theme-dark .input,
body.theme-dark .select,
body.theme-dark .date-input,
body.theme-dark .field-input,
body.theme-dark .patient-combobox-control,
body.theme-dark .dur-select{
  background: rgba(13,21,36,.98) !important;
  border-color: rgba(148,163,184,.28) !important;
  color: rgba(248,250,252,.98) !important;
}

body.theme-dark .input::placeholder,
body.theme-dark .textarea::placeholder,
body.theme-dark .patient-combobox-input::placeholder{
  color: rgba(226,232,240,.62) !important;
}

body.theme-dark .md-preview,
body.theme-dark .notes-editor,
body.theme-dark .textarea{
  background: rgba(11,18,32,.98) !important;
  border-color: rgba(148,163,184,.24) !important;
  color: rgba(248,250,252,.98) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02), 0 14px 30px rgba(0,0,0,.24);
}

body.theme-dark .md-preview *,
body.theme-dark .notes-editor *,
body.theme-dark .textarea *{
  color: inherit;
}

body.theme-dark .notes-toolbar{
  background: rgba(8,14,28,.96) !important;
  border-color: rgba(148,163,184,.22) !important;
}

body.theme-dark .nt-btn,
body.theme-dark .nt-select,
body.theme-dark .nt-color{
  background: rgba(15,23,42,.92) !important;
  border-color: rgba(148,163,184,.22) !important;
  color: rgba(248,250,252,.96) !important;
}

body.theme-dark .segmented{
  background: rgba(8,14,28,.92) !important;
  border-color: rgba(148,163,184,.18) !important;
}

body.theme-dark .seg-btn{
  color: rgba(226,232,240,.82) !important;
}

body.theme-dark .seg-btn.is-active{
  background: rgba(248,250,252,.98) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: #0f172a !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.22);
}

body.theme-dark .field-label,
body.theme-dark .meta,
body.theme-dark .dossier-meta,
body.theme-dark .subtle,
body.theme-dark .status-sub,
body.theme-dark .md-empty{
  color: rgba(226,232,240,.82) !important;
}

body.theme-dark .timer,
body.theme-dark .dur-chip,
body.theme-dark .status-pill,
body.theme-dark .btn,
body.theme-dark .btn-ghost,
body.theme-dark .link-btn,
body.theme-dark .copy-pill,
body.theme-dark .icon-btn,
body.theme-dark .icon-btn-sm,
body.theme-dark .icon-btn-xs{
  background: rgba(13,21,36,.94) !important;
  border-color: rgba(148,163,184,.24) !important;
  color: rgba(248,250,252,.96) !important;
}

body.theme-dark .history-body .md-preview,
body.theme-dark #historiquePreview,
body.theme-dark #synthesePreview,
body.theme-dark #suggestionsPreview,
body.theme-dark #planPreview{
  background: rgba(11,18,32,.98) !important;
  color: rgba(248,250,252,.98) !important;
}

body.theme-dark .search-icon-right,
body.theme-dark .patient-combobox-clear,
body.theme-dark .patient-combobox-toggle{
  color: rgba(226,232,240,.72) !important;
}


/* ===== Patch V28 — hard dark-mode overrides from screenshots ===== */
body.theme-dark #bilanAudioCard .bilan-audio-item{
  background:#0b1220 !important;
  border-color:rgba(94,234,212,.18) !important;
  box-shadow:0 18px 42px rgba(0,0,0,.34) !important;
}
body.theme-dark #bilanAudioCard .bilan-audio-item h3,
body.theme-dark #bilanAudioCard .bilan-audio-label,
body.theme-dark #bilanAudioCard .bilan-audio-ear-title,
body.theme-dark #bilanAudioCard .audiogram-helper,
body.theme-dark #bilanAudioCard .audiogram-file-title,
body.theme-dark #bilanAudioCard .audiogram-analysis-title,
body.theme-dark #bilanAudioCard .audiogram-json-title,
body.theme-dark #bilanAudioCard .audiogram-analysis-chip,
body.theme-dark #bilanAudioCard .audiogram-meta-row .meta,
body.theme-dark #bilanAudioCard .audiogram-meta-row .badge{
  color:#f8fafc !important;
}
body.theme-dark #bilanAudioCard .bilan-audio-ear{
  background:#111b2f !important;
  border-color:rgba(148,163,184,.24) !important;
}
body.theme-dark #bilanAudioCard .input,
body.theme-dark #bilanAudioCard .select,
body.theme-dark #bilanAudioCard .bilan-audio-note,
body.theme-dark #bilanAudioCard .audiogram-actions .btn,
body.theme-dark #bilanAudioCard .audiogram-actions .btn-ghost,
body.theme-dark #bilanAudioCard .audiogram-meta-row .meta,
body.theme-dark #bilanAudioCard .audiogram-meta-row .badge{
  background:#111c30 !important;
  border-color:rgba(148,163,184,.28) !important;
  color:#f8fafc !important;
}
body.theme-dark #bilanAudioCard .audiogram-empty,
body.theme-dark #bilanAudioCard .audiogram-file-card,
body.theme-dark #bilanAudioCard .audiogram-preview-wrap{
  background:#0f172a !important;
  border-color:rgba(148,163,184,.26) !important;
  color:rgba(226,232,240,.88) !important;
}
body.theme-dark #bilanAudioCard #audiogramAnalysisPreview.md-preview{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  padding:0 !important;
  min-height:0 !important;
}
body.theme-dark #bilanAudioCard .audiogram-analysis-body{
  background:#0b1220 !important;
  border-color:rgba(148,163,184,.26) !important;
  color:#f8fafc !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03),0 12px 28px rgba(0,0,0,.24) !important;
}
body.theme-dark #bilanAudioCard .audiogram-analysis-preview,
body.theme-dark #bilanAudioCard .audiogram-analysis-preview *,
body.theme-dark #bilanAudioCard .audiogram-analysis-body,
body.theme-dark #bilanAudioCard .audiogram-analysis-body *,
body.theme-dark #bilanAudioCard .audiogram-analysis-placeholder,
body.theme-dark #bilanAudioCard .audiogram-analysis-placeholder *{
  color:#f8fafc !important;
  opacity:1 !important;
}
body.theme-dark #bilanAudioCard .audiogram-analysis-preview code{
  background:rgba(255,255,255,.06) !important;
  border-color:rgba(148,163,184,.22) !important;
  color:#f8fafc !important;
}
body.theme-dark #historiquePreview,
body.theme-dark #synthesePreview,
body.theme-dark #suggestionsPreview,
body.theme-dark #planPreview,
body.theme-dark .history-body .md-preview,
body.theme-dark .io-wrap .md-preview,
body.theme-dark .io-wrap .textarea,
body.theme-dark .notes-editor{
  background:#0b1220 !important;
  border-color:rgba(148,163,184,.24) !important;
  color:#f8fafc !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03),0 14px 32px rgba(0,0,0,.24) !important;
}
body.theme-dark #historiquePreview *,
body.theme-dark #synthesePreview *,
body.theme-dark #suggestionsPreview *,
body.theme-dark .history-body .md-preview *,
body.theme-dark .io-wrap .md-preview *,
body.theme-dark .io-wrap .textarea *,
body.theme-dark .notes-editor *{
  color:inherit !important;
}
body.theme-dark .segmented{
  background:#0f172a !important;
  border-color:rgba(148,163,184,.20) !important;
}
body.theme-dark .seg-btn{
  color:rgba(226,232,240,.84) !important;
}
body.theme-dark .seg-btn.is-active{
  background:#f8fafc !important;
  color:#0f172a !important;
}
body.theme-dark .section-head,
body.theme-dark .section-title,
body.theme-dark .h2,
body.theme-dark .sidebar-title,
body.theme-dark .brand,
body.theme-dark .dossier-title{
  color:#f8fafc !important;
}
body.theme-dark .meta,
body.theme-dark .field-label,
body.theme-dark .dossier-meta,
body.theme-dark .tagline,
body.theme-dark .subtle,
body.theme-dark .status-sub,
body.theme-dark .md-empty{
  color:rgba(226,232,240,.80) !important;
}
body.theme-dark .btn,
body.theme-dark .btn-ghost,
body.theme-dark .icon-btn,
body.theme-dark .copy-pill,
body.theme-dark .link-btn,
body.theme-dark .timer,
body.theme-dark .dur-chip,
body.theme-dark .status-pill,
body.theme-dark .search-input,
body.theme-dark .input,
body.theme-dark .select,
body.theme-dark .date-input,
body.theme-dark .field-input,
body.theme-dark .dur-select,
body.theme-dark .patient-combobox-control{
  background:#111c30 !important;
  border-color:rgba(148,163,184,.26) !important;
  color:#f8fafc !important;
}
body.theme-dark .input::placeholder,
body.theme-dark .textarea::placeholder,
body.theme-dark .patient-combobox-input::placeholder{
  color:rgba(226,232,240,.62) !important;
}


/* ===== Patch V29 — targeted dark contrast fixes from V3 screenshots ===== */
body.theme-dark .workspace-group.workspace-group-patient,
body.theme-dark .workspace-group.workspace-group-consult{
  background: linear-gradient(180deg, rgba(11,18,32,.97), rgba(8,14,28,.98)) !important;
  border-color: rgba(94,234,212,.16) !important;
  box-shadow: 0 18px 42px rgba(0,0,0,.34) !important;
}

body.theme-dark .workspace-group-kicker,
body.theme-dark .field-block-label,
body.theme-dark .patient-summary-meta-label{
  color: rgba(226,232,240,.80) !important;
}

body.theme-dark .patient-summary-name,
body.theme-dark .patient-summary-birth{
  color: #f8fafc !important;
}

body.theme-dark .patient-summary-dot{
  color: rgba(226,232,240,.34) !important;
}

body.theme-dark .workspace-group .select,
body.theme-dark .workspace-group .date-input,
body.theme-dark .workspace-group .field-input,
body.theme-dark .consult-inline-actions .icon-btn{
  background: #111c30 !important;
  border-color: rgba(148,163,184,.28) !important;
  color: #f8fafc !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03) !important;
}

body.theme-dark .toolbar-left{
  background: linear-gradient(180deg, rgba(11,18,32,.97), rgba(8,14,28,.98)) !important;
  border-color: rgba(94,234,212,.16) !important;
  box-shadow: 0 18px 42px rgba(0,0,0,.30) !important;
}

body.theme-dark .toolbar-left .tool-split{
  background: rgba(148,163,184,.18) !important;
}

body.theme-dark .toolbar-left .timer,
body.theme-dark .toolbar-left .dur-chip{
  background: #111c30 !important;
  border-color: rgba(148,163,184,.28) !important;
  color: #f8fafc !important;
}

body.theme-dark .toolbar-left .dur-label{
  color: rgba(226,232,240,.80) !important;
}

body.theme-dark .toolbar-left .dur-select{
  background: #0f172a !important;
  border-color: rgba(148,163,184,.28) !important;
  color: #f8fafc !important;
}

body.theme-dark .notes-toolbar{
  background: #0d1628 !important;
  border-color: rgba(148,163,184,.24) !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.22) !important;
}

body.theme-dark .notes-toolbar .nt-btn,
body.theme-dark .notes-toolbar .nt-select,
body.theme-dark .notes-toolbar .nt-color{
  background: #111c30 !important;
  border-color: rgba(148,163,184,.24) !important;
  color: #f8fafc !important;
}

body.theme-dark .modal-mode-switch{
  background: #0f172a !important;
  border-color: rgba(148,163,184,.24) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03) !important;
}

body.theme-dark .modal-mode-btn{
  color: rgba(226,232,240,.74) !important;
}

body.theme-dark .modal-mode-btn:hover{
  color: #f8fafc !important;
  background: rgba(255,255,255,.04) !important;
}

body.theme-dark .modal-mode-btn.is-active{
  background: #f8fafc !important;
  color: #0f172a !important;
  box-shadow: 0 10px 22px rgba(0,0,0,.28) !important;
}

body.theme-dark #synthesePreview,
body.theme-dark #synthesePreview.md-preview,
body.theme-dark #synthesePreview p,
body.theme-dark #synthesePreview li,
body.theme-dark #synthesePreview strong,
body.theme-dark #synthesePreview h1,
body.theme-dark #synthesePreview h2,
body.theme-dark #synthesePreview h3,
body.theme-dark #synthesePreview h4,
body.theme-dark #synthesePreview h5,
body.theme-dark #synthesePreview h6,
body.theme-dark .md-empty-synthese,
body.theme-dark .md-empty-synthese p,
body.theme-dark .md-empty-synthese strong{
  color: #f8fafc !important;
  opacity: 1 !important;
}

body.theme-dark .md-empty-synthese{
  background: linear-gradient(180deg, rgba(11,18,32,.96), rgba(8,14,28,.98)) !important;
  border-color: rgba(148,163,184,.24) !important;
}
