/* ==========================================================================
   SERCLITECH TuERP C.A. — EXECUTIVE PHARMACEUTICAL BI SUITE v5.0
   Obsidian Glassmorphism + Light Boardroom Mode | Precision Telemetry UI
   ========================================================================== */

:root {
  --bg-main: #060b16;
  --bg-elevated: #0b1324;
  --bg-sidebar: #080f1e;
  --bg-topbar: rgba(8, 15, 30, 0.88);
  --bg-card: rgba(13, 22, 40, 0.78);
  --bg-card-solid: #0d1628;
  --bg-input: rgba(15, 23, 42, 0.85);
  --bg-hover: rgba(56, 189, 248, 0.08);
  --bg-row-alt: rgba(255, 255, 255, 0.015);

  --border: rgba(56, 189, 248, 0.22);
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);

  --brand-red: #e11d48;
  --brand-red-glow: rgba(225, 29, 72, 0.35);
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-light: #38bdf8;
  --primary-glow: rgba(14, 165, 233, 0.30);

  --emerald: #10b981;
  --emerald-light: #34d399;
  --emerald-glow: rgba(16, 185, 129, 0.28);

  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --danger: #f43f5e;
  --danger-light: #fb7185;
  --purple: #8b5cf6;
  --purple-light: #a78bfa;
  --cyan: #06b6d4;
  --teal: #14b8a6;

  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 14px 36px rgba(0, 0, 0, 0.48), 0 0 22px rgba(14, 165, 233, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

/* BOARDROOM LIGHT MODE */
body.theme-light {
  --bg-main: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-topbar: rgba(255, 255, 255, 0.92);
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-solid: #ffffff;
  --bg-input: #f8fafc;
  --bg-hover: rgba(14, 165, 233, 0.08);
  --bg-row-alt: rgba(15, 23, 42, 0.02);

  --border: rgba(2, 132, 199, 0.25);
  --border-subtle: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 12px 30px rgba(15, 23, 42, 0.12);
}

body.theme-light .top-nav { color: #0f172a; }
body.theme-light .brand-info h2 { background: linear-gradient(90deg, #0f172a, #e11d48); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
body.theme-light .data-table th { background: #f8fafc; color: #475569; }
body.theme-light .data-table td { color: #1e293b; border-bottom-color: rgba(15, 23, 42, 0.06); }
body.theme-light .filter-group select { color: #0f172a; }
body.theme-light .filter-group select option { background: #ffffff; color: #0f172a; }
body.theme-light .kpi-data h3,
body.theme-light .tab-header h1,
body.theme-light .chart-header h3,
body.theme-light .table-header h3 { color: #0f172a; }
body.theme-light .user-name { color: #0f172a; }
body.theme-light .search-bar input,
body.theme-light .table-search-bar input,
body.theme-light .promo-select,
body.theme-light .promo-input { color: #0f172a; background: #f8fafc; }

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.22); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

body {
  background: var(--bg-main);
  background-image:
    radial-gradient(ellipse at 12% 8%, rgba(225, 29, 72, 0.08) 0%, transparent 42%),
    radial-gradient(ellipse at 85% 12%, rgba(14, 165, 233, 0.09) 0%, transparent 45%),
    radial-gradient(ellipse at 70% 90%, rgba(16, 185, 129, 0.06) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.tabular { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   TOP NAVIGATION BAR
   ========================================================================== */
.top-nav {
  height: 66px;
  background: var(--bg-topbar);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  gap: 0.75rem;
  z-index: 60;
  flex-shrink: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(225, 29, 72, 0.45));
}

.brand-info h2 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(90deg, #ffffff 30%, #fda4af 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ver-pill {
  font-size: 0.56rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.25), rgba(14, 165, 233, 0.25));
  border: 1px solid rgba(251, 113, 133, 0.4);
  color: #fda4af;
  -webkit-text-fill-color: #fda4af;
  letter-spacing: 0.6px;
}

.brand-info span.brand-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  min-width: 0;
}
.nav-controls > * { flex-shrink: 0; }

.cmd-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: 9px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cmd-trigger-btn:hover { border-color: var(--primary-light); color: var(--text-main); }
.cmd-trigger-btn kbd {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-secondary);
  font-family: var(--font-main);
}

.db-badge {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.36rem 0.7rem;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.db-badge:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(16, 185, 129, 0.22); }
.db-badge.offline {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.42);
  color: #fbbf24;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite;
}
.db-badge.offline .status-dot { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.rate-badge {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: var(--primary-light);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.36rem 0.65rem;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.filter-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 0.28rem 0.6rem;
  border-radius: 9px;
  font-size: 0.75rem;
}
.filter-group label { color: var(--text-muted); font-weight: 600; font-size: 0.72rem; }
.filter-group select {
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  outline: none;
  cursor: pointer;
}
.filter-group select option { background: #0f172a; color: #fff; }

/* Segmented Currency Switch */
.currency-switch {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}
.curr-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.28rem 0.5rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.curr-btn:hover { color: var(--text-main); }
.curr-btn.active {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
}

.btn-nav-action {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.42rem 0.8rem;
  border-radius: 9px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-nav-action:hover {
  background: rgba(14, 165, 233, 0.18);
  border-color: var(--primary-light);
  color: #fff;
  transform: translateY(-1px);
}
.btn-nav-action.primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  border-color: rgba(56, 189, 248, 0.5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}
.btn-nav-action.crimson {
  background: linear-gradient(135deg, #e11d48, #be123c);
  border-color: rgba(251, 113, 133, 0.5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.32);
}
.btn-nav-action.emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: rgba(52, 211, 153, 0.5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
}
.btn-nav-action.amber {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: rgba(251, 191, 36, 0.5);
  color: #0b1324;
  font-weight: 800;
}
.btn-icon-only {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
}

.user-profile-menu {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
}
.user-avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #e11d48, #0ea5e9);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
  color: #fff;
}
.user-details { display: flex; flex-direction: column; }
.user-name { font-size: 0.74rem; font-weight: 700; color: #fff; line-height: 1.1; }
.user-role { font-size: 0.6rem; font-weight: 700; color: var(--primary-light); letter-spacing: 0.4px; }

.btn-logout {
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  padding: 0.38rem 0.65rem;
  border-radius: 9px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
}
.btn-logout:hover { background: #e11d48; color: #fff; border-color: #f43f5e; }

/* ==========================================================================
   APP CONTAINER & CATEGORIZED SIDEBAR
   ========================================================================== */
.app-container {
  display: flex;
  height: calc(100vh - 66px);
  width: 100vw;
  overflow: hidden;
  position: relative;
}

.sidebar {
  width: 274px;
  min-width: 274px;
  max-width: 274px;
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  transition: width 0.26s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 40;
}

.sidebar-toggle {
  position: absolute;
  top: 18px;
  right: -13px;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  border: 2px solid #080f1e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  color: #fff;
  font-size: 0.65rem;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.45);
  transition: all 0.22s;
}
.sidebar-toggle:hover { transform: scale(1.12); }

.sidebar-search-wrap {
  padding: 0.85rem 0.85rem 0.4rem;
}
.sidebar-search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.sidebar-search-box i {
  position: absolute;
  left: 10px;
  color: #64748b;
  font-size: 0.75rem;
}
.sidebar-search-box input {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 9px;
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  color: #e2e8f0;
  font-size: 0.75rem;
  outline: none;
  transition: border-color 0.2s;
}
.sidebar-search-box input:focus { border-color: var(--primary-light); }

.sidebar-menu {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.4rem 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.sidebar-section-title {
  font-size: 0.64rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  padding: 0.75rem 0.55rem 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.sidebar-section-title.premium-title {
  color: #fbbf24;
  margin-top: 0.2rem;
}

.sidebar-divider {
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  margin: 0.45rem 0.4rem;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  width: 100%;
  padding: 0.58rem 0.78rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  position: relative;
}
.nav-btn i {
  font-size: 0.95rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.nav-btn span.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  transform: translateX(2px);
}
.nav-btn:hover i { transform: scale(1.1); }

.nav-btn.active {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.22) 0%, rgba(14, 165, 233, 0.04) 100%);
  border-color: rgba(56, 189, 248, 0.42);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.18);
}
.nav-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: #38bdf8;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 10px #38bdf8;
}

.nav-btn.ai-btn {
  background: rgba(245, 158, 11, 0.04);
  border-color: rgba(245, 158, 11, 0.08);
}
.nav-btn.ai-btn:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde68a;
}
.nav-btn.ai-btn.active {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.24), rgba(225, 29, 72, 0.08));
  border-color: rgba(251, 191, 36, 0.55);
  color: #fef3c7;
}
.nav-btn.ai-btn.active::before { background: #fbbf24; box-shadow: 0 0 10px #fbbf24; }

.nav-btn.promo-highlight {
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.16), rgba(245, 158, 11, 0.1));
  border-color: rgba(251, 113, 133, 0.35);
  color: #fff;
}
.nav-btn.promo-highlight:hover {
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.28), rgba(245, 158, 11, 0.18));
  border-color: #fb7185;
}

.badge-premium {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b1324;
  font-weight: 900;
  font-size: 0.54rem;
  padding: 2px 6px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.badge-premium.rose { background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff; }
.badge-count {
  background: #ef4444;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  background: rgba(6, 11, 22, 0.85);
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  text-align: center;
}
.footer-subtitle { font-size: 0.58rem; color: #64748b; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.footer-brand { font-size: 0.8rem; font-weight: 900; color: #38bdf8; letter-spacing: 1px; margin: 2px 0; }
.footer-ver { font-size: 0.6rem; color: #475569; }

/* COLLAPSED SIDEBAR */
.sidebar.collapsed { width: 70px; min-width: 70px; max-width: 70px; }
.sidebar.collapsed .sidebar-search-wrap,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .nav-btn .nav-label,
.sidebar.collapsed .nav-btn .badge-premium,
.sidebar.collapsed .nav-btn .badge-count { display: none !important; }
.sidebar.collapsed .sidebar-menu { padding: 0.8rem 0.4rem; align-items: center; }
.sidebar.collapsed .nav-btn { width: 46px; height: 42px; justify-content: center; padding: 0; }
.sidebar.collapsed .sidebar-toggle i { transform: rotate(180deg); }

/* ==========================================================================
   MAIN VIEWPORT & UNIFIED EXECUTIVE CARDS
   ========================================================================== */
.main-content {
  flex: 1 1 auto;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem 1.85rem 3.5rem;
}

.tab-content { display: none; animation: fadeSlideUp 0.26s ease-out; }
.tab-content.active { display: block; }
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.35rem;
}
.tab-header h1 {
  font-family: var(--font-heading);
  font-size: 1.42rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.02em;
}
.tab-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

/* EXECUTIVE HERO BANNER (HOME DASHBOARD) */
.exec-hero-strip {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.72));
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.4rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}
.exec-hero-strip::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(225, 29, 72, 0.16), transparent 70%);
  pointer-events: none;
}
body.theme-light .exec-hero-strip {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border-color: rgba(2, 132, 199, 0.2);
}
.hero-left h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}
.hero-left p { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }
.hero-shortcuts { display: flex; gap: 0.5rem; flex-wrap: wrap; z-index: 2; }

