/* ============================================================
   HandOff 360 · Design System
   Paleta estricta: verde + negro + blanco · Mobile-first
   ============================================================ */

:root {
  --green-50: #eaf9f1;
  --green-100: #d3f4e3;
  --green-200: #a9e9c9;
  --green-300: #74d9a9;
  --green-400: #3fcb89;
  --green-500: #12b76a;
  --green-600: #0e9f5b;
  --green-700: #0b7a46;
  --green-800: #075232;
  --green-900: #04301d;
  --green-950: #021a10;

  --black: #050807;
  --ink: #08120d;
  --white: #ffffff;
  --paper: #f3f8f5;
  --line: #dce8e1;
  --muted: #56685f;
  --muted-2: #5e7067;

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;

  --shadow-sm: 0 2px 8px rgba(5, 8, 7, 0.03);
  --shadow-md: 0 8px 24px rgba(5, 8, 7, 0.07);
  --shadow-lg: 0 18px 44px rgba(5, 8, 7, 0.16);
  --shadow-fab: 0 14px 30px rgba(11, 122, 70, 0.38);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --vvh: 100dvh;
  --kb-inset: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--black);
  background-image: radial-gradient(
      70% 45% at 50% -5%,
      rgba(18, 183, 106, 0.2),
      transparent 70%
    ),
    radial-gradient(45% 35% at 100% 100%, rgba(18, 183, 106, 0.1), transparent 70%);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

svg,
img {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--green-500);
  outline-offset: 2px;
  border-radius: 8px;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ============================================================
   Shell de la app
   ============================================================ */

.app-shell {
  position: relative;
  top: var(--vv-top, 0px);
  width: 100%;
  max-width: 460px;
  height: 100vh;
  height: 100dvh;
  height: var(--vvh, 100dvh);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(18, 183, 106, 0.08), 0 40px 120px rgba(0, 0, 0, 0.7);
  container-type: inline-size;
  container-name: app;
}

.app-view {
  flex: 1;
  position: relative;
  z-index: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--green-200) transparent;
}

.app-view::-webkit-scrollbar {
  width: 5px;
}

.app-view::-webkit-scrollbar-thumb {
  background: var(--green-200);
  border-radius: 999px;
}

.app-view.is-select {
  background: var(--black);
}

/* ============================================================
   Header del sector
   ============================================================ */

.app-header {
  flex: none;
  position: relative;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: calc(10px + var(--safe-top)) 12px 10px;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-back {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--green-800);
  transition: transform 0.12s;
}

.header-back:active {
  transform: scale(0.92);
}

.header-sector {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.header-emoji {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  font-size: 21px;
}

.header-copy {
  min-width: 96px;
}

.header-copy strong {
  display: block;
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-copy small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-shift {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  color: var(--green-800);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}

.header-shift {
  flex: none;
}

.header-action {
  position: relative;
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--green-700);
  touch-action: manipulation;
  transition: transform 0.12s, background 0.15s, color 0.15s;
}

.header-action::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 16px;
}

.header-action .icon {
  width: 18px;
  height: 18px;
}

.header-action:hover {
  background: var(--green-50);
}

.header-action:active {
  transform: scale(0.94);
}

.live-dot {
  position: relative;
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--green-500);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(18, 183, 106, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.55);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ============================================================
   Navegación inferior
   ============================================================ */

.bottom-nav {
  flex: none;
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 8px 8px calc(10px + var(--safe-bottom));
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  padding: 7px 4px 5px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  transition: color 0.15s, background 0.15s;
}

.nav-item .icon {
  width: 22px;
  height: 22px;
  transition: transform 0.15s;
}

.nav-item.is-active {
  color: var(--green-700);
  background: var(--green-50);
}

.nav-item.is-active .icon {
  stroke-width: 2.1;
  transform: translateY(-1px);
}

/* ============================================================
   FAB del asistente
   ============================================================ */

.chat-fab {
  position: absolute;
  right: 16px;
  bottom: calc(88px + var(--safe-bottom));
  z-index: 40;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--green-700), var(--green-800));
  color: var(--white);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-fab);
  transition: transform 0.14s;
}

.chat-fab:active {
  transform: scale(0.93);
}

.chat-fab .icon {
  width: 27px;
  height: 27px;
}

.chat-fab__pulse {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  border: 2px solid rgba(18, 183, 106, 0.55);
  animation: pulse 2.4s infinite;
  pointer-events: none;
}

.chat-fab__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--white);
  border: 2.5px solid var(--green-600);
}

/* ============================================================
   Pantalla de selección de sector
   ============================================================ */

.select-screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--black);
}

.select-hero {
  position: relative;
  overflow: hidden;
  padding: calc(30px + var(--safe-top)) 22px 30px;
}

.select-hero::before {
  content: "";
  position: absolute;
  inset: -45% -20% auto;
  height: 340px;
  background: radial-gradient(closest-side, rgba(18, 183, 106, 0.3), transparent);
  pointer-events: none;
}

.brand-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--green-700), var(--green-800));
  color: var(--white);
  box-shadow: 0 12px 26px rgba(18, 183, 106, 0.38);
}

.brand-mark .icon {
  width: 27px;
  height: 27px;
}

