/* ═══════════════════════════════════════
   EchauriHR — Components v3
   Minimal. Consistent. Premium.
   ═══════════════════════════════════════ */

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  font-family: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium);
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: all var(--duration-fast);
  white-space: nowrap; text-decoration: none; line-height: 1.4;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-secondary { background: var(--surface-0); color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-strong); }

.btn-ghost { background: none; color: var(--ink-secondary); border: none; padding: var(--s-2); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--ink); }

.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #c5221f; }

.btn-sm { padding: 5px var(--s-3); font-size: var(--text-xs); }
.btn-xs { padding: 3px var(--s-2); font-size: var(--text-xs); }
.btn-icon { padding: var(--s-2); }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
}

.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--s-5);
}

.card-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: var(--s-1);
  padding: 2px var(--s-2);
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  border-radius: var(--radius-full);
  line-height: 1.4;
}

.badge-default { background: var(--surface-3); color: var(--ink-secondary); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-xs { font-size: 10px; padding: 1px 5px; }
.badge-incidencia-capturada { background: var(--surface-3); color: var(--ink-secondary); }
.badge-incidencia-pendiente { background: var(--warning-soft); color: var(--warning); }
.badge-incidencia-autorizada { background: var(--success-soft); color: var(--success); }
.badge-incidencia-rechazada { background: var(--danger-soft); color: var(--danger); }
.badge-incidencia-validada { background: var(--info-soft); color: var(--info); }

/* ── Inputs ── */
.input, input[type="text"], input[type="email"], input[type="number"],
input[type="search"], input[type="date"], input[type="password"],
input[type="tel"], select, textarea {
  width: 100%;
  padding: var(--s-2) var(--s-3);
  font-family: inherit; font-size: var(--text-sm);
  color: var(--ink);
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  outline: none;
}
.input:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.08);
}
.input::placeholder, input::placeholder { color: var(--ink-placeholder); }

label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--ink-secondary);
  margin-bottom: var(--s-1);
}

.form-group { display: flex; flex-direction: column; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.form-grid .span-full { grid-column: 1 / -1; }

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table th {
  padding: var(--s-2) var(--s-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--ink-tertiary);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table td {
  padding: var(--s-3) var(--s-3);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--ink-secondary);
  vertical-align: middle;
}

.data-table tr { transition: background var(--duration-fast); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }

.cell-primary { color: var(--ink); font-weight: var(--weight-medium); }

/* ── Tabs ── */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-6);
}

.tab {
  padding: var(--s-3) var(--s-4);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--ink-tertiary);
  cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--duration-fast), border-color var(--duration-fast);
  font-family: inherit;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Subnav (for module sections) ── */
.subnav-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-6);
}
.subnav-tab {
  padding: var(--s-3) var(--s-4);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--ink-tertiary);
  cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--duration-fast);
  font-family: inherit;
}
.subnav-tab:hover { color: var(--ink); }
.subnav-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--z-modal);
  animation: fadeIn var(--duration) var(--ease);
  padding: var(--s-6);
}

.modal {
  background: var(--surface-0);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px;
  animation: slideUp var(--duration) var(--ease);
  max-height: 85vh;
  display: flex; flex-direction: column;
}
.modal-lg { max-width: 720px; }

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--border-subtle);
}
.modal-header h3 { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: -0.01em; }

.modal-body { padding: var(--s-6); overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: var(--s-3);
  padding: var(--s-4) var(--s-6);
  border-top: 1px solid var(--border-subtle);
}

/* ── Drawer ── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: var(--overlay);
  z-index: var(--z-overlay);
  animation: fadeIn var(--duration) var(--ease);
}

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(600px, 85vw);
  background: var(--surface-0);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-modal);
  animation: slideInRight var(--duration-slow) var(--ease);
  display: flex; flex-direction: column;
}

.drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--border);
}

.drawer-body { flex: 1; overflow-y: auto; padding: var(--s-6); }

/* ── Toast ── */
.toast-container {
  position: fixed; bottom: var(--s-6); right: var(--s-6);
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--s-2);
  max-width: min(420px, calc(100vw - 24px));
}
@media (max-width: 768px) {
  .toast-container { left: 12px; right: 12px; bottom: 84px; max-width: none; }
  .page-header-actions { flex-wrap: wrap; }
}

.toast {
  padding: var(--s-3) var(--s-5);
  background: var(--ink);
  color: white;
  border-radius: var(--radius);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  box-shadow: var(--shadow-md);
  animation: slideUp var(--duration) var(--ease);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* ── Empty state ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: var(--s-16) var(--s-8);
  text-align: center;
}
.empty-state svg { width: 40px; height: 40px; color: var(--ink-placeholder); margin-bottom: var(--s-4); }
.empty-state h4 { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--ink); margin-bottom: var(--s-2); }
.empty-state p { font-size: var(--text-sm); color: var(--ink-tertiary); max-width: 280px; }

/* ── Dashboard — Centro de Operaciones ── */
.dash-header { margin-bottom: var(--s-5); }
.dash-title { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: -0.02em; }
.dash-subtitle { font-size: var(--text-sm); color: var(--ink-secondary); margin-top: 2px; }

.dash-kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--s-3); margin-bottom: var(--s-5);
}
.dash-kpi {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--s-3) var(--s-4);
  text-align: center;
}
.dash-kpi-value { display: block; font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: -0.02em; }
.dash-kpi-label { display: block; font-size: 11px; color: var(--ink-tertiary); margin-top: 2px; }
.dash-kpi-sub { display: block; font-size: 10px; color: var(--ink-placeholder); }
.dash-kpi-success .dash-kpi-value { color: var(--success); }
.dash-kpi-warning .dash-kpi-value { color: var(--warning); }
.dash-kpi-danger .dash-kpi-value { color: var(--danger); }

.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); margin-bottom: var(--s-4); }
@media (max-width: 900px) { .dash-grid-2 { grid-template-columns: 1fr; } }

.dash-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--s-4);
}
.dash-section-title { font-size: var(--text-sm); font-weight: var(--weight-semibold); margin-bottom: var(--s-3); }
.dash-empty { font-size: var(--text-sm); color: var(--ink-placeholder); }

/* Atención cards */
.atencion-cards { display: flex; flex-direction: column; gap: var(--s-2); }
.atencion-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-3); border-radius: var(--radius-sm);
  border-left: 3px solid transparent; cursor: pointer;
  transition: background var(--duration-fast);
}
.atencion-card:hover { background: var(--surface-2); }
.atencion-danger { border-left-color: var(--danger); }
.atencion-warning { border-left-color: var(--warning); }
.atencion-info { border-left-color: var(--accent); }
.atencion-text { font-size: var(--text-sm); color: var(--ink); font-weight: var(--weight-medium); }

/* Indicators */
.dash-indicators { display: flex; flex-direction: column; }
.ind-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-2) 0; font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-subtle);
}
.ind-row:last-child { border-bottom: none; }
.ind-label { color: var(--ink-secondary); }
.ind-value { font-weight: var(--weight-semibold); color: var(--ink); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* Department cards */
.dept-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: var(--s-2); }
.dept-card {
  display: flex; flex-direction: column; align-items: center;
  padding: var(--s-3) var(--s-2);
  background: var(--surface-2); border-radius: var(--radius-sm);
  text-align: center;
}
.dept-card-count { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--ink); }
.dept-card-name { font-size: 10px; color: var(--ink-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dept-card-pct { font-size: 10px; color: var(--ink-placeholder); }

/* Quick actions grid */
.dash-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.dash-quick-btn {
  padding: var(--s-3);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-family: inherit; font-weight: var(--weight-medium);
  color: var(--ink-secondary); cursor: pointer; text-align: center;
  transition: all var(--duration-fast);
}
.dash-quick-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* Distribution bar */
.dist-row { display: flex; align-items: center; gap: var(--s-3); padding: 3px 0; }
.dist-label { font-size: var(--text-sm); color: var(--ink-secondary); min-width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.dist-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width var(--duration-slow); }
.dist-value { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--ink); min-width: 20px; text-align: right; }

/* KPI metric cards (DO module reuses) */
.kpi-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: var(--s-3); margin-bottom: var(--s-5);
}
.kpi-metric-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--s-4);
  display: flex; flex-direction: column; gap: 2px;
}
.kpi-metric-label { font-size: 11px; font-weight: var(--weight-medium); color: var(--ink-tertiary); letter-spacing: 0.02em; }
.kpi-metric-value { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: -0.02em; }
.kpi-metric-sub { font-size: 11px; color: var(--ink-placeholder); }

