/* === Page Background Radial Glow === */
body:not(.login-body) .main {
  background:
    radial-gradient(ellipse 600px 400px at 100% 0%, rgba(139,92,246,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 500px 350px at 0% 100%, rgba(30,58,186,0.04) 0%, transparent 70%),
    var(--edge-bg);
}

/* === HOSPIN Gradient Button === */
.btn--hospin {
  background: var(--hospin-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(30,58,186,0.25);
}
.btn--hospin:hover {
  background: var(--hospin-gradient-hover);
  box-shadow: 0 4px 16px rgba(30,58,186,0.35);
}

/* === KPI tier labels === */
.kpi-tier-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--edge-muted);
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.kpi-tier-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--edge-border);
}

/* === Executive KPI (larger, hero style) === */
.kpi-card--exec {
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
}
.kpi-card--exec .kpi-card__value { font-size: clamp(1.375rem, 2vw, 1.875rem); }

/* === Status Bar (top of page) === */
.status-bar {
  background: var(--edge-navy);
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 var(--sp-6);
  height: 36px;
  font-size: 0.75rem;
  font-weight: 500;
  flex-shrink: 0;
}
.status-bar__item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
  border-right: 1px solid rgba(255,255,255,0.1);
  height: 100%;
}
.status-bar__item:first-child { padding-left: 0; }
.status-bar__item strong { color: #fff; font-weight: 600; }
.status-bar__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--edge-green);
  animation: pulse-live 2s infinite;
}
.status-bar__sync { margin-left: auto; padding-right: 0; border-right: none; }

/* === Saúde Operacional Badge === */
.health-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--edge-surface);
  border: 1.5px solid var(--edge-border);
  border-radius: var(--r-full);
  padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-2);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--edge-text);
  cursor: pointer;
  transition: border-color var(--dur), box-shadow var(--dur);
  position: relative;
}
.health-badge:hover { border-color: var(--edge-green); box-shadow: 0 2px 8px rgba(34,197,94,0.1); }
.health-badge__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--edge-green);
  animation: pulse-live 2.5s infinite;
}
.health-badge__label { color: var(--edge-muted); font-weight: 500; font-size: 0.75rem; }

.health-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-4);
  min-width: 220px;
  z-index: 100;
  display: none;
}
.health-badge.is-open .health-panel { display: block; }
.health-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--edge-border);
  font-size: 0.8125rem;
}
.health-row:last-child { border-bottom: none; }
.health-row__label { color: var(--edge-muted); flex: 1; }
.health-row__value { font-weight: 700; color: var(--edge-text); }
.health-row__bar { width: 60px; height: 4px; background: var(--edge-border); border-radius: var(--r-full); overflow: hidden; }
.health-row__fill { height: 100%; border-radius: var(--r-full); background: var(--edge-green); }

/* === Timeline Events === */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--edge-border);
  animation: fade-in-event 0.3s ease;
  transition: background var(--dur);
}
.timeline-item:hover { background: var(--edge-bg); }
.timeline-item:last-child { border-bottom: none; }
.timeline-item__left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  width: 48px;
}
.timeline-item__icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.timeline-item__time {
  font-size: 0.625rem;
  color: var(--edge-subtle);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.timeline-item__line {
  width: 2px; flex: 1;
  background: var(--edge-border);
  border-radius: 1px;
  min-height: 12px;
}
.timeline-item__body { flex: 1; min-width: 0; }
.timeline-item__type {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.timeline-item__title { font-size: 0.8125rem; font-weight: 600; color: var(--edge-text); }
.timeline-item__sub { font-size: 0.75rem; color: var(--edge-muted); margin-top: 1px; }

.timeline-item--red    .timeline-item__icon { background: var(--edge-red-light);    color: var(--edge-red); }
.timeline-item--amber  .timeline-item__icon { background: var(--edge-amber-light);  color: var(--edge-amber); }
.timeline-item--green  .timeline-item__icon { background: var(--edge-green-light);  color: #15803D; }
.timeline-item--blue   .timeline-item__icon { background: var(--edge-blue-light);   color: var(--edge-blue); }
.timeline-item--red    .timeline-item__type { color: var(--edge-red); }
.timeline-item--amber  .timeline-item__type { color: var(--edge-amber); }
.timeline-item--green  .timeline-item__type { color: #15803D; }
.timeline-item--blue   .timeline-item__type { color: var(--edge-blue); }

/* === Team Panel === */
.team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.team-card {
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-xs);
}
.team-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.team-card__label { font-size: 0.75rem; font-weight: 700; color: var(--edge-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.team-card__count { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; }
.team-card__sub { font-size: 0.6875rem; color: var(--edge-muted); margin-top: var(--sp-1); line-height: 1.4; }

/* === Automações Panel === */
.auto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.auto-card {
  background: var(--edge-bg);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
}
.auto-card__label { font-size: 0.75rem; color: var(--edge-muted); font-weight: 500; margin-bottom: var(--sp-1); }
.auto-card__value { font-size: 1.25rem; font-weight: 800; color: var(--edge-text); letter-spacing: -0.02em; }
.auto-card__sub { font-size: 0.6875rem; color: var(--edge-muted); margin-top: 2px; }

/* === Mini Kanban (Fluxos Críticos inline) === */
.mini-flow {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
}
.mini-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  flex: 1;
}
.mini-stage__count {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.mini-stage__label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--edge-muted);
  text-align: center;
  margin-top: 2px;
}
.mini-stage__bar {
  width: 36px; height: 4px;
  border-radius: var(--r-full);
  margin-top: 6px;
}
.mini-arrow {
  color: var(--edge-border-mid);
  font-size: 1rem;
  flex-shrink: 0;
  padding: 0 4px;
  margin-bottom: 16px;
}

/* === Mobile Apps mini grid === */
.mobile-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2);
}
.mobile-mini-card {
  background: var(--edge-bg);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-2);
  text-align: center;
  cursor: pointer;
  transition: all var(--dur);
}
.mobile-mini-card:hover { border-color: var(--edge-blue); background: var(--edge-blue-light); }
.mobile-mini-card__icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  margin: 0 auto var(--sp-2);
  display: grid; place-items: center;
}
.mobile-mini-card__label { font-size: 0.6875rem; font-weight: 600; color: var(--edge-text-mid); }

