/* =====================================================================
   AnalíticaPLAI - Sistema de Diseño y Estilos UI de Alta Gama
   Arquitectura: Predominio Claro con Cabeceras y Pies de Página Oscuros
   Tríada de Tonos Oscuros: #046E54, #54046E, #6E5404
   Tríada de Fondos Claros: #C1F5DF, #DFC1F5, #F5DFC1
===================================================================== */

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

:root {
  /* ===================================================================
     1. VALORES PREDETERMINADOS: TEMA ESMERALDA & MENTA
     =================================================================== */
  /* Cabecera y Pies Oscuros (Tríada Equilátera) */
  --header-dark: #046E54;    /* Verde Pino Esmeralda Profundo */
  --header-dark-hover: #034a39;
  --header-text: #FFFFFF;
  --footer-dark: #034a39;
  --footer-text: #E6FBF2;

  /* Fondo General y Superficies (Predominio Claro) */
  --canvas-light: #C1F5DF;   /* Menta Cristalina Suave */
  --bg-primary: #edfbf5;     /* Fondo de página claro con matiz menta */
  --bg-secondary: #def7ec;   /* Fondo secundario de soporte */
  --bg-card: #FFFFFF;        /* Tarjetas en blanco nítido */
  --bg-card-hover: #f7fdfa;
  --bg-input: #FFFFFF;
  --border-color: rgba(4, 110, 84, 0.18);
  --border-focus: #046E54;

  /* Tipografía Oscura de Máxima Legibilidad */
  --text-main: #0f172a;      /* Slate oscuro carbón (WCAG 13.5:1) */
  --text-muted: #475569;     /* Slate intermedio para subtítulos */
  --text-dim: #64748b;       /* Slate suave para metadatos */
  --text-inverse: #FFFFFF;

  /* Acentos de la Tríada Cromática */
  --accent-primary: #046E54;
  --accent-primary-hover: #034a39;
  --accent-pine: #046E54;
  --accent-plum: #54046E;
  --accent-ochre: #6E5404;

  /* Acentos Temáticos Auxiliares */
  --accent-green: #059669;
  --accent-emerald: #046E54;
  --accent-yellow: #d97706;
  --accent-orange: #ea580c;
  --accent-rose: #e11d48;
  --accent-cyan: #0284c7;
  --accent-purple: #7c3aed;
  --accent-blue-strong: #046E54;
  --accent-blue-vibrant: #059669;

  /* Tablas y Listados Cebrados */
  --table-zebra-bg: #f2fbf7;
  --table-hover-bg: #e3f7ee;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --shadow-sm: 0 2px 8px rgba(4, 110, 84, 0.08);
  --shadow-md: 0 6px 20px -3px rgba(4, 110, 84, 0.12);
  --shadow-lg: 0 14px 34px -5px rgba(4, 110, 84, 0.18);

  --sidebar-width: 270px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* =====================================================================
   2. VARIANTES TEMÁTICAS INTERCAMBIABLES EN VIVO
   ===================================================================== */

/* TEMA 1: ESMERALDA & MENTA (#046E54 / #C1F5DF) */
body.theme-emerald, :root[data-theme="emerald"] {
  --header-dark: #046E54;
  --header-dark-hover: #034a39;
  --header-text: #FFFFFF;
  --footer-dark: #034a39;
  --footer-text: #E6FBF2;
  --canvas-light: #C1F5DF;
  --bg-primary: #edfbf5;
  --bg-secondary: #def7ec;
  --bg-card: #FFFFFF;
  --bg-card-hover: #f7fdfa;
  --border-color: rgba(4, 110, 84, 0.18);
  --border-focus: #046E54;
  --accent-primary: #046E54;
  --accent-primary-hover: #034a39;
  --table-zebra-bg: #f2fbf7;
  --table-hover-bg: #e3f7ee;
  --shadow-sm: 0 2px 8px rgba(4, 110, 84, 0.08);
  --shadow-md: 0 6px 20px -3px rgba(4, 110, 84, 0.12);
}

/* TEMA 2: CIRUELA & LAVANDA (#54046E / #DFC1F5) */
body.theme-plum, :root[data-theme="plum"] {
  --header-dark: #54046E;
  --header-dark-hover: #3c0250;
  --header-text: #FFFFFF;
  --footer-dark: #3c0250;
  --footer-text: #F5E8FF;
  --canvas-light: #DFC1F5;
  --bg-primary: #faf5fd;
  --bg-secondary: #f3e8fc;
  --bg-card: #FFFFFF;
  --bg-card-hover: #fcf9fe;
  --border-color: rgba(84, 4, 110, 0.18);
  --border-focus: #54046E;
  --accent-primary: #54046E;
  --accent-primary-hover: #3c0250;
  --table-zebra-bg: #f9f4fd;
  --table-hover-bg: #f3e8fc;
  --shadow-sm: 0 2px 8px rgba(84, 4, 110, 0.08);
  --shadow-md: 0 6px 20px -3px rgba(84, 4, 110, 0.12);
}

/* TEMA 3: OCRE & ARENA CÁLIDA (#6E5404 / #F5DFC1) */
body.theme-ochre, :root[data-theme="ochre"] {
  --header-dark: #6E5404;
  --header-dark-hover: #4d3b02;
  --header-text: #FFFFFF;
  --footer-dark: #4d3b02;
  --footer-text: #FEF3C7;
  --canvas-light: #F5DFC1;
  --bg-primary: #fdfaf5;
  --bg-secondary: #faeee0;
  --bg-card: #FFFFFF;
  --bg-card-hover: #fffdfa;
  --border-color: rgba(110, 84, 4, 0.18);
  --border-focus: #6E5404;
  --accent-primary: #6E5404;
  --accent-primary-hover: #4d3b02;
  --table-zebra-bg: #fdf8f2;
  --table-hover-bg: #faeee0;
  --shadow-sm: 0 2px 8px rgba(110, 84, 4, 0.08);
  --shadow-md: 0 6px 20px -3px rgba(110, 84, 4, 0.12);
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 12% 10%, var(--canvas-light) 0%, transparent 45%),
    radial-gradient(circle at 88% 90%, rgba(255, 255, 255, 0.9) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* =====================================================================
   3. BARRA LATERAL (SIDEBAR) & NAVEGACIÓN
   ===================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background: #FFFFFF;
  border-right: 1px solid var(--border-color);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.04);
  transition: border-color 0.3s ease;
}