/* BENTO KPI GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.kpi-grid-6 {
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}
.kpi-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
  box-shadow: var(--shadow-card);
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}
.kpi-card.clickable { cursor: pointer; }
.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border);
  box-shadow: var(--shadow-hover);
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent, #0ea5e9);
  opacity: 0.85;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.kpi-icon.blue { background: rgba(14, 165, 233, 0.14); color: #38bdf8; }
.kpi-icon.emerald { background: rgba(16, 185, 129, 0.14); color: #34d399; }
.kpi-icon.orange { background: rgba(245, 158, 11, 0.14); color: #fbbf24; }
.kpi-icon.rose { background: rgba(244, 63, 94, 0.14); color: #fb7185; }
.kpi-icon.purple { background: rgba(139, 92, 246, 0.14); color: #a78bfa; }
.kpi-icon.cyan { background: rgba(6, 182, 212, 0.14); color: #22d3ee; }

.kpi-data { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.kpi-label {
  font-size: 0.69rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.55px;
}
.kpi-data h3 {
  font-family: var(--font-heading);
  font-size: 1.48rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0.18rem 0;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.kpi-sub { font-size: 0.72rem; color: var(--text-muted); }

.kpi-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}
.delta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
}
.delta-pill.up { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.delta-pill.down { background: rgba(244, 63, 94, 0.16); color: #fb7185; }
.delta-pill.warn { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.delta-pill.info { background: rgba(14, 165, 233, 0.16); color: #38bdf8; }

.btn-kpi-ver {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  color: #38bdf8;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}
.btn-kpi-ver:hover { background: #0284c7; color: #fff; border-color: #38bdf8; }

/* CHARTS & GLASS CARDS */
.charts-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.charts-grid-even {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 1120px) {
  .charts-grid, .charts-grid-even { grid-template-columns: 1fr; }
}