/* ── KPI chips (secondary) ── */
.kpi-strip { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-bottom: var(--s-6); }
.kpi-chip {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm); cursor: pointer;
  transition: all var(--duration-fast);
  font-family: inherit; border: 1px solid var(--border);
}
.kpi-chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.kpi-chip-value { font-weight: var(--weight-semibold); }
.kpi-chip-label { color: var(--ink-tertiary); }
.kpi-chip svg { width: 14px; height: 14px; color: var(--ink-tertiary); }

/* ── Dashboard panels ── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-5); }

.dash-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.dash-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--ink);
}
.dash-panel-head svg { width: 14px; height: 14px; color: var(--ink-tertiary); margin-right: var(--s-2); }

.dash-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-3) var(--s-5);
  font-size: var(--text-sm); color: var(--ink-secondary);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.dash-row:last-child { border-bottom: none; }
.dash-row:hover { background: var(--surface-2); }

/* ── CRM Table (Base de empleados) ── */
.crm-table-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.crm-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.crm-table thead { background: var(--surface-2); }
.crm-table th {
  padding: var(--s-2) var(--s-3);
  font-size: 11px; font-weight: var(--weight-medium);
  color: var(--ink-tertiary); text-align: left;
  text-transform: uppercase; letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.crm-th-check { width: 36px; text-align: center; }
.crm-th-name { min-width: 180px; }
.crm-th-actions { width: 64px; }

.crm-row { transition: background var(--duration-fast); cursor: pointer; }
.crm-row:hover { background: var(--surface-2); }
.crm-row.is-selected { background: var(--accent-muted); }
.crm-row td { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.crm-row:last-child td { border-bottom: none; }

.crm-td-check { width: 36px; text-align: center; }
.crm-td-check input { accent-color: var(--accent); }
.crm-td-name { display: flex; align-items: center; gap: var(--s-2); }
.crm-name-wrap { display: flex; flex-direction: column; min-width: 0; }
.crm-name { font-weight: var(--weight-medium); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-sub { font-size: 11px; color: var(--ink-placeholder); }
.crm-td-text { color: var(--ink-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.crm-td-money { font-weight: var(--weight-medium); color: var(--ink); text-align: right; white-space: nowrap; }
.crm-td-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--duration-fast); }
.crm-row:hover .crm-td-actions { opacity: 1; }

.crm-td-badges { white-space: nowrap; }
.row-badge {
  display: inline-block; padding: 1px 6px;
  border-radius: var(--radius-full); font-size: 10px; font-weight: var(--weight-medium);
  margin-right: 2px;
}
.row-badge-warning { background: var(--warning-soft); color: var(--warning); }
.row-badge-danger { background: var(--danger-soft); color: var(--danger); }
.row-badge-info { background: var(--accent-soft); color: var(--accent); }
.row-badge-success { background: var(--success-soft); color: var(--success); }

/* ── Employee list (legacy compat) ── */
.employee-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.employee-table-toolbar {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border-subtle);
}

.search-input {
  flex: 1; max-width: 320px;
  padding: 6px var(--s-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-family: inherit;
  background: var(--surface-2); color: var(--ink);
  outline: none;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.search-input:focus { background: var(--surface-0); border-color: var(--border-focus); }
.search-input::placeholder { color: var(--ink-placeholder); }

.employee-count { font-size: var(--text-xs); color: var(--ink-tertiary); margin-left: auto; }

.employee-table { width: 100%; border-collapse: collapse; }
.employee-table th {
  padding: var(--s-2) var(--s-4);
  font-size: 11px; font-weight: var(--weight-medium);
  color: var(--ink-tertiary); text-align: left;
  text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.employee-table td {
  padding: var(--s-3) var(--s-4);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--ink-secondary);
}
.employee-table tbody tr { transition: background var(--duration-fast); cursor: pointer; }
.employee-table tbody tr:hover { background: var(--surface-2); }
.employee-table tbody tr:last-child td { border-bottom: none; }

.emp-name { font-weight: var(--weight-medium); color: var(--ink); }
.emp-id { font-size: var(--text-xs); color: var(--ink-tertiary); }
.emp-avatar {
  width: 28px; height: 28px; border-radius: var(--radius-full);
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: var(--weight-semibold);
  margin-right: var(--s-2); vertical-align: middle;
}

/* ── Expediente ── */
.btn-back {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--ink-tertiary); cursor: pointer;
  border: none; background: none; border-radius: var(--radius-sm);
  margin-bottom: var(--s-4); font-family: inherit;
  transition: color var(--duration-fast), background var(--duration-fast);
}
.btn-back:hover { color: var(--ink); background: var(--surface-2); }
.btn-back svg { width: 14px; height: 14px; }

.expediente-hero {
  display: flex; align-items: flex-start; gap: var(--s-5);
  padding: var(--s-5) var(--s-6);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--s-5);
}

.expediente-meta { flex: 1; min-width: 0; }
.expediente-meta h3 { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: -0.02em; }

.meta-chips {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  margin-top: var(--s-2);
}

.meta-row {
  display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5);
  margin-top: var(--s-3);
  font-size: var(--text-sm); color: var(--ink-secondary);
}
.meta-row strong { font-weight: var(--weight-medium); color: var(--ink-tertiary); margin-right: var(--s-1); }

.expediente-actions {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  align-self: flex-start; flex-shrink: 0;
}

/* ── Expediente header (hero card) ── */
.exp-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--s-5); padding: var(--s-5);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: var(--s-4);
}
.exp-header-left { display: flex; gap: var(--s-4); align-items: flex-start; flex: 1; min-width: 0; }
.exp-header-info { flex: 1; min-width: 0; }
.exp-header-top { display: flex; align-items: center; gap: var(--s-2); margin-bottom: 2px; }
.exp-name { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: -0.01em; margin: 0; }
.exp-role { font-size: var(--text-sm); color: var(--ink-secondary); margin: 0 0 var(--s-2) 0; }
.exp-meta-grid {
  display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4);
  font-size: var(--text-sm); color: var(--ink-secondary);
}
.exp-meta-item strong { color: var(--ink-tertiary); font-weight: var(--weight-medium); margin-right: 3px; }
.exp-indicators { display: flex; gap: var(--s-2); align-items: center; margin-top: var(--s-2); flex-wrap: wrap; }
.exp-pill {
  display: inline-flex; padding: 2px 8px;
  border-radius: var(--radius-full); font-size: 11px; font-weight: var(--weight-medium);
}
.exp-ok { background: var(--success-soft); color: var(--success); }
.exp-mid { background: var(--warning-soft); color: var(--warning); }
.exp-low { background: var(--danger-soft); color: var(--danger); }
.exp-disc { background: var(--accent-muted); color: var(--accent); }
.exp-header-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; flex-shrink: 0; }

