/* ═══════════════════════════════════════════════════════════════
   INCUBAPRO — Sistema de Diseño RESPONSIVE
   Breakpoints:
     Mobile:  < 640px
     Tablet:  640px – 1023px
     Desktop: ≥ 1024px
   ═══════════════════════════════════════════════════════════════ */

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

/* ── Tokens Modo Claro ──────────────────────────────────────── */
:root {
  --bg:            #f0f2f5;
  --bg-soft:       #e8eaed;
  --surface:       #ffffff;
  --surface-2:     #f7f8fa;
  --surface-3:     #eef0f3;
  --text:          #111827;
  --text-muted:    #6b7280;
  --text-subtle:   #9ca3af;
  --border:        #e5e7eb;
  --border-strong: #d1d5db;
  --primary:       #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft:  #dbeafe;
  --primary-text:  #1e40af;
  --success:       #15803d;
  --success-soft:  #dcfce7;
  --success-text:  #166534;
  --warning:       #b45309;
  --warning-soft:  #fef3c7;
  --warning-text:  #92400e;
  --danger:        #dc2626;
  --danger-soft:   #fee2e2;
  --danger-text:   #991b1b;
  --info:          #0369a1;
  --info-soft:     #e0f2fe;
  --info-text:     #075985;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow:        0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:     0 10px 32px rgba(0,0,0,.12);
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     14px;
  --topbar-h:      56px;
  --sidebar-w:     240px;
  --font-body:     'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:     'IBM Plex Mono', monospace;
}

/* ── Tokens Modo Oscuro ─────────────────────────────────────── */
html[data-theme="dark"] {
  --bg:            #0b0f19;
  --bg-soft:       #111827;
  --surface:       #161d2e;
  --surface-2:     #1e2740;
  --surface-3:     #243050;
  --text:          #e5e9f0;
  --text-muted:    #8892a4;
  --text-subtle:   #5a6478;
  --border:        #2a3348;
  --border-strong: #374155;
  --primary:       #3b82f6;
  --primary-hover: #60a5fa;
  --primary-soft:  #1e3a5f;
  --primary-text:  #93c5fd;
  --success:       #22c55e;
  --success-soft:  #14532d;
  --success-text:  #86efac;
  --warning:       #f59e0b;
  --warning-soft:  #451a03;
  --warning-text:  #fcd34d;
  --danger:        #f87171;
  --danger-soft:   #450a0a;
  --danger-text:   #fca5a5;
  --info:          #38bdf8;
  --info-soft:     #0c2a40;
  --info-text:     #7dd3fc;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.35);
  --shadow:        0 4px 16px rgba(0,0,0,.40);
  --shadow-lg:     0 10px 40px rgba(0,0,0,.50);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  font-family: var(--font-body);
  background:  var(--bg);
  color:       var(--text);
  line-height: 1.6;
  min-height:  100%;
  transition:  background .2s, color .2s;
  overflow-x:  hidden;
  max-width:   100vw;
}
img, svg { max-width: 100%; display: block; }
input, button, select, textarea { font-family: inherit; }
a { color: inherit; }

/* ════════════════════════════════════════════════════════════════
   TOPBAR
   ════════════════════════════════════════════════════════════════ */
.topbar {
  position:   fixed;
  top: 0; left: 0; right: 0;
  height:     var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display:    flex;
  align-items: center;
  justify-content: space-between;
  padding:    0 12px;
  z-index:    1000;
  box-shadow: var(--shadow-sm);
  gap:        8px;
  overflow:   hidden;
  max-width:  100vw;
  box-sizing: border-box;
}

@media (min-width: 640px) { .topbar { padding: 0 20px; } }

