/* AI TEAM COMPANY OS — VISUAL V5 FINAL FIDELITY (1:1 MASTER SPECIFICATION) */
:root {
  color-scheme: dark;
  --bg: #040914;
  --sidebar-bg: #060e1a;
  --surface: rgba(11, 22, 38, 0.7);
  --surface-elevated: rgba(16, 30, 52, 0.8);
  --surface-card: linear-gradient(180deg, rgba(14, 26, 46, 0.75) 0%, rgba(8, 16, 30, 0.88) 100%);
  --border: rgba(56, 189, 248, 0.12);
  --border-strong: rgba(56, 189, 248, 0.22);
  --border-focus: rgba(0, 229, 255, 0.5);
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --accent: #00e5ff;
  --accent-blue: #0284c7;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #818cf8;
  --glow-cyan: 0 0 20px rgba(0, 229, 255, 0.25);
  --glow-blue: 0 0 20px rgba(2, 132, 199, 0.3);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --ease: 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; background: transparent; color: inherit; padding: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1, h2, h3, p { margin: 0; }

.app-shell {
  display: flex;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 25%, rgba(14, 165, 233, 0.06) 0%, transparent 60%), #040914;
}

/* ==========================================================================
   SIDEBAR (1:1 Master)
   ========================================================================== */
.sidebar {
  display: flex;
  flex: 0 0 235px;
  width: 235px;
  flex-direction: column;
  padding: 12px 10px 10px;
  border-right: 1px solid var(--border);
  background: var(--sidebar-bg);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 16px;
}
.brand-mark-wrap {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3) 0%, rgba(0, 229, 255, 0.15) 100%);
  border: 1px solid rgba(0, 229, 255, 0.3);
}
.brand-mark { width: 18px; height: 18px; }
.brand-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
}
.brand-text span {
  display: block;
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 600;
}

.nav-list {
  display: grid;
  gap: 2px;
  overflow-y: auto;
  max-height: calc(100vh - 170px);
  scrollbar-width: none;
}
.nav-list::-webkit-scrollbar { display: none; }
.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 5.5px 9px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 11.5px;
  text-align: left;
  transition: all var(--ease);
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}
.nav-item.is-active {
  background: linear-gradient(90deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.35);
}
.nav-icon {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: currentColor;
}
.nav-item.is-active .nav-icon { color: #ffffff; }
.nav-badge-red {
  margin-left: auto;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ef4444;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.nav-badge-red[hidden] {
  display: none !important;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 4px;
}
.operator-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #ffffff;
  font-weight: 600;
  font-size: 12px;
}
.operator-info strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
}
.operator-info span {
  display: block;
  font-size: 9.5px;
  color: var(--text-tertiary);
}
.profile-chevron {
  margin-left: auto;
  width: 13px;
  height: 13px;
  color: var(--text-tertiary);
}
.workspace-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
}
.company-badge-icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
}
.workspace-card strong {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: #e2e8f0;
}
.workspace-card span {
  display: block;
  font-size: 9px;
  color: var(--text-tertiary);
}

/* ==========================================================================
   TOPBAR / HEADER (1:1 Master)
   ========================================================================== */
.content-shell {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  height: 48px;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(6, 14, 26, 0.85);
  backdrop-filter: blur(12px);
}
.mobile-brand { display: none; }
.search-box {
  display: flex;
  width: 320px;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-tertiary);
  font-size: 11.5px;
}
.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 11.5px;
}
.search-box input::placeholder { color: var(--text-tertiary); }
.search-box kbd {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-tertiary);
  font-size: 9.5px;
  font-family: inherit;
}
.top-metrics {
  display: none !important;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.topbar-icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--ease);
}
.topbar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}
.topbar-bell-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
}
.profile-button {
  padding: 0;
  border-radius: 50%;
}

/* ==========================================================================
   MAIN DASHBOARD CONTAINER (1:1 Master)
   ========================================================================== */
main {
  flex: 1;
  padding: 12px 28px 14px;
}
.dashboard-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 1680px;
}