.brand-badge {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--green-300);
  background: rgba(18, 183, 106, 0.12);
  border: 1px solid rgba(18, 183, 106, 0.3);
  padding: 7px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.select-hero h1 {
  position: relative;
  margin-top: 26px;
  font-size: 40px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--white);
}

.select-hero h1 span {
  color: var(--green-400);
}

.select-tagline {
  position: relative;
  margin-top: 12px;
  font-size: 15.5px;
  line-height: 1.5;
  color: #cfe3d8;
  max-width: 330px;
}

.select-stats {
  position: relative;
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.stat-chip {
  flex: 1;
  padding: 11px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.stat-chip strong {
  display: block;
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-chip span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green-200);
}

.select-panel {
  position: relative;
  flex: 1;
  margin-top: 6px;
  padding: 22px 18px calc(22px + var(--safe-bottom));
  background: var(--paper);
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.45);
}

.select-panel h2 {
  margin-top: 7px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.select-panel__desc {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.sector-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 20px;
}

.sector-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 84px;
  padding: 14px;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.sector-btn:active {
  transform: scale(0.985);
  border-color: var(--accent, var(--green-500));
  box-shadow: 0 6px 18px rgba(11, 122, 70, 0.12);
}

.sector-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  bottom: 15px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent, var(--green-500));
  opacity: 0.9;
}

.sector-emoji {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  font-size: 24px;
}

.sector-copy {
  flex: 1;
  min-width: 0;
}

.sector-copy strong {
  display: block;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sector-copy small {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sector-go {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--green-700);
}

.sector-go .icon {
  width: 18px;
  height: 18px;
}

.select-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.select-note .icon {
  width: 16px;
  height: 16px;
  color: var(--green-600);
}

.link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  transition: background 0.15s;
}

.link-btn:active {
  background: var(--paper);
}

.link-btn .icon {
  width: 17px;
  height: 17px;
}

/* ============================================================
   Vista genérica
   ============================================================ */

.view {
  padding: 16px 16px 176px;
  display: flex;
  flex-direction: column;
  gap: 17px;
  animation: fade-up 0.24s ease both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Identificación de turno
   ============================================================ */

.access-screen {
  min-height: 100%;
  padding: 16px 16px calc(28px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fade-up 0.24s ease both;
}

.access-hero {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 26px;
  background: linear-gradient(150deg, var(--green-700), var(--green-900) 76%);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.access-hero::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -50px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(18, 183, 106, 0.55), transparent);
  pointer-events: none;
}

.access-hero > * {
  position: relative;
  z-index: 1;
}

.access-hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.access-emoji {
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 27px;
}

.access-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--green-900);
  border: 1px solid rgba(116, 217, 169, 0.35);
  color: var(--green-50);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.access-badge .icon {
  width: 14px;
  height: 14px;
}

.access-hero .eyebrow {
  margin-top: 18px;
  color: var(--green-100);
}

.access-hero h1 {
  margin-top: 4px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--white);
}

.access-hero p {
  margin-top: 7px;
  max-width: 34ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--green-100);
}

.access-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 14px;
}

.access-hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green-100);
}

.access-hero__meta .icon {
  width: 14px;
  height: 14px;
}

.access-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.access-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.access-card .field-input {
  min-height: 52px;
}

.access-card select.field-input {
  padding-right: 38px;
}

.access-hint {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted-2);
}

.access-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  color: var(--green-800);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.access-note .icon {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 1px;
  color: var(--green-700);
}

.access-card .btn-primary {
  width: 100%;
  margin-top: 2px;
}

.access-card .btn-primary .icon {
  width: 19px;
  height: 19px;
}

.access-screen .link-btn {
  margin-top: 0;
}

.sector-profile {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 800;
  color: var(--green-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sector-profile .icon {
  width: 13px;
  height: 13px;
  flex: none;
}

.sector-profile > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-700);
}

.view-head h2 {
  margin-top: 3px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.view-head__sub {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  color: var(--green-800);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.pill--dark {
  background: var(--ink);
  color: var(--green-300);
  border-color: var(--ink);
}

.pill .icon {
  width: 15px;
  height: 15px;
}

/* ============================================================
   Dashboard · Hero
   ============================================================ */

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 26px;
  background: linear-gradient(150deg, var(--green-700), var(--green-900) 70%);
  color: var(--white);
  box-shadow: 0 18px 40px rgba(4, 48, 29, 0.28);
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -46px;
  top: -46px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(18, 183, 106, 0.55), transparent);
  pointer-events: none;
}

.hero-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hero-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--green-100);
}

.hero-label .icon {
  width: 17px;
  height: 17px;
}

.hero-tag {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(5, 8, 7, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-value {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 18px;
}

.hero-value strong {
  font-size: 54px;
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: -0.055em;
}

.hero-value span {
  font-size: 22px;
  font-weight: 800;
  color: var(--green-300);
}

.hero-sub {
  position: relative;
  margin-top: 8px;
  font-size: 13px;
  color: var(--green-100);
}

.hero-bar {
  position: relative;
  margin-top: 20px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.hero-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-400), var(--green-200));
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-foot {
  position: relative;
  display: flex;
  gap: 10px;
  margin-top: 13px;
}

.hero-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-stat strong {
  font-size: 15px;
  font-weight: 800;
}

.hero-stat span {
  font-size: 11px;
  font-weight: 600;
  color: var(--green-100);
}

.hero-stat--right {
  text-align: right;
}

/* ============================================================
   Secciones
   ============================================================ */

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

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.section-title .icon {
  width: 18px;
  height: 18px;
  color: var(--green-600);
}

.count-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--green-700);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
}

