/* ============================================================
   area14 ERP — Hoja de estilos principal
   Paleta: rojo area14 + azul agua + dorado podio
   Estética: moderna, plana, espaciosa, con acentos vanguardistas
   ============================================================ */

/* ──────────────────────────────────────────
   1. Tokens de diseño (variables CSS)
   ────────────────────────────────────────── */
:root {
  /* Marca */
  --color-primary: #BF0000;
  --color-primary-rgb: 191, 0, 0;
  --color-primary-dark: #7F0000;
  --color-primary-light: #FFE5E5;
  --color-aqua: #00A6CB;
  --color-aqua-rgb: 0, 166, 203;
  --color-aqua-dark: #00708C;
  --color-aqua-light: #E0F6FB;
  --color-gold: #C9A84C;
  --color-gold-light: #FAF1D3;

  /* Neutros (light) */
  --bg-app:        #F8FAFC;
  --bg-surface:    #FFFFFF;
  --bg-surface-2:  #F1F5F9;
  --bg-hover:      #F8FAFC;
  --border-color:  #E2E8F0;
  --border-strong: #CBD5E1;
  --text-primary:  #0F172A;
  --text-secondary:#475569;
  --text-muted:    #94A3B8;
  --text-inverse:  #FFFFFF;

  /* Sidebar (siempre oscuro, da carácter al ERP) */
  --sidebar-bg:        #0A1929;
  --sidebar-bg-2:      #0E1F33;
  --sidebar-border:    #1E2E42;
  --sidebar-text:      #B0BFD1;
  --sidebar-text-muted:#647488;
  --sidebar-active-bg: rgba(191, 0, 0, 0.18);
  --sidebar-hover-bg:  rgba(255, 255, 255, 0.04);

  /* Estados semánticos */
  --color-success:    #10B981;
  --color-success-bg: #DCFCE7;
  --color-warning:    #F59E0B;
  --color-warning-bg: #FEF3C7;
  --color-danger:     #EF4444;
  --color-danger-bg:  #FEE2E2;
  --color-info:       #3B82F6;
  --color-info-bg:    #DBEAFE;

  /* Sombras (escala discreta) */
  --shadow-xs:  0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm:  0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow:     0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-md:  0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-lg:  0 20px 30px -10px rgba(0, 0, 0, 0.10), 0 8px 12px -6px rgba(0, 0, 0, 0.06);

  /* Radios */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Espaciado */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-8: 48px;

  /* Layout */
  --sidebar-w: 264px;
  --topbar-h:  64px;
  --content-pad: 32px;

  /* Tipografía */
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --font-display: 'Manrope', sans-serif;

  /* Animaciones */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 200ms var(--ease-out);
}

/* Dark mode ──────────────────────────────── */
[data-theme="dark"] {
  --bg-app:        #0A1320;
  --bg-surface:    #0F1B2D;
  --bg-surface-2:  #142339;
  --bg-hover:      #182842;
  --border-color:  #1E2E42;
  --border-strong: #2A3A52;
  --text-primary:  #F1F5F9;
  --text-secondary:#94A3B8;
  --text-muted:    #64748B;

  --color-primary-light: rgba(191, 0, 0, 0.18);
  --color-aqua-light:    rgba(0, 166, 203, 0.18);
  --color-gold-light:    rgba(201, 168, 76, 0.18);

  --color-success-bg: rgba(16, 185, 129, 0.18);
  --color-warning-bg: rgba(245, 158, 11, 0.18);
  --color-danger-bg:  rgba(239, 68, 68, 0.18);
  --color-info-bg:    rgba(59, 130, 246, 0.18);

  --shadow-xs:  0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-sm:  0 2px 4px -1px rgba(0, 0, 0, 0.5), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
  --shadow:     0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-md:  0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-lg:  0 20px 30px -10px rgba(0, 0, 0, 0.6);
}

/* ──────────────────────────────────────────
   2. Base / reset suave
   ────────────────────────────────────────── */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body.erp-body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Texto y enlaces */
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }

/* Selección */
::selection { background: var(--color-primary); color: white; }

/* Scroll fino */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ──────────────────────────────────────────
   3. Layout principal
   ────────────────────────────────────────── */
.erp-layout {
  display: flex;
  min-height: 100vh;
}

