@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ==================== BLACK EMPIRE DESIGN TOKENS ==================== */
:root,
[data-theme="dark"] {
  --bg-app: #050507;
  --bg-surface: #0a0a0d;
  --bg-elevated: #111116;
  --bg-card: #0d0d12;
  --bg-hover: #181820;
  --bg-input: #121217;
  --bg-glass: rgba(13, 13, 18, 0.85);

  --sidebar-bg: #07070a;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #949cae;
  --sidebar-text-hover: #ffffff;
  --sidebar-text-active: #ffffff;

  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-faint: #64748b;

  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-focus: #ffffff;
  --border-strong: rgba(255, 255, 255, 0.22);

  --accent: #27272a;
  --accent-glow: rgba(255, 255, 255, 0.16);
  --accent-soft: rgba(255, 255, 255, 0.08);
  --accent-text: #ffffff;

  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(16, 185, 129, 0.3);

  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --amber-border: rgba(245, 158, 11, 0.3);

  --crimson: #ef4444;
  --crimson-soft: rgba(239, 68, 68, 0.14);
  --crimson-border: rgba(239, 68, 68, 0.35);

  --violet: #38bdf8;
  --violet-soft: rgba(56, 189, 248, 0.12);
  --violet-border: rgba(56, 189, 248, 0.3);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 14px 35px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 25px rgba(255, 255, 255, 0.08);

  --skeleton-base: #111116;
  --skeleton-highlight: #1e1e26;
}

[data-theme="light"] {
  --bg-app: #f4f5f8;
  --bg-surface: #ffffff;
  --bg-elevated: #f0f2f5;
  --bg-card: #ffffff;
  --bg-hover: #e9ecef;
  --bg-input: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.92);

  --sidebar-bg: #09090b;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #a1a1aa;
  --sidebar-text-hover: #ffffff;
  --sidebar-text-active: #ffffff;

  --text-main: #09090b;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  --border-subtle: #e2e8f0;
  --border-focus: #09090b;
  --border-strong: #cbd5e1;

  --accent: #09090b;
  --accent-glow: rgba(0, 0, 0, 0.12);
  --accent-soft: #f1f3f6;
  --accent-text: #09090b;

  --emerald: #059669;
  --emerald-soft: #ecfdf5;
  --emerald-border: #a7f3d0;

  --amber: #d97706;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;

  --crimson: #dc2626;
  --crimson-soft: #fef2f2;
  --crimson-border: #fecaca;

  --violet: #0284c7;
  --violet-soft: #f0f9ff;
  --violet-border: #bae6fd;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 10px 25px -4px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(0, 0, 0, 0.08);

  --skeleton-base: #e4e4e7;
  --skeleton-highlight: #f4f4f5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