.topbar-brand {
  display:     flex;
  align-items: center;
  gap:         8px;
  font-weight: 700;
  font-size:   16px;
  color:       var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.topbar-brand .brand-icon {
  width: 32px; height: 32px;
  background:    var(--primary);
  border-radius: var(--radius-sm);
  display:       flex;
  align-items:   center;
  justify-content: center;
  color:         #fff;
  font-size:     13px;
  font-weight:   700;
  flex-shrink:   0;
}

.topbar-right {
  display:     flex;
  align-items: center;
  gap:         6px;
}

.topbar-user {
  display:     flex;
  align-items: center;
  gap:         6px;
  font-size:   13px;
  color:       var(--text-muted);
}

.topbar-user strong {
  color:         var(--text);
  max-width:     90px;
  overflow:      hidden;
  text-overflow: ellipsis;
  white-space:   nowrap;
  display:       none;
}

.topbar-user .user-role { display: none; }

@media (min-width: 640px) {
  .topbar-user strong { display: inline; max-width: 140px; }
}
@media (min-width: 1024px) {
  .topbar-user .user-role { display: inline; }
}

/* Botón hamburguesa */
.sidebar-toggle {
  display:     flex;
  align-items: center;
  justify-content: center;
  width:  38px; height: 38px;
  background:    transparent;
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  color:         var(--text-muted);
  cursor:        pointer;
  font-size:     20px;
  flex-shrink:   0;
  transition:    background .15s;
}
.sidebar-toggle:hover { background: var(--surface-2); }

@media (min-width: 1024px) { .sidebar-toggle { display: none; } }

/* ════════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════════ */
.sidebar-overlay {
  display:    none;
  position:   fixed;
  inset:      0;
  background: rgba(0,0,0,.55);
  z-index:    990;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

.sidebar {
  position:   fixed;
  top:        var(--topbar-h);
  left:       0;
  bottom:     0;
  width:      var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  z-index:    995;
  padding:    10px 0 80px;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  /* Scroll suave en iOS */
  -webkit-overflow-scrolling: touch;
}

/* Móvil / tablet: oculto por defecto */
@media (max-width: 1023px) {
  .sidebar             { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open        { transform: translateX(0); }
}

/* Desktop: siempre visible */
@media (min-width: 1024px) {
  .sidebar { transform: translateX(0) !important; }
}

.sidebar-section { padding: 0 8px; margin-bottom: 2px; }

.sidebar-label {
  display:        block;
  font-size:      10px;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color:          var(--text-subtle);
  padding:        12px 12px 4px;
}

.sidebar-link {
  display:     flex;
  align-items: center;
  gap:         10px;
  padding:     9px 12px;
  border-radius: var(--radius-sm);
  color:       var(--text-muted);
  text-decoration: none;
  font-size:   14px;
  font-weight: 500;
  transition:  background .12s, color .12s;
  white-space: nowrap;
  /* Área táctil más grande en móvil */
  min-height:  44px;
}
.sidebar-link:hover  { background: var(--surface-2); color: var(--text); }
.sidebar-link.active { background: var(--primary-soft); color: var(--primary-text); }
.sidebar-link .icon  { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════════
   CONTENIDO PRINCIPAL
   ════════════════════════════════════════════════════════════════ */
.main-content {
  margin-top:  var(--topbar-h);
  padding:     16px 12px 40px;
  width:       100%;
  min-width:   0;
  max-width:   100%;
  box-sizing:  border-box;
  overflow-x:  hidden;
}

@media (min-width: 640px) {
  .main-content { padding: 20px 20px 40px; }
}

@media (min-width: 1024px) {
  .main-content {
    margin-left: var(--sidebar-w);
    padding:     28px 28px 48px;
    /* El contenido ocupa exactamente el espacio restante sin desbordarse */
    width:       calc(100% - var(--sidebar-w));
    max-width:   calc(100% - var(--sidebar-w));
  }
}

/* ════════════════════════════════════════════════════════════════
   CARD
   ════════════════════════════════════════════════════════════════ */
.card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       14px;
  box-shadow:    var(--shadow-sm);
}
@media (min-width: 640px)  { .card { padding: 18px; } }
@media (min-width: 1024px) { .card { padding: 24px; } }

.card-header {
  display:         flex;
  align-items:     flex-start;
  justify-content: space-between;
  flex-wrap:       wrap;
  gap:             8px;
  margin-bottom:   14px;
  padding-bottom:  12px;
  border-bottom:   1px solid var(--border);
}

.card-title    { font-size: 16px; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

@media (min-width: 640px) { .card-title { font-size: 17px; } }

/* ════════════════════════════════════════════════════════════════
   PAGE HEADER
   ════════════════════════════════════════════════════════════════ */
.page-header {
  display:         flex;
  align-items:     flex-start;
  justify-content: space-between;
  flex-wrap:       wrap;
  gap:             10px;
  margin-bottom:   16px;
}
@media (min-width: 1024px) { .page-header { margin-bottom: 24px; } }

.page-title {
  font-size:      20px;
  font-weight:    800;
  letter-spacing: -.02em;
  color:          var(--text);
  line-height:    1.2;
}
@media (min-width: 640px)  { .page-title { font-size: 23px; } }
@media (min-width: 1024px) { .page-title { font-size: 26px; } }

.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ════════════════════════════════════════════════════════════════
   STATS GRID
   ════════════════════════════════════════════════════════════════ */
.stats-grid {
  display:               grid;
  grid-template-columns: repeat(2, 1fr);
  gap:                   10px;
  margin-bottom:         14px;
}
@media (min-width: 600px)  { .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 900px)  { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
  }
}

.stat-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       12px;
  box-shadow:    var(--shadow-sm);
}
@media (min-width: 640px)  { .stat-card { padding: 14px; } }
@media (min-width: 1024px) { .stat-card { padding: 18px; } }

.stat-label {
  font-size:      11px;
  font-weight:    600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color:          var(--text-muted);
  margin-bottom:  4px;
}

.stat-value {
  font-size:      18px;
  font-weight:    800;
  font-family:    var(--font-mono);
  color:          var(--text);
  letter-spacing: -.02em;
  line-height:    1.1;
  word-break:     break-all;
}
@media (min-width: 640px)  { .stat-value { font-size: 22px; } }
@media (min-width: 1024px) { .stat-value { font-size: 26px; } }

.stat-value.primary { color: var(--primary); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }
.stat-value.danger  { color: var(--danger);  }

/* ════════════════════════════════════════════════════════════════
   TABLA — scroll horizontal en móvil
   ════════════════════════════════════════════════════════════════ */
.table-wrapper {
  overflow-x:    auto;
  overflow-y:    visible;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border:        1px solid var(--border);
  max-width:     100%;
  width:         100%;
}

table.table {
  width:           100%;
  border-collapse: collapse;
  font-size:       13px;
  /* min-width solo activa el scroll interno del wrapper, no desborda el body */
  min-width:       480px;
}
@media (min-width: 640px) { table.table { font-size: 14px; } }

.table thead th {
  background:     var(--surface-2);
  color:          var(--text-muted);
  font-size:      11px;
  font-weight:    600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding:        8px 12px;
  text-align:     left;
  border-bottom:  1px solid var(--border);
  white-space:    nowrap;
}
@media (min-width: 640px) { .table thead th { padding: 10px 16px; } }

.table tbody tr             { border-bottom: 1px solid var(--border); transition: background .1s; }
.table tbody tr:last-child  { border-bottom: none; }
.table tbody tr:hover       { background: var(--surface-2); }

.table tbody td {
  padding:        9px 12px;
  color:          var(--text);
  vertical-align: middle;
}
@media (min-width: 640px) { .table tbody td { padding: 11px 16px; } }

.table .mono {
  font-family: var(--font-mono);
  font-size:   12px;
  color:       var(--text-muted);
}

.table .actions {
  display:  flex;
  gap:      4px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════════
   FORMULARIOS
   ════════════════════════════════════════════════════════════════ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap:     14px;
}
@media (min-width: 600px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
}

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }

label, .form-label { font-size: 13px; font-weight: 600; color: var(--text); }

/* font-size: 16px evita zoom en iOS al hacer focus */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="url"],
input[type="tel"],
select,
textarea {
  width:         100%;
  padding:       11px 12px;
  background:    var(--surface-2);
  border:        1px solid var(--border-strong);
  border-radius: var(--radius);
  color:         var(--text);
  font-family:   var(--font-body);
  font-size:     16px;
  transition:    border-color .15s, box-shadow .15s;
  outline:       none;
  -webkit-appearance: none;
  appearance:    none;
}