/* 1. GREETING ROW */
.dashboard-welcome {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 4px 2px;
}
.welcome-copy h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.15;
}
.welcome-subtitle {
  margin-top: 3px;
  font-size: 12.5px;
  color: #94a3b8;
}
.welcome-meta {
  text-align: right;
}
.welcome-date {
  font-size: 11.5px;
  color: var(--text-secondary);
}
.welcome-time {
  font-weight: 700;
  color: #ffffff;
  margin-left: 6px;
}
.welcome-quote {
  margin-top: 2px;
  font-size: 11px;
  font-style: italic;
  color: var(--text-tertiary);
}

/* 2. ROW OF 6 KPIS */
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 76px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(14, 27, 50, 0.78) 0%, rgba(8, 17, 34, 0.92) 100%);
  border: 1px solid rgba(56, 189, 248, 0.16);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.kpi-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(14, 165, 233, 0.15);
}
.kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kpi-head span {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
.kpi-chevron {
  width: 13px;
  height: 13px;
  color: var(--text-tertiary);
}
.kpi-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 6px;
}
.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}
.kpi-trend {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
}
.kpi-trend.is-neutral {
  color: var(--text-tertiary);
}
.kpi-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--success);
}
.kpi-subtext {
  font-size: 10px;
  color: var(--text-tertiary);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}
/* Sparkline bar heights & layout classes (CSP compliant: zero inline styles) */
.h-35 { height: 35%; }
.h-40 { height: 40%; }
.h-45 { height: 45%; }
.h-50 { height: 50%; }
.h-55 { height: 55%; }
.h-60 { height: 60%; }
.h-65 { height: 65%; }
.h-70 { height: 70%; }
.h-75 { height: 75%; }
.h-80 { height: 80%; }
.h-85 { height: 85%; }
.h-90 { height: 90%; }
.h-95 { height: 95%; }
.h-100 { height: 100%; }

.reference-earth {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0.001;
  pointer-events: none;
}
.revenue-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.revenue-val {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}
.revenue-months {
  display: flex;
  justify-content: space-around;
  font-size: 9px;
  color: var(--text-tertiary);
  margin-top: 3px;
}
.access-brand-wrap {
  margin: 0 auto 16px;
}

.kpi-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}
.kpi-sparkline i {
  width: 3.5px;
  border-radius: 2px;
  background: linear-gradient(180deg, #00e5ff 0%, #0284c7 100%);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
  display: block;
}
.kpi-sparkline.is-neutral i {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.5) 0%, rgba(2, 132, 199, 0.25) 100%);
  box-shadow: none;
}
.kpi-sparkline.is-teal i { background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%); box-shadow: 0 0 6px rgba(20, 184, 166, 0.4); }
.kpi-sparkline.is-green i { background: linear-gradient(180deg, #10b981 0%, #059669 100%); box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
.kpi-sparkline.is-cyan i { background: linear-gradient(180deg, #00e5ff 0%, #0284c7 100%); box-shadow: 0 0 6px rgba(0, 229, 255, 0.5); }

/* 3. PRIMARY ROW (HERO + AGENTES + ATIVIDADE) */
.dashboard-primary {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(250px, 1fr) minmax(260px, 1fr);
  gap: 12px;
  height: 380px;
}
.panel {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(14, 27, 50, 0.78) 0%, rgba(8, 17, 34, 0.92) 100%);
  border: 1px solid rgba(56, 189, 248, 0.16);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.card-heading h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}
.card-heading .button.is-quiet {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* HERO PANEL & APPROVED VISUAL BACKGROUND */
.hero-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 28px;
  border-radius: var(--radius-lg);
  background-color: #010512;
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.hero-visual-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background-color: #010512;
}

.hero-bg-img {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: auto;
  object-fit: contain;
  object-position: right center;
  display: block;
  z-index: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.2) 8%, rgba(0, 0, 0, 0.6) 18%, black 32%, black 100%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.2) 8%, rgba(0, 0, 0, 0.6) 18%, black 32%, black 100%);
}