.sidebar-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--header-dark);
  color: var(--header-text);
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  transition: background 0.3s ease;
}

.brand-badge {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 800;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}

.brand-version {
  font-size: 11px;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  padding: 2px 6px;
  border-radius: 4px;
}

.nav-menu {
  list-style: none;
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-weight: 700;
  padding: 14px 14px 6px;
}

.nav-item {
  margin-bottom: 3px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  position: relative;
}

.nav-link i {
  font-size: 17px;
  width: 20px;
  text-align: center;
  color: var(--text-dim);
  transition: color 0.2s;
}

.nav-link:hover {
  background: var(--bg-secondary);
  color: var(--text-main);
}

.nav-link:hover i {
  color: var(--accent-primary);
}

.nav-link.active {
  background: var(--bg-secondary);
  color: var(--accent-primary);
  border-left: 3px solid var(--accent-primary);
  font-weight: 700;
}

.nav-link.active i {
  color: var(--accent-primary);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--footer-dark);
  color: var(--footer-text);
  transition: background 0.3s ease;
}

.ai-copilot-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  color: #FFFFFF;
}

.ai-copilot-card:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.ai-pulse-dot {
  width: 9px;
  height: 9px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 10px #34d399;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* =====================================================================
   4. CABECERA SUPERIOR DEL SITIO (TOP-BAR OSCURA)
   ===================================================================== */
.app-container {
  margin-left: var(--sidebar-width);
  flex: 1 1 0%;
  min-width: 0;
  max-width: calc(100vw - var(--sidebar-width));
  width: calc(100% - var(--sidebar-width));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

.top-bar {
  height: 68px;
  background: var(--header-dark);
  color: var(--header-text);
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  transition: background 0.3s ease;
}

.top-title-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.3px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-live-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
}

/* Theme Switcher Pills en Topbar */
.theme-switcher-pill {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  padding: 3px 5px;
  gap: 3px;
}

.btn-theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-theme-pill:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.btn-theme-pill.active {
  background: #FFFFFF;
  color: #0f172a !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-weight: 700;
}

.btn-theme-pill .pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* =====================================================================
   5. CONTENIDO PRINCIPAL & TARJETAS BLANCAS (CARDS)
   ===================================================================== */
.main-content {
  padding: 30px 32px 60px;
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  overflow-x: hidden;
}

.view-section {
  display: none;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  animation: fadeIn 0.25s ease-in-out;
}

.view-section.active-view {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.grid-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 20px;
  margin-bottom: 26px;
  min-width: 0;
  max-width: 100%;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.card:hover {
  border-color: rgba(15, 23, 42, 0.25);
  box-shadow: var(--shadow-md);
}

.kpi-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-left: 4px solid var(--accent-primary);
}

.kpi-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin: 6px 0 4px;
  font-family: var(--font-sans);
}