/* === KPI Cards === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}

.kpi-card {
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--edge-border-mid);
}

.kpi-card__icon {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  margin-bottom: var(--sp-2);
}

.kpi-card__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--edge-muted);
  margin-bottom: var(--sp-1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-card__value {
  font-size: clamp(1.125rem, 1.6vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--edge-text);
  line-height: 1;
}

.kpi-card__delta {
  margin-top: var(--sp-2);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.kpi-card__delta--good { color: var(--edge-green); }
.kpi-card__delta--warn { color: var(--edge-amber); }
.kpi-card__delta--bad  { color: var(--edge-red); }
.kpi-card__delta--neutral { color: var(--edge-muted); }

/* === Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.6;
}
.badge--green  { background: var(--edge-green-light);  color: #15803D; }
.badge--blue   { background: var(--edge-blue-light);   color: var(--edge-blue); }
.badge--amber  { background: var(--edge-amber-light);  color: #B45309; }
.badge--red    { background: var(--edge-red-light);    color: #B91C1C; }
.badge--purple { background: var(--edge-purple-light); color: #6D28D9; }
.badge--orange { background: var(--edge-orange-light); color: #C2410C; }
.badge--gray   { background: var(--edge-border);       color: var(--edge-muted); }

.badge__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge--green  .badge__dot { background: var(--edge-green); }
.badge--blue   .badge__dot { background: var(--edge-blue); }
.badge--amber  .badge__dot { background: var(--edge-amber); }
.badge--red    .badge__dot { background: var(--edge-red); }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.5rem var(--sp-4);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--dur) var(--ease);
  line-height: 1;
}
.btn--primary {
  background: var(--edge-blue);
  color: #fff;
  border: 1px solid var(--edge-blue);
}
.btn--primary:hover { background: var(--edge-blue-mid); }

.btn--ghost {
  background: transparent;
  color: var(--edge-muted);
  border: 1px solid var(--edge-border);
}
.btn--ghost:hover {
  background: var(--edge-surface);
  color: var(--edge-text);
  border-color: var(--edge-border-mid);
}
.btn--sm { padding: 0.375rem var(--sp-3); font-size: 0.8125rem; }
.btn--danger { background: var(--edge-red); color: #fff; border-color: var(--edge-red); }
.btn--green { background: var(--edge-green); color: #fff; border-color: var(--edge-green); }

/* === Card === */
.card {
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--edge-border);
}
.card__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--edge-text);
}
.card__body { padding: var(--sp-4) var(--sp-5); }

/* === Cockpit Cards (Centro Operacional) === */
.cockpit-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-4);
}

.cockpit-card {
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-3);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--edge-border);
  transition: box-shadow var(--dur);
}
.cockpit-card:hover { box-shadow: var(--shadow-md); }