.hero-text-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(1, 5, 18, 0.95) 0%,
    rgba(1, 5, 18, 0.88) 18%,
    rgba(1, 5, 18, 0.65) 32%,
    rgba(1, 5, 18, 0.30) 46%,
    rgba(1, 5, 18, 0.08) 58%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 2;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 360px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.hero-brand img { width: 14px; height: 14px; }

.hero-copy h1 {
  display: flex;
  flex-direction: column;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: #ffffff;
  margin: 0 0 10px 0;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.75), 0 0 30px rgba(0, 229, 255, 0.25);
}

.hero-copy h1 span {
  display: block;
}

.hero-description {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.45;
  max-width: 310px;
  margin-bottom: 16px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.hero-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 20px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #0284c7 0%, #00b4d8 100%);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 0 24px rgba(14, 165, 233, 0.55);
  cursor: pointer;
  transition: all var(--ease);
}

.hero-action:hover {
  background: linear-gradient(90deg, #0369a1 0%, #0284c7 100%);
  box-shadow: 0 0 32px rgba(14, 165, 233, 0.8);
  transform: translateY(-1px);
}

.hero-action:focus-visible {
  outline: 2px solid #00e5ff;
  outline-offset: 2px;
}

.play-icon { font-size: 10px; color: #ffffff; }

.hero-foot {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 28px;
  margin-top: auto;
  padding-top: 10px;
}
.hero-metric-item {
  display: flex;
  flex-direction: column;
}
.hero-metric-bar {
  width: 28px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 6px;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}
.hero-foot strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}
.hero-foot span {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* AGENTES DE IA PANEL */
.agents-panel {
  justify-content: flex-start;
}
.live-agents {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  max-height: none;
}
.agent-slot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background var(--ease);
}
.agent-slot-row:hover {
  background: rgba(255, 255, 255, 0.05);
}
.agent-circle-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.agent-brand-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}
.agent-circle-avatar svg.ui-icon {
  width: 16px;
  height: 16px;
}
.agent-circle-avatar.is-coral-dark {
  background: radial-gradient(circle, #2d1810 0%, #170c08 100%);
  border: 1px solid rgba(249, 115, 22, 0.45);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.2);
}
.agent-circle-avatar.is-teal-dark {
  background: radial-gradient(circle, #0f2922 0%, #061511 100%);
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.agent-circle-avatar.is-blue-dark {
  background: radial-gradient(circle, #0e1e38 0%, #060e1d 100%);
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}
.agent-circle-avatar.is-coral { background: radial-gradient(circle, #f97316 0%, #c2410c 100%); }
.agent-circle-avatar.is-cyan { background: radial-gradient(circle, #06b6d4 0%, #0e7490 100%); }
.agent-circle-avatar.is-teal { background: radial-gradient(circle, #10b981 0%, #047857 100%); }
.agent-circle-avatar.is-gold { background: radial-gradient(circle, #eab308 0%, #a16207 100%); }
.agent-circle-avatar.is-blue { background: radial-gradient(circle, #3b82f6 0%, #1d4ed8 100%); }
.agent-circle-avatar.is-amber { background: radial-gradient(circle, #f59e0b 0%, #b45309 100%); }
.agent-circle-avatar.is-purple { background: radial-gradient(circle, #a855f7 0%, #7e22ce 100%); }
.agent-circle-avatar.is-sky { background: radial-gradient(circle, #0ea5e9 0%, #0369a1 100%); }

.agent-slot-info {
  flex: 1;
  min-width: 0;
}
.agent-slot-info strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-slot-info span {
  display: block;
  font-size: 10px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-slot-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 500;
  white-space: nowrap;
}
.agent-slot-status.is-online { color: var(--success); }
.agent-slot-status.is-executing { color: var(--accent); }
.agent-slot-status.is-analysis, .agent-slot-status.is-waiting { color: var(--warning); }
.agent-slot-status.is-unconfigured { color: var(--text-tertiary); }
.agent-slot-status i {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: currentColor;
}

/* ATIVIDADE EM TEMPO REAL PANEL */
.realtime-panel {
  justify-content: flex-start;
}
.live-activity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  max-height: none;
}
.activity-slot-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 3.5px 4px;
}
.activity-icon-badge {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--ease);
}
.activity-icon-badge svg { width: 12px; height: 12px; color: var(--accent); }
.activity-icon-badge.is-green { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.35); }
.activity-icon-badge.is-green svg { color: #10b981; }
.activity-icon-badge.is-cyan { background: rgba(0, 229, 255, 0.12); border-color: rgba(0, 229, 255, 0.35); }
.activity-icon-badge.is-cyan svg { color: #00e5ff; }
.activity-icon-badge.is-blue { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.35); }
.activity-icon-badge.is-blue svg { color: #38bdf8; }
.activity-icon-badge.is-amber { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); }
.activity-icon-badge.is-amber svg { color: #f59e0b; }
.activity-icon-badge.is-red { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); }
.activity-icon-badge.is-red svg { color: #ef4444; }
.activity-icon-badge.is-purple { background: rgba(168, 85, 247, 0.12); border-color: rgba(168, 85, 247, 0.35); }
.activity-icon-badge.is-purple svg { color: #c084fc; }

.activity-slot-info {
  flex: 1;
  min-width: 0;
}
.activity-slot-info strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-slot-info p {
  font-size: 10px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.activity-slot-time {
  font-size: 9px;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
  margin-left: 4px;
  opacity: 0.85;
}

/* 4. MIDDLE ROW (DESEMPENHO + RECEITA + STATUS) */
.dashboard-triad {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 12px;
  height: 175px;
}
.performance-body-wrap,
.revenue-body-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}
.panel-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 14px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.panel-empty-state .empty-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.16);
  color: var(--accent);
  margin-bottom: 6px;
}
.panel-empty-state .empty-icon svg {
  width: 14px;
  height: 14px;
}
.panel-empty-state strong {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
}
.panel-empty-state p {
  font-size: 9.5px;
  color: #94a3b8;
  line-height: 1.35;
  margin: 0;
  max-width: 260px;
}
.chart-box {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
  height: 98px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: rgba(8, 16, 32, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.08);
}
.chart-real-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 4px;
  font-size: 10px;
  color: var(--text-secondary);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}
.legend-item i.is-cyan { background: var(--accent); }
.legend-item i.is-blue { background: #3b82f6; }
.legend-item i.is-red { background: var(--danger); }
.legend-item i.is-amber { background: var(--warning); }
.legend-item i.is-purple { background: var(--info); }

/* Donut chart layout */
.donut-layout {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
}
.donut-svg-wrap {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.35));
}
.donut-legend {
  display: grid;
  gap: 3px;
  font-size: 9.5px;
  color: var(--text-secondary);
}

/* 5. BOTTOM ROW (APROVAÇÕES + COMPROMISSOS + INDICADORES) */
.dashboard-secondary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 12px;
  height: 175px;
}
.approvals-list, .appointments-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  max-height: none;
}
.approval-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.1);
}
.approval-card-info {
  flex: 1;
  min-width: 0;
}
.approval-card-info strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.approval-card-info span {
  display: block;
  font-size: 9.5px;
  color: var(--text-tertiary);
  margin-top: 1px;
}
.approval-action-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.btn-approve {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: #10b981;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 600;
  transition: opacity var(--ease);
}
.btn-reject {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: #ef4444;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 600;
  transition: opacity var(--ease);
}
.btn-approve:hover, .btn-reject:hover { opacity: 0.9; }

/* Appointments list */
.appointment-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 4px;
}
.appointment-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.appointment-date-badge strong { font-size: 11px; font-weight: 700; color: #ffffff; line-height: 1; }
.appointment-date-badge span { font-size: 7.5px; font-weight: 700; color: var(--accent); }
.appointment-info {
  flex: 1;
  min-width: 0;
}
.appointment-info strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.appointment-info span {
  display: block;
  font-size: 9.5px;
  color: var(--text-tertiary);
}
.appointment-tag {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  font-size: 9px;
  font-weight: 500;
}

/* Indicators layout */
.indicators-layout {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
}
.radial-gauge-wrap {
  width: 82px;
  height: 82px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.4));
}
.indicators-checklist {
  display: grid;
  gap: 3px;
  font-size: 10px;
  color: var(--text-secondary);
}
.indicators-checklist li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.indicators-checklist li span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
}
.indicators-checklist li strong {
  color: #ffffff;
}
.check-icon {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

/* BRAND FOOTER BAR */
.dashboard-brand-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 4px;
  border-top: 1px solid rgba(56, 189, 248, 0.1);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
}
.footer-left strong { color: var(--accent); font-weight: 700; margin-right: 6px; }

/* UTILITY ICONS & SVG */
.ui-icon {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* EMPTY STATE CARDS & MINI EMPTY STATES */
.empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 10px 14px;
  color: var(--text-tertiary);
}
.empty-state-card .empty-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.15);
  color: var(--accent);
  margin-bottom: 5px;
}
.empty-state-card .empty-icon svg {
  width: 12px;
  height: 12px;
}
.empty-state-card strong {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.empty-state-card p {
  font-size: 8.5px;
  color: var(--text-tertiary);
  line-height: 1.3;
  margin: 0;
}
.empty-state-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 10px;
  color: var(--text-tertiary);
  gap: 4px;
}
.empty-state-mini .empty-icon-mini {
  color: var(--accent);
  margin-bottom: 2px;
}
.empty-state-mini .empty-icon-mini svg {
  width: 14px;
  height: 14px;
}
.empty-state-mini strong {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
}
.empty-state-mini p {
  font-size: 8.5px;
  color: var(--text-tertiary);
  margin: 0;
}
.kpi-trend.is-neutral {
  color: var(--text-tertiary);
  font-weight: 500;
}
.kpi-sparkline.is-neutral i {
  background: rgba(56, 189, 248, 0.15);
}

/* ==========================================================================
   RESPONSIVENESS (1920, 1600, 1366, Mobile 390/360)
   ========================================================================== */
@media (max-width: 1400px) {
  .dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-primary { grid-template-columns: 1fr; height: auto; gap: 12px; }
  .dashboard-triad, .dashboard-secondary { grid-template-columns: 1fr; height: auto; gap: 12px; }
  .hero-panel { min-height: 380px; }
  .hero-visual-bg::before { display: none; }
  .hero-bg-img { -webkit-mask-image: none; mask-image: none; object-fit: cover; object-position: right center; }
  .agents-panel, .realtime-panel { height: auto; min-height: 220px; }
  .performance-panel, .revenue-panel, .status-panel, .approvals-panel, .appointments-panel, .indicators-panel { height: auto; min-height: 180px; }
}

@media (max-width: 720px) {
  .app-shell { display: block; overflow-x: hidden; }
  .content-shell { max-width: 100vw; overflow-x: hidden; }
  main { max-width: 100vw; overflow-x: hidden; padding: 14px 12px 80px; }
  .dashboard-page { max-width: 100%; overflow-x: hidden; display: flex; flex-direction: column; gap: 12px; }
  .sidebar {
    position: fixed;
    z-index: 20;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 62px;
    padding: 6px 10px;
    border-top: 1px solid var(--border);
    border-right: 0;
    background: var(--sidebar-bg);
  }
  .brand, .sidebar-bottom, .nav-item:not([data-mobile="true"]) { display: none; }
  .nav-list {
    display: flex;
    height: 100%;
    justify-content: space-around;
    gap: 4px;
    overflow: visible;
  }
  .nav-item {
    display: grid;
    flex: 1;
    justify-items: center;
    gap: 2px;
    padding: 4px 2px;
    font-size: 9px;
    text-align: center;
  }
  .topbar {
    height: 56px;
    padding: 0 14px;
  }
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .mobile-brand .brand-mark { width: 22px; height: 22px; }
  .mobile-brand strong { font-size: 13px; letter-spacing: 0.08em; }
  .mobile-brand span { font-size: 8px; color: var(--accent); }
  .search-box, .top-metrics { display: none !important; }
  .dashboard-welcome { flex-direction: column; align-items: flex-start; gap: 4px; }
  .welcome-meta { text-align: left; }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dashboard-primary, .dashboard-triad, .dashboard-secondary {
    display: flex;
    flex-direction: column;
    height: auto;
    gap: 12px;
  }
  .hero-panel { min-height: 440px; padding: 24px 20px; overflow: hidden; }
  .hero-visual-bg::before { display: none; }
  .hero-bg-img { -webkit-mask-image: none; mask-image: none; object-fit: cover; object-position: 80% center; }
  .hero-text-shade {
    background: linear-gradient(135deg, rgba(2, 6, 18, 0.88) 0%, rgba(2, 6, 18, 0.68) 50%, rgba(2, 6, 18, 0.30) 100%);
  }
  .hero-copy h1 { font-size: 27px; line-height: 1.1; margin-bottom: 12px; }
  .hero-description { font-size: 12.5px; max-width: 280px; margin-bottom: 20px; color: #e2e8f0; }
  .hero-foot { gap: 18px; padding-top: 14px; }
  .hero-foot strong { font-size: 16px; }
  .hero-foot span { font-size: 10px; }
  .agents-panel, .realtime-panel { height: auto; min-height: 220px; }
  .performance-panel, .revenue-panel, .status-panel, .approvals-panel, .appointments-panel, .indicators-panel { height: auto; min-height: 180px; }
  .donut-layout { flex-direction: column; align-items: center; gap: 12px; }
  .indicators-layout { flex-direction: column; align-items: center; gap: 12px; }
  .dashboard-brand-footer { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Access State / Login Screen */
.access-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
}
.access-card {
  width: 100%;
  max-width: 440px;
  padding: 36px 32px;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.access-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.access-card p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 24px;
}
.access-form {
  display: grid;
  gap: 12px;
}
.access-form input {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  color: #ffffff;
  font-size: 13px;
}
.access-form button {
  padding: 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

/* Toast */
.toast {
  position: fixed;
  z-index: 99;
  right: 24px;
  bottom: 24px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-strong);
  color: #ffffff;
  font-size: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--ease);
  pointer-events: none;
}
.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   AI TEAM COMPANY OS — P3.2 TASK WORKSPACE, TIMELINE & INSTRUCTION COMPOSER
   ========================================================================== */
.task-workspace-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.task-workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.task-filters-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-pill {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  transition: all var(--ease);
}
.filter-pill:hover {
  border-color: var(--border-strong);
  color: #ffffff;
}
.filter-pill.is-active {
  background: rgba(0, 229, 255, 0.12);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}
.table-search-wrap {
  flex: 0 1 300px;
}
.table-search-wrap .input {
  width: 100%;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  color: #ffffff;
  font-size: 11.5px;
}

.task-table-header {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) minmax(100px, 1fr) minmax(130px, 1.2fr) minmax(110px, 1fr) minmax(110px, 1fr);
  gap: 12px;
  padding: 6px 14px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.task-row {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) minmax(100px, 1fr) minmax(130px, 1.2fr) minmax(110px, 1fr) minmax(110px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.08);
  transition: all var(--ease);
  cursor: pointer;
}
.task-row:hover {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateX(2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.task-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.task-main strong {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.02em;
}
.task-objective {
  font-size: 11px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-project .project-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  font-size: 10px;
  color: #38bdf8;
  font-weight: 500;
}
.task-executor-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.task-executor-col .executor-name {
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
}
.task-executor-col .model-name {
  font-size: 9.5px;
  color: var(--text-tertiary);
}
.task-status-col {
  display: flex;
  align-items: center;
}
.task-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 10.5px;
  color: var(--text-tertiary);
}
.checkpoint-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  font-family: monospace;
}

/* TASK DETAIL WORKSPACE LAYOUT */
.task-workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(310px, 1fr);
  gap: 16px;
  align-items: start;
}
.task-workspace-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.task-workspace-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.event-count-badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.25);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
}

/* OPERATIONAL CONVERSATION / TIMELINE */
.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}
.conversation-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  transition: all var(--ease);
}
.conversation-row.is-michel {
  border-left: 3px solid #38bdf8;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.08) 0%, rgba(15, 23, 42, 0.5) 100%);
}
.conversation-row.is-orchestrator {
  border-left: 3px solid #a855f7;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.08) 0%, rgba(15, 23, 42, 0.5) 100%);
}
.conversation-row.is-agent {
  border-left: 3px solid #00e5ff;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.08) 0%, rgba(15, 23, 42, 0.5) 100%);
}
.conversation-row.is-system {
  border-left: 3px solid #64748b;
  background: rgba(15, 23, 42, 0.35);
}