.count-badge--dark {
  background: var(--ink);
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  min-height: 36px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--green-700);
}

.section-link .icon {
  width: 15px;
  height: 15px;
}

/* ============================================================
   KPIs
   ============================================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kpi-card {
  position: relative;
  padding: 14px;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.kpi-card--warn {
  background: var(--green-50);
  border-color: var(--green-200);
}

.kpi-card--critical {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-icon {
  width: 37px;
  height: 37px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--green-100);
}

.kpi-icon .icon {
  width: 19px;
  height: 19px;
}

.kpi-card--critical .kpi-icon {
  background: rgba(18, 183, 106, 0.18);
  color: var(--green-300);
  border-color: rgba(18, 183, 106, 0.3);
}

.kpi-label {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--muted);
}

.kpi-card--critical .kpi-label {
  color: var(--green-200);
}

.kpi-value {
  margin-top: 3px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.kpi-hint {
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted-2);
}

.kpi-card--critical .kpi-hint {
  color: var(--green-300);
}

.kpi-tone {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-300);
}

.kpi-card--warn .kpi-tone {
  background: var(--green-600);
}

.kpi-card--critical .kpi-tone {
  background: var(--green-400);
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.18);
}

/* ============================================================
   KPIs y métricas operativas
   ============================================================ */

.metrics-hero {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 26px;
  color: var(--white);
  background:
    radial-gradient(circle at 92% 8%, rgba(18, 183, 106, 0.26), transparent 42%),
    var(--ink);
  border: 1px solid rgba(18, 183, 106, 0.28);
  box-shadow: 0 18px 40px rgba(4, 48, 29, 0.24);
}

.metrics-hero::after {
  content: "";
  position: absolute;
  right: -54px;
  bottom: -82px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 1px solid rgba(18, 183, 106, 0.16);
}

.metrics-hero > * {
  position: relative;
  z-index: 1;
}

.metrics-hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.metrics-hero__label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--green-200);
}

.metrics-hero__label .icon {
  width: 17px;
  height: 17px;
  color: var(--green-300);
}

.metrics-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-300);
  white-space: nowrap;
}

.metrics-hero__value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 16px;
}

.metrics-hero__value strong {
  font-size: 58px;
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.metrics-hero__value span {
  font-size: 22px;
  font-weight: 800;
  color: var(--green-300);
}

.metrics-hero__sub {
  margin-top: 9px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--green-100);
}

.metrics-hero__bar {
  margin-top: 15px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.metrics-hero__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-500), var(--green-300));
  transition: width 0.35s ease;
}

.metrics-hero__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green-200);
}

.metrics-hero__foot span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.metrics-hero__foot .icon {
  width: 14px;
  height: 14px;
  color: var(--green-300);
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-tile {
  display: flex;
  flex-direction: column;
  min-height: 158px;
  padding: 15px;
  border-radius: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.metric-tile__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.metric-tile__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  color: var(--green-700);
}

.metric-tile__icon .icon {
  width: 18px;
  height: 18px;
}

.metric-tile__mark {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-tile__label {
  min-height: 32px;
  margin-top: 11px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--muted);
}

.metric-tile__value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: auto;
  padding-top: 8px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.metric-tile__value small {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--muted-2);
}

.metric-tile__hint {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--muted-2);
}

.metrics-chart {
  padding: 16px;
  border-radius: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.metrics-chart .section-head {
  margin-bottom: 14px;
}

.metrics-mix {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.metrics-mix__row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 10px;
}

.metrics-mix__label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
}

.metrics-mix__label small {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-2);
}

.metrics-mix__track {
  height: 11px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  overflow: hidden;
}

.metrics-mix__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}

.metrics-mix__fill--alta {
  background: var(--green-700);
}

.metrics-mix__fill--media {
  background: var(--green-500);
}

.metrics-mix__fill--baja {
  background: var(--green-300);
}

.metrics-mix__count {
  text-align: right;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.metrics-chart__empty {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.metrics-chart__foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
}

.metrics-chart__foot span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.metrics-chart__foot .icon {
  width: 14px;
  height: 14px;
  color: var(--green-600);
}

.metrics-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 13px 14px;
  border-radius: 16px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  color: var(--green-800);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.45;
}

.metrics-note .icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--green-700);
}

/* ============================================================
   Soporte técnico · panel estático (HTML fijo + clase .active)
   ============================================================ */

.support-panel {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: none;
}

.support-panel.active {
  display: block;
}

.support-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 7, 0.52);
  animation: support-fade 0.18s ease both;
}

.support-panel__sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 60px rgba(5, 8, 7, 0.5);
  animation: support-rise 0.24s cubic-bezier(0.32, 0.72, 0.24, 1) both;
  overflow: hidden;
}

.support-panel__head {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.support-panel__head-copy {
  flex: 1;
  min-width: 0;
}

.support-panel__title {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--ink);
}

.support-panel__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 18px 20px;
}