.erp-main {
  flex: 1;
  min-width: 0;        /* importante para flex */
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.erp-content {
  flex: 1;
  padding: var(--content-pad);
  max-width: 100%;
}

/* ──────────────────────────────────────────
   4. Sidebar
   ────────────────────────────────────────── */
.erp-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

/* Brand */
.erp-sidebar-brand {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sidebar-border);
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
}
.brand-logo {
  width: 38px;
  height: 38px;
  background: var(--color-primary);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: white;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(191, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}
.brand-logo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
}
/* Logo como imagen: sin fondo ni gradiente, deja ver el PNG */
.brand-logo-img {
  background: transparent;
  box-shadow: none;
}
.brand-logo-img::before { content: none; }
.brand-logo-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 16px; color: white; letter-spacing: -0.02em; }
.brand-sub  { font-size: 10px; color: var(--sidebar-text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 3px; }

/* Crédito de desarrollo al pie del sidebar */
.sidebar-credit {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--sidebar-border, rgba(255,255,255,0.08));
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--sidebar-text-muted);
  text-align: center;
}

.sidebar-collapse-btn {
  background: none; border: 0; color: var(--sidebar-text);
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: grid; place-items: center; cursor: pointer;
}
.sidebar-collapse-btn:hover { background: var(--sidebar-hover-bg); color: white; }

/* Buscador */
.erp-sidebar-search {
  position: relative;
  padding: 16px 16px 12px;
}
.sidebar-search-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: white;
  padding: 9px 12px 9px 38px;
  font-size: 13px;
  border-radius: var(--radius);
  height: auto;
  width: 100%;
  font-family: var(--font-sans);
  transition: var(--transition);
}
.sidebar-search-input::placeholder { color: var(--sidebar-text-muted); }
.sidebar-search-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-aqua);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 166, 203, 0.15);
  color: white;
}
.search-icon {
  position: absolute;
  left: 28px; top: 50%;
  transform: translateY(-50%);
  color: var(--sidebar-text-muted);
  display: grid; place-items: center;
}
.search-kbd {
  position: absolute;
  right: 26px; top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--sidebar-text-muted);
  font-family: var(--font-mono);
}

/* Navegación */
.erp-sidebar-nav {
  flex: 1;
  padding: 4px 12px 16px;
  overflow-y: auto;
}
.nav-section { margin-bottom: 18px; }
.nav-section:last-child { margin-bottom: 0; }

.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--sidebar-text-muted);
  padding: 8px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 1px;
  position: relative;
  transition: var(--transition);
}
.nav-item:hover {
  background: var(--sidebar-hover-bg);
  color: white;
}
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: white;
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--color-primary);
  border-radius: 0 3px 3px 0;
}
.nav-icon {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-item.active .nav-icon { opacity: 1; color: var(--color-primary); }
.nav-text { flex: 1; }
.nav-badge {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
}
.nav-badge-aqua {
  background: rgba(0, 166, 203, 0.2);
  color: #5ED4F0;
}
.nav-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--color-success);
}
.nav-dot-live { animation: pulse 1.5s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  50%      { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
}

/* User card */
.erp-sidebar-user {
  border-top: 1px solid var(--sidebar-border);
  padding: 14px;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  border-radius: var(--radius);
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; line-height: 1.2; }
.user-name {
  color: white; font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { color: var(--sidebar-text-muted); font-size: 11px; margin-top: 2px; }
.user-logout {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--sidebar-text-muted);
  transition: var(--transition);
}
.user-logout:hover { background: rgba(239, 68, 68, 0.12); color: var(--color-danger); }

.erp-sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--transition);
}

/* ──────────────────────────────────────────
   5. Topbar
   ────────────────────────────────────────── */
.erp-topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--content-pad);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.topbar-menu-btn {
  background: none;
  border: 0;
  color: var(--text-primary);
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  cursor: pointer;
}
.topbar-menu-btn:hover { background: var(--bg-surface-2); }

/* Breadcrumb */
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
}
.bc-item {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: var(--transition);
}
.bc-home { display: grid; place-items: center; color: var(--text-muted); }
.bc-item:hover:not(.bc-current):not(.bc-home) { background: var(--bg-surface-2); color: var(--text-primary); }
.bc-current { color: var(--text-primary); font-weight: 600; }
.bc-sep { color: var(--text-muted); display: grid; place-items: center; opacity: 0.5; }

/* Actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-btn {
  background: none;
  border: 0;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}
.topbar-btn:hover { background: var(--bg-surface-2); color: var(--text-primary); }

.topbar-badge {
  position: absolute;
  top: 6px; right: 6px;
  background: var(--color-primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: grid; place-items: center;
  padding: 0 4px;
  border: 2px solid var(--bg-surface);
}

.topbar-theme-toggle .theme-light { display: none; }
.topbar-theme-toggle .theme-dark  { display: grid; }
[data-theme="dark"] .topbar-theme-toggle .theme-light { display: grid; }
[data-theme="dark"] .topbar-theme-toggle .theme-dark  { display: none; }

.topbar-user {
  background: none;
  border: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
  margin-left: 8px;
  transition: var(--transition);
}
.topbar-user:hover { background: var(--bg-surface-2); }
.topbar-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white;
  font-weight: 700;
  font-size: 11px;
}
.topbar-user-info { display: flex; flex-direction: column; line-height: 1.15; align-items: flex-start; }
.topbar-user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.topbar-user-role { font-size: 11px; color: var(--text-muted); }

/* Dropdown */
.topbar-dropdown { position: relative; }
.topbar-dropdown-menu {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  min-width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: var(--transition);
  z-index: 60;
}
.topbar-dropdown.open .topbar-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.topbar-dropdown-wide { min-width: 360px; }
.dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}
.dropdown-header a { color: var(--color-aqua); font-weight: 500; }
.dropdown-divider-erp { height: 1px; background: var(--border-color); margin: 4px 0; }
.dropdown-item-erp {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.dropdown-item-erp:hover { background: var(--bg-surface-2); }
.dropdown-item-danger:hover { background: var(--color-danger-bg); color: var(--color-danger); }

/* Notif item */
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  align-items: flex-start;
  transition: var(--transition);
}
.notif-item:hover { background: var(--bg-surface-2); }
.notif-unread { background: rgba(0, 166, 203, 0.03); position: relative; }
.notif-unread::after {
  content: '';
  position: absolute; right: 12px; top: 16px;
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--color-aqua);
}
.notif-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.notif-icon-success { background: var(--color-success-bg); color: var(--color-success); }
.notif-icon-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.notif-icon-aqua    { background: var(--color-aqua-light); color: var(--color-aqua); }
.notif-icon-gold    { background: var(--color-gold-light); color: var(--color-gold); }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.notif-time  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ──────────────────────────────────────────
   6. Page header
   ────────────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
}
.page-title-block { min-width: 0; }
.page-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.15;
}
.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ──────────────────────────────────────────
   7. Cards
   ────────────────────────────────────────── */
.erp-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}
.erp-card-tight { padding: 16px; }
.erp-card-loose { padding: 28px; }
.erp-card-flush { padding: 0; overflow: hidden; }
.erp-card:hover { box-shadow: var(--shadow-sm); }

.card-header-erp {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.card-title-erp {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title-erp .title-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--color-primary);
  background: var(--color-primary-light);
}
.card-subtitle-erp {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}
.card-actions-erp { display: flex; gap: 4px; align-items: center; }

/* ──────────────────────────────────────────
   8. KPI cards (dashboard)
   ────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--color-primary);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 300ms var(--ease-out);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card:hover::before { transform: scaleY(1); }
.kpi-card.kpi-aqua::before { background: var(--color-aqua); }
.kpi-card.kpi-gold::before { background: var(--color-gold); }
.kpi-card.kpi-success::before { background: var(--color-success); }

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.kpi-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
  font-feature-settings: 'tnum';
}
.kpi-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}
.kpi-delta-up      { background: var(--color-success-bg); color: var(--color-success); }
.kpi-delta-down    { background: var(--color-danger-bg);  color: var(--color-danger); }
.kpi-delta-neutral { background: var(--bg-surface-2);     color: var(--text-secondary); }

.kpi-spark {
  position: absolute;
  bottom: 12px; right: 12px;
  opacity: 0.4;
  pointer-events: none;
}

/* ──────────────────────────────────────────
   9. Badges
   ────────────────────────────────────────── */
.badge-erp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-erp svg { flex-shrink: 0; }