.chart-card, .table-card, .glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.25rem;
}
.charts-grid .chart-card,
.charts-grid-even .chart-card { margin-bottom: 0; }

.chart-header, .table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}
.chart-header h3, .table-header h3 {
  font-family: var(--font-heading);
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.chart-subtitle { font-size: 0.74rem; color: var(--text-muted); }
.chart-body { height: 280px; position: relative; }
.chart-body-lg { height: 320px; position: relative; }

/* TABLES & SEARCH BARS */
.table-search-bar, .search-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.search-input-wrapper {
  position: relative;
  flex: 1;
  max-width: 480px;
}
.search-input-wrapper i, .search-bar > i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.82rem;
}
.search-bar { position: relative; }
.search-input-wrapper input, .search-bar input, .table-search-bar input {
  width: 100%;
  padding: 0.52rem 0.9rem 0.52rem 2.2rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 0.8rem;
  outline: none;
  transition: all 0.2s;
}
.search-input-wrapper input:focus, .search-bar input:focus, .table-search-bar input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
}

.table-responsive {
  overflow-x: auto;
  max-height: 490px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.data-table th {
  background: rgba(11, 19, 36, 0.96);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  font-size: 0.68rem;
  padding: 0.78rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}
.data-table td {
  padding: 0.68rem 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  color: var(--text-secondary);
}
.data-table tbody tr:nth-child(even) td { background: var(--bg-row-alt); }
.data-table tbody tr:hover td { background: var(--bg-hover); }
.data-table td.loading { text-align: center; padding: 2.2rem; color: var(--text-muted); }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

/* BADGES & PILLS */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-green { background: rgba(16, 185, 129, 0.16); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.32); }
.badge-yellow { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.32); }
.badge-orange { background: rgba(249, 115, 22, 0.16); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.32); }
.badge-red { background: rgba(244, 63, 94, 0.16); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.35); }
.badge-blue { background: rgba(14, 165, 233, 0.16); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.32); }
.badge-purple { background: rgba(139, 92, 246, 0.16); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.32); }
.badge-gray { background: rgba(148, 163, 184, 0.14); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.25); }