@keyframes support-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes support-rise {
  from {
    transform: translateY(26px);
    opacity: 0.4;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.support-section {
  margin-top: 4px;
}

.support-section + .support-section {
  margin-top: 18px;
}

.support-section__head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
}

.support-section__head .icon {
  width: 16px;
  height: 16px;
  color: var(--green-700);
}

.support-section__head h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.support-faq {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  overflow: hidden;
}

.support-faq details + details {
  border-top: 1px solid var(--line);
}

.support-faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
}

.support-faq summary::-webkit-details-marker {
  display: none;
}

.support-faq summary::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--green-700);
  border-bottom: 2px solid var(--green-700);
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.support-faq details[open] summary::after {
  transform: rotate(-135deg);
}

.support-faq details p {
  padding: 0 13px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.support-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  padding: 12px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--white);
}

.support-contact__icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(18, 183, 106, 0.18);
  border: 1px solid rgba(18, 183, 106, 0.35);
  color: var(--green-300);
}

.support-contact__icon .icon {
  width: 18px;
  height: 18px;
}

.support-contact__copy {
  flex: 1;
  min-width: 0;
}

.support-contact__copy strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.support-advisor {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 20px;
  background: var(--ink);
  border: 1px solid rgba(18, 183, 106, 0.28);
}

.support-advisor__copy strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--white);
}

.support-advisor__copy small {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--green-200);
}

.support-advisor__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  background: var(--green-500);
  box-shadow: 0 10px 24px rgba(18, 183, 106, 0.28);
  touch-action: manipulation;
  transition: transform 0.12s, background 0.15s;
}

.support-advisor__btn:hover {
  background: var(--green-400);
}

.support-advisor__btn:active {
  transform: scale(0.98);
}

.support-advisor__btn .icon {
  width: 19px;
  height: 19px;
}

.support-contact__mail {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green-300);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.support-contact__call {
  flex: none;
  min-height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  background: var(--green-700);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
}

.support-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.support-form label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.support-form textarea {
  min-height: 92px;
  resize: vertical;
}

.support-submit {
  width: 100%;
  margin-top: 4px;
}

.support-hint {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted-2);
}

/* ============================================================
   Bloc Offline
   ============================================================ */

.bloc-composer {
  padding: 16px;
  border-radius: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.bloc-composer .field-input {
  min-height: 118px;
  resize: none;
}

.bloc-composer .field-tools {
  margin-top: 10px;
}

.bloc-composer .bloc-save {
  flex: 1;
  width: auto;
  min-height: 52px;
  min-width: 0;
  padding: 0 12px;
  font-size: 12.5px;
  gap: 6px;
  white-space: nowrap;
}

.bloc-composer .bloc-save .icon {
  width: 16px;
  height: 16px;
}

.bloc-composer .tool-btn {
  flex: none;
  padding: 0 12px;
}

.bloc-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 11px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted-2);
}

.bloc-hint .icon {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--green-700);
}

.bloc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bloc-note {
  padding: 13px 14px;
  border-radius: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.bloc-note--converted {
  background: var(--green-50);
  border-color: var(--green-200);
}

.bloc-note__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bloc-note__time {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.bloc-note__badge {
  flex: none;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bloc-note__badge--converted {
  background: var(--green-700);
  border-color: var(--green-700);
  color: var(--white);
}

.bloc-note__text {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bloc-note__actions {
  display: flex;
  gap: 8px;
  margin-top: 11px;
}

.bloc-action {
  flex: 1;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bloc-action .icon {
  width: 14px;
  height: 14px;
}

.bloc-action--primary {
  background: var(--green-700);
  border-color: var(--green-700);
  color: var(--white);
}

.bloc-action--danger {
  color: var(--muted);
  background: var(--white);
}

.bloc-action--danger:active {
  background: var(--paper);
}

/* ============================================================
   Encargado de área: personal y turnos
   ============================================================ */

.supervisor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.supervisor-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 20px;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.13s, border-color 0.15s;
}

.supervisor-card:active {
  transform: scale(0.985);
  border-color: var(--green-300);
}

.supervisor-card__icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  color: var(--green-700);
}

.supervisor-card__icon .icon {
  width: 19px;
  height: 19px;
}

.supervisor-card strong {
  flex: 1;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.supervisor-card > span:not(.supervisor-card__icon) {
  display: block;
  width: 100%;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted-2);
}

.supervisor-card > .icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--green-700);
}

.staff-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.staff-summary__item {
  padding: 13px 10px;
  border-radius: 18px;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.staff-summary__item strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.staff-summary__item span {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
}

.staff-nav {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
}

.staff-form-card {
  padding: 16px;
  border-radius: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.staff-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.staff-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.staff-field--wide {
  grid-column: 1 / -1;
}

.staff-field .field-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted-2);
}

.staff-field .field-label .icon {
  display: none;
}

.staff-field .field-input {
  min-height: 46px;
  padding: 11px 12px;
  font-size: 14px;
}

.staff-submit {
  grid-column: 1 / -1;
  min-height: 50px;
}

.staff-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.staff-group {
  border-radius: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.staff-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  background: var(--green-50);
  border-bottom: 1px solid var(--green-100);
}

.staff-group__title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
}

.staff-group__title .icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--green-700);
}

.staff-group__count {
  flex: none;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--green-700);
}

.staff-group__body {
  padding: 4px 14px 8px;
}

.staff-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.staff-row:last-child {
  border-bottom: 0;
}

.staff-avatar {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  color: var(--green-800);
  font-size: 13px;
  font-weight: 800;
}