[data-theme="light"] * {
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

/* ==================== MICRO SCROLLBARS OBSIDIAN EXECUTIVE ==================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

::-webkit-scrollbar-thumb:active {
  background: rgba(255, 255, 255, 0.48);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.32);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:active {
  background: rgba(0, 0, 0, 0.45);
}

html, body {
  height: 100%;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow: hidden;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

svg.icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

svg.icon-sm { width: 13px; height: 13px; }
svg.icon-lg { width: 18px; height: 18px; }

/* ==================== SKELETON LOADERS ==================== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 25%,
    var(--skeleton-highlight) 50%,
    var(--skeleton-base) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 6px;
  display: inline-block;
}

.skeleton-line { height: 12px; width: 100%; margin-bottom: 6px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 8px; }
.skeleton-avatar { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; }
.skeleton-pill { height: 22px; width: 90px; border-radius: 999px; }

/* ==================== SLEEK BLACK EMPIRE LOGIN SCREEN ==================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 12%, #18181f 0%, #08080a 55%, #020203 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .login-screen {
  background: radial-gradient(circle at 50% 12%, #ffffff 0%, #edf1f6 55%, #dee3ea 100%);
}

.login-screen::before {
  content: '';
  position: absolute;
  width: 700px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  top: 10%;
  pointer-events: none;
}

[data-theme="light"] .login-screen::before {
  background: radial-gradient(circle, rgba(0, 0, 0, 0.04) 0%, transparent 70%);
}

.login-card-pro {
  width: 100%;
  max-width: 440px;
  background: #0d0d12;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 38px 34px;
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.95), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 10;
  backdrop-filter: blur(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .login-card-pro {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.09);
  box-shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.14), 0 0 1px 1px rgba(0, 0, 0, 0.04);
}

.login-header-pro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-gem,
.corp-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(145deg, #27272a 0%, #09090b 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 14.5px;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

[data-theme="light"] .brand-gem,
[data-theme="light"] .corp-mark {
  background: linear-gradient(145deg, #18181b 0%, #09090b 100%);
  border: 1px solid #000000;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.brand-text h2 {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.theme-toggle-btn,
.theme-toggle-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}

.theme-toggle-btn:hover,
.theme-toggle-ghost:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
  color: var(--text-main);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.theme-label-text {
  font-weight: 700;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.login-headline h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 6px;
}

.login-headline p {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-bottom: 22px;
}

.login-card-pro .field-group label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.login-card-pro .input-corp {
  padding: 10px 13px;
  font-size: 13px;
  border-radius: 9px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  transition: all 0.18s ease;
}

.login-card-pro .input-corp:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-card-pro .input-corp::placeholder {
  color: var(--text-faint);
}

.demo-pills-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 22px 0 10px;
  display: flex;
  justify-content: space-between;
}

.demo-chips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.demo-chip-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.demo-chip-btn:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.demo-avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 800;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.demo-avatar.admin {
  background: var(--amber-soft);
  color: var(--amber);
}

.demo-meta strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
}

.demo-meta span {
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ==================== WORKSPACE APP SHELL ==================== */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg-app);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 90;
}

/* Sidebar Ultra-Elegante */
.corp-sidebar {
  width: 260px;
  min-width: 260px;
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  z-index: 95;
  user-select: none;
  flex-shrink: 0;
  transition: width 0.24s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: width, min-width;
  position: relative;
}

.sidebar-collapse-btn,
.desktop-collapse-trigger {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
  padding: 0;
}

.sidebar-collapse-btn:hover,
.desktop-collapse-trigger:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
}

[data-theme="light"] .sidebar-collapse-btn,
[data-theme="light"] .desktop-collapse-trigger {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #475569;
}

[data-theme="light"] .sidebar-collapse-btn:hover,
[data-theme="light"] .desktop-collapse-trigger:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.2);
}