.badge-state-draft   { background: var(--bg-surface-2); color: var(--text-secondary); }
.badge-state-pre     { background: var(--color-info-bg); color: var(--color-info); }
.badge-state-open    { background: var(--color-success-bg); color: var(--color-success); }
.badge-state-closed  { background: var(--bg-surface-2); color: var(--text-secondary); }
.badge-state-live    { background: var(--color-primary-light); color: var(--color-primary); }
.badge-state-done    { background: var(--color-gold-light); color: var(--color-gold); }
.badge-state-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-state-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-state-danger  { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-state-neutral { background: var(--bg-surface-2); color: var(--text-secondary); }

.badge-tier-diamond { background: var(--color-primary-light); color: var(--color-primary-dark); border-color: rgba(191,0,0,0.2); }
.badge-tier-gold    { background: var(--color-gold-light); color: #8B6914; border-color: rgba(201,168,76,0.4); }
.badge-tier-silver  { background: #F1F5F9; color: #475569; border-color: #CBD5E1; }
.badge-tier-bronze  { background: #FFF1E5; color: #8B4513; border-color: #E0B583; }

.badge-pill-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-pill-live::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--color-primary);
  animation: pulse 1.5s ease-in-out infinite;
}

/* ──────────────────────────────────────────
   10. Botones
   ────────────────────────────────────────── */
.btn-erp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-erp-primary {
  background: var(--color-primary);
  color: white;
}
.btn-erp-primary:hover { background: var(--color-primary-dark); color: white; box-shadow: 0 4px 12px rgba(191,0,0,0.25); }

.btn-erp-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-erp-secondary:hover { background: var(--bg-surface-2); border-color: var(--border-strong); }

.btn-erp-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-erp-ghost:hover { background: var(--bg-surface-2); color: var(--text-primary); }

.btn-erp-aqua {
  background: var(--color-aqua);
  color: white;
}
.btn-erp-aqua:hover { background: var(--color-aqua-dark); color: white; }

.btn-erp-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
}

.btn-erp-sm { padding: 6px 10px; font-size: 12px; }

/* ──────────────────────────────────────────
   11. Tablas
   ────────────────────────────────────────── */
.erp-table-wrap {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
}
.erp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.erp-table thead th {
  background: var(--bg-surface-2);
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.erp-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}
.erp-table tbody tr:last-child td { border-bottom: 0; }
.erp-table tbody tr {
  transition: background 150ms ease;
}
.erp-table tbody tr:hover { background: var(--bg-hover); }
.erp-table tbody tr.row-highlight { background: rgba(201, 168, 76, 0.08); }
.erp-table tbody tr.row-highlight:hover { background: rgba(201, 168, 76, 0.15); }

.cell-mono { font-family: var(--font-mono); font-weight: 500; }
.cell-strong { font-weight: 700; }
.cell-muted  { color: var(--text-muted); }
.cell-aqua   { color: var(--color-aqua); font-weight: 700; }
.cell-primary{ color: var(--color-primary); font-weight: 700; }
.cell-gold   { color: var(--color-gold); font-weight: 700; }

.cell-dorsal {
  display: inline-block;
  min-width: 38px;
  padding: 3px 8px;
  background: var(--color-primary);
  color: white;
  font-weight: 800;
  text-align: center;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.cell-rank {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  color: var(--text-muted);
}
.cell-rank-1 { background: var(--color-gold-light); color: #8B6914; }
.cell-rank-2 { background: #F1F5F9; color: #475569; }
.cell-rank-3 { background: #FFF1E5; color: #B5651D; }

.nadador-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nadador-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}
.nadador-name { font-weight: 600; }
.nadador-club { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ──────────────────────────────────────────
   12. Filtros / barra superior de tabla
   ────────────────────────────────────────── */
.toolbar-erp {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.toolbar-search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}
.toolbar-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: 13px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  height: 36px;
}
.toolbar-search input:focus {
  outline: none;
  border-color: var(--color-aqua);
  box-shadow: 0 0 0 3px rgba(0, 166, 203, 0.15);
}
.toolbar-search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: 13px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  height: 36px;
  min-width: 140px;
}
.filter-select:focus { outline: none; border-color: var(--color-aqua); box-shadow: 0 0 0 3px rgba(0, 166, 203, 0.15); }

/* ──────────────────────────────────────────
   13. Iconos en formularios / forms misc
   ────────────────────────────────────────── */
.input-erp {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: 13px;
  color: var(--text-primary);
  font-family: var(--font-sans);
}
.input-erp:focus { outline: none; border-color: var(--color-aqua); box-shadow: 0 0 0 3px rgba(0, 166, 203, 0.15); }
.label-erp {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field-erp { margin-bottom: 14px; }

/* ──────────────────────────────────────────
   14. Misc: chips live, tarjetas tier, progress
   ────────────────────────────────────────── */
.chip-erp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.chip-meta { background: var(--color-success-bg); color: var(--color-success); }
.chip-agua { background: var(--color-aqua-light); color: var(--color-aqua-dark); }
.chip-salida { background: var(--color-info-bg); color: var(--color-info); }
.chip-nosalio { background: var(--bg-surface-2); color: var(--text-secondary); }
.chip-dnf { background: var(--color-danger-bg); color: var(--color-danger); }

.progress-erp {
  height: 6px;
  background: var(--bg-surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress-erp-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: 999px;
  transition: width 400ms var(--ease-out);
}
.progress-erp-bar-aqua { background: var(--color-aqua); }
.progress-erp-bar-success { background: var(--color-success); }
.progress-erp-bar-gold { background: var(--color-gold); }

/* Tier cards (patrocinadores) */
.tier-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.tier-card-diamante { background: linear-gradient(135deg, #1F0000 0%, #3F0000 100%); color: white; border-color: #5C0F12; }
.tier-card-platino { background: linear-gradient(135deg, #5B7C99 0%, #3A5269 100%); color: white; border-color: #3A5269; }
.tier-card-oro { background: linear-gradient(135deg, #C9A84C 0%, #8B6914 100%); color: white; border-color: #8B6914; }
.tier-card-plata { background: linear-gradient(135deg, #E2E8F0 0%, #94A3B8 100%); color: #1E293B; border-color: #94A3B8; }
.tier-card-bronce { background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%); color: white; border-color: #8B4513; }

.tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.tier-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.tier-capacity {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  opacity: 0.85;
  padding: 4px 10px;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}
.tier-card-plata .tier-capacity { background: rgba(0,0,0,0.08); }

.tier-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.tier-stat { }
.tier-stat-value { font-size: 22px; font-weight: 800; line-height: 1; }
.tier-stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; opacity: 0.8; margin-top: 4px; }

/* ──────────────────────────────────────────
   15. Login (página independiente, sin layout)
   ────────────────────────────────────────── */
body.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at top right, rgba(0, 166, 203, 0.2), transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(191, 0, 0, 0.15), transparent 50%),
    #0A1929;
  color: white;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
body.login-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0, 166, 203, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(191, 0, 0, 0.08) 0%, transparent 40%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(15, 27, 45, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 40px;
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 1;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.login-logo {
  width: 50px; height: 50px;
  background: var(--color-primary);
  border-radius: 14px;
  display: grid; place-items: center;
  color: white;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 8px 24px rgba(191, 0, 0, 0.5);
}
.login-brand-name { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.login-brand-sub  { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.12em; margin-top: 4px; }

.login-title { font-size: 26px; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.02em; }
.login-subtitle { font-size: 14px; color: rgba(255,255,255,0.55); margin-bottom: 28px; }

.login-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-family: var(--font-sans);
  margin-bottom: 14px;
  transition: var(--transition);
}
.login-input::placeholder { color: rgba(255,255,255,0.35); }
.login-input:focus {
  outline: none;
  border-color: var(--color-aqua);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(0, 166, 203, 0.2);
}
.login-button {
  width: 100%;
  padding: 13px;
  background: var(--color-primary);
  color: white;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font-sans);
  cursor: pointer;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}
.login-button:hover { background: var(--color-primary-dark); box-shadow: 0 8px 24px rgba(191, 0, 0, 0.4); }

.login-helper {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
.login-helper a { color: var(--color-aqua); }

.login-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ──────────────────────────────────────────
   16. Empty state
   ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-icon {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--bg-surface-2);
  display: grid; place-items: center;
  color: var(--text-muted);
}
.empty-title { font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.empty-sub { font-size: 13px; color: var(--text-muted); }

/* ──────────────────────────────────────────
   17. Responsive
   ────────────────────────────────────────── */
@media (max-width: 991.98px) {
  :root { --content-pad: 20px; }
  .erp-sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .erp-sidebar.open { transform: translateX(0); }
  .erp-sidebar-overlay.open { display: block; opacity: 1; }
  .erp-main { margin-left: 0; }
}

@media (max-width: 575.98px) {
  .page-title { font-size: 22px; }
  .kpi-value { font-size: 26px; }
  :root { --content-pad: 16px; }
}

/* Bootstrap overrides selectivos para uniformidad */
.dropdown-menu { font-family: var(--font-sans); }
.btn:focus, .btn:focus-visible { box-shadow: none; outline: 2px solid var(--color-aqua); outline-offset: 2px; }

/* Animación de entrada */
.fade-in { animation: fadeIn 300ms var(--ease-out) both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-delay-1 { animation-delay: 60ms; }
.fade-in-delay-2 { animation-delay: 120ms; }
.fade-in-delay-3 { animation-delay: 180ms; }
.fade-in-delay-4 { animation-delay: 240ms; }

/* ──────────────────────────────────────────
   18. Action dropdown (acciones contextuales)
   ────────────────────────────────────────── */
.action-dd { position: relative; display: inline-block; }
.action-dd-menu {
  position: fixed;
  min-width: 210px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0; visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition), transform var(--transition);
  z-index: 9000;
}
.action-dd.open .action-dd-menu,
.action-dd-menu.action-dd-menu-open {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.action-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: var(--transition);
}
.action-dd-item:hover {
  background: var(--bg-surface-2);
}
.action-dd-item svg { flex-shrink: 0; opacity: 0.7; }
.action-dd-item:hover svg { opacity: 1; }
.action-dd-danger { color: var(--color-danger); }
.action-dd-danger:hover { background: var(--color-danger-bg); }
.action-dd-sep { height: 1px; background: var(--border-color); margin: 4px 0; }

/* ──────────────────────────────────────────
   19. Tabs (para fichas detalle)
   ────────────────────────────────────────── */
.tabs-erp {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab-erp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border-top: 0; border-left: 0; border-right: 0;
  font-family: var(--font-sans);
  transition: var(--transition);
}
.tab-erp:hover { color: var(--text-primary); }
.tab-erp.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.tab-erp .tab-count {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-surface-2);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 700;
}
.tab-erp.active .tab-count { background: var(--color-primary-light); color: var(--color-primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ──────────────────────────────────────────
   20. Ficha header (cabecera de detalle con avatar grande)
   ────────────────────────────────────────── */
.entity-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}
.entity-avatar {
  width: 88px; height: 88px;
  border-radius: 20px;
  display: grid; place-items: center;
  color: white;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.entity-info { flex: 1; min-width: 0; }
.entity-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.entity-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.entity-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.entity-subtitle span { display: inline-flex; align-items: center; gap: 5px; }
.entity-actions { display: flex; gap: 8px; align-items: flex-start; flex-shrink: 0; flex-wrap: wrap; }

/* ──────────────────────────────────────────
   21. Definition list (dl) para fichas
   ────────────────────────────────────────── */
.dl-erp {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4px 24px;
}
.dl-erp dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 0;
}
.dl-erp dd {
  font-size: 14px;
  color: var(--text-primary);
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}
.dl-erp dt + dd { border-bottom: 1px solid var(--border-color); }
.dl-erp dt { border-bottom: 1px solid var(--border-color); }
.dl-erp dt:last-of-type, .dl-erp dd:last-of-type { border-bottom: 0; }

/* ──────────────────────────────────────────
   22. Confirm modal
   ────────────────────────────────────────── */
.modal-confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}
.modal-confirm-overlay.open { display: flex; }
.modal-confirm {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 28px;
  max-width: 440px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-lg);
  animation: modalIn 200ms var(--ease-out);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-confirm-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--color-danger-bg);
  color: var(--color-danger);
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.modal-confirm-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.01em; }
.modal-confirm-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.modal-confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ──────────────────────────────────────────
   23. Modal genérico ERP
   ────────────────────────────────────────── */
.erp-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 250;
  padding: 40px 20px;
  overflow-y: auto;
  backdrop-filter: blur(4px);
}
.erp-modal-overlay.open { display: flex; }
.erp-modal {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 200ms var(--ease-out);
  margin: auto;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 80px);
}
.erp-modal-lg { max-width: 720px; }
.erp-modal-xl { max-width: 980px; }
.erp-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}
.erp-modal-title {
  font-size: 15px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.erp-modal-close {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  border-radius: 4px;
  transition: var(--transition);
}
.erp-modal-close:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.erp-modal-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}
.erp-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: var(--bg-surface-2);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ──────────────────────────────────────────
   24. Ordenación de tablas
   ────────────────────────────────────────── */
.th-sortable { transition: var(--transition); }
.th-sortable:hover { color: var(--color-primary); background: var(--bg-surface-2); }
.th-sort-ind { display: inline-block; margin-left: 2px; font-weight: 700; }