.staff-copy {
  flex: 1 1 120px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.staff-copy strong {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
}

.staff-meta {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.staff-meta--time {
  font-size: 10.5px;
  color: var(--muted-2);
}

.staff-row__side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.staff-row__actions {
  display: flex;
  gap: 6px;
}

.staff-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.staff-status--active {
  background: var(--green-700);
  color: var(--white);
}

.staff-status--missing {
  background: var(--ink);
  color: var(--green-300);
}

.staff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--green-800);
  font-size: 11.5px;
  font-weight: 800;
  transition: transform 0.12s, background 0.15s;
}

.staff-btn .icon {
  width: 15px;
  height: 15px;
}

.staff-btn:active {
  transform: scale(0.96);
  background: var(--green-50);
}

.staff-btn--icon {
  width: 44px;
  padding: 0;
}

.staff-btn--danger {
  color: var(--muted);
}

.staff-empty {
  margin: 10px 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted-2);
}

.board-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.board-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 8px;
  border-radius: 18px;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.board-stat__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 11px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  color: var(--green-700);
}

.board-stat__icon .icon {
  width: 17px;
  height: 17px;
}

.board-stat strong {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.board-stat > span:last-child {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted-2);
}

.shift-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.shift-card {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 20px;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.13s, border-color 0.15s, background 0.15s;
}

.shift-card:active {
  transform: scale(0.985);
}

.shift-card--active {
  background: var(--green-50);
  border-color: var(--green-300);
}

.shift-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.shift-card__label {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
}

.shift-card__window {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted-2);
}

.shift-card__value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 10px;
}

.shift-card__value strong {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.shift-card__value span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.shift-card__bar {
  height: 8px;
  margin-top: 11px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  overflow: hidden;
}

.shift-card__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-700), var(--green-500));
  transition: width 0.3s ease;
}

.shift-card__foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
}

.shift-card__foot span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.shift-card__foot .icon {
  width: 13px;
  height: 13px;
  color: var(--green-700);
}

.metrics-mix__fill--area {
  background: var(--green-500);
}

.board-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.board-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.board-row--missing {
  background: var(--paper);
}

.board-row .staff-status {
  margin-left: auto;
}

/* ============================================================
   Alertas
   ============================================================ */

.alert-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  text-align: left;
  width: 100%;
  transition: transform 0.13s, border-color 0.13s;
}

button.alert-card:active {
  transform: scale(0.985);
  border-color: var(--green-300);
}

.alert-card--critical {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.alert-card--warn {
  background: var(--green-50);
  border-color: var(--green-200);
}

.alert-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--green-100);
}

.alert-icon .icon {
  width: 19px;
  height: 19px;
}

.alert-card--critical .alert-icon {
  background: rgba(18, 183, 106, 0.18);
  color: var(--green-300);
  border-color: rgba(18, 183, 106, 0.32);
}

.alert-card--warn .alert-icon {
  background: var(--white);
}

.alert-copy {
  flex: 1;
  min-width: 0;
}

.alert-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.sev {
  flex: none;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--green-700);
  color: var(--white);
}

.alert-card--warn .sev {
  background: var(--green-200);
  color: var(--green-900);
}

.alert-card--critical .sev {
  background: var(--green-500);
}

.alert-detail {
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.alert-card--critical .alert-detail {
  color: var(--green-200);
}

.alert-time {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
}

.alert-time .icon {
  width: 14px;
  height: 14px;
}

.alert-card--critical .alert-time {
  color: var(--green-300);
}

.alert-arrow {
  width: 32px;
  height: 32px;
  flex: none;
  align-self: center;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--green-700);
}

.alert-card--critical .alert-arrow {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--green-300);
}

.alert-arrow .icon {
  width: 16px;
  height: 16px;
}

/* ============================================================
   Pendientes
   ============================================================ */

.pending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pending-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-radius: 18px;
  background: var(--white);
  border: 1px solid var(--line);
}

.pending-row--done {
  opacity: 0.62;
}

.pending-check {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 9px;
  border: 1.8px solid var(--green-600);
  background: var(--white);
  display: grid;
  place-items: center;
  color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pending-check .icon {
  width: 15px;
  height: 15px;
}

.pending-row--done .pending-check {
  background: var(--green-700);
  border-color: var(--green-700);
  color: var(--white);
}

.pending-copy {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink);
}

.pending-row--done .pending-copy {
  text-decoration: line-through;
  color: var(--muted);
}

.pending-prio {
  flex: none;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
}

.prio-alta {
  background: var(--ink);
  color: var(--green-300);
}

.prio-media {
  background: var(--green-100);
  color: var(--green-800);
}

.prio-baja {
  background: var(--paper);
  color: var(--muted);
  border: 1px solid var(--line);
}

.pending-remove {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: transform 0.12s;
}

.pending-remove:active {
  transform: scale(0.92);
}

.pending-remove .icon {
  width: 16px;
  height: 16px;
}

/* ============================================================
   Último cierre
   ============================================================ */

.close-card {
  padding: 15px;
  border-radius: 20px;
  background: linear-gradient(150deg, var(--white), var(--green-50));
  border: 1px solid var(--green-200);
}

.close-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.close-head .icon {
  width: 19px;
  height: 19px;
  color: var(--green-700);
}