@media (max-width: 768px) {
  .exp-header { flex-direction: column; }
  .exp-header-actions { width: 100%; }
}

/* Tabs (expediente) */
.tabs-expediente { margin-bottom: 0; border-bottom: 1px solid var(--border); }
.tab-btn {
  padding: var(--s-2) var(--s-3);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--ink-tertiary); cursor: pointer;
  border: none; background: none; font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--duration-fast), border-color var(--duration-fast);
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: var(--weight-semibold);
  margin-left: var(--s-1);
}

.tab-panel { display: none; padding-top: var(--s-5); }
.tab-panel.active { display: block; animation: fadeIn var(--duration) var(--ease); }

/* ── Document cards grid ── */
.doc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
}
.doc-card {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--bg-card);
  transition: box-shadow var(--duration-fast);
}
.doc-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.doc-card-icon { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-sm); flex-shrink: 0; }
.doc-card-icon svg { width: 16px; height: 16px; }
.doc-loaded .doc-card-icon { background: var(--success-soft); color: var(--success); }
.doc-pending .doc-card-icon { background: var(--surface-3); color: var(--ink-tertiary); }
.doc-icon-pending { opacity: 0.6; }
.doc-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-card-type { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--ink); }
.doc-card-date { font-size: 11px; color: var(--ink-placeholder); }
.doc-card-status { font-size: 11px; color: var(--warning); font-weight: var(--weight-medium); }
.doc-card-actions { flex-shrink: 0; }
.doc-upload-btn { flex-shrink: 0; }

/* Document categories */
.doc-category { margin-bottom: var(--s-5); }
.doc-cat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-2); }
.doc-cat-header h4 { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.doc-cat-progress {
  font-size: 11px; font-weight: var(--weight-medium);
  padding: 2px 8px; border-radius: var(--radius-full);
  background: var(--surface-3); color: var(--ink-tertiary);
}
.doc-prog-ok { background: var(--success-soft); color: var(--success); }

/* Seguimiento */
.seguimiento-panel { }
.seguimiento-header { margin-bottom: var(--s-5); }
.seguimiento-summary { font-size: var(--text-sm); color: var(--ink-secondary); margin-top: var(--s-2); }

.checklist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s-4); }
.checklist-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s-4); }
.checklist-card h4 { font-size: var(--text-sm); font-weight: var(--weight-semibold); margin-bottom: var(--s-3); }

.checklist-dense { list-style: none; }
.checklist-item-row { display: flex; align-items: center; gap: var(--s-2); padding: 5px var(--s-2); border-radius: var(--radius-sm); font-size: var(--text-sm); }
.checklist-item-row:hover { background: var(--surface-2); }
.checklist-item { display: flex; align-items: center; gap: var(--s-2); cursor: pointer; }
.checklist-item input[type="checkbox"] { accent-color: var(--accent); }
.checklist-status-select { padding: 2px var(--s-2); font-size: var(--text-xs); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-0); }
.checklist-date { font-size: var(--text-xs); color: var(--ink-placeholder); margin-left: auto; }
.adj-link { font-size: var(--text-xs); color: var(--accent); text-decoration: none; display: flex; align-items: center; gap: 2px; }
.adj-link:hover { text-decoration: underline; }
.adj-input { font-size: var(--text-xs); max-width: 160px; }

.seguimiento-extra { margin-top: var(--s-6); }
.seguimiento-chip { cursor: default; }
.disc-chip { background: #f3e8ff; color: #7c3aed; }
.pipeline-mini-chip { background: var(--accent-soft); color: var(--accent); }

/* DISC & eval forms */
.form-grid-compact { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; }
.form-grid-compact .form-group { min-width: 100px; }
.disc-scores { display: flex; gap: var(--s-2); }
.disc-scores input { width: 52px; text-align: center; }

.detail-eval-row { display: flex; justify-content: space-between; align-items: center; padding: var(--s-2) 0; font-size: var(--text-sm); border-bottom: 1px solid var(--border-subtle); }
.detail-eval-row:last-child { border-bottom: none; }

/* Audit list */
.audit-list { max-height: 300px; overflow-y: auto; }
.audit-row { padding: var(--s-3) 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm); }
.audit-row:last-child { border-bottom: none; }
.audit-date { font-size: var(--text-xs); color: var(--ink-tertiary); margin-right: var(--s-2); }
.audit-user { font-weight: var(--weight-medium); }
.audit-row ul { margin-top: var(--s-1); padding-left: var(--s-5); font-size: var(--text-xs); color: var(--ink-secondary); }

/* Timeline */
.timeline { position: relative; padding-left: var(--s-6); }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: var(--s-5); }
.timeline-item::before {
  content: ''; position: absolute; left: calc(-1 * var(--s-6) + 4px); top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border-strong); border: 2px solid var(--surface-0);
}
.timeline-item.tipo-alta::before { background: var(--success); }
.timeline-item.tipo-baja::before { background: var(--danger); }
.timeline-item.tipo-disc::before { background: #7c3aed; }
.timeline-item.tipo-seguimiento::before { background: var(--accent); }
.timeline-date { font-size: var(--text-xs); color: var(--ink-tertiary); }
.timeline-title { font-size: var(--text-sm); font-weight: var(--weight-medium); margin-top: 2px; }
.timeline-desc { font-size: var(--text-sm); color: var(--ink-secondary); margin-top: 2px; }

/* Readonly notice */
.readonly-notice {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2); border-radius: var(--radius-sm);
  font-size: var(--text-sm); color: var(--ink-secondary);
  margin-bottom: var(--s-4);
}
.readonly-notice-icon svg { width: 16px; height: 16px; color: var(--ink-tertiary); }

/* Field readonly */
.field-readonly { font-size: var(--text-sm); color: var(--ink); padding: var(--s-2) 0; min-height: 28px; }

/* Empty inline */
.empty-inline { font-size: var(--text-sm); color: var(--ink-tertiary); padding: var(--s-3) 0; font-style: italic; }

/* Card flat */
.card-flat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s-5); }

/* Wizard steps (baja assistant) */
.wizard-steps-bar { display: flex; gap: var(--s-4); margin-bottom: var(--s-5); }
.wizard-steps-bar .wizard-step {
  font-size: var(--text-sm); color: var(--ink-tertiary); font-weight: var(--weight-medium);
  padding: var(--s-2) var(--s-3); border-radius: var(--radius-full);
}
.wizard-steps-bar .wizard-step.active { background: var(--accent-soft); color: var(--accent); }
.wizard-steps-bar .wizard-step.done { color: var(--success); }

/* Wizard steps (install wizard / multi-step) */
.wizard-modal .wizard-steps { display: flex; flex-direction: column; gap: var(--s-5); }
.wizard-modal .wizard-step { display: none; }
.wizard-modal .wizard-step.active { display: block; }
.wizard-modal .wizard-step h4 { font-size: var(--text-md); font-weight: var(--weight-semibold); margin-bottom: var(--s-3); }
.wizard-check { display: flex; align-items: center; gap: var(--s-2); cursor: pointer; font-size: var(--text-sm); }
.wizard-progress { height: 3px; background: var(--surface-3); border-radius: 2px; margin: var(--s-3) var(--s-6); overflow: hidden; }
.wizard-progress span { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width var(--duration-slow); }
.wizard-step-label { font-size: var(--text-sm); color: var(--ink-secondary); padding: 0 var(--s-6) var(--s-2); }
.wizard-footer { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); }
.wizard-footer-actions { display: flex; gap: var(--s-3); margin-left: auto; }

/* Badge estatus */
.badge-activo { background: var(--success-soft); color: var(--success); }
.badge-inactivo { background: var(--surface-3); color: var(--ink-tertiary); }