.conversation-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}
.conversation-avatar.is-michel {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.conversation-avatar.is-orchestrator {
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
  color: #ffffff;
  border: 1px solid rgba(168, 85, 247, 0.4);
}
.conversation-avatar.is-agent {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: #ffffff;
  border: 1px solid rgba(0, 229, 255, 0.4);
}
.conversation-avatar.is-system {
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-tertiary);
  border: 1px solid var(--border);
}

.conversation-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.conversation-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.conversation-category {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 3px;
}
.conversation-category.is-michel { color: #38bdf8; background: rgba(56, 189, 248, 0.12); }
.conversation-category.is-orchestrator { color: #c084fc; background: rgba(168, 85, 247, 0.12); }
.conversation-category.is-agent { color: #22d3ee; background: rgba(6, 182, 212, 0.12); }
.conversation-category.is-system { color: #94a3b8; background: rgba(100, 116, 139, 0.12); }

.conversation-actor {
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
}
.conversation-type {
  font-size: 9.5px;
  font-family: monospace;
  color: var(--text-tertiary);
}
.conversation-body {
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.45;
  word-break: break-word;
}
.conversation-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.meta-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.15);
  font-size: 9px;
  font-family: monospace;
  color: var(--text-secondary);
}
.conversation-time {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* INSTRUCTION COMPOSER */
.composer-approval-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  margin-bottom: 12px;
}
.composer-approval-warning .warning-icon {
  font-size: 16px;
}
.composer-approval-warning strong {
  display: block;
  font-size: 11.5px;
  color: #fef3c7;
}
.composer-approval-warning p {
  font-size: 10.5px;
  color: #fcd34d;
  margin: 2px 0 0;
}
.composer-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}
.composer-textarea {
  min-height: 76px;
  resize: vertical;
  width: 100%;
  padding: 10px 12px;
  font-size: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: inherit;
}
.composer-textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}
.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 12px;
}
.composer-hint {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* SIDE PANELS & DETAILS */
.model-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #c084fc;
  font-size: 10.5px;
  font-family: monospace;
  font-weight: 600;
}
.inline-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.button.is-fullwidth {
  width: 100%;
  text-align: center;
}