.close-head strong {
  font-size: 14px;
  font-weight: 800;
}

.close-head time {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.close-summary {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.close-foot {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.close-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--green-800);
  background: var(--white);
  border: 1px solid var(--green-200);
  padding: 5px 9px;
  border-radius: 999px;
}

/* ============================================================
   Estados vacíos
   ============================================================ */

.empty {
  padding: 32px 20px;
  text-align: center;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: 22px;
}

.empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--green-50);
  color: var(--green-600);
  border: 1px solid var(--green-100);
}

.empty-icon .icon {
  width: 25px;
  height: 25px;
}

.empty h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.empty p {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

/* ============================================================
   Entrega de turno
   ============================================================ */

.field-card {
  padding: 16px;
  border-radius: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.field-label .icon {
  width: 18px;
  height: 18px;
  color: var(--green-600);
}

.field-meta {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted-2);
  white-space: nowrap;
}

.field-input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 16px;
  padding: 14px;
  font-size: 15px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field-input:focus {
  border-color: var(--green-500);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.12);
}

.field-input::placeholder {
  color: var(--muted-2);
}

textarea.field-input {
  min-height: 132px;
  resize: none;
}

.field-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green-800);
  transition: transform 0.12s, background 0.15s;
}

.tool-btn:active {
  transform: scale(0.96);
}

.tool-btn.is-listening {
  background: var(--ink);
  color: var(--green-300);
  border-color: var(--ink);
}

.tool-btn .icon {
  width: 17px;
  height: 17px;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 11px 2px 2px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  flex: none;
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--green-800);
  white-space: nowrap;
  transition: background 0.15s;
}

.quick-chip:active {
  background: var(--green-50);
}

.dictation-preview {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--green-800);
}

.dictation-preview.is-visible {
  display: block;
}

.dictation-preview strong {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--green-700);
  margin-bottom: 3px;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.composer-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer .field-input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
}

.composer-mic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 15px;
  border: 1px solid var(--green-200);
  background: var(--green-50);
  color: var(--green-800);
  transition: transform 0.12s, background 0.15s, color 0.15s, border-color 0.15s;
}

.composer-mic .icon {
  width: 20px;
  height: 20px;
}

.composer-mic:hover {
  background: var(--green-100);
}

.composer-mic:active {
  transform: scale(0.96);
}

.composer-mic.is-listening {
  background: var(--ink);
  border-color: var(--green-700);
  color: var(--green-300);
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.16);
}

.composer .composer-add {
  flex: none;
  width: 52px;
  min-width: 52px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 15px;
}

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.seg button {
  min-width: 0;
  height: 44px;
  padding: 0 11px;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.seg button.is-active {
  background: var(--green-700);
  border-color: var(--green-700);
  color: var(--white);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 56px;
  padding: 15px 20px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--green-700), var(--green-800));
  color: var(--white);
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: 0 14px 28px rgba(11, 122, 70, 0.3);
  transition: transform 0.12s, box-shadow 0.12s;
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 8px 18px rgba(11, 122, 70, 0.28);
}

.btn-primary .icon {
  width: 20px;
  height: 20px;
}

.close-card {
  padding: 18px;
  border-radius: 24px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow-lg);
}

button.close-card {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

button.alert-card {
  cursor: pointer;
}

button.pending-check {
  cursor: pointer;
}

.close-card h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.close-card h3 .icon {
  width: 20px;
  height: 20px;
  color: var(--green-400);
}

.close-card > p {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--green-200);
}

.close-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 16px;
}

.close-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--green-200);
}

.close-item .icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--green-400);
}

.close-item span {
  flex: 1;
  min-width: 0;
}

/* Bitácora */
.log-list {
  display: flex;
  flex-direction: column;
}

.log-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding-bottom: 14px;
}

.log-item:last-child {
  padding-bottom: 0;
}

.log-item::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 38px;
  bottom: 0;
  width: 1.5px;
  background: var(--line);
}

.log-item:last-child::before {
  display: none;
}

.log-icon {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--green-100);
}

.log-icon .icon {
  width: 17px;
  height: 17px;
}

.log-icon--cierre {
  background: var(--ink);
  color: var(--green-300);
  border-color: var(--ink);
}

.log-copy {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.log-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.log-copy p {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.log-time {
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted-2);
}

/* ============================================================
   Historial y buscador
   ============================================================ */

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.search-bar .icon {
  width: 21px;
  height: 21px;
  color: var(--green-600);
}

.search-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  padding: 14px 0;
}

.search-bar input::placeholder {
  color: var(--muted-2);
}

.search-clear {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--muted);
}

.search-clear .icon {
  width: 15px;
  height: 15px;
}

.filter-row {
  display: flex;
  gap: 8px;
}

.filter-chip {
  flex: 1;
  min-height: 42px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.search-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-2);
}

.search-hint .icon {
  width: 15px;
  height: 15px;
  color: var(--green-600);
}

.result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.result-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-group__title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  padding-left: 2px;
}

.result-group__title .icon {
  width: 16px;
  height: 16px;
  color: var(--green-600);
}

.result-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px;
  text-align: left;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, border-color 0.12s;
}

.result-card:active {
  transform: scale(0.985);
  border-color: var(--green-300);
}

.result-icon {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--green-100);
}

.result-icon .icon {
  width: 20px;
  height: 20px;
}