/* ── Pipeline / Onboarding ── */
.pipeline-header { margin-bottom: var(--s-5); }
.pipeline-header h2 { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: -0.02em; }
.pipeline-sub { font-size: var(--text-sm); color: var(--ink-tertiary); }

.pipeline-stats { display: flex; gap: var(--s-5); margin-bottom: var(--s-5); font-size: var(--text-sm); }
.pipeline-stat { display: flex; align-items: center; gap: var(--s-2); color: var(--ink-secondary); }
.pipeline-stat svg { width: 14px; height: 14px; }
.pipeline-stat.warning { color: var(--warning); }

.pipeline-table {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--s-5);
}
.pipeline-table-head {
  display: grid; grid-template-columns: 2fr 1.2fr 1.2fr 0.6fr 0.5fr;
  padding: var(--s-2) var(--s-4);
  font-size: 11px; font-weight: var(--weight-medium);
  color: var(--ink-tertiary); text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.pipeline-row {
  display: grid; grid-template-columns: 2fr 1.2fr 1.2fr 0.6fr 0.5fr;
  padding: var(--s-3) var(--s-4);
  font-size: var(--text-sm); align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration-fast);
  cursor: pointer;
}
.pipeline-row:hover { background: var(--surface-2); }
.pipeline-row:last-child { border-bottom: none; }

.ptcol-name { font-weight: var(--weight-medium); color: var(--ink); }
.ptcol-step { }
.ptcol-progress { display: flex; align-items: center; gap: var(--s-2); }
.ptcol-alerts { display: flex; gap: 3px; }
.ptcol-action { text-align: right; }

.pipeline-step-badge {
  display: inline-block; padding: 2px var(--s-2);
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: var(--weight-medium);
}

.progress-bar-mini { width: 48px; height: 4px; border-radius: 2px; background: var(--surface-3); }
.progress-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width var(--duration-slow); }
.progress-text { font-size: var(--text-xs); color: var(--ink-tertiary); }

.progress-bar { width: 48px; height: 4px; border-radius: 2px; background: var(--surface-3); display: inline-block; vertical-align: middle; }

/* Pipeline completed section */
.pipeline-completos { margin-top: var(--s-4); }
.pipeline-completos summary { font-size: var(--text-sm); font-weight: var(--weight-medium); cursor: pointer; color: var(--ink-secondary); padding: var(--s-3); }
.pipeline-completos summary:hover { color: var(--ink); }
.pipeline-completos-list { display: flex; flex-wrap: wrap; gap: var(--s-2); padding: var(--s-3); }
.pipeline-completo-chip {
  padding: var(--s-1) var(--s-3);
  background: var(--success-soft); color: var(--success);
  border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: var(--weight-medium);
  cursor: pointer;
}
.pipeline-completo-chip:hover { background: var(--success); color: white; }

/* Pipeline modal */
.pipeline-modal-body { max-height: 60vh; overflow-y: auto; }
.pipeline-alertas-bar {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  background: var(--warning-soft); border-radius: var(--radius-sm);
  margin-bottom: var(--s-5);
}
.pipeline-alerta { display: flex; align-items: center; gap: var(--s-1); font-size: var(--text-sm); color: var(--warning); }
.pipeline-alerta.urgente { color: var(--danger); font-weight: var(--weight-medium); }
.pipeline-alerta svg { width: 14px; height: 14px; }

.pipeline-section { margin-bottom: var(--s-4); background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: var(--s-4); }
.pipeline-section.done { border-color: var(--success); background: var(--success-soft); opacity: 0.8; }
.pipeline-section.readonly { background: var(--surface-2); border-style: dashed; }
.pipeline-readonly-note { font-size: var(--text-xs); color: var(--ink-tertiary); font-style: italic; margin-bottom: var(--s-2); }
.pipeline-check-item.is-readonly { opacity: 0.7; cursor: default; }
.pipeline-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s-3); }
.pipeline-section-title { font-size: var(--text-sm); font-weight: var(--weight-semibold); display: flex; align-items: center; gap: var(--s-2); }
.pipeline-section-title svg { width: 14px; height: 14px; color: var(--success); }
.pipeline-section-count { font-size: var(--text-xs); color: var(--ink-tertiary); }

.pipeline-checklist { display: flex; flex-direction: column; gap: 2px; }
.pipeline-check-item {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 4px var(--s-2); border-radius: var(--radius-sm);
  font-size: var(--text-sm); cursor: pointer;
  transition: background var(--duration-fast);
}
.pipeline-check-item:hover { background: var(--surface-2); }
.pipeline-check-item.checked { color: var(--ink-tertiary); }
.pipeline-check-item input[type="checkbox"] { accent-color: var(--accent); }
.pipe-date { margin-left: auto; font-size: var(--text-xs); color: var(--ink-placeholder); }

/* ── Alerts ── */
.alert-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); display: inline-block; }
.alert-dot.urgente { background: var(--danger); }
.alert-dot.urgent { background: var(--danger); }

/* ── Finiquito ── */
.finiquito-neto {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-5) 0; margin-top: var(--s-4);
  border-top: 2px solid var(--accent);
}
.finiquito-total { font-size: var(--text-2xl); font-weight: var(--weight-semibold); color: var(--success); }

/* ── Nomina ── */
.kpi-grid { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-bottom: var(--s-5); }
.kpi-grid-compact { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.kpi-card {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-full);
  font-size: var(--text-sm);
}
.kpi-card .kpi-label { font-size: var(--text-xs); color: var(--ink-tertiary); }
.kpi-card .kpi-value { font-weight: var(--weight-semibold); }
.kpi-card.success .kpi-value { color: var(--success); }
.kpi-card.warning .kpi-value { color: var(--warning); }
.kpi-card.danger .kpi-value { color: var(--danger); }

/* ── Prenómina ── */
.prenomina-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s-4);
}
.prenomina-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.prenomina-periodo { font-size: var(--text-sm); color: var(--ink-secondary); }
.prenomina-actions { display: flex; gap: var(--s-2); align-items: center; }

.prenomina-legend {
  display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-3);
  font-size: 11px; color: var(--ink-tertiary);
}
.legend-item { padding: 2px 6px; border-radius: var(--radius-sm); background: var(--surface-2); }
.legend-success { color: var(--success); }
.legend-danger { color: var(--danger); }
.legend-warning { color: var(--warning); }
.legend-info { color: var(--accent); }

.spreadsheet-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: auto; max-height: 520px;
}
.prenomina-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.prenomina-table th {
  position: sticky; top: 0; z-index: 2;
  padding: var(--s-2);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: var(--weight-medium);
  color: var(--ink-tertiary); text-align: center; white-space: nowrap;
}
.prenomina-th-name { text-align: left; min-width: 150px; }
.prenomina-th-day { min-width: 50px; }
.prenomina-th-total { min-width: 40px; font-weight: var(--weight-semibold); }

.prenomina-row td { padding: 4px 2px; border-bottom: 1px solid var(--border-subtle); text-align: center; }
.prenomina-name { text-align: left !important; font-weight: var(--weight-medium); color: var(--ink); white-space: nowrap; padding-left: var(--s-2) !important; }
.prenomina-cell { padding: 2px !important; }
.prenomina-select {
  width: 42px; padding: 3px 2px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 11px; font-family: inherit;
  text-align: center; color: var(--ink); cursor: pointer;
  transition: border-color var(--duration-fast);
  appearance: none; -webkit-appearance: none;
}
.prenomina-select:focus { border-color: var(--accent); outline: none; background: var(--surface-0); }
.prenomina-val-F { background: var(--danger-soft); color: var(--danger); font-weight: var(--weight-semibold); }
.prenomina-val-R { background: var(--warning-soft); color: var(--warning); }
.prenomina-val-V { background: var(--accent-soft); color: var(--accent); }
.prenomina-val-I { background: var(--warning-soft); color: var(--warning); }
.prenomina-val-HE { background: var(--info-soft); color: var(--info); font-weight: var(--weight-semibold); }
.prenomina-val-D { background: var(--surface-3); color: var(--ink-placeholder); }
.prenomina-total { font-weight: var(--weight-semibold); font-size: 12px; }