.cockpit-card--red    { border-left-color: var(--edge-red); }
.cockpit-card--orange { border-left-color: var(--edge-orange); }
.cockpit-card--amber  { border-left-color: var(--edge-amber); }
.cockpit-card--green  { border-left-color: var(--edge-green); }
.cockpit-card--blue   { border-left-color: var(--edge-blue); }
.cockpit-card--purple { border-left-color: var(--edge-purple); }

.cockpit-card__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--edge-muted);
  margin-bottom: var(--sp-2);
}

.cockpit-card__value {
  font-size: clamp(1.375rem, 1.8vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.cockpit-card--red    .cockpit-card__value { color: var(--edge-red); }
.cockpit-card--orange .cockpit-card__value { color: var(--edge-orange); }
.cockpit-card--green  .cockpit-card__value { color: var(--edge-green); }
.cockpit-card--blue   .cockpit-card__value { color: var(--edge-blue); }
.cockpit-card--purple .cockpit-card__value { color: var(--edge-purple); }

.cockpit-card__sub {
  font-size: 0.75rem;
  color: var(--edge-muted);
  margin-top: var(--sp-2);
  line-height: 1.4;
}

/* === Event Feed === */
.event-feed { display: flex; flex-direction: column; gap: 0; }

.event-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--edge-border);
  transition: background var(--dur);
  animation: fade-in-event 0.3s ease;
}
.event-row:hover { background: var(--edge-bg); }
.event-row:last-child { border-bottom: none; }

@keyframes fade-in-event {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.event-dot--red    { background: var(--edge-red); }
.event-dot--amber  { background: var(--edge-amber); }
.event-dot--green  { background: var(--edge-green); }
.event-dot--blue   { background: var(--edge-blue); }

.event-text {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--edge-text-mid);
  line-height: 1.4;
}
.event-text strong { color: var(--edge-text); font-weight: 600; }
.event-time {
  font-size: 0.6875rem;
  color: var(--edge-subtle);
  flex-shrink: 0;
  margin-top: 2px;
}

/* === Progress Bars === */
.progress-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.progress-row__label {
  font-size: 0.8125rem;
  color: var(--edge-text-mid);
  font-weight: 500;
  min-width: 140px;
}
.progress-row__bar {
  flex: 1;
  height: 6px;
  background: var(--edge-border);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-row__fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--edge-blue);
  transition: width 0.5s var(--ease);
}
.progress-row__pct {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--edge-text);
  min-width: 36px;
  text-align: right;
}
.progress-row__kwh {
  font-size: 0.75rem;
  color: var(--edge-muted);
  min-width: 64px;
  text-align: right;
}

/* === Sensor Cards === */
.sensor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}

.sensor-card {
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  box-shadow: var(--shadow-xs);
}

.sensor-card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.sensor-card__count {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--edge-text);
  letter-spacing: -0.02em;
}
.sensor-card__label {
  font-size: 0.6875rem;
  color: var(--edge-muted);
  font-weight: 500;
}
.sensor-card__status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  color: var(--edge-green);
  font-weight: 600;
}

/* === Toggle Switch === */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle__slider {
  position: absolute;
  inset: 0;
  background: var(--edge-border-mid);
  border-radius: var(--r-full);
  transition: background var(--dur);
  cursor: pointer;
}
.toggle__slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--dur);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle__slider { background: var(--edge-green); }
.toggle input:checked + .toggle__slider::before { transform: translateX(16px); }

/* === Kanban (Fluxo) === */
.kanban-board {
  display: flex;
  gap: var(--sp-3);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  align-items: flex-start;
}

.kanban-col {
  flex: 1;
  min-width: 160px;
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
}