.collapse-icon {
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-top {
  padding: 16px 14px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-brand-text {
  min-width: 0;
}

.sidebar-brand-group h3 {
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.live-indicator,
.sidebar-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: #34d399;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ==================== ESTADO COLAPSADO (ICON RAIL) ==================== */
.corp-sidebar.collapsed {
  width: 70px;
  min-width: 70px;
}

.corp-sidebar.collapsed .sidebar-top {
  padding: 14px 6px;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.corp-sidebar.collapsed .sidebar-brand-group {
  gap: 0;
  justify-content: center;
}

.corp-sidebar.collapsed .sidebar-brand-text {
  display: none;
}

.corp-sidebar.collapsed .collapse-icon {
  transform: rotate(180deg);
}

.corp-sidebar.collapsed .sidebar-nav-scroll {
  padding: 12px 6px;
  overflow-x: hidden;
}

.corp-sidebar.collapsed .nav-group-header {
  font-size: 0;
  height: 1px;
  padding: 0;
  margin: 12px 6px;
  background: var(--sidebar-border);
  overflow: hidden;
}

.corp-sidebar.collapsed .nav-item {
  padding: 10px 0;
  justify-content: center;
  position: relative;
}

.corp-sidebar.collapsed .nav-item-left {
  gap: 0;
  justify-content: center;
}

.corp-sidebar.collapsed .nav-item-left span {
  display: none;
}

.corp-sidebar.collapsed .nav-item svg.icon {
  width: 19px;
  height: 19px;
  margin: 0;
}

.corp-sidebar.collapsed .nav-counter {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--sidebar-bg);
}

.corp-sidebar.collapsed .sidebar-bottom-panel {
  padding: 10px 6px;
}

.corp-sidebar.collapsed .sidebar-user-card {
  flex-direction: column;
  padding: 8px 4px;
  gap: 8px;
  align-items: center;
}

.corp-sidebar.collapsed .sidebar-user-text {
  display: none;
}

.corp-sidebar.collapsed .sidebar-user-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.corp-sidebar.collapsed .btn-logout-icon {
  width: 28px;
  height: 28px;
}

/* Hover-to-expand suave si el cursor reposa sobre el menú colapsado en desktop */
@media (min-width: 1025px) {
  .corp-sidebar.collapsed:hover {
    width: 260px;
    min-width: 260px;
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.65);
    transition-delay: 0.16s;
  }

  .corp-sidebar.collapsed:hover .sidebar-top {
    flex-direction: row;
    padding: 16px 14px;
    align-items: center;
  }

  .corp-sidebar.collapsed:hover .sidebar-brand-group {
    gap: 10px;
    justify-content: flex-start;
  }

  .corp-sidebar.collapsed:hover .sidebar-brand-text {
    display: block;
  }

  .corp-sidebar.collapsed:hover .collapse-icon {
    transform: rotate(0deg);
  }

  .corp-sidebar.collapsed:hover .sidebar-nav-scroll {
    padding: 12px 10px;
  }

  .corp-sidebar.collapsed:hover .nav-group-header {
    font-size: 10px;
    height: auto;
    padding: 14px 10px 6px;
    margin: 0;
    background: transparent;
  }

  .corp-sidebar.collapsed:hover .nav-item {
    padding: 8px 10px;
    justify-content: space-between;
  }

  .corp-sidebar.collapsed:hover .nav-item-left {
    gap: 9px;
    justify-content: flex-start;
  }

  .corp-sidebar.collapsed:hover .nav-item-left span {
    display: inline;
  }

  .corp-sidebar.collapsed:hover .nav-counter {
    position: static;
    font-size: 10.5px;
    min-width: unset;
    height: unset;
    padding: 2px 7px;
    box-shadow: none;
  }

  .corp-sidebar.collapsed:hover .sidebar-bottom-panel {
    padding: 10px 12px;
  }

  .corp-sidebar.collapsed:hover .sidebar-user-card {
    flex-direction: row;
    padding: 8px 10px;
    gap: 8px;
  }

  .corp-sidebar.collapsed:hover .sidebar-user-text {
    display: block;
  }

  .corp-sidebar.collapsed:hover .sidebar-user-actions {
    flex-direction: row;
    gap: 4px;
  }
}

.live-indicator::before,
.sidebar-status-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
}

.sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sidebar-nav-scroll {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
}

.nav-group-header {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555d71;
  padding: 14px 10px 6px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 2px;
  transition: all 0.14s ease;
  text-align: left;
  font-family: inherit;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-text-hover);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: inset 2px 0 0 #ffffff;
}

.nav-item.active svg.icon {
  color: #ffffff;
}

.nav-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.nav-item.active .nav-counter {
  background: #ffffff;
  color: #09090b;
  font-weight: 800;
}

