
/* VHIP v0.4.4 — Multi-Device Adaptive Workspace */
.vhip-device-mode-selector{display:flex;align-items:center;gap:5px;margin-left:auto;padding:4px 7px;border:1px solid #1b5268;border-radius:8px;background:#061d29}.vhip-device-mode-selector .dashicons{color:#63d6e2}.vhip-device-mode-selector select{max-width:155px;border:0;background:transparent;color:#bde3ec;font-size:8px;outline:none}.vhip-device-mode-selector option{color:#111}
.vhip-adaptive-action-dock{display:none;position:sticky;bottom:8px;z-index:80;max-width:680px;margin:10px auto 0;padding:6px;border:1px solid #276377;border-radius:14px;background:rgba(4,28,40,.94);backdrop-filter:blur(12px);box-shadow:0 10px 30px rgba(0,0,0,.3)}.vhip-adaptive-action-dock button{flex:1;display:grid;justify-items:center;gap:2px;border:0;border-radius:9px;background:transparent;color:#8fb7c6;padding:7px;cursor:pointer}.vhip-adaptive-action-dock button:hover{background:#0b3a4a;color:#e9fdff}.vhip-adaptive-action-dock small{font-size:7px}
.vhip-terminal-controls{display:none}.vhip-terminal-rail{position:fixed;top:18%;bottom:18%;z-index:100;display:flex;flex-direction:column;justify-content:center;gap:10px;width:68px;padding:8px;background:rgba(4,24,35,.78);border:1px solid #275c70;backdrop-filter:blur(10px)}.vhip-terminal-rail.is-left{left:4px;border-radius:0 18px 18px 0}.vhip-terminal-rail.is-right{right:4px;border-radius:18px 0 0 18px}.vhip-terminal-rail button{display:grid;justify-items:center;gap:2px;border:1px solid #2b5c6e;border-radius:10px;background:#082d3c;color:#d7f4fa;padding:8px 3px;cursor:pointer}.vhip-terminal-rail button>b{display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#0e6376}.vhip-terminal-rail small{font-size:6.5px}.vhip-terminal-pad{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;place-items:center;margin-top:4px;color:#62d9e4;font-size:10px}.vhip-terminal-pad i{font-style:normal}.vhip-terminal-pad i:first-child{grid-column:2}.vhip-terminal-shoulders{position:fixed;z-index:101;top:6px;left:50%;transform:translateX(-50%);display:flex;gap:12px}.vhip-terminal-shoulders button{border:1px solid #2b6478;border-radius:999px;background:#082d3c;color:#bce7ef;padding:5px 10px;font-size:7px;cursor:pointer}
.vhip-operational-stream{display:grid;gap:10px}.vhip-operational-stream-head{display:flex;justify-content:space-between;gap:16px;padding:15px;border:1px solid #285b70;border-radius:12px;background:#082938}.vhip-operational-stream-head small{font-size:8px;color:#4ed8e4;font-weight:800}.vhip-operational-stream-head h2{margin:4px 0}.vhip-operational-stream-head p{margin:0;color:#8eb0bd;font-size:9px}.vhip-operational-stream-head>span{align-self:flex-start;border:1px solid #34768a;border-radius:999px;padding:6px 9px;color:#8de2ec;font-size:8px}.vhip-operational-list{display:grid;gap:6px}.vhip-operational-list article{display:grid;grid-template-columns:minmax(180px,.7fr) 1.3fr;gap:10px;padding:10px;border:1px solid #264c5d;border-radius:9px;background:#061923}.vhip-op-main{display:grid;gap:2px}.vhip-op-main small{font-size:7px;color:#7296a4}.vhip-op-main b{font-size:10px}.vhip-op-main span{font-size:7px;color:#51ceda}.vhip-op-reflections{display:flex;flex-wrap:wrap;gap:4px;align-content:center}.vhip-op-reflections span{padding:4px 6px;border-radius:999px;background:#0c3543;color:#9cc7d3;font-size:7px}
.vhip-rst-signals{margin:0 0 12px;padding:12px;border:1px solid #285d70;border-radius:12px;background:#072632}.vhip-rst-signals header{display:flex;justify-content:space-between;align-items:center}.vhip-rst-signals header small{font-size:7px;color:#50d5df}.vhip-rst-signals header h3{margin:3px 0}.vhip-rst-signals header>span{display:grid;place-items:center;min-width:26px;height:26px;border-radius:50%;background:#0c5d6e}.vhip-rst-signals>p{font-size:8px;color:#8faeb9}.vhip-rst-signals>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.vhip-rst-signals article{display:grid;gap:2px;padding:8px;border:1px solid #2a5261;border-radius:8px;background:#061a23}.vhip-rst-signals article b{font-size:8.5px}.vhip-rst-signals article small{font-size:7px;color:#8daeba}.vhip-rst-signals article span{font-size:7px;color:#5ad3c4}

/* Auto mode: behavior is resolved by JS */
.vhip-ws[data-vhip-device-mode="desktop"] .vhip-adaptive-action-dock{display:none}
.vhip-ws[data-vhip-device-mode="tablet"] .vhip-adaptive-action-dock{display:flex}
.vhip-ws[data-vhip-device-mode="tablet"] .vhip-ux-sidebar{width:68px}
.vhip-ws[data-vhip-device-mode="tablet"] .vhip-ws-main{min-width:0}
.vhip-ws[data-vhip-device-mode="tablet"] .vhip-ux-context-chip:not(.vhip-ux-location){display:none}
.vhip-ws[data-vhip-device-mode="tablet"] .vhip-device-mode-selector select{max-width:110px}

.vhip-ws[data-vhip-device-mode="terminal"]{padding-left:76px;padding-right:76px}
.vhip-ws[data-vhip-device-mode="terminal"] .vhip-terminal-controls{display:block}
.vhip-ws[data-vhip-device-mode="terminal"] .vhip-adaptive-action-dock{display:flex}
.vhip-ws[data-vhip-device-mode="terminal"] .vhip-ws-sidebar{display:none}
.vhip-ws[data-vhip-device-mode="terminal"] .vhip-ws-layout{display:block}
.vhip-ws[data-vhip-device-mode="terminal"] .vhip-ux-patient-context{grid-template-columns:minmax(210px,1.2fr) repeat(2,minmax(120px,.6fr)) auto}
.vhip-ws[data-vhip-device-mode="terminal"] .vhip-ux-context-chip:nth-of-type(n+4){display:none}
.vhip-ws[data-vhip-device-mode="terminal"] .vhip-ws-header{padding-left:6px;padding-right:6px}
.vhip-ws[data-vhip-device-mode="terminal"] .vhip-device-mode-selector select{max-width:120px}

.vhip-ws[data-vhip-device-mode="command"]{max-width:none}
.vhip-ws[data-vhip-device-mode="command"] .vhip-ws-main{max-width:none}
.vhip-ws[data-vhip-device-mode="command"] .vhip-ws-dashboard-grid{grid-template-columns:minmax(0,1.7fr) minmax(350px,.8fr)}
.vhip-ws[data-vhip-device-mode="command"] .vhip-adaptive-action-dock{display:flex;max-width:900px}

@media(max-width:900px){
  .vhip-device-mode-selector{order:3}
  .vhip-operational-list article{grid-template-columns:1fr}
  .vhip-rst-signals>div{grid-template-columns:1fr 1fr}
}
@media(max-width:680px){
  .vhip-ws[data-vhip-device-mode="terminal"]{padding-left:58px;padding-right:58px}
  .vhip-terminal-rail{width:50px}
  .vhip-rst-signals>div{grid-template-columns:1fr}
}

.vhip-terminal-toast{position:fixed;left:50%;bottom:84px;transform:translateX(-50%);z-index:100002;max-width:560px;padding:10px 14px;border:1px solid #3a8494;border-radius:10px;background:#092b38;color:#d8f5fa;box-shadow:0 12px 32px rgba(0,0,0,.35);font-size:9px;text-align:center}


/* VHIP v0.4.4.2 — Workspace Viewport & Navigation Visibility Hotfix */

/* Keep the global workspace inside the viewport and reserve room for fixed UI. */
.vhip-ws{
  width:100%;
  max-width:100vw;
  overflow-x:hidden;
  box-sizing:border-box;
}
.vhip-ws *{box-sizing:border-box}

/* Header must never hide patient navigation / logout controls. */
.vhip-ws-header{
  position:sticky;
  top:0;
  z-index:120;
  width:100%;
  max-width:100%;
  min-width:0;
  display:grid!important;
  grid-template-columns:minmax(220px,1fr) auto auto;
  align-items:center;
  gap:10px;
  padding:8px 14px!important;
  background:rgba(2,22,34,.98);
  backdrop-filter:blur(12px);
}
.vhip-ws-brand,
.vhip-ws-user,
.vhip-device-mode-selector{
  min-width:0;
}
.vhip-ws-user{
  display:flex!important;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  flex-wrap:wrap;
}
.vhip-ws-user a,
.vhip-ws-user button{
  flex:0 0 auto;
  white-space:nowrap;
}

/* Context row can wrap instead of pushing controls out of screen. */
.vhip-ux-patient-context{
  width:100%;
  max-width:100%;
  grid-template-columns:minmax(250px,1.25fr) repeat(2,minmax(150px,.65fr)) minmax(120px,.45fr)!important;
  gap:7px!important;
  overflow:visible!important;
}
.vhip-ux-context-chip{
  min-width:0!important;
  overflow:hidden;
}
.vhip-ux-context-chip b,
.vhip-ux-context-chip small{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Content must account for sticky header and floating dock. */
.vhip-ws-main{
  min-width:0;
  max-width:100%;
  padding-bottom:92px!important;
}
.vhip-ws-panel,
.vhip-ws-dashboard-grid,
.vhip-ws-module-grid{
  min-width:0;
  max-width:100%;
}

/* Floating quick-actions button/menu: keep it in safe area and above dock. */
.vhip-ux-fab,
.vhip-floating-actions,
[data-vhip-fab]{
  position:fixed!important;
  right:18px!important;
  bottom:96px!important;
  z-index:135!important;
}
.vhip-ux-fab-menu,
.vhip-floating-actions-menu,
[data-vhip-fab-menu]{
  position:fixed!important;
  right:18px!important;
  bottom:150px!important;
  max-height:min(62vh,520px)!important;
  overflow-y:auto!important;
  z-index:134!important;
}

/* Action dock must float over a dedicated safe zone, not over forms. */
.vhip-adaptive-action-dock{
  position:fixed!important;
  left:50%;
  transform:translateX(-50%);
  bottom:10px!important;
  width:min(680px,calc(100vw - 120px));
  margin:0!important;
  z-index:130!important;
}
.vhip-ws[data-vhip-device-mode="desktop"] .vhip-adaptive-action-dock{
  display:none!important;
}

/* Terminal rails must not overlap global header. */
.vhip-ws[data-vhip-device-mode="terminal"] .vhip-terminal-rail{
  top:110px!important;
  bottom:92px!important;
}
.vhip-ws[data-vhip-device-mode="terminal"] .vhip-terminal-shoulders{
  top:72px!important;
}

/* Reduce horizontal pressure in tablet / auto modes. */
.vhip-ws[data-vhip-device-mode="tablet"] .vhip-ws-header,
.vhip-ws[data-vhip-device-mode="terminal"] .vhip-ws-header{
  grid-template-columns:minmax(180px,1fr) auto!important;
}
.vhip-ws[data-vhip-device-mode="tablet"] .vhip-device-mode-selector,
.vhip-ws[data-vhip-device-mode="terminal"] .vhip-device-mode-selector{
  grid-column:auto;
}
.vhip-ws[data-vhip-device-mode="tablet"] .vhip-ux-patient-context,
.vhip-ws[data-vhip-device-mode="terminal"] .vhip-ux-patient-context{
  grid-template-columns:minmax(220px,1.2fr) repeat(2,minmax(130px,.7fr))!important;
}

/* Desktop/laptop keeps all top navigation visible, including Pacientes and Salir. */
@media(min-width:1180px){
  .vhip-ws-header{
    grid-template-columns:minmax(260px,1fr) auto auto!important;
  }
  .vhip-ws-user{
    min-width:max-content!important;
  }
}

/* Medium screens: wrap the header rather than clipping the controls. */
@media(max-width:1179px){
  .vhip-ws-header{
    grid-template-columns:minmax(200px,1fr) auto!important;
  }
  .vhip-ws-user{
    grid-column:1/-1;
    justify-content:flex-end;
  }
  .vhip-ux-patient-context{
    grid-template-columns:1fr 1fr!important;
  }
}

/* Small screens: all navigation remains visible and touchable. */
@media(max-width:720px){
  .vhip-ws-header{
    position:sticky;
    grid-template-columns:1fr!important;
    padding:7px 8px!important;
  }
  .vhip-device-mode-selector{
    margin-left:0!important;
    width:100%;
    justify-content:flex-end;
  }
  .vhip-ws-user{
    width:100%;
    justify-content:space-between;
  }
  .vhip-ux-patient-context{
    grid-template-columns:1fr!important;
  }
  .vhip-adaptive-action-dock{
    width:calc(100vw - 16px)!important;
    bottom:8px!important;
  }
  .vhip-ux-fab,
  .vhip-floating-actions,
  [data-vhip-fab]{
    right:10px!important;
    bottom:84px!important;
  }
  .vhip-ux-fab-menu,
  .vhip-floating-actions-menu,
  [data-vhip-fab-menu]{
    right:10px!important;
    left:10px!important;
    bottom:136px!important;
    width:auto!important;
  }
}


/* v0.4.5.5 header alignment */
@media(min-width:1181px){.vhip-ws-header{grid-template-columns:minmax(280px,1fr) minmax(220px,.75fr) auto minmax(260px,auto)!important;gap:12px!important}.vhip-ws-context{text-align:center;min-width:0}.vhip-device-mode-selector{margin-left:0!important;justify-self:center}.vhip-ws-user{justify-self:end!important;display:grid!important;grid-template-columns:minmax(120px,auto) auto auto;align-items:center;gap:8px!important;flex-wrap:nowrap!important;text-align:right}.vhip-ws-user>div{min-width:120px}.vhip-ws-user a{min-width:68px;text-align:center;padding:8px 12px!important}.vhip-ws-user b{display:block;font-size:12px}.vhip-ws-user small{font-size:9px!important}}