.kanban-col__header {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--edge-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.kanban-col__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kanban-col__count {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.kanban-col__body {
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: 360px;
  overflow-y: auto;
}

.kanban-card {
  background: var(--edge-bg);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.8125rem;
}
.kanban-card__leito {
  font-weight: 700;
  color: var(--edge-text);
}
.kanban-card__setor {
  color: var(--edge-muted);
  font-size: 0.6875rem;
  margin-top: 2px;
}
.kanban-card__time {
  font-size: 0.6875rem;
  font-weight: 600;
  margin-top: var(--sp-1);
}
.kanban-card--ok   .kanban-card__time { color: var(--edge-green); }
.kanban-card--warn .kanban-card__time { color: var(--edge-amber); }
.kanban-card--late .kanban-card__time { color: var(--edge-red); }
.kanban-card--warn { border-color: var(--edge-amber-light); }
.kanban-card--late { border-color: var(--edge-red-light); }

/* Kanban column color themes */
.kanban-col--alta   .kanban-col__header { background: var(--edge-blue-light); }
.kanban-col--alta   .kanban-col__title  { color: var(--edge-blue); }
.kanban-col--alta   .kanban-col__count  { color: var(--edge-blue); }

.kanban-col--transp .kanban-col__header { background: var(--edge-orange-light); }
.kanban-col--transp .kanban-col__title  { color: var(--edge-orange); }
.kanban-col--transp .kanban-col__count  { color: var(--edge-orange); }

.kanban-col--limpeza .kanban-col__header { background: var(--edge-cyan-light); }
.kanban-col--limpeza .kanban-col__title  { color: #0E7490; }
.kanban-col--limpeza .kanban-col__count  { color: #0E7490; }

.kanban-col--check  .kanban-col__header { background: var(--edge-amber-light); }
.kanban-col--check  .kanban-col__title  { color: #B45309; }
.kanban-col--check  .kanban-col__count  { color: #B45309; }

.kanban-col--disp   .kanban-col__header { background: var(--edge-green-light); }
.kanban-col--disp   .kanban-col__title  { color: #15803D; }
.kanban-col--disp   .kanban-col__count  { color: #15803D; }

.kanban-col--nova   .kanban-col__header { background: var(--edge-purple-light); }
.kanban-col--nova   .kanban-col__title  { color: #6D28D9; }
.kanban-col--nova   .kanban-col__count  { color: #6D28D9; }

/* === SLA Metrics Bar === */
.sla-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-4);
}
.sla-item {
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-xs);
}
.sla-item__label {
  font-size: 0.6875rem;
  color: var(--edge-muted);
  font-weight: 500;
  margin-bottom: var(--sp-1);
}
.sla-item__value {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.sla-item__meta {
  font-size: 0.6875rem;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sla-item__meta--ok  { color: var(--edge-green); }
.sla-item__meta--warn { color: var(--edge-amber); }

/* === Gargalo Alert === */
.gargalo-alert {
  background: #FFF7ED;
  border: 1.5px solid #FED7AA;
  border-left: 4px solid var(--edge-amber);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}
.gargalo-alert__icon { color: var(--edge-amber); flex-shrink: 0; margin-top: 1px; }
.gargalo-alert__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #92400E;
}
.gargalo-alert__body {
  font-size: 0.8125rem;
  color: #B45309;
  margin-top: 2px;
  line-height: 1.4;
}

/* === Asset Cards === */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}
.asset-card {
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-xs);
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  transition: box-shadow var(--dur), border-color var(--dur);
}
.asset-card:hover { box-shadow: var(--shadow-md); border-color: var(--edge-border-mid); }
.asset-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--edge-blue-light);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--edge-blue);
}
.asset-card__name { font-size: 0.9375rem; font-weight: 700; color: var(--edge-text); }
.asset-card__loc  { font-size: 0.8125rem; color: var(--edge-muted); margin-top: 2px; }
.asset-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-3);
}
.asset-card__time { font-size: 0.6875rem; color: var(--edge-subtle); }

/* === Phone Frames === */
.phone-frames {
  display: flex;
  gap: var(--sp-5);
  justify-content: center;
  flex-wrap: wrap;
}
.phone-frame {
  width: 220px;
  background: var(--edge-surface);
  border: 2px solid var(--edge-navy);
  border-radius: 28px;
  box-shadow: 0 12px 40px rgba(11,29,58,0.18), 0 4px 8px rgba(11,29,58,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.phone-frame__notch {
  height: 24px;
  background: var(--edge-navy);
  display: flex;
  align-items: center;
  justify-content: center;
}
.phone-frame__notch-dot {
  width: 40px;
  height: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--r-full);
}
.phone-frame__header {
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.875rem;
  font-weight: 700;
  border-bottom: 1px solid var(--edge-border);
}
.phone-frame__body {
  padding: var(--sp-3) var(--sp-4);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

/* === Integration Architecture === */
.arch-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.arch-tier {
  width: 100%;
  max-width: 760px;
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  text-align: center;
}
.arch-tier--his {
  background: var(--edge-border);
  border: 1px solid var(--edge-border-mid);
}
.arch-tier--hospin {
  background: var(--edge-navy);
  color: #fff;
}
.arch-tier--bottom {
  display: flex;
  gap: var(--sp-3);
  background: transparent;
  padding: 0;
}
.arch-tier__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-bottom: var(--sp-2);
}
.arch-tier__systems {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
  flex-wrap: wrap;
}
.arch-sys {
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--edge-text);
}
.arch-tier--hospin .arch-sys {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}
.arch-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-2) 0;
  color: var(--edge-muted);
  gap: 2px;
}
.arch-arrow__line {
  width: 2px;
  height: 24px;
  background: var(--edge-border-mid);
}
.arch-protocols {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: center;
  margin: var(--sp-3) 0;
}
.arch-proto {
  background: var(--edge-blue-light);
  color: var(--edge-blue);
  border: 1px solid rgba(30,58,186,0.2);
  border-radius: var(--r-full);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
}
.arch-bottom-card {
  flex: 1;
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  text-align: center;
  box-shadow: var(--shadow-xs);
}
.arch-bottom-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  margin: 0 auto var(--sp-2);
  display: grid;
  place-items: center;
}
.arch-bottom-card__label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--edge-text);
}
.arch-bottom-card__sub {
  font-size: 0.6875rem;
  color: var(--edge-muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* === VALL IA Chat === */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.chat-bubble {
  max-width: 72%;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-size: 0.9rem;
  line-height: 1.6;
}
.chat-bubble--user {
  background: var(--edge-blue);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: var(--r-xs);
}
.chat-bubble--ai {
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  color: var(--edge-text);
  align-self: flex-start;
  border-bottom-left-radius: var(--r-xs);
  box-shadow: var(--shadow-xs);
}
.chat-bubble__sender {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-1);
}
.chat-bubble--ai .chat-bubble__sender { color: var(--edge-cyan); }
.chat-bubble--user .chat-bubble__sender { color: rgba(255,255,255,0.7); }

.chat-chips {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-6);
  border-bottom: 1px solid var(--edge-border);
}
.chat-chip {
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-full);
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.8125rem;
  color: var(--edge-text-mid);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur);
}
.chat-chip:hover {
  border-color: var(--edge-blue);
  color: var(--edge-blue);
  background: var(--edge-blue-light);
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--edge-border);
  background: var(--edge-surface);
}
.chat-input {
  flex: 1;
  background: var(--edge-bg);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--dur);
}
.chat-input:focus { border-color: var(--edge-blue); }