.kpi-sub {
  font-size: 12px;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.kpi-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.icon-blue   { background: rgba(2, 132, 199, 0.12); color: #0284c7; border: 1px solid rgba(2, 132, 199, 0.25); }
.icon-yellow { background: rgba(217, 119, 6, 0.12); color: #d97706; border: 1px solid rgba(217, 119, 6, 0.25); }
.icon-orange { background: rgba(234, 88, 12, 0.12); color: #ea580c; border: 1px solid rgba(234, 88, 12, 0.25); }
.icon-green  { background: rgba(5, 150, 105, 0.12); color: #059669; border: 1px solid rgba(5, 150, 105, 0.25); }
.icon-purple { background: rgba(124, 58, 237, 0.12); color: #7c3aed; border: 1px solid rgba(124, 58, 237, 0.25); }

/* =====================================================================
   6. BOTONES, INPUTS & FORMULARIOS
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--header-dark);
  color: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
  background: var(--header-dark-hover);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--border-focus);
  color: var(--text-main);
}

.btn-success, .btn-green {
  background: #059669;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.btn-success:hover, .btn-green:hover {
  background: #047857;
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(225, 29, 72, 0.1);
  border-color: rgba(225, 29, 72, 0.25);
  color: #e11d48;
}

.btn-danger:hover {
  background: #e11d48;
  color: #fff;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13.5px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(4, 110, 84, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* =====================================================================
   7. LISTADOS TABULARES (DATA TABLES CON CABECERA & PIE OSCUROS)
   ===================================================================== */
.table-responsive {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.cell-truncate {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.data-table th {
  background: var(--header-dark);
  padding: 14px 16px;
  font-weight: 600;
  color: #FFFFFF !important;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
  transition: background 0.3s ease;
}

.data-table th i {
  color: rgba(255, 255, 255, 0.7);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text-main);
  white-space: nowrap;
}

.data-table tbody tr {
  background: #FFFFFF;
  transition: background 0.15s ease;
}

.data-table tbody tr:nth-child(even) {
  background: var(--table-zebra-bg);
}

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

/* Insignias de Estado */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
}

.status-active  { background: rgba(5, 150, 105, 0.14); color: #059669; border: 1px solid rgba(5, 150, 105, 0.3); }
.status-error   { background: rgba(225, 29, 72, 0.14); color: #e11d48; border: 1px solid rgba(225, 29, 72, 0.3); }
.status-warning { background: rgba(217, 119, 6, 0.14); color: #d97706; border: 1px solid rgba(217, 119, 6, 0.3); }

/* =====================================================================
   8. MODALES & DIÁLOGOS
   ===================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  padding: 0;
  color: var(--text-main);
}

.modal-header-styled {
  background: var(--header-dark);
  color: #FFFFFF;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body-styled {
  padding: 24px;
}

/* =====================================================================
   9. EDITOR SQL & COPILLOTO IA
   ===================================================================== */
.sql-editor-container {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: #38bdf8;
  width: 100%;
  min-height: 160px;
  resize: vertical;
}

.ai-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  height: 100vh;
  background: #FFFFFF;
  border-left: 1px solid var(--border-color);
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-drawer.open {
  right: 0;
}

.ai-drawer-header {
  padding: 18px 20px;
  background: var(--header-dark);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-drawer-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-message {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.5;
}

.ai-msg-assistant {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  align-self: flex-start;
}

.ai-msg-user {
  background: var(--header-dark);
  color: #FFFFFF;
  align-self: flex-end;
}

.ai-drawer-footer {
  padding: 16px;
  background: #FFFFFF;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
}

/* =====================================================================
   10. APLICACIONES CGC & SUBNAVS
   ===================================================================== */
.cgc-app-group {
  margin-bottom: 4px;
}

.cgc-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  cursor: pointer;
  background: transparent;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.cgc-app-header:hover {
  background: var(--bg-secondary);
}

.cgc-app-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.cgc-subnav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.cgc-subnav-link:hover {
  background: var(--bg-secondary);
  color: var(--text-main);
}

.cgc-subnav-link.active {
  background: var(--bg-secondary);
  color: var(--accent-primary);
  font-weight: 700;
  border-left: 2px solid var(--accent-primary);
}

.cgc-iframe-wrapper {
  position: relative;
  width: 100%;
  height: calc(100vh - 190px);
  min-height: 600px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* =====================================================================
   11. JERARQUÍA TIPOGRÁFICA Y REGLAS DE CONTRASTE ESTRICTO
   ===================================================================== */
/* Cabeceras Oscuras: Topbar y Sidebar Header */
.top-bar {
  background: var(--header-dark);
  color: #FFFFFF;
}
.top-bar .page-title {
  color: #FFFFFF !important;
}
.top-bar .badge-live-status {
  background: rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #FFFFFF !important;
}
.top-bar .btn-secondary {
  background: rgba(255, 255, 255, 0.16) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  color: #FFFFFF !important;
}
.top-bar .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.28) !important;
  color: #FFFFFF !important;
}
.top-bar .btn-secondary i, .top-bar .btn-secondary svg {
  color: #FFFFFF !important;
}

/* Pills de tema en Topbar */
.theme-switcher-pill {
  background: rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
}
.btn-theme-pill {
  color: rgba(255, 255, 255, 0.9) !important;
}
.btn-theme-pill.active {
  background: #FFFFFF !important;
  color: #0f172a !important;
  font-weight: 700 !important;
}

/* Cabecera y Pie de Barra Lateral */
.sidebar-header {
  background: var(--header-dark);
}
.sidebar-header .brand-title {
  color: #FFFFFF !important;
}
.sidebar-footer {
  background: var(--footer-dark);
  color: var(--footer-text);
}
.sidebar-footer a, .sidebar-footer div {
  color: var(--footer-text);
}

/* Superficies Claras: Cuerpo, Cards, Modales, Secciones */
body {
  color: var(--text-main);
}
.card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
}
.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.view-section h1, .view-section h2, .view-section h3, .view-section h4, .view-section h5, .view-section h6,
.modal-card h1, .modal-card h2, .modal-card h3, .modal-card h4 {
  color: var(--text-main) !important;
}
.card p, .card span:not(.status-badge):not(.kpi-sub):not(.badge-count) {
  color: var(--text-muted);
}
.card strong, .card b {
  color: var(--text-main);
}

/* Botones: Asegurar alto contraste sin sobreescribir texto */
.btn-primary {
  background: var(--header-dark) !important;
  color: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.btn-primary:hover {
  background: var(--header-dark-hover) !important;
  color: #FFFFFF !important;
}
.btn-primary i, .btn-primary svg, .btn-primary span {
  color: #FFFFFF !important;
}

.btn-secondary {
  background: #FFFFFF !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.btn-secondary:hover {
  background: var(--bg-secondary) !important;
  border-color: var(--border-focus) !important;
  color: var(--accent-primary) !important;
}
.btn-secondary i, .btn-secondary svg {
  color: var(--text-dim);
}
.btn-secondary:hover i, .btn-secondary:hover svg {
  color: var(--accent-primary);
}

.btn-success {
  background: #059669 !important;
  color: #FFFFFF !important;
}
.btn-success i, .btn-success svg, .btn-success span {
  color: #FFFFFF !important;
}

/* Modales */
.modal-card {
  background: #FFFFFF !important;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
}
.modal-card .form-label {
  color: #1e293b !important;
}

/* Formularios */
.form-label {
  color: #1e293b !important;
  font-weight: 600;
}
.form-control {
  background: #FFFFFF !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
}
.form-control:focus {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 3px rgba(4, 110, 84, 0.15) !important;
}

/* Tablas con Cabecera Oscura y Cebrado Claro */
.data-table thead th {
  background: var(--header-dark) !important;
  color: #FFFFFF !important;
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}
.data-table thead th i, .data-table thead th svg {
  color: rgba(255, 255, 255, 0.7) !important;
}
.data-table td {
  color: var(--text-main) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.data-table tbody tr {
  background: #FFFFFF;
}
.data-table tbody tr:nth-child(even) {
  background: var(--table-zebra-bg);
}
.data-table tbody tr:hover {
  background: var(--table-hover-bg);
}

/* Insignias de Estado Legibles sobre Fondo Claro */
.status-badge {
  font-weight: 600;
  border-radius: 12px;
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.status-active  { background: rgba(5, 150, 105, 0.12) !important; color: #065f46 !important; border: 1px solid rgba(5, 150, 105, 0.25) !important; }
.status-warning { background: rgba(217, 119, 6, 0.12) !important; color: #92400e !important; border: 1px solid rgba(217, 119, 6, 0.25) !important; }
.status-error   { background: rgba(225, 29, 72, 0.12) !important; color: #9f1239 !important; border: 1px solid rgba(225, 29, 72, 0.25) !important; }

/* =====================================================================
   MÓDULO DE RUTINAS & ARCHIVOS PLANOS - ESTILOS ENTERPRISE
   ===================================================================== */
.bimodal-tab-group {
  display: inline-flex;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
  gap: 4px;
  border: 1px solid var(--border-color);
}

.bimodal-tab-btn {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bimodal-tab-btn.active {
  background: #FFFFFF;
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.facing-panels-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.facing-panels-container > div {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .facing-panels-container {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tabular-preview-box {
  max-height: 420px;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.tabular-preview-box table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: var(--font-mono);
}

.tabular-preview-box th {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  color: var(--text-main);
  padding: 9px 12px;
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  z-index: 2;
}

.tabular-preview-box td {
  padding: 7px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.tabular-preview-box tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.015);
}

.schema-builder-box {
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.schema-builder-item {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 70px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.schema-builder-item:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(4, 110, 84, 0.08);
}

.flat-files-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.flat-files-grid > .card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.cron-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px;
  margin-top: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.dash-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.facing-panels-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* =====================================================================
   ESTILOS COMPLEMENTARIOS DE COMPONENTES UI
   ===================================================================== */
/* Botón de toggle del sidebar en móvil */
.btn-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-left: auto;
  transition: all 0.2s ease;
}

.btn-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Backdrop para mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Perfil de Usuario en Topbar */
.top-user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.top-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

/* Toolbars y Filtros de Búsqueda */
.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.users-search-box {
  flex: 1;
  min-width: 260px;
  position: relative;
  display: flex;
  align-items: center;
}

.users-search-box i, .users-search-box svg {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.users-search-input {
  padding-left: 36px !important;
}

.users-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.users-filter-select {
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.users-filter-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(4, 110, 84, 0.15);
}

.user-table-card {
  width: 100%;
}

/* Dropzone de Carga Universal */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  padding: 38px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
  transform: scale(1.005);
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(4, 110, 84, 0.12);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 26px;
}

.dropzone-icon svg, .dropzone-icon i {
  width: 28px;
  height: 28px;
}

.dropzone-helper-text {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.dropzone-browse-btn {
  margin-top: 8px;
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(4, 110, 84, 0.25);
  transition: all 0.2s ease;
  pointer-events: auto;
}

.dropzone-browse-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(4, 110, 84, 0.35);
}

.builder-inline-dropzone {
  padding: 14px 12px !important;
  margin-bottom: 14px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  transition: all 0.2s ease;
}

.builder-inline-dropzone:hover,
.builder-inline-dropzone.dragover {
  border-color: var(--accent-primary);
  background: var(--bg-primary);
  transform: scale(1.01);
}

/* CGC Bimodal Switcher & Grids */
.cgc-bimodal-switcher {
  display: inline-flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
}

.cgc-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cgc-mode-btn.active {
  background: #FFFFFF;
  color: var(--accent-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.cgc-multi-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 20px;
}

/* Grids de Construcción y Métricas */
.builder-layout-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.analytics-layout-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
}

.builder-field-row {
  display: grid;
  grid-template-columns: 140px 1fr 140px 1fr 36px;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

/* =====================================================================
   12. SISTEMA DE DISEÑO RESPONSIVO (DESKTOPS, TABLETS, MÓVILES)
   ===================================================================== */

/* Pantallas Medianas y Laptops (<= 1200px) */
@media (max-width: 1200px) {
  .grid-kpis {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 16px;
  }
}

/* Tablets y Dispositivos de Ancho Medio (<= 1024px) */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.45);
  }

  .btn-sidebar-toggle {
    display: inline-flex;
  }

  .btn-sidebar-close {
    display: inline-flex;
  }

  .app-container {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .top-bar {
    padding: 0 18px;
  }

  .builder-layout-grid {
    grid-template-columns: 1fr;
  }

  .analytics-layout-grid {
    grid-template-columns: 1fr;
  }

  .facing-panels-container {
    grid-template-columns: 1fr;
  }

  .cgc-iframe-wrapper {
    height: calc(100vh - 220px);
    min-height: 480px;
  }
}

/* Tablets Pequeñas y Móviles Horizontales (<= 768px) */
@media (max-width: 768px) {
  .top-bar {
    height: auto;
    min-height: 58px;
    padding: 8px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .top-title-area {
    gap: 10px;
    flex: 1;
    min-width: 160px;
  }

  .page-title {
    font-size: 15.5px;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-actions {
    gap: 8px;
    flex-wrap: wrap;
  }

  .theme-pill-text {
    display: none !important;
  }

  .btn-theme-pill {
    padding: 6px 8px;
  }

  .badge-live-status span:last-child {
    display: none;
  }

  .badge-live-status {
    padding: 6px 8px;
  }

  #top-copilot-btn span {
    display: none;
  }

  #top-copilot-btn {
    padding: 7px 10px;
  }

  .top-user-meta {
    display: none !important;
  }

  .top-user-profile {
    margin-left: 4px;
    padding-left: 8px;
  }

  .main-content {
    padding: 16px 14px 48px;
  }

  .grid-kpis {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .kpi-card {
    padding: 14px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .kpi-title {
    font-size: 11px;
  }

  .kpi-icon-box {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .card {
    padding: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ai-drawer {
    width: 100%;
    max-width: 100vw;
    right: -100%;
  }

  .modal-card {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 94vh !important;
    padding: 16px !important;
    border-radius: var(--radius-md) !important;
  }

  .schema-builder-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .bimodal-tab-group {
    width: 100%;
    display: flex;
  }

  .bimodal-tab-btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 7px 10px;
  }

  .cgc-bimodal-switcher {
    width: 100%;
    display: flex;
  }

  .cgc-mode-btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
  }

  .cgc-multi-charts-grid {
    grid-template-columns: 1fr;
  }

  .builder-field-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .builder-field-row span:first-child {
    grid-column: 1 / -1;
  }

  .builder-field-row button {
    grid-column: 1 / -1;
  }
}

/* Teléfonos Móviles y Pantallas Angostas (<= 480px) */
@media (max-width: 480px) {
  .top-bar {
    padding: 8px 10px;
  }

  .page-title {
    font-size: 14px;
    max-width: 140px;
  }

  .main-content {
    padding: 12px 10px 40px;
  }

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

  .card {
    padding: 14px 12px;
    border-radius: var(--radius-sm);
  }

  .btn {
    font-size: 12px;
    padding: 7px 12px;
  }

  .users-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .users-search-box {
    width: 100%;
    min-width: 0;
  }

  .users-filter-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .users-filter-select {
    width: 100%;
  }

  .dropzone {
    padding: 24px 12px;
  }

  .dropzone-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .modal-card {
    width: 98% !important;
    max-width: 98% !important;
    padding: 14px 10px !important;
  }

  .modal-header-styled {
    padding: 14px 16px;
  }

  .modal-body-styled {
    padding: 16px 12px;
  }

  .data-table th, .data-table td {
    padding: 9px 10px;
    font-size: 12px;
  }

  .status-badge {
    font-size: 10.5px;
    padding: 3px 7px;
  }

  .builder-field-row {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   13. UTILIDADES MODERNAS NATIVAS CSS GRID & TAILWIND COMPATIBLES
   ===================================================================== */
.w-full { width: 100% !important; }
.max-w-full { max-width: 100% !important; }
.min-w-0 { min-width: 0 !important; }
.h-full { height: 100% !important; }
.overflow-x-auto { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
.overflow-hidden { overflow: hidden !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break-words { overflow-wrap: break-word; word-break: break-word; }
.break-all { word-break: break-all; }

/* Grid Utilities */
.grid { display: grid !important; }
.grid-cols-1 { grid-template-columns: minmax(0, 1fr) !important; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }

.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }
.gap-5 { gap: 20px !important; }
.gap-6 { gap: 24px !important; }

/* Flex Utilities */
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.flex-col { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-1 { flex: 1 1 0% !important; min-width: 0 !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }

/* Media Queries para Utilidades Responsive */
@media (max-width: 1024px) {
  .lg\:grid-cols-1 { grid-template-columns: minmax(0, 1fr) !important; }
  .lg\:flex-col { flex-direction: column !important; }
}

@media (max-width: 768px) {
  .md\:grid-cols-1 { grid-template-columns: minmax(0, 1fr) !important; }
  .md\:flex-col { flex-direction: column !important; }
  .md\:w-full { width: 100% !important; }

  .facing-panels-actions {
    width: 100%;
    flex-direction: column;
  }
  .facing-panels-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .inspection-search-bar {
    width: 100%;
    flex-wrap: wrap;
  }
  .inspection-search-bar input {
    flex: 1;
    min-width: 140px;
  }
}

@media (max-width: 480px) {
  .sm\:grid-cols-1 { grid-template-columns: minmax(0, 1fr) !important; }
  .sm\:flex-col { flex-direction: column !important; }
  .sm\:w-full { width: 100% !important; }
}





