/* KORDVEX · features no-PWA (Sentinel, FAB, handover) */
/* Sentinel AI composer */
.sentinel-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 15px;
  color: #fff;
  background: var(--kv-primary, #0f1c2e);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  box-shadow: 0 14px 36px -14px rgba(15,28,46,.6);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.sentinel-fab:hover { background: #173243; }
.sentinel-fab .icon { width: 17px; height: 17px; }
.sentinel-dialog {
  width: min(560px, calc(100vw - 24px));
  height: min(680px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--kv-border, #dce2dc);
  border-radius: 16px;
  background: #fff;
  color: var(--ink, #18242b);
  box-shadow: 0 30px 90px -30px rgba(16,35,28,.55);
  overflow: hidden;
}
.sentinel-dialog::backdrop { background: rgba(17,29,24,.48); backdrop-filter: blur(3px); }
.sentinel-shell { display:flex; flex-direction:column; height:100%; min-height:0; }
.sentinel-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:14px 16px; border-bottom:1px solid var(--kv-border, #dce2dc); }
.sentinel-head-copy { display:flex; align-items:center; gap:10px; min-width:0; }
.sentinel-head h2 { margin:1px 0 0; font-size:18px; letter-spacing:-.03em; }
.sentinel-mark { display:grid; place-items:center; width:31px; height:31px; border-radius:9px; color:#fff; background:var(--kv-primary,#0f1c2e); font-size:13px; font-weight:750; }
.sentinel-scope { margin:0; padding:8px 16px; color:var(--kv-text-secondary,#6e7a73); background:var(--kv-background,#f7f8fa); border-bottom:1px solid var(--kv-border,#dce2dc); font-size:9.5px; line-height:1.4; }
.sentinel-messages { flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:14px 16px; display:grid; align-content:start; gap:9px; scrollbar-width:thin; }
.sentinel-msg { max-width:88%; padding:9px 11px; border-radius:10px; font-size:12px; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.sentinel-msg.is-user { justify-self:end; color:#fff; background:var(--kv-primary,#0f1c2e); border-bottom-right-radius:3px; }
.sentinel-msg.is-assistant { justify-self:start; color:var(--ink,#18242b); background:#f3f6f3; border:1px solid var(--kv-border,#dce2dc); border-bottom-left-radius:3px; }
.sentinel-msg.is-pending { color:var(--kv-text-secondary,#6e7a73); font-style:italic; }
.sentinel-composer { display:flex; gap:7px; align-items:flex-end; padding:10px 12px 12px; border-top:1px solid var(--kv-border,#dce2dc); }
.sentinel-composer textarea { flex:1 1 auto; min-width:0; min-height:42px; max-height:120px; resize:vertical; padding:9px 10px; border:1px solid var(--kv-border,#dce2dc); border-radius:8px; font:inherit; font-size:12px; }
.sentinel-composer .btn { min-height:42px; }
.sentinel-error { margin:0; padding:0 16px 10px; color:var(--danger,#b63b4b); font-size:10px; }
@media (max-width:900px) {
  .sentinel-fab { right:12px; bottom:calc(12px + env(safe-area-inset-bottom)); width:44px; height:44px; padding:0; justify-content:center; }
  .sentinel-fab span { display:none; }
  .sentinel-dialog { width:calc(100vw - 16px); height:calc(100dvh - 16px); max-height:calc(100dvh - 16px); margin:8px auto; border-radius:14px; }
  .sentinel-head { padding:12px 13px; }
  .sentinel-scope { padding:7px 13px; }
  .sentinel-messages { padding:12px 13px; }
  .sentinel-msg { max-width:94%; }
  .sentinel-composer { padding:8px 10px calc(9px + env(safe-area-inset-bottom)); }
}

.sentinel-tool { display:flex; align-items:center; gap:6px; flex-wrap:wrap; justify-self:start; max-width:94%; padding:7px 9px; color:var(--kv-text-secondary,#6e7a73); background:#f7f8f5; border:1px solid var(--kv-border,#dce2dc); border-radius:7px; font-size:9.5px; }
.sentinel-tool strong { color:var(--ink,#18242b); font-weight:650; }
.sentinel-tool span { text-transform:uppercase; letter-spacing:.04em; }
.sentinel-tool .btn { min-height:26px; margin-left:4px; padding:4px 8px; font-size:9px; }

/* Acceso flotante Sentinel: fuera de contenedores con transform, siempre visible y arrastrable. */
.sentinel-fab[hidden] { display: none !important; }
.sentinel-fab {
  position: fixed !important;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 120;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.sentinel-fab.is-dragging { cursor: grabbing; opacity: .92; }
.sentinel-fab.is-positioned { right: auto; bottom: auto; }
@media (max-width: 900px) {
  .sentinel-fab { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* Entrega de turno y agenda completa en Mi servicio */
.service-handover-panel,
.service-agenda-panel {
  margin-top: 12px; padding: 16px 17px; background: #fff;
  border: 1px solid var(--line-soft, #dce2dc); border-radius: 12px;
}
.service-handover-panel .eyebrow,
.service-agenda-panel .eyebrow { margin-bottom: 4px; }
.service-handover-panel h2,
.service-agenda-panel h2 { margin: 0 0 7px; font-size: 18px; letter-spacing: -.03em; }
.service-handover-target { margin: 0 0 3px; color: #0f1c2e; font-size: 15px; font-weight: 750; }
.service-handover-meta { margin: 0 0 8px; color: #617067; font-size: 10px; }
.service-handover-panel p:not(.eyebrow):not(.service-handover-target):not(.service-handover-meta) { margin: 0 0 8px; color: #56655b; font-size: 10px; line-height: 1.5; }
.service-agenda-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:8px; }
.service-agenda-head > span { flex:0 0 auto; color:#6b786f; font-size:9px; }
.service-agenda-day { display:grid; gap:5px; padding:9px 0; border-top:1px solid #edf0ec; }
.service-agenda-date { display:flex; justify-content:space-between; gap:8px; align-items:baseline; }
.service-agenda-date strong { font-size:10px; color:#1c3026; }
.service-agenda-date span { color:#6b786f; font-size:8.5px; text-align:right; }
.service-agenda-shift { display:flex; justify-content:space-between; gap:8px; padding:4px 0 4px 9px; border-left:2px solid #dfe7dc; color:#536259; font-size:9px; }
.service-agenda-shift strong { color:#263a2e; font-weight:650; text-align:right; }
@media (max-width:900px) {
  .service-handover-panel, .service-agenda-panel { padding:14px; border-radius:11px; }
  .service-handover-panel h2, .service-agenda-panel h2 { font-size:16px; }
  .service-agenda-date { flex-direction:column; gap:2px; }
  .service-agenda-date span { text-align:left; }
  .service-agenda-shift { font-size:8.5px; }
}

@media (max-width: 900px) {
  table.mobile-card-table { display:block !important; width:100% !important; min-width:0 !important; border:0 !important; }
  table.mobile-card-table thead { display:none !important; }
  table.mobile-card-table tbody { display:grid !important; gap:8px !important; width:100% !important; }
  table.mobile-card-table tbody tr { display:block !important; width:100% !important; padding:10px 11px !important; background:#fff !important; border:1px solid var(--line-soft,#dce2dc) !important; border-radius:10px !important; }
  table.mobile-card-table tbody tr:nth-child(even) { background:#f7f9f6 !important; }
  table.mobile-card-table tbody td { display:flex !important; justify-content:space-between; align-items:baseline; gap:12px; width:100% !important; padding:4px 0 !important; border:0 !important; text-align:right !important; font-size:11px !important; }
  table.mobile-card-table tbody td::before { content:attr(data-label); flex:0 0 44%; color:#6d7a71; font-size:9px; font-weight:600; text-align:left; text-transform:uppercase; letter-spacing:.03em; }
  table.mobile-card-table tbody td:empty { display:none !important; }
  .history-table-wrap, .table-wrap, .analytics-table-wrap, .payroll-table-wrap { overflow-x:clip !important; }
}