/* RESPONSIVE / MOBILE ADAPTATIONS */
@media (max-width: 900px) {
  .task-workspace-layout {
    grid-template-columns: 1fr;
  }
  .task-table-header {
    display: none;
  }
  .task-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
  }
  .task-meta {
    align-items: flex-start;
  }
  .composer-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .composer-actions button {
    width: 100%;
  }
}

/* ==========================================================================
   AI TEAM COMPANY OS — P3.3 FAILOVER & CONTINUITY STYLES
   ========================================================================== */
.failover-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.failover-capacity-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm);
  color: #fbbf24;
  font-size: 11.5px;
  line-height: 1.4;
}
.failover-capacity-warning strong {
  color: #fef3c7;
  display: block;
  margin-bottom: 2px;
}
.failover-approval-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-sm);
  color: #c084fc;
  font-size: 11.5px;
  line-height: 1.4;
}
.failover-approval-warning strong {
  color: #f3e8ff;
  display: block;
  margin-bottom: 2px;
}
.failover-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
}
.failover-route div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.failover-route span {
  color: var(--text-tertiary);
  font-size: 10px;
}
.failover-route strong {
  color: var(--text-primary);
  font-size: 12px;
}
.failover-zero-cost {
  margin-top: 2px;
}
.zero-cost-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.failover-detail-text {
  word-break: break-word;
  font-size: 11px;
  color: var(--text-secondary);
}