@media (min-width: 640px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="search"],
  input[type="url"],
  input[type="tel"],
  select,
  textarea {
    font-size: 14px;
    padding:   10px 14px;
  }
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow:   0 0 0 3px var(--primary-soft);
  background:   var(--surface);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:   no-repeat;
  background-position: right 12px center;
  padding-right:       36px;
}

textarea { resize: vertical; min-height: 85px; }

.form-hint  { font-size: 12px; color: var(--text-muted); }
.form-error { font-size: 12px; color: var(--danger); }

.form-actions {
  display:     flex;
  flex-wrap:   wrap;
  gap:         10px;
  align-items: center;
  margin-top:  18px;
  padding-top: 14px;
  border-top:  1px solid var(--border);
}

/* ════════════════════════════════════════════════════════════════
   BOTONES
   ════════════════════════════════════════════════════════════════ */
.btn {
  display:       inline-flex;
  align-items:   center;
  justify-content: center;
  gap:           6px;
  padding:       10px 18px;
  border-radius: var(--radius);
  font-family:   var(--font-body);
  font-size:     14px;
  font-weight:   600;
  cursor:        pointer;
  border:        none;
  text-decoration: none;
  transition:    background .14s, transform .1s;
  white-space:   nowrap;
  line-height:   1;
  min-height:    42px;
  -webkit-tap-highlight-color: transparent;
  touch-action:  manipulation;
}
.btn:active { transform: translateY(1px); }