.semaforo-filters, .preset-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.pill {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.36rem 0.75rem;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.pill:hover, .pill.active {
  background: var(--primary-dark);
  color: #fff;
  border-color: var(--primary-light);
}
.pill.pill-green.active { background: #10b981; border-color: #34d399; color: #052e16; }
.pill.pill-yellow.active { background: #f59e0b; border-color: #fbbf24; color: #0b1324; }
.pill.pill-orange.active { background: #ea580c; border-color: #fb923c; color: #fff; }
.pill.pill-red.active { background: #e11d48; border-color: #fb7185; color: #fff; }

/* ==========================================================================
   PREMIUM PROMOTIONS & FARMATODO SIMULATOR MODULE
   ========================================================================== */
.promo-controls-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem;
  background: var(--bg-card);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
}
.promo-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.38rem;
}
.promo-select, .promo-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 0.54rem 0.8rem;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
}
.promo-select:focus, .promo-input:focus { border-color: #fbbf24; }

.promo-sliders-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 1180px) { .promo-sliders-grid { grid-template-columns: 1fr; } }

.slider-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
}
.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
}
.slider-val-badge {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
}
input[type="range"].pro-range {
  width: 100%;
  accent-color: #0ea5e9;
  height: 6px;
  cursor: pointer;
}

