/* ========================================================================== */
/* URG360 v2.7 alpha1 — Espace Patient, Plan de soins pleine largeur, Pancarte */
/* Cette feuille est additive pour permettre un rollback simple vers v2.6.     */
/* ========================================================================== */

:root{
  --u27-blue:#0b63a7;
  --u27-blue-dark:#0a345d;
  --u27-bg:#eef3f8;
  --u27-card:#ffffff;
  --u27-border:#cbd8e4;
  --u27-text:#173754;
  --u27-muted:#667d90;
  --u27-green:#2f8b50;
  --u27-amber:#d18a12;
  --u27-red:#ca2f37;
  --u27-purple:#6b56a6;
}

/* ---------- Shell patient ---------- */
body.urg-v26-patient-focus .layout{padding:calc(var(--urg-topbar) + 4px) 8px 10px!important;background:var(--u27-bg)}
#v26PrescriptionLabView.v26-patient-focus .v26-workspace-card{min-height:calc(100vh - 74px);border-color:#cbd8e4;box-shadow:0 8px 26px rgba(18,55,84,.08)}
.v26-patient-shell{grid-template-columns:184px minmax(0,1fr);min-height:calc(100vh - 76px)}
.v26-patient-nav{padding:10px 9px;background:linear-gradient(180deg,#0a345d 0%,#092b4d 56%,#082642 100%);box-shadow:inset -1px 0 rgba(255,255,255,.06)}
.v26-patient-back-service{min-height:42px;padding:9px 10px;font-size:13px;border-radius:9px;background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.32)}
.v26-patient-back-service:hover{background:rgba(255,255,255,.18)}
.v26-patient-nav .v26-workspace-tabs{gap:6px;top:74px}
.v26-patient-nav .v26-workspace-tabs button{min-height:44px;padding:8px 9px;font-size:13.5px;font-weight:800;letter-spacing:0;color:#e6f0fa;border-radius:9px}
.v26-patient-nav .v26-workspace-tabs button::before{width:20px;flex-basis:20px;font-size:16px}
.v26-patient-nav [data-v26-tab="summary"]::before{content:"⌂"}
.v26-patient-nav [data-v26-tab="pancarte"]::before{content:"⌁";font-size:20px}
/* Icône prescription = document +, volontairement distincte de l'imagerie. */
.v26-patient-nav [data-v26-tab="prescriptions"]::before{content:""!important;width:16px!important;height:19px!important;flex:0 0 16px!important;border:1.7px solid currentColor!important;border-radius:3px!important;display:block!important;box-sizing:border-box;position:relative;background:linear-gradient(currentColor,currentColor) 3px 5px/8px 1.5px no-repeat,linear-gradient(currentColor,currentColor) 3px 9px/6px 1.5px no-repeat!important}
.v26-patient-nav [data-v26-tab="prescriptions"]::after{content:"+";position:absolute;left:17px;top:18px;width:11px;height:11px;display:grid;place-items:center;border-radius:50%;background:#0b63a7;color:#fff;font-size:10px;font-weight:950;line-height:1;border:1px solid rgba(255,255,255,.85)}
.v26-patient-nav [data-v26-tab="prescriptions"].active::after{background:#0b63a7;color:#fff}
.v26-patient-nav [data-v26-tab="plan"]::before{content:"✓"}
.v26-patient-nav [data-v26-tab="todo"]::before{content:"!"}
.v26-patient-nav [data-v26-tab="timeline"]::before{content:"◷"}
.v26-patient-nav [data-v26-tab="audit"]::before{content:"◎"}
.v26-patient-nav .v26-workspace-tabs button.active{background:#fff;color:#0b4f89;box-shadow:inset 4px 0 0 #0b67b2,0 3px 12px rgba(0,0,0,.13)}
.v26-patient-nav .v26-tab-count{font-size:10px;min-width:20px;height:20px}

#v26PrescriptionLabView.v26-patient-focus .v26-patient-main{background:var(--u27-bg)}
#v26PrescriptionLabView.v26-patient-focus .v26-patient-banner{min-height:54px;padding:6px 12px;background:#fff;border-bottom:1px solid #c9d7e3;box-shadow:0 2px 8px rgba(20,55,82,.04)}
#v26PrescriptionLabView.v26-patient-focus .v26-patient-banner h3{font-size:19px;color:#0c3156}
#v26PrescriptionLabView.v26-patient-focus .v26-patient-banner small{font-size:10.5px;color:#5d7589}
#v26PrescriptionLabView.v26-patient-focus .v26-patient-banner .v26-context-badge{background:#dceeff;color:#0b5f9d;border:1px solid #b9d7ef}
#v26PrescriptionLabView.v26-patient-focus .v26-tab-pane{padding:9px 10px 12px;background:var(--u27-bg)}
/* Éviter de répéter l'identité dans les formulaires déjà contenus dans le dossier patient. */
#v26PrescriptionLabView.v26-patient-focus .v26-final-patient-line{display:none!important}

/* ---------- Rappel des constantes : une seule ligne, plus lisible ---------- */
#v26PrescriptionLabView.v26-patient-focus .v26-latest-vitals-head{min-height:21px;padding:2px 8px;background:#e9f1f8}
#v26PrescriptionLabView.v26-patient-focus .v26-latest-vitals-head span{font-size:8.5px}
#v26PrescriptionLabView.v26-patient-focus .v26-latest-vitals-head small{font-size:8.5px}
#v26PrescriptionLabView.v26-patient-focus .v26-latest-vitals-grid{gap:4px;padding:4px 5px;background:#f3f7fa}
#v26PrescriptionLabView.v26-patient-focus .v26-latest-vital{min-height:43px;padding:4px 7px;border-radius:7px!important}
#v26PrescriptionLabView.v26-patient-focus .v26-latest-vital>span{font-size:8px}
#v26PrescriptionLabView.v26-patient-focus .v26-latest-vital>strong{font-size:16px}
#v26PrescriptionLabView.v26-patient-focus .v26-latest-vital>time{font-size:7.5px}
#v26PrescriptionLabView.v26-patient-focus .v26-latest-vital.v26-vital-normal{background:#fff;border-color:#d4e2d8!important}
#v26PrescriptionLabView.v26-patient-focus .v26-latest-vital.v26-vital-warning{background:#fff8e9;border-color:#dfb860!important}
#v26PrescriptionLabView.v26-patient-focus .v26-latest-vital.v26-vital-critical{background:#fff1f2;border-color:#df8287!important}

/* ---------- Hiérarchie générale ---------- */
#v26PrescriptionLabView.v26-patient-focus .v26-section{border-color:#cbd8e4;border-radius:12px;box-shadow:0 2px 8px rgba(17,54,84,.045)}
#v26PrescriptionLabView.v26-patient-focus .v26-section-head{background:#eaf1f7;border-bottom-color:#cedae5}
#v26PrescriptionLabView.v26-patient-focus .v26-section-head h4{color:#153b5a}
#v26PrescriptionLabView.v26-patient-focus .v26-kpi{border-radius:11px}
#v26PrescriptionLabView.v26-patient-focus button:focus-visible,
#v26PrescriptionLabView.v26-patient-focus input:focus-visible,
#v26PrescriptionLabView.v26-patient-focus select:focus-visible,
#v26PrescriptionLabView.v26-patient-focus textarea:focus-visible{outline:3px solid rgba(11,99,167,.18);outline-offset:1px}

/* ---------- Plan de soins : la timeline occupe réellement toute la largeur ---------- */
#v26PrescriptionLabView.v26-patient-focus #v26TabPlan{padding-left:8px;padding-right:8px}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-head{padding:3px 4px 8px;gap:12px}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-controls{gap:5px}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-filter{padding:0 4px 7px}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-legend{padding:0 4px 8px}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-scroll{width:100%;overflow:auto;border-color:#bfcfdd}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.time-window{
  --v26-label-width:238px;
  width:100%!important;
  min-width:100%!important;
  max-width:none!important;
}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.time-window .v26-plan-periods,
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.time-window .v26-plan-hours,
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.time-window .v26-plan-row,
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.time-window .v26-plan-group,
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.time-window .v26-plan-route-group{
  width:100%;
  grid-template-columns:var(--v26-label-width) minmax(0,1fr)!important;
}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.time-window .v26-plan-period-track,
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.time-window .v26-plan-hour-track,
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.time-window .v26-plan-track{
  width:100%!important;
  min-width:0!important;
}
/* Les positions des marqueurs restent temporelles, mais l'heure devient une fraction de la largeur disponible. */
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.window-1440{--v26-hour-width:calc(100% / 24)!important;--v26-window-width:100%!important}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.window-360{--v26-hour-width:calc(100% / 6)!important;--v26-window-width:100%!important}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.window-120{--v26-hour-width:calc(100% / 2)!important;--v26-window-width:100%!important}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.window-60{--v26-hour-width:100%!important;--v26-window-width:100%!important}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.window-30{--v26-hour-width:200%!important;--v26-window-width:100%!important}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.window-15{--v26-hour-width:400%!important;--v26-window-width:100%!important}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-table.window-5{--v26-hour-width:1200%!important;--v26-window-width:100%!important}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-corner,
#v26PrescriptionLabView.v26-patient-focus .v26-plan-label{position:sticky;left:0;z-index:6}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-hours .v26-plan-corner{z-index:10}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-periods .v26-plan-corner{z-index:11}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-label{padding:7px 9px;background:#fff}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-label strong{font-size:11.5px}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-label span{font-size:9.5px}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-group span{padding:5px 9px;background:#e4edf4;color:#355d78}
#v26PrescriptionLabView.v26-patient-focus .v26-now-line{width:3px;background:#d81f3d;box-shadow:0 0 0 1px rgba(216,31,61,.05)}
#v26PrescriptionLabView.v26-patient-focus .v26-now-line b{font-size:8px;padding:3px 4px}

/* ---------- Pancarte V2 ---------- */
#v26PrescriptionLabView.v26-patient-focus #v26TabPancarte{padding:8px;background:#edf3f8}
.v27-pancarte{display:flex;flex-direction:column;gap:8px;min-height:calc(100vh - 132px)}
.v27-pancarte-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:4px 3px}
.v27-pancarte-title{min-width:0}.v27-pancarte-title .eyebrow{margin:0 0 2px}.v27-pancarte-title h4{margin:0;color:#123858;font-size:20px}.v27-pancarte-title p{margin:2px 0 0;font-size:10px;color:#6a8092}
.v27-pancarte-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.v27-time-range{display:flex;gap:2px;padding:2px;border:1px solid #bfcfdd;background:#fff;border-radius:8px}
.v27-time-range button{border:0;background:transparent;color:#49677e;border-radius:6px;padding:6px 8px;font-size:10px;font-weight:850;cursor:pointer}
.v27-time-range button.active{background:#0b63a7;color:#fff}
.v27-pancarte-actions>.primary,.v27-pancarte-actions>.secondary{border-radius:8px;padding:7px 9px;font-size:10px;font-weight:850;cursor:pointer}
.v27-pancarte-actions>.primary{border:1px solid #0b63a7;background:#0b63a7;color:#fff}.v27-pancarte-actions>.secondary{border:1px solid #b9cbd9;background:#fff;color:#315a78}

.v27-clinical-strip{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:5px}
.v27-clinical-chip{position:relative;min-width:0;padding:6px 7px 5px;border:1px solid #d4dee7;border-radius:8px;background:#fff;box-shadow:0 1px 3px rgba(20,54,82,.03)}
.v27-clinical-chip::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;border-radius:8px 0 0 8px;background:#8fa4b5}
.v27-clinical-chip span{display:block;font-size:7.5px;font-weight:900;text-transform:uppercase;letter-spacing:.03em;color:#647b8d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v27-clinical-chip strong{display:block;margin-top:1px;font-size:14px;line-height:1.1;color:#163b59;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.v27-clinical-chip small{font-size:7.5px;color:#82929f}
.v27-clinical-chip.normal::before{background:#4b9b63}.v27-clinical-chip.warning{background:#fff9ec;border-color:#e2c277}.v27-clinical-chip.warning::before{background:#d89315}.v27-clinical-chip.warning strong{color:#995f00}.v27-clinical-chip.critical{background:#fff2f3;border-color:#e29a9f}.v27-clinical-chip.critical::before{background:#cb2d37}.v27-clinical-chip.critical strong{color:#aa1e28}.v27-clinical-chip.unknown{background:#f8fafc}

.v27-chart-grid{display:grid;grid-template-columns:1.1fr 1fr 1fr;gap:8px;min-height:0}
.v27-chart-card{min-width:0;border:1px solid #c5d4e0;border-radius:12px;background:#fff;box-shadow:0 3px 10px rgba(20,54,83,.05);overflow:hidden}
.v27-chart-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:8px 10px 6px;background:#f5f9fc;border-bottom:1px solid #dce5ec}.v27-chart-head strong{display:block;font-size:12px;color:#173e5d}.v27-chart-head small{display:block;font-size:8.5px;color:#708496;margin-top:2px}
.v27-chart-legend{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.v27-chart-legend span{font-size:8px;font-weight:850;color:#5b7184;white-space:nowrap}.v27-chart-legend i{display:inline-block;width:9px;height:3px;border-radius:999px;margin-right:3px;vertical-align:middle}
.v27-lanes{padding:5px 7px 7px;display:grid;gap:3px}.v27-lane{border-top:1px solid #edf1f4}.v27-lane:first-child{border-top:0}.v27-lane-title{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:2px 3px 0}.v27-lane-title strong{font-size:8.5px;color:#536d80}.v27-lane-title span{font-size:8px;color:#80919e}
.v27-chart-svg{display:block;width:100%;height:104px}.v27-chart-svg.compact{height:82px}
.v27-chart-gridline{stroke:#dce5ec;stroke-width:1}.v27-chart-axis{fill:#8092a0;font-size:8px;font-family:Arial,sans-serif}.v27-chart-event{stroke:#8d78b7;stroke-width:1;stroke-dasharray:3 3;opacity:.7}.v27-chart-event-dot{fill:#6b56a6;stroke:#fff;stroke-width:1.5}
.v27-series-pas{fill:none;stroke:#c4383d;stroke-width:2.4}.v27-series-pam{fill:none;stroke:#d78617;stroke-width:2}.v27-series-pad{fill:none;stroke:#557ba8;stroke-width:2}.v27-series-fc{fill:none;stroke:#7d3aa8;stroke-width:2.2}.v27-series-spo2{fill:none;stroke:#147f9d;stroke-width:2.4}.v27-series-fr{fill:none;stroke:#4f6d86;stroke-width:2.2}.v27-series-gly{fill:none;stroke:#b56c18;stroke-width:2.4}.v27-series-ket{fill:none;stroke:#b03b78;stroke-width:2.4}.v27-chart-point{stroke:#fff;stroke-width:1.5}
.v27-chart-empty{height:88px;display:grid;place-items:center;color:#8a99a5;font-size:9px;border:1px dashed #d7e0e7;border-radius:8px;margin:5px}

.v27-event-strip{display:flex;align-items:center;gap:6px;min-height:31px;padding:5px 7px;border:1px solid #c8d7e2;border-radius:9px;background:#fff;overflow:hidden}
.v27-event-strip>strong{flex:0 0 auto;font-size:8px;text-transform:uppercase;color:#5d7386}.v27-event-list{display:flex;gap:5px;min-width:0;overflow:auto;scrollbar-width:thin}.v27-event-chip{flex:0 0 auto;border:1px solid #d6cce7;background:#f7f3fb;color:#5e4b87;border-radius:999px;padding:4px 7px;font-size:8px;white-space:nowrap}.v27-event-chip b{color:#392d58;margin-right:4px}

.v27-pancarte-bottom{display:grid;grid-template-columns:1.35fr .9fr;gap:8px;min-height:0}.v27-pancarte-bottom .v26-section{margin:0}.v27-pancarte-bottom .v26-section-head{padding:8px 10px}.v27-pancarte-bottom .v26-section-body{padding:8px 10px}.v27-pancarte-bottom .v26-pancarte-monitoring-list{gap:5px}.v27-pancarte-bottom .v26-pancarte-monitoring-card{padding:7px 9px;border-radius:8px}.v27-pancarte-bottom .v26-pancarte-monitoring-card strong{font-size:10px}.v27-pancarte-bottom .v26-pancarte-monitoring-card small,.v27-pancarte-bottom .v26-pancarte-monitoring-card>span{font-size:8px}.v27-pancarte-bottom .v26-pancarte-resp-current{padding:8px 9px;border-radius:8px}.v27-pancarte-bottom .v26-pancarte-resp-current strong{font-size:10px}.v27-pancarte-bottom .v26-pancarte-resp-current small{font-size:8px}
.v27-history-details{border:1px solid #ccd9e4;border-radius:9px;background:#fff;overflow:hidden}.v27-history-details>summary{cursor:pointer;padding:7px 10px;font-size:9px;font-weight:850;color:#365b76;background:#f5f8fb;list-style:none}.v27-history-details>summary::-webkit-details-marker{display:none}.v27-history-details>summary::before{content:"›";display:inline-block;margin-right:6px;font-size:14px;vertical-align:-1px}.v27-history-details[open]>summary::before{transform:rotate(90deg)}.v27-history-details .v26-pancarte-table-wrap{max-height:300px}

@media(max-width:1380px){
  .v27-clinical-strip{grid-template-columns:repeat(6,minmax(0,1fr))}
  .v27-chart-grid{grid-template-columns:1fr 1fr}.v27-chart-card.metabolic{grid-column:1/-1}
}
@media(max-width:1080px){
  .v26-patient-shell{grid-template-columns:168px minmax(0,1fr)}
  #v26PrescriptionLabView.v26-patient-focus .v26-plan-table.time-window{--v26-label-width:210px}
  .v27-chart-grid{grid-template-columns:1fr}.v27-chart-card.metabolic{grid-column:auto}.v27-pancarte-bottom{grid-template-columns:1fr}.v27-clinical-strip{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(max-width:900px){
  .v26-patient-shell{grid-template-columns:1fr}
  .v26-patient-nav .v26-workspace-tabs button{font-size:12.5px}
  .v27-clinical-strip{grid-template-columns:repeat(3,minmax(0,1fr))}.v27-pancarte-toolbar{align-items:flex-start;flex-direction:column}.v27-pancarte-actions{justify-content:flex-start}
}

/* En-tête patient persistant pendant les écrans longs. */
#v26PrescriptionLabView.v26-patient-focus .v26-patient-banner{position:sticky;top:64px;z-index:25}

/* Repères de familles du Plan de soins : sobres, cohérents, non décoratifs. */
#v26PrescriptionLabView.v26-patient-focus .v26-plan-group{border-left:4px solid #7590a5}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-group.group-respiratory_support{border-left-color:#6b56a6}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-group.group-medication{border-left-color:#3378b5}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-group.group-infusion{border-left-color:#258a9b}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-group.group-care{border-left-color:#4b8b65}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-group.group-monitoring{border-left-color:#d18a12}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-group.group-lab{border-left-color:#8a5aa8}
#v26PrescriptionLabView.v26-patient-focus .v26-plan-group.group-imaging{border-left-color:#65738a}