/* === VALL Bottom Bar === */
.vall-bar {
  background: var(--edge-surface);
  border-top: 1px solid var(--edge-border);
  padding: var(--sp-3) var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.vall-bar__label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--edge-navy);
  white-space: nowrap;
}
.vall-bar__input {
  flex: 1;
  background: var(--edge-bg);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-full);
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--dur);
}
.vall-bar__input:focus { border-color: var(--edge-blue); }
.vall-chips {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: nowrap;
  overflow-x: auto;
}
.vall-chip {
  background: var(--edge-blue-light);
  border: 1px solid rgba(30,58,186,0.15);
  border-radius: var(--r-full);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--edge-blue);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur), border-color var(--dur);
}
.vall-chip:hover { background: var(--edge-blue); color: #fff; }

/* === Sensor Reading Row (Ambientes) === */
.reading-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}
.reading-item {
  background: var(--edge-bg);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.reading-item__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.reading-item__label {
  font-size: 0.75rem;
  color: var(--edge-muted);
  font-weight: 500;
}
.reading-item__value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--edge-text);
}
.reading-item__right { text-align: right; }

/* === Filter Bar === */
.filter-bar {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}
.filter-btn {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-full);
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--edge-border);
  background: var(--edge-surface);
  color: var(--edge-muted);
  cursor: pointer;
  transition: all var(--dur);
}
.filter-btn.is-active,
.filter-btn:hover {
  background: var(--edge-blue);
  border-color: var(--edge-blue);
  color: #fff;
}
.search-input {
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-full);
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.875rem;
  outline: none;
  width: 200px;
  transition: border-color var(--dur);
}
.search-input:focus { border-color: var(--edge-blue); }

/* === Status Chips Row (abaixo do page header) === */
.status-chips-row {
  background: var(--edge-surface);
  border-bottom: 1px solid var(--edge-border);
  padding: var(--sp-2) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-shrink: 0;
}
.status-chips {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 5px var(--sp-3);
  border-radius: var(--r-full);
  background: var(--edge-bg);
  border: 1px solid var(--edge-border);
  font-size: 0.8125rem;
  color: var(--edge-muted);
  white-space: nowrap;
}
.status-chip strong {
  color: var(--edge-text);
  font-weight: 700;
  margin-left: 1px;
}

.vall-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--hospin-gradient);
  color: #fff;
  border-radius: var(--r-full);
  padding: 7px var(--sp-5) 7px var(--sp-4);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(139,92,246,0.25);
  transition: box-shadow var(--dur), transform var(--dur);
  flex-shrink: 0;
}
.vall-hero-btn:hover {
  box-shadow: 0 4px 20px rgba(139,92,246,0.4);
  transform: translateY(-1px);
}