.nav-counter.alert-pill {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.sidebar-bottom-panel {
  padding: 10px 12px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-user-card,
.user-card-sleek {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.sidebar-user-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.user-avatar-badge,
.user-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #27272a, #09090b);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 800;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.sidebar-user-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.sidebar-user-text strong,
.user-meta-text strong {
  display: block;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.sidebar-user-text span,
.user-meta-text span {
  display: block;
  font-size: 9.5px;
  color: #a1a1aa;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.sidebar-user-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.btn-logout-icon,
.btn-icon-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #a1a1aa;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-logout-icon:hover,
.btn-icon-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-logout-icon[title*="Cerrar"]:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

/* ==================== WORKSPACE MAIN CONTAINER ==================== */
.workspace-main {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-app);
}

/* Cabecera Flotante Vidrio / Frosted Glass */
.corp-header {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger-btn {
  display: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
}

.breadcrumb-trail {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-text);
  margin-bottom: 1px;
}

.header-titles h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.header-titles p {
  font-size: 11.5px;
  color: var(--text-muted);
}

.header-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-body {
  padding: 20px 24px 60px;
  max-width: 1650px;
  width: 100%;
  margin: 0 auto;
}

/* ==================== KPI STATS TILES (CON MICRO-INTERACCIONES GSAP) ==================== */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.kpi-tile:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.kpi-tile.danger-tile {
  border-color: var(--crimson-border);
  background: linear-gradient(145deg, var(--bg-card) 60%, var(--crimson-soft) 100%);
}

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

.kpi-tile-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-icon-gem,
.kpi-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.kpi-icon-gem.indigo,
.kpi-icon-gem.blue,
.kpi-icon-box.indigo,
.kpi-icon-box.blue {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.kpi-icon-gem.amber,
.kpi-icon-box.amber {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: var(--amber-border);
}

.kpi-icon-gem.crimson,
.kpi-icon-box.crimson {
  background: var(--crimson-soft);
  color: var(--crimson);
  border-color: var(--crimson-border);
}

.kpi-icon-gem.violet,
.kpi-icon-box.violet {
  background: var(--violet-soft);
  color: var(--violet);
  border-color: var(--violet-border);
}

.kpi-icon-gem.emerald,
.kpi-icon-box.emerald {
  background: var(--emerald-soft);
  color: var(--emerald);
  border-color: var(--emerald-border);
}

.kpi-tile-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.kpi-tile-footer {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.kpi-progress-track {
  height: 3px;
  width: 100%;
  background: var(--bg-elevated);
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}

.kpi-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  width: 0%;
  transition: width 0.45s ease;
}

/* ==================== BANNER DECISIÓN ADMIN (NO ANSWER 5) ==================== */
.decision-banner {
  background: linear-gradient(90deg, #7f1d1d 0%, #991b1b 50%, #dc2626 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 13px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
}

.decision-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.decision-icon-pulse {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.decision-banner-left strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.decision-banner-left span {
  font-size: 11.5px;
  color: #fecaca;
}

/* ==================== CONTROL BAR: TABS, FILTROS Y VIEW SWITCHER ==================== */
.control-bar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 13px 15px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.segmented-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.seg-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.14s;
}

.seg-tab:hover {
  border-color: var(--accent);
  color: var(--text-main);
}

.seg-tab.active {
  background: #ffffff;
  color: #09090b;
  border-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  font-weight: 800;
}

.seg-tab.tab-danger.active {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.control-filters {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.search-box-wrap {
  position: relative;
  min-width: 240px;
  flex: 1;
}

.search-box-wrap svg.icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.search-input-corp {
  width: 100%;
  padding: 7px 11px 7px 32px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  font-size: 12.5px;
  color: var(--text-main);
  font-family: inherit;
  transition: all 0.15s;
}

.select-corp,
.input-corp,
.textarea-corp {
  padding: 7px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  font-size: 12.5px;
  color: var(--text-main);
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s;
}

.search-input-corp:focus,
.select-corp:focus,
.input-corp:focus,
.textarea-corp:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.select-corp optgroup {
  background: var(--bg-card);
  color: var(--accent-text);
  font-weight: 800;
  font-size: 11.5px;
  padding: 6px 4px;
}

.select-corp option {
  background: var(--bg-surface);
  color: var(--text-main);
  font-weight: 500;
  font-size: 12.5px;
  padding: 5px 8px;
}

.view-mode-switcher {
  display: inline-flex;
  background: var(--bg-elevated);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.view-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.14s;
}

.view-mode-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ==================== BULK BAR ==================== */
.bulk-command-bar {
  background: var(--bg-elevated);
  color: var(--text-main);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-strong);
}

.bulk-info-left {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 12.5px;
}

.bulk-badge-count {
  background: var(--accent);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
}

.bulk-actions-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

/* ==================== BUTTONS (LINEAR / STRIPE STYLE) ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
  line-height: 1.25;
}

.btn:active {
  transform: scale(0.97);
}

.btn-xs {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
  gap: 4px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11.5px;
  border-radius: 7px;
  gap: 5px;
}

.btn-primary {
  background: linear-gradient(180deg, #27272a 0%, #09090b 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-weight: 700;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #3f3f46 0%, #18181b 100%);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  color: #ffffff;
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(180deg, #18181b 0%, #09090b 100%);
  color: #ffffff;
  border: 1px solid #000000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(180deg, #27272a 0%, #18181b 100%);
  border-color: #000000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  color: #ffffff;
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.btn-amber {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.btn-amber:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
  color: #ffffff;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
  color: #ffffff;
}

.row-checkbox,
.rr-agent-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  border-radius: 4px;
}

.count {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

.crm-row {
  transition: background-color 0.12s ease;
}

/* ==================== HIGH-END DATA TABLE ==================== */
.data-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.data-panel-header {
  padding: 11px 18px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.data-panel-header-left {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.data-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  border-radius: 0 0 14px 14px;
}

.data-table-wrapper::-webkit-scrollbar {
  height: 5px;
}

table.enterprise-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  text-align: left;
}

table.enterprise-table th {
  background: var(--bg-elevated);
  padding: 9px 12px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

table.enterprise-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  font-size: 12.5px;
}

table.enterprise-table tbody tr {
  transition: background-color 0.12s ease;
}

table.enterprise-table tbody tr:hover {
  background-color: var(--bg-hover);
}

table.enterprise-table tbody tr.row-critical-5 {
  background-color: var(--crimson-soft);
}

table.enterprise-table tbody tr.row-critical-5:hover {
  background-color: rgba(239, 68, 68, 0.2);
}

.cell-nowrap {
  white-space: nowrap;
}

.lead-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
  max-width: 210px;
}

.lead-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 800;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lead-name-link {
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  font-size: 13px;
  display: block;
  white-space: nowrap;
}

.lead-name-link:hover {
  color: var(--accent-text);
  text-decoration: underline;
}

.lead-email-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.country-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.agent-assigned-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.agent-mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  flex-shrink: 0;
}

.agent-assigned-pill.unassigned {
  background: var(--amber-soft);
  border-color: var(--amber-border);
  color: var(--amber);
}

.agent-assigned-pill.unassigned .agent-mini-dot {
  background: var(--amber);
}

.report-snippet-box {
  min-width: 160px;
  max-width: 240px;
}

table.enterprise-table th:last-child {
  text-align: right;
  min-width: 135px;
}

table.enterprise-table td:last-child {
  text-align: right;
  min-width: 135px;
  white-space: nowrap;
}

.report-snippet-text {
  font-size: 12px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.report-snippet-meta {
  font-size: 10.5px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ==================== ESTADO CRM Y MEDIDOR 5 INTENTOS ==================== */
.crm-status-wrap {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  width: fit-content;
}

.status-NEW {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-NO-ANSWER-1,
.status-NO-ANSWER-2 {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.status-NO-ANSWER-3,
.status-NO-ANSWER-4 {
  background: rgba(249, 115, 22, 0.12);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.status-NO-ANSWER-5 {
  background: var(--crimson-soft);
  color: var(--crimson);
  border: 1px solid var(--crimson-border);
}

.status-CALL-AGAIN {
  background: var(--violet-soft);
  color: var(--violet);
  border: 1px solid var(--violet-border);
}

.status-NO-INTEREST {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.status-INTERESTED {
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.attempt-bar-5 {
  display: inline-grid;
  grid-template-columns: repeat(5, 14px);
  gap: 3px;
}

.attempt-seg {
  height: 3px;
  border-radius: 2px;
  background: var(--border-subtle);
  opacity: 0.5;
}

.attempt-seg.active-amber {
  background: #f59e0b;
  opacity: 1;
}

.attempt-seg.active-crimson {
  background: #ef4444;
  opacity: 1;
}

/* ==================== TABLERO KANBAN VERCEL ==================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(250px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.kanban-col {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.kanban-col-header {
  padding: 11px 13px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
}

.kanban-col-body {
  padding: 9px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.16s ease;
}

.kanban-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

/* ==================== DIRECTORIO DE AGENTES ==================== */
.agents-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.corp-agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.2s ease;
}

.corp-agent-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.corp-agent-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.corp-agent-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.corp-agent-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.credential-vault {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.agent-metrics-matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.matrix-cell {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 8px;
  text-align: center;
}

.matrix-cell strong {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.matrix-cell span {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ==================== DRAWER PANEL (ESTACIÓN DE LLAMADA) ==================== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 120;
  display: flex;
  justify-content: flex-end;
}

.drawer-sheet {
  width: 100%;
  max-width: 600px;
  background: var(--bg-surface);
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  border-left: 1px solid var(--border-subtle);
}

.drawer-top {
  padding: 16px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-content {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-dossier {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
}

.dossier-field label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.dossier-value {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.panel-section {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  background: var(--bg-card);
}

.panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-section-header h4 {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.state-matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.state-btn {
  padding: 9px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.14s;
  text-align: center;
}

.state-btn:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.state-btn.selected {
  background: #ffffff;
  color: #09090b;
  border-color: #ffffff;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.25);
  font-weight: 800;
}

.state-btn.selected-critical {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.45);
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.preset-chip {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
}

.preset-chip:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-soft);
}

.audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audit-entry {
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 10px 12px;
}

.audit-entry.critical { border-left-color: #ef4444; }
.audit-entry.transfer { border-left-color: #f59e0b; }

.audit-entry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ==================== MODALS VERCEL STYLE ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-window {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-top {
  padding: 14px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-top h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}

.modal-body-scroll {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.modal-bottom {
  padding: 12px 20px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

.field-group label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

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

/* ==================== TOASTS ==================== */
.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 90vw;
}

.toast-item {
  background: var(--bg-elevated);
  color: var(--text-main);
  padding: 11px 15px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent);
}

.toast-item.success { border-left-color: #10b981; }
.toast-item.error { border-left-color: #ef4444; }

/* ==================== RESPONSIVO (MÓVIL Y TABLET) ==================== */
@media (max-width: 1024px) {
  .hamburger-btn { display: inline-flex; }
  .sidebar-close-btn { display: inline-flex; }
  .desktop-collapse-trigger { display: none !important; }
  .sidebar-collapse-btn { display: none !important; }

  .corp-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 270px;
    transform: translateX(-100%);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .corp-sidebar.collapsed {
    width: 270px !important;
    min-width: 270px !important;
  }

  .corp-sidebar.collapsed .sidebar-brand-text,
  .corp-sidebar.collapsed .nav-item-left span,
  .corp-sidebar.collapsed .sidebar-user-text {
    display: block !important;
  }

  .corp-sidebar.collapsed .nav-item {
    justify-content: space-between !important;
    padding: 8px 10px !important;
  }

  .corp-sidebar.collapsed .nav-item-left {
    gap: 9px !important;
    justify-content: flex-start !important;
  }

  .corp-sidebar.collapsed .nav-counter {
    position: static !important;
    font-size: 10.5px !important;
    min-width: unset !important;
    height: unset !important;
    padding: 2px 7px !important;
    box-shadow: none !important;
  }

  .corp-sidebar.collapsed .nav-group-header {
    font-size: 10px !important;
    height: auto !important;
    padding: 14px 10px 6px !important;
    margin: 0 !important;
    background: transparent !important;
  }

  .corp-sidebar.collapsed .sidebar-top {
    flex-direction: row !important;
    padding: 16px 14px !important;
  }

  .corp-sidebar.collapsed .sidebar-user-card {
    flex-direction: row !important;
    padding: 8px 10px !important;
  }

  .corp-sidebar.collapsed .sidebar-user-actions {
    flex-direction: row !important;
  }

  .corp-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.open {
    display: block;
  }

  .corp-header { padding: 12px 16px; }
  .workspace-body { padding: 16px 14px 60px; }
}

@media (max-width: 768px) {
  .corp-header {
    padding: 10px 14px;
    gap: 10px;
  }
  .header-left {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
  }
  .header-titles h1 {
    font-size: 15px;
  }
  .header-titles p {
    font-size: 11px;
  }
  .header-toolbar {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }
  .workspace-body {
    padding: 12px 10px 60px;
  }
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .contact-dossier,
  .grid-2-cols {
    grid-template-columns: 1fr;
  }
  .state-matrix-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .drawer-sheet {
    max-width: 100%;
  }
  .modal-window {
    width: 94%;
    max-width: 500px;
    padding: 20px 16px;
  }
  .table-controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .table-controls-left,
  .table-controls-right {
    width: 100%;
    flex-wrap: wrap;
  }
}