.inc-history-title { font-size: var(--text-sm); font-weight: var(--weight-semibold); margin-bottom: var(--s-3); display: flex; align-items: center; gap: var(--s-2); }

/* ── Formatos ── */
.page-header-simple { margin-bottom: var(--s-5); }
.page-header-simple h1 { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: -0.02em; }
.page-header-simple p { font-size: var(--text-sm); color: var(--ink-secondary); margin-top: 2px; }

.formato-cats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-4);
}
.formato-cat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-2);
  cursor: pointer; font-family: inherit; text-align: left;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.formato-cat-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(26,115,232,0.08); }
.formato-cat-icon { color: var(--accent); margin-bottom: var(--s-1); }
.formato-cat-icon svg { width: 24px; height: 24px; }
.formato-cat-card h3 { font-size: var(--text-md); font-weight: var(--weight-semibold); }
.formato-cat-card p { font-size: var(--text-sm); color: var(--ink-secondary); }
.formato-cat-count { font-size: 11px; color: var(--ink-placeholder); margin-top: auto; }

.formato-tpl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-3);
}
.formato-tpl-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.formato-tpl-head h4 { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.formato-tpl-vars { font-size: 11px; color: var(--ink-tertiary); }
.formato-tpl-vars code { background: var(--surface-3); padding: 1px 4px; border-radius: 3px; font-size: 10px; }
.formato-tpl-actions { display: flex; gap: var(--s-2); margin-top: var(--s-2); }

/* Wizard emp list */
.wiz-emp-list { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.wiz-emp-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: none; font-family: inherit; text-align: left; cursor: pointer;
  transition: background var(--duration-fast);
}
.wiz-emp-item:hover { background: var(--accent-soft); border-color: var(--accent); }
.wiz-emp-item strong { font-size: var(--text-sm); }
.wiz-emp-item span { font-size: 11px; color: var(--ink-secondary); }
.modal-step { font-size: var(--text-sm); color: var(--ink-tertiary); }

.format-preview { max-height: 360px; overflow: auto; }
.format-preview-body { font-size: var(--text-sm); line-height: var(--leading-relaxed); white-space: pre-wrap; padding: var(--s-4); background: var(--surface-2); border-radius: var(--radius-sm); }
.format-preview-doc { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--s-4); transform-origin: top center; }
.format-preview-doc .doc-formal { font-size: 9pt; max-width: 100%; }
.format-preview-doc .doc-formal-titulo { font-size: 11pt; }
.format-preview-doc .doc-firma-linea { height: 24px; }
.vac-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 560px; }
.vac-month-head { text-align: center; font-size: 10px; font-weight: 700; color: var(--text-muted); padding: 4px; }
.vac-day { min-height: 52px; border: 1px solid var(--border); border-radius: 4px; padding: 4px; position: relative; font-size: 11px; }
.vac-day-empty { background: transparent; border: none; }
.vac-day-busy { background: #ecfdf5; border-color: #6ee7b7; }
.vac-day-alert { background: #fef2f2; border-color: #fca5a5; }
.vac-day-num { font-weight: 700; }
.vac-day-count { position: absolute; bottom: 2px; right: 4px; font-size: 9px; background: var(--accent); color: #fff; border-radius: 8px; padding: 0 4px; }
.rotacion-bars { display: flex; flex-direction: column; gap: 8px; }
.rotacion-bar-row { display: grid; grid-template-columns: 72px 1fr 100px; gap: 8px; align-items: center; font-size: var(--text-sm); }
.rotacion-bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.rotacion-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.vac-cal-dia { padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: var(--text-sm); }
.vac-cal-alerta { border-color: var(--warning); background: #fffbeb; }
.vac-cal-list { margin: var(--s-2) 0 0; padding-left: 1rem; font-size: var(--text-xs); }
.asist-captura-table select { width: 100%; font-size: 11px; padding: 2px; }
.row-warning { background: #fffbeb; }
.mono-textarea { font-family: ui-monospace, monospace; font-size: 12px; }

/* ── Config ── */
.config-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--s-5); }
.config-panel { height: fit-content; }
.config-catalog-title {
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--ink-secondary); margin-bottom: var(--s-2);
}
.catalog-add-row {
  display: flex; gap: var(--s-2); margin-top: var(--s-2); flex-wrap: wrap;
}
.catalog-add-row .catalog-add-input { flex: 1; min-width: 140px; }
.catalog-tag-remove, .festivo-custom-remove {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; margin-left: 2px;
  border: none; background: none; cursor: pointer;
  color: var(--ink-tertiary); border-radius: var(--radius-sm);
  transition: color var(--duration-fast);
}
.catalog-tag-remove:hover, .festivo-custom-remove:hover { color: var(--danger); }
.catalog-tag-remove svg, .festivo-custom-remove svg { width: 12px; height: 12px; }
.festivos-list {
  list-style: none; margin: 0 0 var(--s-3); padding: 0;
  font-size: var(--text-sm); color: var(--ink-secondary);
}
.festivos-list li {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-1) 0; border-bottom: 1px solid var(--border-subtle);
}
.festivos-list li:last-child { border-bottom: none; }
.festivos-oficiales li { padding-left: 0; }
.festivo-custom-item { justify-content: space-between; }
.festivo-add-row {
  display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center;
}
.festivo-add-row input[type="date"] { width: auto; }
.festivo-add-row input[type="text"] { flex: 1; min-width: 120px; }
.config-hint { font-size: var(--text-sm); color: var(--ink-tertiary); margin-bottom: var(--s-4); line-height: var(--leading-relaxed); }

/* ── Dropdown ── */
.dropdown-menu {
  position: absolute; top: 100%; right: 0; margin-top: 4px;
  min-width: 180px;
  background: var(--surface-0); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  z-index: var(--z-dropdown); padding: var(--s-1) 0;
}
.dropdown-item {
  display: flex; align-items: center; gap: var(--s-2);
  width: 100%; padding: var(--s-2) var(--s-4);
  font-size: var(--text-sm); font-family: inherit;
  background: none; border: none; cursor: pointer;
  color: var(--ink-secondary); text-align: left;
  transition: background var(--duration-fast);
}
.dropdown-item:hover { background: var(--surface-2); color: var(--ink); }
.dropdown-item svg { width: 14px; height: 14px; opacity: 0.6; }

/* ── Misc ── */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--ink-tertiary); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-default { color: var(--ink-secondary); }

.chip-cloud { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.meta-chip {
  display: inline-flex; align-items: center; gap: var(--s-1);
  padding: 2px var(--s-2);
  background: var(--surface-3); border-radius: var(--radius-full);
  font-size: var(--text-xs); color: var(--ink-secondary);
}
.meta-chip svg { width: 12px; height: 12px; }

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ── Dense list (employee rows) ── */
.dense-list-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.dense-list-head {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  font-size: 11px; font-weight: var(--weight-medium);
  color: var(--ink-tertiary); text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}

.dense-row {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration-fast);
  outline: none;
}
.dense-row:last-child { border-bottom: none; }
.dense-row:hover, .dense-row:focus-within { background: var(--surface-2); }
.dense-row.is-selected { background: var(--accent-muted); }
.dense-row.is-expanded { background: var(--surface-2); }

.dense-row-main {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  min-height: 44px;
}