.verdict-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(14, 165, 233, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.42);
  border-left: 5px solid #10b981;
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.verdict-banner.warn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(244, 63, 94, 0.08));
  border-color: rgba(245, 158, 11, 0.45);
  border-left-color: #f59e0b;
}
.verdict-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.verdict-banner.warn .verdict-icon { background: rgba(245, 158, 11, 0.22); color: #fbbf24; }
.verdict-body h4 { font-family: var(--font-heading); font-size: 0.98rem; font-weight: 800; color: var(--text-main); margin-bottom: 0.3rem; }
.verdict-body p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.55; }

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 0.95rem;
  margin-bottom: 1.25rem;
}
.scenario-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
  min-width: 0;
  transition: all 0.22s;
}
.scenario-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.scenario-card-head .badge,
.scenario-card-head .delta-pill {
  max-width: 100%;
  font-size: 0.64rem;
  padding: 3px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scenario-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.scenario-card.recommended {
  border-color: rgba(16, 185, 129, 0.6);
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.12), var(--bg-card));
  box-shadow: 0 0 28px rgba(16, 185, 129, 0.14);
}
.scenario-card.reference {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.08), var(--bg-card));
}
.scenario-tag {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 6px;
  width: fit-content;
}
.scenario-metric {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.78rem;
  padding: 0.3rem 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.12);
}
.scenario-metric:last-child { border-bottom: none; }
.scenario-metric span { color: var(--text-muted); }
.scenario-metric strong { color: var(--text-main); font-variant-numeric: tabular-nums; }

.mode-tabs-inline {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.mode-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}
.mode-tab-btn.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b1324;
}

/* ==========================================================================
   FLOATING AI ASSISTANT DRAWER (SERCLITECH IA EXECUTIVE)
   ========================================================================== */
#serclitech-ai-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e11d48, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.45rem;
  box-shadow: 0 8px 30px rgba(14, 165, 233, 0.5), 0 0 25px rgba(225, 29, 72, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  z-index: 9998;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#serclitech-ai-bubble:hover { transform: scale(1.1); }

#serclitech-ai-drawer {
  position: fixed;
  bottom: 94px;
  right: 24px;
  width: 480px;
  height: 630px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 115px);
  background: #0a1222;
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 20px;
  box-shadow: 0 24px 65px rgba(0, 0, 0, 0.85), 0 0 35px rgba(14, 165, 233, 0.22);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: width 0.25s ease;
}
#serclitech-ai-drawer.expanded { width: 680px; height: 740px; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-drawer-header {
  padding: 0.95rem 1.2rem;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-header-info { display: flex; align-items: center; gap: 0.7rem; }