/* === KPI Sparkline === */
.kpi-sparkline { flex-shrink: 0; }

/* === Page Header Extensions (compartilhado entre páginas) === */
.page-sync {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  color: var(--edge-muted);
  white-space: nowrap;
  padding: 5px var(--sp-3);
  border-radius: var(--r-full);
  background: var(--edge-bg);
  border: 1px solid var(--edge-border);
}
.page-sync strong { color: var(--edge-text-mid); font-weight: 600; }

.sistemas-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 5px var(--sp-3);
  border-radius: var(--r-full);
  background: var(--edge-green-light);
  border: 1px solid #BBF7D0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #15803D;
  white-space: nowrap;
}
.sistemas-badge__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--edge-green);
  animation: pulse-live 2s infinite;
}

/* === Botão Filtros === */
.btn--filter {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 7px var(--sp-4);
  border-radius: var(--r-full);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--edge-surface);
  border: 1px solid var(--edge-border);
  color: var(--edge-text-mid);
  cursor: pointer;
  transition: all var(--dur);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn--filter:hover { border-color: var(--edge-border-mid); background: var(--edge-bg); }

/* === Ação sub-header row === */
.page-actions-row {
  background: var(--edge-surface);
  border-bottom: 1px solid var(--edge-border);
  padding: var(--sp-2) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-shrink: 0;
}
.page-actions-right { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }

/* === Table styles (Ativos) === */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--edge-muted);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--edge-border);
  text-align: left;
  white-space: nowrap;
}
.data-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--edge-border);
  font-size: 0.875rem;
  color: var(--edge-text-mid);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--edge-bg); }
.data-table__name { font-weight: 700; color: var(--edge-text); font-size: 0.875rem; }
.data-table__code { font-size: 0.6875rem; color: var(--edge-subtle); margin-top: 1px; }

/* === Health bar (Ativos saúde) === */
.health-bar-wrap { display: flex; align-items: center; gap: var(--sp-2); }
.health-bar {
  flex: 1;
  min-width: 80px;
  height: 5px;
  border-radius: var(--r-full);
  background: var(--edge-border);
  overflow: hidden;
}
.health-bar__fill { height: 100%; border-radius: var(--r-full); }
.health-bar__fill--green  { background: var(--edge-green); }
.health-bar__fill--amber  { background: var(--edge-amber); }
.health-bar__fill--red    { background: var(--edge-red); }

/* === Tab Nav === */
.tab-nav {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 2px solid var(--edge-border);
}
.tab-btn {
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--edge-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--dur), border-color var(--dur);
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab-btn:hover { color: var(--edge-text); }
.tab-btn.is-active { color: var(--edge-blue); border-bottom-color: var(--edge-blue); }

/* === Equipes em campo progress === */
.team-progress-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--edge-border);
}
.team-progress-card:last-child { border-bottom: none; }
.team-progress-card__icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.team-progress-card__info { flex: 1; min-width: 0; }
.team-progress-card__name { font-size: 0.875rem; font-weight: 700; color: var(--edge-text); }
.team-progress-card__sub { font-size: 0.75rem; color: var(--edge-muted); margin-top: 2px; }
.team-progress-card__bar-wrap { width: 120px; flex-shrink: 0; }
.team-progress-card__bar {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--edge-border);
  overflow: hidden;
  margin-bottom: 2px;
}
.team-progress-card__fill { height: 100%; border-radius: var(--r-full); transition: width 0.5s; }
.team-progress-card__pct { font-size: 0.6875rem; font-weight: 700; text-align: right; }

/* === Gargalo alert (inline) === */
.gargalo-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--edge-border);
}
.gargalo-row:last-child { border-bottom: none; }
.gargalo-row__icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.gargalo-row__name { font-size: 0.875rem; font-weight: 700; color: var(--edge-text); }
.gargalo-row__sub { font-size: 0.75rem; color: var(--edge-muted); margin-top: 1px; }
.gargalo-row__value { margin-left: auto; text-align: right; font-size: 1.125rem; font-weight: 800; letter-spacing: -0.02em; flex-shrink: 0; }
.gargalo-row__meta { font-size: 0.6875rem; color: var(--edge-muted); margin-top: 1px; }

/* === Misc utilities === */
.section-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--edge-muted);
  margin-bottom: var(--sp-3);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
}

.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-4);
}