.result-card--report .result-icon {
  background: var(--ink);
  color: var(--green-300);
  border-color: var(--ink);
}

.result-copy {
  flex: 1;
  min-width: 0;
}

.result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.result-title .id {
  color: var(--green-700);
  font-variant-numeric: tabular-nums;
}

.result-sub {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.result-detail {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.status-pill {
  flex: none;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--green-100);
  color: var(--green-800);
}

.status-pill--critical {
  background: var(--ink);
  color: var(--green-300);
}

.status-pill--warn {
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--green-200);
}

.status-pill--done {
  background: var(--paper);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* ============================================================
   Chat asistente
   ============================================================ */

.chat-scrim {
  position: absolute;
  inset: 0;
  z-index: 45;
  background: rgba(5, 8, 7, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.chat-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

.chat-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: min(82%, 680px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 60px rgba(5, 8, 7, 0.5);
  transform: translateY(103%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0.24, 1);
  overflow: hidden;
}

.chat-panel.is-open {
  transform: translateY(0);
}

.chat-grabber {
  width: 44px;
  height: 4px;
  flex: none;
  margin: 8px auto 4px;
  border-radius: 999px;
  background: var(--line);
}

.chat-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 14px 12px;
  background: linear-gradient(150deg, var(--green-700), var(--green-900));
  color: var(--white);
}

.chat-avatar {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.chat-avatar .icon {
  width: 21px;
  height: 21px;
}

.chat-head-copy {
  flex: 1;
  min-width: 0;
}

.chat-head-copy strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

.chat-head-copy small {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green-200);
}

.chat-close {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.chat-close .icon {
  width: 18px;
  height: 18px;
}

.chat-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--paper);
  background-image: radial-gradient(rgba(18, 183, 106, 0.07) 1px, transparent 1px);
  background-size: 16px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--green-200) transparent;
}

.msg {
  max-width: 87%;
  min-height: 0;
  flex: none;
  padding: 11px 13px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  animation: msg-in 0.22s ease both;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.msg--bot {
  align-self: flex-start;
  background: var(--white);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

.msg--user {
  align-self: flex-end;
  background: linear-gradient(145deg, var(--green-700), var(--green-800));
  color: var(--white);
  border-bottom-right-radius: 6px;
  box-shadow: 0 6px 16px rgba(11, 122, 70, 0.25);
}

.msg time {
  display: block;
  margin-top: 5px;
  font-size: 9.5px;
  font-weight: 700;
  opacity: 0.65;
}

.msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.msg-action {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--green-800);
  background: var(--green-50);
  border: 1px solid var(--green-200);
  padding: 8px 11px;
  border-radius: 999px;
}

.msg-action:active {
  background: var(--green-100);
}

.msg--chips {
  max-width: 100%;
  width: 100%;
}
.msg-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  margin-top: 10px;
}

.msg-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 13px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--green-800);
  background: var(--paper);
  border: 1px solid var(--line);
  transition: background 0.15s, transform 0.12s, border-color 0.15s;
}

.msg-chip:hover {
  background: var(--green-50);
  border-color: var(--green-200);
}

.msg-chip:active {
  transform: scale(0.985);
  background: var(--green-100);
}

.typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 13px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-400);
  animation: typing 1s infinite;
}

.typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.chat-suggest {
  flex: none;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 8px 14px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  scrollbar-width: none;
}

.chat-suggest::-webkit-scrollbar {
  display: none;
}

.chat-composer {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px calc(12px + var(--safe-bottom));
  background: var(--white);
  border-top: 1px solid var(--line);
}

.chat-input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 16px;
  padding: 0 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.chat-input:focus {
  border-color: var(--green-500);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.1);
}

.chat-input::placeholder {
  color: var(--muted-2);
}

.chat-send {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--green-700);
  color: var(--white);
  box-shadow: 0 8px 18px rgba(11, 122, 70, 0.28);
  transition: transform 0.12s;
}

.chat-send:active {
  transform: scale(0.93);
}

.chat-send .icon {
  width: 20px;
  height: 20px;
}

.chat-mic {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--green-700);
  transition: background 0.15s;
}

.chat-mic.is-listening {
  background: var(--ink);
  color: var(--green-300);
  border-color: var(--ink);
}

.chat-mic .icon {
  width: 20px;
  height: 20px;
}

/* ============================================================
   Modales
   ============================================================ */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: end center;
  padding: 0;
  background: rgba(5, 8, 7, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}

.overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 100%;
  max-height: 88%;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 60px rgba(5, 8, 7, 0.5);
  transform: translateY(26px);
  transition: transform 0.22s ease;
  overflow: hidden;
}

.overlay.is-open .modal {
  transform: translateY(0);
}

.modal-grabber {
  width: 44px;
  height: 4px;
  flex: none;
  margin: 8px auto 4px;
  border-radius: 999px;
  background: var(--line);
}

.modal-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.modal-head-copy {
  flex: 1;
  min-width: 0;
}

.modal-eyebrow {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--green-700);
}

.modal-title {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--ink);
}

.modal-close {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
}

.modal-close .icon {
  width: 17px;
  height: 17px;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  scrollbar-width: thin;
}

.modal-actions {
  flex: none;
  display: flex;
  gap: 9px;
  padding: 12px 18px calc(14px + var(--safe-bottom));
  background: var(--white);
  border-top: 1px solid var(--line);
}