.dense-select-wrap { display: flex; align-items: center; }
.dense-select { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }

.dense-expand-btn {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  border: none; background: none; cursor: pointer;
  color: var(--ink-placeholder); border-radius: var(--radius-sm);
  transition: color var(--duration-fast), transform var(--duration-fast);
}
.dense-expand-btn:hover { color: var(--ink); }
.dense-row.is-expanded .dense-expand-btn { transform: rotate(90deg); color: var(--accent); }

.dense-cell { display: flex; align-items: center; }
.dense-cell-person {
  flex: 2; min-width: 0;
  display: flex; align-items: center; gap: var(--s-2);
  cursor: pointer;
}
.dense-person-text { display: flex; flex-direction: column; min-width: 0; }
.dense-name { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dense-meta { font-size: var(--text-xs); color: var(--ink-tertiary); }

.dense-cell-data { flex: 1; min-width: 80px; font-size: var(--text-sm); color: var(--ink-secondary); }
.dense-value.emphasis { font-weight: var(--weight-semibold); color: var(--ink); }
.dense-cell-indicator { width: 80px; display: flex; align-items: center; gap: var(--s-1); font-size: var(--text-xs); }
.dense-cell-actions { display: flex; gap: 2px; opacity: 0; transition: opacity var(--duration-fast); }
.dense-row:hover .dense-cell-actions, .dense-row:focus-within .dense-cell-actions { opacity: 1; }

.btn-icon-xs {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  color: var(--ink-tertiary); border-radius: var(--radius-sm);
  transition: background var(--duration-fast), color var(--duration-fast);
}
.btn-icon-xs:hover { background: var(--bg-hover); color: var(--ink); }
.btn-icon-xs svg { width: 14px; height: 14px; }

.dense-row-detail {
  padding: var(--s-3) var(--s-6) var(--s-4);
  background: var(--surface-2);
  border-top: 1px solid var(--border-subtle);
}

.dense-detail-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s-3);
}
.dense-detail-item dt { font-size: var(--text-xs); color: var(--ink-tertiary); font-weight: var(--weight-medium); }
.dense-detail-item dd { font-size: var(--text-sm); color: var(--ink); margin: 0; }

.docs-mini { font-size: var(--text-xs); color: var(--ink-tertiary); }
.search-hit { background: var(--warning-soft); color: var(--warning); border-radius: 2px; padding: 0 1px; }

/* Dense head columns */
.dense-col-select { width: 22px; }
.dense-col-expand { width: 20px; }
.dense-col-person { flex: 2; }
.dense-col-data { flex: 1; }
.dense-col-indicator { width: 80px; }
.dense-col-actions { width: 100px; }
.employee-dense-head { display: flex; align-items: center; gap: var(--s-2); }
.employee-dense-head .dense-col-select { width: 22px; flex-shrink: 0; }
.employee-dense-row .dense-row-main { flex-wrap: nowrap; }
.plantilla-dense-panel .dense-list-body {
  max-height: min(68vh, 720px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.dense-row.is-focused { background: var(--accent-muted); outline: 1px solid var(--accent-soft); outline-offset: -1px; }

/* Avatar */
.avatar-xs { width: 28px; height: 28px; font-size: 10px; font-weight: var(--weight-semibold); border-radius: var(--radius-full); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar-blue { background: var(--accent-soft); color: var(--accent); }
.avatar-purple { background: #f3e8ff; color: #7c3aed; }
.avatar-teal { background: #ccfbf1; color: #0d9488; }
.avatar-gold { background: #fef3c7; color: #d97706; }

/* Incidencia rows */
.incidencia-dense-row .dense-row-main { gap: var(--s-3); }
.incidencia-person { flex: 1.5; }
.dense-cell-date { width: 80px; font-size: var(--text-xs); color: var(--ink-tertiary); }
.dense-cell-desc { flex: 2; font-size: var(--text-sm); color: var(--ink-secondary); }
.dense-cell-money { width: 90px; font-size: var(--text-sm); font-weight: var(--weight-medium); text-align: right; }

.dense-list-body .list-item-row {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  transition: background var(--duration-fast);
  cursor: pointer;
}
.dense-list-body .list-item-row:hover { background: var(--surface-2); }

/* ── Search box ── */
.search-box { position: relative; display: flex; align-items: center; }
.search-box-grow { flex: 1; }
.search-box-icon { position: absolute; left: var(--s-3); color: var(--ink-placeholder); pointer-events: none; }
.search-box-icon svg { width: 14px; height: 14px; }
.search-box input {
  width: 100%; padding: 6px var(--s-3) 6px var(--s-8);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-family: inherit;
  background: var(--surface-2); color: var(--ink); outline: none;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.search-box input:focus { background: var(--surface-0); border-color: var(--border-focus); }

/* ── Plantilla toolbar ── */
.plantilla-topbar { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.plantilla-count { font-size: var(--text-xs); color: var(--ink-tertiary); white-space: nowrap; }
.plantilla-actions-dropdown { position: relative; }

/* ── Page header ── */
.page-header-compact { margin-bottom: var(--s-5); }
.page-header-meta { font-size: var(--text-sm); color: var(--ink-tertiary); }

/* ── Checklist ── */
.checklist-progress-lg { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.checklist-progress-lg span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

/* ── Filter bar ── */
.filter-bar { display: flex; gap: var(--s-3); align-items: flex-end; margin-bottom: var(--s-4); padding: var(--s-3) var(--s-4); background: var(--surface-2); border-radius: var(--radius); }

/* ── PIN ── */
.pin-overlay { position: fixed; inset: 0; background: var(--surface-0); z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; }
.pin-card { text-align: center; max-width: 300px; }
.pin-card h2 { font-size: var(--text-xl); font-weight: var(--weight-semibold); margin-bottom: var(--s-2); }
.pin-card p { font-size: var(--text-sm); color: var(--ink-tertiary); margin-bottom: var(--s-4); }
.pin-actions { display: flex; gap: var(--s-2); justify-content: center; margin-top: var(--s-3); }
.pin-hint { font-size: var(--text-xs); color: var(--ink-placeholder); margin-top: var(--s-4); }
.pin-logo { display: flex; justify-content: center; margin-bottom: var(--s-4); }

/* ── Coming soon ── */
.coming-soon-panel, .section-placeholder {
  display: flex; flex-direction: column; align-items: center;
  padding: var(--s-16) var(--s-8); text-align: center;
}

/* ── Misc compat ── */
.btn-outline { background: var(--surface-0); color: var(--ink-secondary); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }

.table-scroll { overflow-x: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; } }

/* ── Validacion ── */
.validacion-result { margin-top: var(--s-3); }
.validacion-list { max-height: 300px; overflow-y: auto; }

/* ── Formatear moneda ── */
.format-preview { margin-top: var(--s-3); }

/* ── Module shell ── */
.module-shell-head { margin-bottom: var(--s-5); }
.module-page { }
.module-page-header { margin-bottom: var(--s-4); }
.module-page-header h2 { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: -0.02em; }
.module-page-header p { font-size: var(--text-sm); color: var(--ink-tertiary); margin-top: var(--s-1); }
.module-page-body { }
.subnav-tag { font-size: 10px; padding: 1px 5px; border-radius: var(--radius-full); background: var(--surface-3); color: var(--ink-tertiary); margin-left: var(--s-1); }
.section-placeholder { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--s-16) var(--s-8); }
.section-placeholder-icon { margin-bottom: var(--s-4); }
.section-placeholder-icon svg { width: 40px; height: 40px; color: var(--ink-placeholder); }
.section-placeholder h3 { font-size: var(--text-md); font-weight: var(--weight-semibold); margin-bottom: var(--s-2); }
.section-placeholder p { font-size: var(--text-sm); color: var(--ink-tertiary); }
.module-scope-list { text-align: left; margin-top: var(--s-3); font-size: var(--text-sm); color: var(--ink-secondary); padding-left: var(--s-5); }

/* ── Detail panel (right side) ── */
.detail-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(480px, 75vw);
  background: var(--surface-0);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-overlay);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.detail-panel.open { transform: translateX(0); }
.detail-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0; background: var(--surface-0); z-index: 1;
}
.detail-panel-body { padding: var(--s-5); flex: 1; }
.detail-panel-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  color: var(--ink-tertiary); border-radius: var(--radius-sm);
  transition: background var(--duration-fast), color var(--duration-fast);
}
.detail-panel-close:hover { background: var(--bg-hover); color: var(--ink); }

.detail-panel-head {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.detail-panel-hero { display: flex; align-items: center; gap: var(--s-3); }
.detail-panel-hero h3 { font-size: var(--text-md); font-weight: var(--weight-semibold); }
.detail-panel-sub { font-size: var(--text-xs); color: var(--ink-tertiary); }
.detail-panel-kpis { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.detail-kpi-chip { display: inline-flex; align-items: center; gap: var(--s-1); padding: 2px var(--s-2); background: var(--surface-3); border-radius: var(--radius-full); font-size: var(--text-xs); color: var(--ink-secondary); }
.detail-kpi-chip svg { width: 12px; height: 12px; }
.detail-kpi-chip.disc { background: #f3e8ff; color: #7c3aed; }

.detail-panel-actions { display: flex; gap: var(--s-2); padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--border-subtle); }
.detail-panel-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 var(--s-5); }
.detail-tab {
  padding: var(--s-2) var(--s-3); font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--ink-tertiary); cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit;
  transition: color var(--duration-fast);
}
.detail-tab:hover { color: var(--ink); }
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.detail-panel-body { padding: var(--s-4) var(--s-5); flex: 1; overflow-y: auto; }
.detail-tab-panel { display: none; }
.detail-tab-panel.active { display: block; }

.detail-section { margin-bottom: var(--s-5); }
.detail-section-title { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--ink-tertiary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--s-2); }
.detail-field { padding: var(--s-1) 0; font-size: var(--text-sm); }
.detail-field-label { color: var(--ink-tertiary); font-size: var(--text-xs); }
.detail-field-value { color: var(--ink); }
.detail-panel-open { overflow: hidden; }

/* Avatar sm for detail panel */
.avatar-sm { width: 32px; height: 32px; font-size: 11px; font-weight: var(--weight-semibold); border-radius: var(--radius-full); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── Context menu ── */
.ctx-menu {
  position: fixed; background: var(--surface-0); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md); padding: var(--s-1) 0;
  z-index: var(--z-dropdown); min-width: 160px;
}
.ctx-menu button {
  display: flex; align-items: center; gap: var(--s-2);
  width: 100%; padding: var(--s-2) var(--s-4);
  font-size: var(--text-sm); font-family: inherit;
  background: none; border: none; cursor: pointer;
  color: var(--ink-secondary); text-align: left;
  transition: background var(--duration-fast);
}
.ctx-menu button:hover { background: var(--surface-2); color: var(--ink); }
.ctx-menu button.danger { color: var(--danger); }
.ctx-menu button.danger:hover { background: var(--danger-soft); }

/* ── Finiquito details ── */
.finiq-options summary { cursor: pointer; font-size: var(--text-sm); color: var(--ink-tertiary); font-weight: var(--weight-medium); padding: var(--s-2) 0; }
.finiquito-meta { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm); }
.finiquito-detalle-mat summary { cursor: pointer; font-size: var(--text-sm); color: var(--accent); font-weight: var(--weight-medium); }
.finiquito-formulas { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }
.formula-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: var(--s-3); align-items: center; padding: var(--s-2) var(--s-3); background: var(--surface-2); border-radius: var(--radius-sm); font-size: var(--text-sm); }
.formula-row.formula-total { background: var(--accent-soft); }
.formula-calc { font-family: 'JetBrains Mono', monospace; font-size: var(--text-xs); color: var(--ink-tertiary); }
.formula-result { text-align: right; font-weight: var(--weight-semibold); }

/* ── Prestaciones ── */
.prestaciones-config-bar { display: flex; flex-wrap: wrap; gap: var(--s-3); padding: var(--s-2) var(--s-3); background: var(--surface-2); border-radius: var(--radius-sm); font-size: var(--text-sm); margin-bottom: var(--s-4); }

/* ── Checklist config ── */
.checklist-config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.checklist-config-item { display: flex; align-items: center; gap: var(--s-2); font-size: var(--text-sm); cursor: pointer; padding: var(--s-1) 0; }

/* ── Fields config ── */
.fields-config-table-wrap { overflow-x: auto; max-height: 400px; }

/* ── Data table compact ── */
.data-table-sm { font-size: var(--text-xs); }
.data-table-sm td, .data-table-sm th { padding: var(--s-1) var(--s-2); }
.row-total td { border-top: 2px solid var(--border); }

/* ── Avatar compat ── */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-full); font-weight: var(--weight-semibold); flex-shrink: 0; }
.avatar-xl { width: 56px; height: 56px; font-size: var(--text-lg); }
.avatar-brand { background: var(--accent-soft); color: var(--accent); }