/* Commercial Control Module */
.mb-4 {
  margin-bottom: 16px;
}
.kpi-value-lg {
  font-size: 20px;
}
.card-heading-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.badge-human-gate {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}
.boundary-text-danger {
  color: #f87171;
}
.commercial-agent-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.task-table-checkout {
  grid-template-columns: minmax(140px, 1.5fr) minmax(140px, 1.5fr) minmax(90px, 1fr) minmax(100px, 1fr) minmax(100px, 1fr);
  cursor: default;
}
.task-table-customer {
  grid-template-columns: minmax(140px, 1.2fr) minmax(150px, 1.5fr) minmax(180px, 2fr) minmax(140px, 1.2fr);
  cursor: default;
}
.task-table-account {
  grid-template-columns: minmax(140px, 1.5fr) minmax(160px, 2fr) minmax(100px, 1fr) minmax(120px, 1.2fr);
  cursor: default;
}
.task-table-plan {
  grid-template-columns: minmax(100px, 1fr) minmax(140px, 1.5fr) minmax(120px, 1fr);
  cursor: default;
}
.task-table-sub {
  grid-template-columns: minmax(140px, 1.5fr) minmax(140px, 1.5fr) minmax(100px, 1fr) minmax(100px, 1fr);
  cursor: default;
}
.task-table-quota {
  grid-template-columns: minmax(140px, 1.5fr) minmax(100px, 1fr) minmax(110px, 1fr) minmax(110px, 1fr) minmax(90px, 1fr);
  cursor: default;
}
.audit-details-code {
  margin: 0;
  font-size: 10px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* P5 Departments & Operations */
.departments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.department-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.supervisor-hero-panel {
  border-left: 3px solid #6366f1;
}
.dept-header-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}
.correlation-row {
  grid-template-columns: minmax(180px, 2fr) minmax(110px, 1.2fr) minmax(140px, 1.5fr) minmax(100px, 1fr) minmax(90px, 0.8fr);
  cursor: default;
}
.department-card-alerts {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  padding: 8px;
}
.eyebrow-red {
  color: #ef4444;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0 0 4px 0;
}
.mini-alert-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  margin-top: 4px;
}

/* P6.1 Integrations Foundation */
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.integration-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 380px;
}
.integration-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.integration-governance-banner {
  border-left: 3px solid #10b981;
}
.integration-desc {
  font-size: 0.88rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.45;
}
.integration-section {
  margin-bottom: 8px;
}
.integration-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.secret-boundary-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 10px;
}
.secret-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.secret-var-pill {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.secret-var-pill.is-present {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.secret-var-pill.is-missing {
  background: rgba(234, 179, 8, 0.12);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.25);
}
.secret-notice {
  display: block;
  font-size: 0.7rem;
  color: #64748b;
}
.integration-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.probe-result-slot {
  font-size: 0.8rem;
}

/* P6.2 Dogfood Workflows */
.dogfood-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.dogfood-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}
.dogfood-title {
  margin-bottom: 4px;
  font-size: 0.9rem;
}
.dogfood-steps {
  font-size: 0.82rem;
  padding-left: 18px;
  margin: 6px 0;
}

#topbar-logout {
  color: var(--text-tertiary);
  transition: all var(--ease);
}
#topbar-logout:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}