.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: var(--surface-3); }

.btn-danger  { background: var(--danger);  color: #fff; }
.btn-danger:hover { opacity: .9; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: .9; }

.btn-ghost { background: transparent; color: var(--text-muted); min-height: 36px; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 13px; min-height: 34px; }
.btn-lg { padding: 13px 24px; font-size: 15px; min-height: 48px; }

.btn-icon {
  width: 38px; height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
  min-height: unset;
}
.btn-sm.btn-icon { width: 32px; height: 32px; }

/* ════════════════════════════════════════════════════════════════
   ALERTAS
   ════════════════════════════════════════════════════════════════ */
.alert {
  display:       flex;
  align-items:   flex-start;
  gap:           10px;
  padding:       12px 14px;
  border-radius: var(--radius);
  font-size:     14px;
  line-height:   1.5;
  margin-bottom: 14px;
  word-break:    break-word;
}
.alert-success { background: var(--success-soft); color: var(--success-text); border: 1px solid var(--success); }
.alert-danger  { background: var(--danger-soft);  color: var(--danger-text);  border: 1px solid var(--danger);  }
.alert-warning { background: var(--warning-soft); color: var(--warning-text); border: 1px solid var(--warning); }
.alert-info    { background: var(--info-soft);    color: var(--info-text);    border: 1px solid var(--info);    }
.alert-icon    { font-size: 16px; flex-shrink: 0; margin-top: 2px; }

/* ════════════════════════════════════════════════════════════════
   BADGES
   ════════════════════════════════════════════════════════════════ */
.badge {
  display:       inline-flex;
  align-items:   center;
  padding:       2px 8px;
  border-radius: 999px;
  font-size:     11px;
  font-weight:   600;
  white-space:   nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success-text); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger-text);  }
.badge-warning { background: var(--warning-soft); color: var(--warning-text); }
.badge-info    { background: var(--info-soft);    color: var(--info-text);    }
.badge-muted   { background: var(--surface-3);    color: var(--text-muted);   }
.badge-primary { background: var(--primary-soft); color: var(--primary-text); }

/* ════════════════════════════════════════════════════════════════
   PAGINACIÓN
   ════════════════════════════════════════════════════════════════ */
.pagination {
  display:     flex;
  flex-wrap:   wrap;
  align-items: center;
  gap:         8px;
  padding-top: 12px;
}
.pagination-info {
  flex:      1;
  text-align: center;
  font-size:  12px;
  color:      var(--text-muted);
  font-family: var(--font-mono);
  min-width:  120px;
}

/* ════════════════════════════════════════════════════════════════
   FILTROS BAR
   ════════════════════════════════════════════════════════════════ */
.filters-bar {
  display:       flex;
  flex-wrap:     wrap;
  gap:           10px;
  align-items:   flex-end;
  margin-bottom: 14px;
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       12px;
}
@media (min-width: 640px) { .filters-bar { padding: 14px 18px; } }

.filters-bar .form-group { min-width: 130px; flex: 1 1 130px; }
@media (min-width: 640px) { .filters-bar .form-group { min-width: 170px; } }

/* ════════════════════════════════════════════════════════════════
   TOGGLE TEMA
   ════════════════════════════════════════════════════════════════ */
.theme-toggle {
  width:  36px; height: 36px;
  border-radius: var(--radius-sm);
  border:        1px solid var(--border-strong);
  background:    var(--surface-2);
  color:         var(--text-muted);
  cursor:        pointer;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     16px;
  flex-shrink:   0;
  transition:    background .14s;
}
.theme-toggle:hover { background: var(--surface-3); }

/* ════════════════════════════════════════════════════════════════
   LOGIN / AUTH
   ════════════════════════════════════════════════════════════════ */