/* ── Alert banners ── */
.alert-banner { padding: var(--s-3) var(--s-4); border-radius: var(--radius-sm); font-size: var(--text-sm); display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-4); }
.alert-banner[hidden],
#auth-alert[hidden] { display: none !important; }
.alert-banner.warning { background: var(--warning-soft); color: var(--warning); }
.alert-banner.success-inline { background: var(--success-soft); color: var(--success); }
.alert-banner.danger { background: #fce8e6; color: #b3261e; border: 1px solid #f3b8b3; }
html[data-theme="dark"] .alert-banner.danger,
html[data-theme="dark"] .pin-card .alert-banner.danger { background: #351a18; color: #ffb4ab; border-color: #8c3a34; }
html[data-theme="dark"] .pin-card { background: #111c21 !important; color: #edf7fa !important; }
html[data-theme="dark"] .pin-card h2,
html[data-theme="dark"] .pin-card label { color: #edf7fa !important; }
html[data-theme="dark"] .pin-card > p,
html[data-theme="dark"] .pin-card .pin-hint { color: #c5d5dc !important; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .alert-banner.danger { background: #351a18; color: #ffb4ab; border-color: #8c3a34; }
  html:not([data-theme="light"]) .pin-card { background: #111c21 !important; color: #edf7fa !important; }
  html:not([data-theme="light"]) .pin-card h2,
  html:not([data-theme="light"]) .pin-card label { color: #edf7fa !important; }
  html:not([data-theme="light"]) .pin-card > p,
  html:not([data-theme="light"]) .pin-card .pin-hint { color: #c5d5dc !important; }
}

/* ── Form renderer ── */
.expediente-section { margin-bottom: var(--s-6); }
.expediente-section h4 { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--ink); margin-bottom: var(--s-3); padding-bottom: var(--s-2); border-bottom: 1px solid var(--border-subtle); }
.expediente-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s-3) var(--s-4); }
.expediente-fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--s-4); }
.campo-group { display: flex; flex-direction: column; }
.campo-label { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--ink-tertiary); margin-bottom: 2px; }
.campo-valor { font-size: var(--text-sm); color: var(--ink); }
.campo-vacio { font-size: var(--text-sm); color: var(--ink-placeholder); font-style: italic; }
.campo-faltante { border-left: 2px solid var(--warning); padding-left: var(--s-2); }

.form-section { margin-bottom: var(--s-5); }
.form-section-title { font-size: var(--text-sm); font-weight: var(--weight-semibold); margin-bottom: var(--s-3); padding-bottom: var(--s-2); border-bottom: 1px solid var(--border-subtle); }
.required { color: var(--danger); font-weight: var(--weight-medium); }
.mx-tag { font-size: 9px; padding: 1px 4px; background: var(--info-soft); color: var(--info); border-radius: 3px; font-weight: var(--weight-medium); vertical-align: middle; }

/* ── Modal XL ── */
.modal-xl { max-width: 900px; }
.modal-subtitle { font-size: var(--text-sm); color: var(--ink-tertiary); margin-top: 2px; }
.modal-hint { font-size: var(--text-sm); color: var(--ink-tertiary); margin-bottom: var(--s-4); }

/* ── Loading ── */
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s-16); color: var(--ink-placeholder); gap: var(--s-3); }
.loading-spinner { width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Nav badges ── */
.nav-badge { font-size: 10px; padding: 1px 5px; border-radius: var(--radius-full); background: var(--surface-3); color: var(--ink-tertiary); margin-left: auto; }

/* ── Completitud indicator ── */
.completion-indicator {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: var(--text-xs); color: var(--ink-tertiary);
}
.completion-indicator svg { width: 12px; height: 12px; }
.completion-indicator.is-complete { color: var(--success); }
.completion-indicator.is-complete svg { color: var(--success); }
.completion-pct { font-weight: var(--weight-medium); }
.completion-bar {
  width: 24px; height: 3px; border-radius: 2px;
  background: var(--surface-3); position: relative; overflow: hidden;
}
.completion-bar::after {
  content: ''; position: absolute; inset: 0;
  background: var(--accent); width: var(--pct, 0%);
  border-radius: 2px;
}

/* ── Responsive expediente ── */
@media (max-width: 768px) {
  .expediente-hero { flex-direction: column; }
  .expediente-actions { align-self: stretch; }
  .checklist-grid { grid-template-columns: 1fr; }
}

/* Notificaciones header */
.header-actions { position: relative; }
.notif-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 600; line-height: 16px; text-align: center;
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: min(380px, 92vw);
  max-height: 420px; overflow: auto; background: var(--surface-raised);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 200;
}
.notif-panel-head { display: flex; justify-content: space-between; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border-subtle); }
.notif-item { display: block; width: 100%; text-align: left; padding: var(--s-3) var(--s-4); border: none; background: transparent; cursor: pointer; border-bottom: 1px solid var(--border-subtle); }
.notif-item:hover { background: var(--surface-hover); }
.notif-cat { display: block; font-size: var(--text-xs); color: var(--ink-tertiary); text-transform: uppercase; }
.notif-text { font-size: var(--text-sm); color: var(--ink-primary); }
.notif-empty { padding: var(--s-6); color: var(--ink-tertiary); text-align: center; }

