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

:root {
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Colores Principales — Paleta Ejecutiva / SaaS Moderno */
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --accent-border: #bfdbfe;

  /* Superficies y Fondos */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f8fafc;

  /* Sidebar Oscuro Premium */
  --sidebar-bg: #090d16;
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #f8fafc;
  --sidebar-item-active: rgba(255, 255, 255, 0.08);
  --sidebar-item-active-border: #3b82f6;

  /* Tipografía */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-disabled: #94a3b8;

  /* Bordes */
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: #2563eb;

  /* Estados Funcionales */
  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;

  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;

  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  /* Sombras Ultra-Pulidas */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* Reset Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* ------------------------------------------------------------- */
/* ICONOS SVG EN LÍNEA                                           */
/* ------------------------------------------------------------- */
.svg-icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.8px;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.svg-icon.sm { width: 14px; height: 14px; stroke-width: 1.8px; }
.svg-icon.lg { width: 22px; height: 22px; stroke-width: 1.8px; }

/* ------------------------------------------------------------- */
/* SIDEBAR DE NAVEGACIÓN — ESTILO SAAS MODERNO                   */
/* ------------------------------------------------------------- */
.sidebar {
  width: 250px;
  background-color: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--sidebar-border);
  user-select: none;
  z-index: 100;
}

.sidebar-header {
  padding: 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-brand-box {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
}

.sidebar-brand-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #94a3b8;
}

.sidebar-brand-text {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-section-title {
  padding: 16px 18px 6px 18px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
}

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

.sidebar-menu li {
  margin-bottom: 3px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  position: relative;
}

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

.sidebar-menu a.active {
  color: #ffffff;
  background-color: var(--sidebar-item-active);
  font-weight: 600;
}

.sidebar-menu a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background-color: var(--sidebar-item-active-border);
  border-radius: 0 2px 2px 0;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 12px;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
}

.system-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #10b981;
  font-weight: 600;
}
.system-status-indicator .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

/* ------------------------------------------------------------- */
/* CONTENEDOR PRINCIPAL                                          */
/* ------------------------------------------------------------- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-app);
}

/* ------------------------------------------------------------- */
/* TOPBAR (CABECERA SUPERIOR)                                    */
/* ------------------------------------------------------------- */
.topbar {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.topbar-title p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ------------------------------------------------------------- */
/* BOTONES — ESTILO MINIMALISTA Y REFINADO                       */
/* ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-xs);
}
.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-outline {
  background: #ffffff;
  border: 1px solid #d0d5dd;
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.btn-subtle {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}
.btn-subtle:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn-danger-outline {
  background: #ffffff;
  border: 1px solid var(--danger-border);
  color: var(--danger);
}
.btn-danger-outline:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  padding: 6px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ------------------------------------------------------------- */
/* CONTENEDOR DE PESTAÑAS Y VISTAS                               */
/* ------------------------------------------------------------- */
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
  animation: viewFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ------------------------------------------------------------- */
/* TARJETAS DE MÉTRICAS KPI (DASHBOARD)                          */
/* ------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.stat-card-meta {
  display: flex;
  flex-direction: column;
}

.stat-card-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-card-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.stat-card-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-card-icon.emerald { background: #ecfdf5; color: #059669; }
.stat-card-icon.amber { background: #fffbeb; color: #d97706; }
.stat-card-icon.slate { background: #f1f5f9; color: #475569; }

/* ------------------------------------------------------------- */
/* TARJETAS CONTENEDORAS                                         */
/* ------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title-group {
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ------------------------------------------------------------- */
/* BARRAS DE BÚSQUEDA Y FILTROS                                  */
/* ------------------------------------------------------------- */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon-inside {
  position: absolute;
  left: 11px;
  color: #94a3b8;
  pointer-events: none;
}

.search-input {
  padding: 8px 12px 8px 34px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius-md);
  font-size: 13px;
  width: 260px;
  background: #ffffff;
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s ease;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius-md);
  font-size: 13px;
  background: #ffffff;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ------------------------------------------------------------- */
/* TABLAS DE DATOS PROFESIONALES (ENTERPRISE)                    */
/* ------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

table.data-table th {
  background: #fafbfc;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

table.data-table tr:last-child td {
  border-bottom: none;
}

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

table.data-table tbody tr:hover {
  background-color: #f8fafc;
}

table.data-table code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #334155;
  border: 1px solid #e2e8f0;
}

/* ------------------------------------------------------------- */
/* INSIGNIAS DE ESTADO (STATUS PILLS CON PUNTO)                 */
/* ------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-border); }
.badge-gray    { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge-accent  { background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent-border); }

/* Clases de compatibilidad heredadas */
.badge-green { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-red   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-border); }
.badge-amber { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }

/* ------------------------------------------------------------- */
/* MODALES PULIDOS                                               */
/* ------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  animation: modalScaleUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 18px;
  line-height: 1;
}

.modal-close:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
}

/* ------------------------------------------------------------- */
/* FORMULARIOS Y CONTROLES                                       */
/* ------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.form-group.col-span-2 {
  grid-column: span 2;
}

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

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--text-primary);
  background: #ffffff;
  outline: none;
  transition: all 0.15s ease;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-control[readonly] {
  background-color: #f8fafc;
  color: #64748b;
  cursor: default;
}

/* ------------------------------------------------------------- */
/* TABLA DE LÍNEAS DEL COTIZADOR                                 */
/* ------------------------------------------------------------- */
.items-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.items-table th {
  background: #f8fafc;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  border-bottom: 1px solid var(--border);
}

.items-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.items-table input, .items-table select {
  padding: 6px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  width: 100%;
  font-size: 12.5px;
  outline: none;
}

.items-table input:focus, .items-table select:focus {
  border-color: var(--accent);
}

.btn-remove-row {
  color: var(--danger);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}
.btn-remove-row:hover {
  background: var(--danger-bg);
}

/* ------------------------------------------------------------- */
/* VISTA DE DOCUMENTOS (PRESUPUESTOS Y FACTURAS EN FORMATO HOJA)  */
/* ------------------------------------------------------------- */
.doc-sheet {
  background: #ffffff;
  padding: 44px 48px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  max-width: 820px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
  color: #0f172a;
}

/* ------------------------------------------------------------- */
/* ZONA DE ARRASTRAR ARCHIVOS (DROPZONE)                          */
/* ------------------------------------------------------------- */
.dropzone {
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  background: #fafbfc;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: #f0f7ff;
}

.dropzone-icon-box {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

/* ------------------------------------------------------------- */
/* GRIDS DE DOS COLUMNAS                                         */
/* ------------------------------------------------------------- */
.dashboard-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.quote-totals-grid {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 24px;
}

.quote-shipping-card {
  flex: 1;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.quote-summary-card {
  width: 300px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

/* ------------------------------------------------------------- */
/* ELEMENTOS MÓVILES                                             */
/* ------------------------------------------------------------- */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
}
.sidebar-backdrop.open {
  display: block;
}

.mobile-toggle {
  display: none;
  background: #ffffff;
  border: 1px solid #d0d5dd;
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.mobile-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
}

/* ------------------------------------------------------------- */
/* RESPONSIVE DESIGN (< 1024px)                                  */
/* ------------------------------------------------------------- */
@media (max-width: 1024px) {
  body {
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: -300px !important;
    width: 260px !important;
    z-index: 9999 !important;
    transition: left 0.24s cubic-bezier(0.16, 1, 0.3, 1) !important;
    visibility: hidden;
  }

  .sidebar.open {
    left: 0 !important;
    visibility: visible !important;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.4) !important;
  }

  .mobile-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  .mobile-close-btn {
    display: inline-block !important;
  }

  .topbar {
    height: auto !important;
    padding: 12px 16px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .topbar-left {
    width: 100% !important;
    justify-content: space-between;
  }

  .topbar-actions {
    width: 100% !important;
  }
  .topbar-actions .btn {
    flex: 1 !important;
  }

  .view-container {
    padding: 16px 14px !important;
  }

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

  .dashboard-two-cols {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
  }
  .form-group.col-span-2 {
    grid-column: span 1 !important;
  }

  .quote-totals-grid {
    flex-direction: column !important;
  }
  .quote-summary-card {
    width: 100% !important;
  }

  .card-header {
    flex-direction: column !important;
    align-items: stretch !important;
  }
}

/* ------------------------------------------------------------- */
/* PANTALLA DE LOGIN CORPORATIVO                                 */
/* ------------------------------------------------------------- */
.login-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background-color: #090d16;
  background-image: radial-gradient(circle at 50% 10%, rgba(37, 99, 235, 0.15), transparent 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #ffffff;
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-container {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.login-brand h2 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
}

.login-brand p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------- */
/* TARJETA DE USUARIO EN SIDEBAR                                 */
/* ------------------------------------------------------------- */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 12px;
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: 500;
}

.sidebar-user-logout {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.sidebar-user-logout:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.badge-role-admin {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 700;
  font-size: 11px;
}

.badge-role-comercial {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-weight: 700;
  font-size: 11px;
}