.divider {
  height: 1px;
  background: var(--edge-border);
  border: none;
  margin: var(--sp-4) 0;
}

.text-muted { color: var(--edge-muted); }
.text-sm { font-size: 0.8125rem; }
.fw-700 { font-weight: 700; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.js-hidden { display: none !important; }

.kanban-card--link { display: block; text-decoration: none; color: inherit; }
.kanban-card__vall-badge {
  font-size: 0.5625rem;
  background: var(--edge-blue);
  color: #fff;
  border-radius: 3px;
  padding: 1px 4px;
  vertical-align: middle;
  margin-left: 3px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════
   VALL — Floating Button + Drawer
   ═══════════════════════════════════════════ */

.vall-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.18);
  cursor: pointer;
  background: linear-gradient(135deg, #1E3ABA 0%, #5B21B6 100%);
  box-shadow: 0 6px 28px rgba(30, 58, 186, 0.50), 0 0 0 0 rgba(91,33,182,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  overflow: hidden;
  animation: vallFabPulse 3s ease-in-out infinite;
}
.vall-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 36px rgba(30, 58, 186, 0.60), 0 0 0 8px rgba(91,33,182,0.12);
}
.vall-fab img,
.vall-fab__img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  object-position: center 15%;
  border-radius: 50%;
}
.vall-fab__orb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E3ABA, #5B21B6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}
body[data-page="centro-operacional"] .vall-fab {
  width: 92px;
  height: 92px;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.82);
  background: linear-gradient(135deg, #2E1065 0%, #5B21B6 58%, #C026D3 100%);
  box-shadow: 0 10px 34px rgba(91,33,182,0.28);
}
body[data-page="centro-operacional"] .vall-fab img,
body[data-page="centro-operacional"] .vall-fab__img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  object-position: center 14%;
  border-radius: 50%;
}
body[data-page="centro-operacional"] .vall-fab__orb {
  width: 64px;
  height: 64px;
}
@keyframes vallFabPulse {
  0%, 100% { box-shadow: 0 6px 28px rgba(30,58,186,0.50), 0 0 0 0 rgba(91,33,182,0); }
  50%       { box-shadow: 0 6px 28px rgba(30,58,186,0.50), 0 0 0 10px rgba(91,33,182,0.12); }
}

.vall-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  z-index: 950;
  background: var(--edge-surface);
  border-left: 1px solid var(--edge-border);
  box-shadow: -8px 0 40px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.vall-drawer.is-open { right: 0; }

.vall-drawer__header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4);
  border-bottom: 1px solid var(--edge-border);
  background: linear-gradient(135deg, rgba(30,58,186,0.04) 0%, rgba(91,33,182,0.04) 100%);
  flex-shrink: 0;
}
.vall-drawer__avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #1E3ABA 0%, #5B21B6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vall-drawer__avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vall-drawer__avatar-orb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(139,92,246,0.5));
}
.vall-drawer__info { flex: 1; }
.vall-drawer__name { font-size: 0.9375rem; font-weight: 700; color: var(--edge-text); }
.vall-drawer__role { font-size: 0.75rem; color: var(--edge-muted); margin-top: 1px; }
.vall-drawer__live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--edge-green);
  margin-top: 3px;
}
.vall-drawer__live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--edge-green);
  animation: pulse-live 2s infinite;
}
.vall-drawer__close {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--edge-border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--edge-muted);
  font-size: 1.1rem;
  line-height: 1;
  transition: background var(--dur), color var(--dur);
  flex-shrink: 0;
}
.vall-drawer__close:hover { background: var(--edge-bg); color: var(--edge-text); }

.vall-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.vall-drawer__stage-avatar {
  margin-top: auto;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.vall-drawer__stage-avatar img {
  width: min(260px, 76%);
  max-height: 34vh;
  object-fit: contain;
  object-position: center bottom;
}
.vall-drawer__body.has-interaction .vall-drawer__stage-avatar {
  display: none;
}

.vall-msg {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}
.vall-msg--user { flex-direction: row-reverse; }

.vall-msg__bubble {
  max-width: 80%;
  padding: var(--sp-3) var(--sp-3);
  border-radius: var(--r-md);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--edge-text);
  background: var(--edge-bg);
  border: 1px solid var(--edge-border);
}
.vall-msg--user .vall-msg__bubble {
  background: linear-gradient(135deg, #1E3ABA 0%, #5B21B6 100%);
  color: #fff;
  border-color: transparent;
}
.vall-msg__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E3ABA, #5B21B6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.vall-msg__avatar img { width: 100%; height: 100%; object-fit: cover; }
.vall-msg__avatar-orb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(139,92,246,0.5));
}