/* Plantilla tarjetas */
.plantilla-view-toggle { display: flex; gap: 2px; }
.plantilla-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-3); }
.plantilla-card { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--s-3); background: var(--surface-raised); }
.plantilla-card-head { display: flex; gap: var(--s-2); align-items: center; margin-bottom: var(--s-2); }
.plantilla-card-foot { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-3); }
.row-badge-do { background: rgba(139, 92, 246, 0.15); color: #7c3aed; }

/* Dashboard cumpleaños / festivos */
.cumple-list { display: flex; flex-direction: column; gap: var(--s-2); }
.cumple-item { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-2) var(--s-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: transparent; cursor: pointer; width: 100%; text-align: left; }
.cumple-item.cumple-hoy { border-color: var(--accent); background: rgba(8, 145, 178, 0.08); }
.cumple-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-muted); display: grid; place-items: center; font-weight: 600; }
.festivos-mini-list { display: flex; flex-direction: column; gap: var(--s-2); }
.festivo-mini-item { display: flex; gap: var(--s-2); align-items: center; font-size: var(--text-sm); }
.festivo-fecha { min-width: 5rem; color: var(--ink-secondary); }

/* Auditoría expediente */
.audit-list { display: flex; flex-direction: column; gap: var(--s-3); }
.audit-entry { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--s-3); }
.audit-head { display: flex; justify-content: space-between; margin-bottom: var(--s-2); font-size: var(--text-sm); }
.audit-changes { margin: 0; padding-left: 1.2rem; font-size: var(--text-sm); }

/* Fase 4 premium */
.vars-panel { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--s-2) var(--s-3); }
.vars-panel-toggle { cursor: pointer; font-weight: 600; font-size: var(--text-sm); }
.vars-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-2); margin-top: var(--s-3); }
.var-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: var(--s-2) var(--s-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface-raised); cursor: pointer; text-align: left; }
.var-chip:hover { border-color: var(--accent); background: rgba(8, 145, 178, 0.06); }
.var-chip code { font-size: var(--text-xs); color: var(--accent); }
.var-chip span { font-size: var(--text-xs); color: var(--ink-tertiary); }
.disc-timeline { position: relative; padding-left: var(--s-4); margin-top: var(--s-3); }
.disc-timeline-item { position: relative; padding: var(--s-3) 0 var(--s-3) var(--s-4); border-left: 2px solid var(--border-subtle); margin-left: 6px; }
.disc-timeline-item:last-child { border-left-color: transparent; }
.disc-timeline-marker { position: absolute; left: -7px; top: 1.25rem; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface-base); }
.disc-grav-grave .disc-timeline-marker { background: var(--danger); }
.disc-timeline-head { display: flex; justify-content: space-between; gap: var(--s-2); font-size: var(--text-xs); color: var(--ink-tertiary); margin-bottom: var(--s-1); }
.cierre-semana-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.cierre-item { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-3); align-items: center; padding: var(--s-2) var(--s-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.cierre-item.done { border-color: rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.06); }
.cierre-item.pending { border-color: rgba(245, 158, 11, 0.35); }
.cierre-check { font-weight: 700; width: 1.25rem; text-align: center; }
.cierre-item small { display: block; color: var(--ink-tertiary); font-size: var(--text-xs); }
.toggle-alta-rapida { display: flex; align-items: center; gap: var(--s-2); font-size: var(--text-sm); cursor: pointer; }
.modo-impresion-rrhh .content-area { max-width: none; padding: var(--s-4); }
.modo-impresion-rrhh #developer-credit { display: none !important; }
.barra-modo-impresion { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; gap: var(--s-3); padding: var(--s-2) var(--s-4); background: #0f1419; color: #fff; font-size: var(--text-sm); }
ul.hechos-acta-list { list-style: none; margin: 0; padding: 0; }
.hechos-acta-list li { padding: var(--s-2) 0; border-bottom: 1px solid var(--border-subtle); }
.row-warning { background: rgba(245, 158, 11, 0.08); }
@media print {
  .barra-modo-impresion, .sidebar, .header { display: none !important; }
  .modo-impresion-rrhh .content-area { padding: 0; }
}

/* Panel de avisos y etiquetas secundarias del asistente de alta. */
#btn-notificaciones { position: relative; }
#notif-panel { background: var(--surface-0, #fff); color: var(--ink-primary); isolation: isolate; }
#notif-panel .notif-panel-head { align-items: center; }
#notif-panel .notif-group summary { padding: 12px 16px; min-height: 44px; cursor: pointer; border-bottom: 1px solid var(--border-subtle); }
@media (max-width: 720px) {
  #notif-panel { position: fixed; inset: auto 12px max(70px, env(safe-area-inset-bottom)); width: auto; max-height: min(62vh, 420px); }
}
.alta-field-note { font-size: .82em; font-weight: 500; }
.alta-essential-grid > .config-hint { font-size: .85rem; }