.ai-header-avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #e11d48, #0ea5e9);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff;
}
.ai-header-title { display: flex; align-items: center; gap: 0.45rem; font-size: 0.92rem; font-weight: 800; color: #fff; }
.ai-header-status { font-size: 0.67rem; color: #34d399; font-weight: 700; display: flex; align-items: center; gap: 0.35rem; margin-top: 2px; }
.ai-drawer-actions { display: flex; align-items: center; gap: 0.35rem; }
.ai-drawer-close {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #94a3b8;
  width: 30px; height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.ai-drawer-close:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }

.ai-drawer-pills {
  padding: 0.65rem 0.9rem;
  background: rgba(15, 23, 42, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.ai-quick-btn {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #7dd3fc;
  padding: 0.3rem 0.62rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.ai-quick-btn:hover { background: rgba(14, 165, 233, 0.26); color: #fff; transform: translateY(-1px); }
.ai-quick-btn.rose { background: rgba(225, 29, 72, 0.16); border-color: rgba(251, 113, 133, 0.42); color: #fda4af; }
.ai-quick-btn.green { background: rgba(16, 185, 129, 0.14); border-color: rgba(52, 211, 153, 0.35); color: #6ee7b7; }
.ai-quick-btn.amber { background: rgba(245, 158, 11, 0.14); border-color: rgba(251, 191, 36, 0.35); color: #fcd34d; }

.ai-drawer-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.81rem;
}
.ai-bubble-msg {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  line-height: 1.5;
  max-width: 94%;
}
.ai-bubble-msg.bot {
  background: rgba(20, 32, 56, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
  align-self: flex-start;
}
.ai-bubble-msg.user {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
}
.ai-mini-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
  gap: 0.45rem;
  margin: 0.7rem 0;
}
.ai-mini-kpi {
  background: rgba(6, 11, 22, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  text-align: center;
}
.ai-mini-kpi small { display: block; font-size: 0.62rem; color: #94a3b8; }
.ai-mini-kpi strong { font-size: 0.84rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ai-mini-table-wrap {
  overflow-x: auto;
  margin-top: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
}
.ai-mini-table { width: 100%; border-collapse: collapse; font-size: 0.71rem; }
.ai-mini-table th { background: rgba(6, 11, 22, 0.8); color: #94a3b8; padding: 5px 7px; text-align: left; }
.ai-mini-table td { padding: 5px 7px; border-top: 1px solid rgba(255, 255, 255, 0.04); color: #e2e8f0; }

.ai-drawer-footer {
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 0.5rem;
}
.ai-drawer-input {
  flex: 1;
  background: #060b16;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.58rem 0.85rem;
  border-radius: 10px;
  color: #fff;
  font-size: 0.81rem;
  outline: none;
}
.ai-drawer-input:focus { border-color: #38bdf8; }
.ai-drawer-send {
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  border: none;
  color: #fff;
  width: 38px; height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ==========================================================================
   MODALS & COMMAND PALETTE
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 18, 0.82);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1.25rem;
}
.modal-overlay.active { display: flex; }

.modal-window, .modal-card {
  background: #0d1628;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 18px;
  width: 100%;
  max-width: 960px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #f8fafc;
}
.modal-card { padding: 1.5rem; max-width: 740px; overflow-y: auto; }
@keyframes modalPop {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-header {
  padding: 1.15rem 1.4rem;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.modal-card .modal-header { padding: 0 0 1rem; background: transparent; margin-bottom: 1rem; }
.modal-header h2, .modal-header h3 { font-family: var(--font-heading); font-size: 1.08rem; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 0.5rem; }
.modal-title-wrap { display: flex; align-items: center; gap: 0.75rem; }
.modal-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem;
}
.modal-close, .modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.modal-close:hover, .modal-close-btn:hover { background: #e11d48; color: #fff; border-color: #f43f5e; }
.modal-toolbar {
  padding: 0.8rem 1.4rem;
  background: rgba(15, 23, 42, 0.55);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.modal-search-box { position: relative; flex: 1; max-width: 420px; }
.modal-search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 0.82rem; }
.modal-search-box input {
  width: 100%; padding: 0.48rem 0.9rem 0.48rem 2.2rem;
  background: #060b16; border: 1px solid rgba(148, 163, 184, 0.2); border-radius: 8px; color: #fff; font-size: 0.8rem; outline: none;
}
.modal-body { padding: 1.25rem 1.4rem; overflow-y: auto; flex: 1; }
.modal-card .modal-body { padding: 0; }
.modal-section { margin-bottom: 1.15rem; }
.modal-section h3 { font-size: 0.9rem; color: #38bdf8; margin-bottom: 0.45rem; }
.modal-section p { font-size: 0.83rem; color: #cbd5e1; line-height: 1.6; }
.pilares-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.8rem; margin-top: 0.85rem; }
.pilar-box { background: rgba(15, 23, 42, 0.7); border: 1px solid rgba(148, 163, 184, 0.14); border-left: 3px solid #38bdf8; padding: 0.85rem; border-radius: 10px; }
.pilar-box h4 { font-size: 0.8rem; color: #fff; margin-bottom: 0.3rem; }
.pilar-box p { font-size: 0.74rem; color: #94a3b8; line-height: 1.45; }

/* COMMAND PALETTE */
.cmd-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.62rem 0.9rem; border-radius: 10px; cursor: pointer; transition: background 0.15s;
}
.cmd-item:hover { background: rgba(14, 165, 233, 0.16); }

/* TOAST */
#executive-welcome-toast {
  position: fixed; top: 76px; right: 24px; z-index: 99990; max-width: 420px;
  background: linear-gradient(135deg, rgba(13, 22, 40, 0.97), rgba(20, 32, 56, 0.95));
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 14px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.65);
  padding: 1rem 1.2rem;
  backdrop-filter: blur(16px);
  display: none; transform: translateY(-20px); opacity: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* RESPONSIVE TOPBAR POLISH FOR 1280px-1440px LAPTOPS */
@media (max-width: 1460px) {
  .top-nav { padding: 0 0.85rem; gap: 0.5rem; }
  .brand-info span.brand-sub { display: none; }
  .brand-info h2 { font-size: 0.92rem; }
  .nav-controls { gap: 0.36rem; }
  .cmd-trigger-btn span { display: none; }
  .cmd-trigger-btn { padding: 0.36rem 0.55rem; }
  .db-badge, .rate-badge { padding: 0.32rem 0.55rem; font-size: 0.69rem; }
  .filter-group { padding: 0.26rem 0.48rem; }
  .filter-group select { font-size: 0.71rem; max-width: 112px; }
  .curr-btn { padding: 0.26rem 0.42rem; font-size: 0.67rem; }
  .btn-nav-action { padding: 0.36rem 0.6rem; font-size: 0.72rem; }
  .btn-icon-only { width: 31px; height: 31px; }
  .user-profile-menu { padding: 0.2rem 0.48rem; gap: 0.4rem; }
  .user-name { max-width: 86px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.7rem; }
  .btn-logout { padding: 0.34rem 0.55rem; }
}

/* PRINT STYLES */
@media print {
  .top-nav, .sidebar, #serclitech-ai-bubble, #serclitech-ai-drawer, #executive-welcome-toast, .header-actions { display: none !important; }
  body { background: #fff !important; color: #000 !important; height: auto; overflow: visible; }
  .app-container { height: auto; display: block; }
  .main-content { padding: 0; overflow: visible; }
  .chart-card, .table-card, .kpi-card { break-inside: avoid; border: 1px solid #cbd5e1; background: #fff !important; color: #000 !important; }
}

/* Demo logo framing & 1280px compact fit */
.nav-logo-img {
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(255, 255, 255, 0.96);
  padding: 2px;
}
.filter-group select { white-space: nowrap; }
#usuarios-table th, #usuarios-table td { padding: 0.55rem 0.65rem; font-size: 0.76rem; }
@media (max-width: 1360px) {
  .top-nav { padding: 0 0.65rem; gap: 0.35rem; }
  .nav-brand { gap: 0.5rem; }
  .nav-logo-img { height: 34px; }
  .brand-info h2 { font-size: 0.85rem; }
  .brand-info .ver-pill { font-size: 0.58rem; padding: 2px 5px; }
  .nav-controls { gap: 0.28rem; flex-shrink: 1; min-width: 0; }
  .cmd-trigger-btn { padding: 0.3rem 0.45rem; font-size: 0.68rem; }
  .db-badge, .rate-badge { padding: 0.28rem 0.46rem; font-size: 0.65rem; white-space: nowrap; }
  .filter-group { padding: 0.24rem 0.4rem; }
  .filter-group select { max-width: 96px; font-size: 0.68rem; }
  .curr-btn { padding: 0.24rem 0.36rem; font-size: 0.65rem; }
  .btn-nav-action { padding: 0.3rem 0.48rem; font-size: 0.68rem; }
  .btn-icon-only { width: 29px; height: 29px; }
  .user-profile-menu { padding: 0.18rem 0.36rem; gap: 0.32rem; }
  .user-details { display: none; }
  .btn-logout { padding: 0.3rem 0.48rem; flex-shrink: 0; }
}