.vall-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: 0 0 var(--sp-2);
}
.vall-action-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  border: 1px solid var(--edge-border);
  background: var(--edge-surface);
  color: var(--edge-blue);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur), border-color var(--dur);
  text-align: left;
}
.vall-action-btn:hover { background: var(--edge-blue-light); border-color: var(--edge-blue); }
.vall-action-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.vall-drawer__input {
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  border-top: 1px solid var(--edge-border);
  display: flex;
  gap: var(--sp-2);
  flex-shrink: 0;
}
.vall-drawer__input input {
  flex: 1;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--edge-border);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--edge-bg);
  color: var(--edge-text);
  outline: none;
  transition: border-color var(--dur);
}
.vall-drawer__input input:focus { border-color: var(--edge-blue); }
.vall-drawer__input input::placeholder { color: var(--edge-muted); }
.vall-drawer__send {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  border: none;
  background: linear-gradient(135deg, #1E3ABA, #5B21B6);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity var(--dur);
}
.vall-drawer__send:hover { opacity: 0.85; }

/* ═══════════════════════════════════════════
   VALL — Hero Card (Centro Operacional)
   ═══════════════════════════════════════════ */

.vall-hero-card {
  background: linear-gradient(135deg, rgba(30,58,186,0.05) 0%, rgba(91,33,182,0.07) 100%);
  border: 1px solid rgba(30,58,186,0.15);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.vall-hero-card__avatar {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #1E3ABA 0%, #5B21B6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(30,58,186,0.3);
}
.vall-hero-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vall-hero-card__avatar-orb {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.92), rgba(139,92,246,0.6));
  box-shadow: 0 0 24px rgba(255,255,255,0.4);
  animation: vallOrbFloat 4s ease-in-out infinite;
}
@keyframes vallOrbFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}
.vall-hero-card__content { flex: 1; }
.vall-hero-card__greeting {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--edge-blue);
  margin-bottom: var(--sp-1);
}
.vall-hero-card__message {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--edge-text);
  line-height: 1.45;
  margin-bottom: var(--sp-3);
}
.vall-hero-card__sub {
  font-size: 0.875rem;
  color: var(--edge-muted);
  margin-bottom: var(--sp-4);
  line-height: 1.5;
}
.vall-hero-card__actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

/* ═══════════════════════════════════════════
   Ambientes — Tab content layouts
   ═══════════════════════════════════════════ */

.amb-tab-kpi-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-3); margin-bottom: var(--sp-4); }
.amb-tab-kpi-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.amb-tab-kpi-stack { display: flex; flex-direction: column; gap: var(--sp-2); }

.kpi-card--dark { background: linear-gradient(135deg,#0B1D3A,#132848); color: #fff; border: none; }
.kpi-card--dark .kpi-card__label { color: rgba(255,255,255,0.6); }
.kpi-card--dark .kpi-card__value { color: #fff; font-size: 2rem; }
.kpi-card--dark .kpi-card__value span { font-size: 1rem; font-weight: 400; opacity: 0.7; }
.kpi-card--dark .kpi-card__delta { color: #4ADE80; }

.amb-bar-chart { display: flex; align-items: flex-end; gap: 5px; height: 72px; margin-bottom: var(--sp-2); }
.amb-bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.amb-bar-fill { width: 100%; height: var(--bar-h, 50%); background: var(--edge-blue); border-radius: 3px 3px 0 0; min-height: 4px; }
.amb-bar-fill--peak { background: var(--edge-amber); }
.amb-bar-fill--now  { background: var(--edge-green); }
.amb-bar-label { font-size: 7px; color: var(--edge-subtle); }

.amb-legend { display: flex; gap: var(--sp-3); }
.amb-legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.amb-legend-dot--blue  { background: var(--edge-blue); }
.amb-legend-dot--amber { background: var(--edge-amber); }
.amb-legend-dot--green { background: var(--edge-green); }

/* ═══════════════════════════════════════════
   Ambientes — Tabs
   ═══════════════════════════════════════════ */

.amb-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--edge-border);
  margin-bottom: var(--sp-4);
  overflow-x: auto;
  flex-shrink: 0;
}
.amb-tab-btn {
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--edge-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur), border-color var(--dur);
  margin-bottom: -1px;
}
.amb-tab-btn:hover { color: var(--edge-text-mid); }
.amb-tab-btn.is-active {
  color: var(--edge-blue);
  border-bottom-color: var(--edge-blue);
}
.amb-tab-panel { display: none; }
.amb-tab-panel.is-active { display: block; }