.modal-actions .btn-primary {
  min-height: 52px;
}

.modal-actions .btn-soft:only-child {
  flex: 1;
}

.modal--critical {
  background: var(--black);
  border: 1px solid rgba(18, 183, 106, 0.42);
  color: var(--white);
}

.modal--critical .modal-grabber {
  background: rgba(255, 255, 255, 0.2);
}

.modal--critical .modal-head {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.modal--critical .modal-eyebrow {
  color: var(--green-300);
}

.modal--critical .modal-title {
  color: var(--white);
}

.modal--critical .modal-close {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--green-100);
}

.modal--critical .modal-actions {
  background: var(--black);
  border-top-color: rgba(255, 255, 255, 0.12);
}

.modal--critical .btn-primary {
  box-shadow: 0 14px 30px rgba(18, 183, 106, 0.34);
}

.critical-alert {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.critical-alert__mark {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: rgba(18, 183, 106, 0.14);
  border: 1px solid rgba(18, 183, 106, 0.42);
  color: var(--green-300);
}

.critical-alert__mark .icon {
  width: 24px;
  height: 24px;
}

.critical-alert__copy {
  min-width: 0;
}

.critical-alert__detail {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.critical-alert__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.critical-alert__chip,
.critical-alert__time,
.critical-alert__place {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.critical-alert__chip {
  background: var(--green-500);
  color: var(--black);
}

.critical-alert__time,
.critical-alert__place {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--green-100);
}

.critical-alert__meta .icon {
  width: 13px;
  height: 13px;
}

.critical-alert__case {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
}

.critical-alert__hint {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.66);
}

.btn-soft {
  flex: none;
  min-width: 52px;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.btn-soft:active {
  background: var(--green-50);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 14px;
}

.detail-cell {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.detail-cell span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.detail-cell strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}

.detail-section {
  margin-top: 17px;
}

.detail-section h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.detail-section h4 .icon {
  width: 16px;
  height: 16px;
  color: var(--green-600);
}

.detail-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
}

.resolution-hint {
  margin-bottom: 9px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.resolution-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resolution-field textarea.field-input {
  min-height: 112px;
}

.resolution-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.resolution-tools .field-meta {
  flex: none;
}

.resolution-card {
  padding: 13px 14px;
  border-radius: 16px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
}

.resolution-card .detail-text {
  color: var(--green-800);
}

.resolution-meta {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--green-700);
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding-left: 21px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: var(--green-100);
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 0 3px var(--green-50);
}

.timeline-time {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--green-700);
}

.timeline-text {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}

.success-mark {
  width: 62px;
  height: 62px;
  margin: 4px auto 14px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: var(--green-50);
  color: var(--green-600);
  border: 1px solid var(--green-100);
}

.success-mark .icon {
  width: 30px;
  height: 30px;
}

.success-title {
  text-align: center;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.success-sub {
  margin-top: 7px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.report-id {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 12px auto 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--green-300);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.report-id .icon {
  width: 15px;
  height: 15px;
}

/* ============================================================
   Toasts
   ============================================================ */

.toast-root {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(168px + var(--safe-bottom));
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(5, 8, 7, 0.4);
  animation: toast-in 0.22s ease both;
}

.toast .icon {
  width: 17px;
  height: 17px;
  color: var(--green-400);
}

.toast.is-leaving {
  animation: toast-out 0.2s ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ============================================================
   Responsive y accesibilidad
   ============================================================ */

@container app (max-width: 400px) {
  .header-shift__label {
    display: none;
  }

  .header-shift {
    padding: 8px 9px;
  }
}

@container app (max-width: 380px) {
  .nav-item {
    font-size: 10.5px;
    padding: 7px 2px 5px;
  }

  .nav-item .icon {
    width: 20px;
    height: 20px;
  }

  .staff-form {
    grid-template-columns: 1fr;
  }

  .chat-suggest {
    padding: 6px 10px;
    gap: 5px;
  }

  .quick-chip {
    padding: 8px 11px;
    font-size: 11px;
  }

  .chat-body {
    padding: 10px 10px 6px;
    gap: 8px;
  }

  .msg {
    padding: 9px 11px;
    font-size: 13px;
  }

  .msg-chip {
    min-height: 42px;
    padding: 9px 11px;
    font-size: 11.5px;
  }
}

@container app (max-width: 340px) {
  .header-copy small {
    display: none;
  }
}

@media (min-width: 600px) {
  body {
    padding: 18px 0;
  }
  .app-shell {
    height: calc(100vh - 36px);
    height: calc(100dvh - 36px);
    height: calc(var(--vvh, 100dvh) - 36px);
    border-radius: 34px;
    border: 1px solid rgba(18, 183, 106, 0.18);
  }

  .chat-fab {
    bottom: calc(92px + var(--safe-bottom));
  }
}

@media (max-width: 360px) {
  .select-hero h1 {
    font-size: 34px;
  }

  .hero-value strong {
    font-size: 46px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .header-copy small {
    display: none;
  }

  .header-shift {
    display: none;
  }

  .access-screen {
    padding-left: 14px;
    padding-right: 14px;
  }

  .access-hero {
    padding: 18px;
  }

  .access-hero h1 {
    font-size: 24px;
  }

  .access-card {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