.auth-wrap {
  min-height:     100vh;
  display:        flex;
  flex-direction: column;
  background:     var(--bg);
}

@media (min-width: 900px) {
  .auth-wrap { flex-direction: row; }
}

.auth-hero {
  background:     linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);
  display:        none;
  flex-direction: column;
  align-items:    flex-start;
  justify-content: flex-end;
  padding:        56px;
  position:       relative;
  overflow:       hidden;
  flex:           1;
}
@media (min-width: 900px) { .auth-hero { display: flex; } }

.auth-hero::before {
  content:  '';
  position: absolute;
  inset:    0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23fff' fill-opacity='.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6z'/%3E%3C/g%3E%3C/svg%3E");
}
.auth-hero-content { position: relative; }
.auth-hero-title { font-size: 38px; font-weight: 900; color: #fff; line-height: 1.1; letter-spacing: -.03em; margin-bottom: 12px; }
.auth-hero-sub   { font-size: 15px; color: rgba(255,255,255,.7); line-height: 1.6; }

.auth-panel {
  background:      var(--surface);
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  padding:         40px 20px;
  min-height:      100vh;
}
@media (min-width: 640px) { .auth-panel { padding: 48px 40px; } }
@media (min-width: 900px) {
  .auth-panel { width: 460px; flex-shrink: 0; border-left: 1px solid var(--border); min-height: auto; }
}

.auth-logo {
  width:  52px; height: 52px;
  background:    var(--primary);
  border-radius: var(--radius);
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     20px;
  font-weight:   900;
  color:         #fff;
  margin-bottom: 24px;
}

.auth-title { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -.02em; margin-bottom: 4px; }
@media (min-width: 640px) { .auth-title { font-size: 28px; } }

.auth-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

.auth-form { width: 100%; max-width: 400px; }
.auth-form .form-group { margin-bottom: 16px; }

/* ════════════════════════════════════════════════════════════════
   PERMISOS CHECKBOXES
   ════════════════════════════════════════════════════════════════ */
.permissions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 8px;
}
@media (min-width: 480px)  { .permissions-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .permissions-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .permissions-grid { grid-template-columns: repeat(4, 1fr); } }

.perm-module-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
  margin: 14px 0 6px; padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
  grid-column: 1 / -1;
}

.checkbox-row {
  display:       flex;
  align-items:   center;
  gap:           8px;
  background:    var(--surface-2);
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  padding:       9px 12px;
  cursor:        pointer;
  min-height:    44px;
  transition:    border-color .14s, background .14s;
}
.checkbox-row:hover { border-color: var(--primary); background: var(--primary-soft); }
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }
.checkbox-row span { font-size: 12px; color: var(--text); font-family: var(--font-mono); word-break: break-all; }

/* ════════════════════════════════════════════════════════════════
   UTILIDADES
   ════════════════════════════════════════════════════════════════ */
.text-muted   { color: var(--text-muted); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.mono         { font-family: var(--font-mono); }
.w-full       { width: 100%; }
.hidden       { display: none !important; }
.flex         { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.items-center { align-items: center; }
.flex-wrap    { flex-wrap: wrap; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mt-20  { margin-top: 20px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.mb-20  { margin-bottom: 20px; }

/* Ocultar columnas en pantallas pequeñas */
@media (max-width: 639px)  { .hide-mobile { display: none !important; } }
@media (max-width: 1023px) { .hide-tablet { display: none !important; } }

/* ════════════════════════════════════════════════════════════════
   ANIMACIÓN ENTRADA
   ════════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn .22s ease forwards; }

/* ════════════════════════════════════════════════════════════════
   SEARCHABLE SELECT — selector con búsqueda sin dependencias externas
   ════════════════════════════════════════════════════════════════ */
.ss-wrap { display: block; width: 100%; }
.ss-btn  { box-sizing: border-box; }
.ss-btn:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-soft) !important;
}
.ss-dd input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}


/* ════════════════════════════════════════════════════════════════
   AJUSTES EXTRA MÓVIL
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .ss-wrap { min-width: 0; }
  .ss-btn { min-height: 44px !important; font-size: 16px !important; padding: 10px 36px 10px 12px !important; }
  .ss-btn-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ss-dd { left: 0 !important; right: 0 !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
  .ss-dd input[type="text"] { font-size: 16px !important; }
  .ss-item { white-space: normal !important; word-break: break-word; }
}
