/* ========================================================================
   VictorIA PTW · Premium Design System
   ======================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --brand-900: #0a1628;
  --brand-800: #0d1f3c;
  --brand-700: #102a52;
  --brand-600: #1a3a6e;
  --brand-500: #1e4d9e;
  --brand-400: #2563eb;
  --brand-300: #3b82f6;
  --brand-200: #93c5fd;
  --brand-100: #dbeafe;
  --brand-50:  #eff6ff;

  --accent-500: #f59e0b;
  --accent-400: #fbbf24;
  --accent-100: #fef3c7;

  --success-500: #10b981;
  --success-100: #d1fae5;
  --danger-500:  #ef4444;
  --danger-100:  #fee2e2;
  --warning-500: #f59e0b;
  --warning-100: #fef3c7;

  --gray-900: #0f172a;
  --gray-800: #1e293b;
  --gray-700: #334155;
  --gray-600: #475569;
  --gray-500: #64748b;
  --gray-400: #94a3b8;
  --gray-300: #cbd5e1;
  --gray-200: #e2e8f0;
  --gray-100: #f1f5f9;
  --gray-50:  #f8fafc;

  --sidebar-w: 268px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.04);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.12), 0 4px 12px rgba(15,23,42,.06);
  --shadow-xl: 0 24px 64px rgba(15,23,42,.18);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}
code, pre, .mono { font-family: 'JetBrains Mono', monospace; }

/* ── Login Page ─────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 50%, var(--brand-500) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-page::after {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,.3) 0%, transparent 70%);
  bottom: -200px; right: -200px;
  pointer-events: none;
}
.login-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  animation: slideUp .5s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-header {
  background: linear-gradient(135deg, var(--brand-800) 0%, var(--brand-600) 100%);
  padding: 36px 32px 28px;
  text-align: center;
  color: white;
  position: relative;
}
.login-logo {
  width: 72px; height: 72px;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 14px;
}
.login-header h1 { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.login-header p { opacity: .75; font-size: 13px; margin: 0; }
.login-body { padding: 32px; }
.login-body .form-label { font-weight: 600; font-size: 13px; color: var(--gray-700); margin-bottom: 6px; }
.login-body .form-control {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  transition: all .2s;
  background: var(--gray-50);
}
.login-body .form-control:focus {
  border-color: var(--brand-400);
  background: white;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  outline: none;
}
.btn-login {
  background: linear-gradient(135deg, var(--brand-400) 0%, var(--brand-500) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-weight: 700;
  font-size: 14px;
  width: 100%;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,.45);
}
.login-footer { padding: 0 32px 24px; text-align: center; }

/* ── Admin Shell ─────────────────────────────────────── */
.admin-body { background: var(--gray-100); }
.admin-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--brand-900);
  color: white;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  z-index: 100;
  transition: width .25s ease;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.sidebar-brand {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-icon-wrap {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-500));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
}
.brand-text .brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.3px;
  line-height: 1.1;
}
.brand-text .brand-sub {
  font-size: 10px;
  opacity: .55;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 500;
}

.sidebar-user {
  margin: 14px 14px 0;
  padding: 12px 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-300));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 700; line-height: 1.1; }
.user-role {
  font-size: 10px;
  opacity: .6;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.sidebar-nav { padding: 14px 12px; flex: 1; }
.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.35);
  padding: 12px 10px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin: 2px 0;
  transition: all .15s;
  border: 1px solid transparent;
}
.sidebar-link i { font-size: 16px; flex-shrink: 0; width: 18px; }
.sidebar-link:hover {
  background: rgba(255,255,255,.08);
  color: white;
  border-color: rgba(255,255,255,.1);
}
.sidebar-link.active {
  background: var(--brand-400);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
  font-weight: 600;
}
.sidebar-link.danger { color: rgba(239,68,68,.8); }
.sidebar-link.danger:hover { background: rgba(239,68,68,.12); color: #ef4444; }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-version {
  font-size: 10px;
  color: rgba(255,255,255,.3);
  text-align: center;
  letter-spacing: .5px;
}

/* Main Area */
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.admin-topbar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-title { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-badge {
  background: var(--brand-50);
  color: var(--brand-500);
  border: 1px solid var(--brand-200);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
}

.admin-content { flex: 1; padding: 24px; }

.admin-footer {
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-text { font-size: 12px; color: var(--gray-400); }

/* ── Cards ─────────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header-bar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header-bar h2, .card-header-bar h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: var(--gray-900);
}
.card-body { padding: 20px; }

/* KPI Cards */
.kpi-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.kpi-card.blue::before   { background: var(--brand-400); }
.kpi-card.green::before  { background: var(--success-500); }
.kpi-card.yellow::before { background: var(--warning-500); }
.kpi-card.indigo::before { background: #6366f1; }

.kpi-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.kpi-icon.blue   { background: var(--brand-50);  color: var(--brand-400); }
.kpi-icon.green  { background: var(--success-100); color: var(--success-500); }
.kpi-icon.yellow { background: var(--accent-100); color: var(--accent-500); }
.kpi-icon.indigo { background: #eef2ff; color: #6366f1; }

.kpi-value { font-size: 30px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.kpi-label { font-size: 12px; color: var(--gray-500); font-weight: 500; margin-top: 3px; }

/* ── Tables ─────────────────────────────────────── */
.table-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  font-size: 13px;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--gray-50); }
.data-table .td-code { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500; color: var(--brand-500); }
.data-table .td-strong { font-weight: 600; color: var(--gray-900); }

/* ── Badges / Status ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
}
.badge-borrador  { background: var(--gray-100); color: var(--gray-600); }
.badge-evaluacion { background: #fef3c7; color: #92400e; }
.badge-observado { background: #fee2e2; color: #b91c1c; }
.badge-autorizado { background: #d1fae5; color: #065f46; }
.badge-ejecucion  { background: #dbeafe; color: #1e40af; }
.badge-suspendido { background: #fce7f3; color: #9d174d; }
.badge-cerrado    { background: var(--gray-100); color: var(--gray-500); }
.badge-si   { background: var(--success-100); color: #065f46; }
.badge-no   { background: var(--danger-100);  color: #b91c1c; }
.badge-na   { background: var(--gray-100);    color: var(--gray-500); }
.badge-critica { background: var(--danger-100); color: #b91c1c; }
.badge-req { background: var(--accent-100); color: #92400e; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  border: 1.5px solid transparent;
  text-decoration: none;
  line-height: 1;
}
.btn-primary {
  background: var(--brand-400);
  color: white;
  border-color: var(--brand-400);
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.btn-primary:hover { background: var(--brand-500); border-color: var(--brand-500); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.4); color: white; }
.btn-success {
  background: var(--success-500);
  color: white;
  border-color: var(--success-500);
  box-shadow: 0 2px 8px rgba(16,185,129,.25);
}
.btn-success:hover { background: #059669; color: white; }
.btn-outline {
  background: transparent;
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-outline-primary {
  background: transparent;
  color: var(--brand-500);
  border-color: var(--brand-200);
}
.btn-outline-primary:hover { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-600); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { background: var(--danger-500); color: white; border-color: var(--danger-500); }
.btn-danger:hover { background: #dc2626; color: white; }

/* ── Forms ─────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 6px;
  letter-spacing: .2px;
}
.form-control, .form-select {
  width: 100%;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--gray-800);
  background: white;
  transition: all .15s;
  outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
textarea.form-control { resize: vertical; }
.form-hint { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
.field-required { color: var(--danger-500); margin-left: 2px; }

/* Radio toggle group */
.radio-group { display: flex; gap: 4px; }
.radio-option input[type=radio] { display: none; }
.radio-option label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  color: var(--gray-600);
  user-select: none;
}
.radio-option input[value=SI]:checked + label { background: var(--success-100); border-color: var(--success-500); color: #065f46; }
.radio-option input[value=NO]:checked + label { background: var(--danger-100); border-color: var(--danger-500); color: #b91c1c; }
.radio-option input[value=NA]:checked + label { background: var(--gray-100); border-color: var(--gray-400); color: var(--gray-600); }
.radio-option label:hover { border-color: var(--gray-400); background: var(--gray-50); }

/* ── Wizard Steps ─────────────────────────────────────── */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  border: 2px solid var(--gray-300);
  color: var(--gray-400);
  background: white;
  transition: all .2s;
}
.step-label { font-size: 12px; font-weight: 600; color: var(--gray-400); }
.step-connector { width: 40px; height: 2px; background: var(--gray-200); margin: 0 8px; }
.wizard-step.done .step-num { background: var(--success-500); border-color: var(--success-500); color: white; }
.wizard-step.active .step-num { background: var(--brand-400); border-color: var(--brand-400); color: white; box-shadow: 0 0 0 4px rgba(37,99,235,.15); }
.wizard-step.done .step-label, .wizard-step.active .step-label { color: var(--gray-700); }
.wizard-step.done .step-connector, .wizard-step.active .step-connector { background: var(--brand-200); }

/* ── Section Block ─────────────────────────────────────── */
.section-block {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
}
.section-header {
  background: var(--gray-50);
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 700;
  font-size: 13px;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.question-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
}
.question-text { font-size: 13px; font-weight: 500; color: var(--gray-800); }
.question-sub { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ── Log Timeline ─────────────────────────────────────── */
.log-timeline { display: flex; flex-direction: column; gap: 0; }
.log-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  position: relative;
}
.log-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: 0;
  width: 1px;
  background: var(--gray-200);
}
.log-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand-50);
  border: 2px solid var(--brand-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: var(--brand-400);
  flex-shrink: 0;
  z-index: 1;
}
.log-content { flex: 1; }
.log-action { font-size: 12px; font-weight: 700; color: var(--gray-900); }
.log-meta { font-size: 11px; color: var(--gray-400); }
.log-notes { font-size: 12px; color: var(--gray-600); margin-top: 3px; }

/* ── Alerts ─────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: var(--success-100); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: var(--danger-100);  color: #b91c1c; border: 1px solid #fecaca; }
.alert-warning { background: var(--accent-100);  color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: var(--brand-50);    color: var(--brand-700); border: 1px solid var(--brand-200); }
.alert-close { margin-left: auto; cursor: pointer; opacity: .6; }
.alert-close:hover { opacity: 1; }

/* ── Page Header ─────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-title { font-size: 20px; font-weight: 800; color: var(--gray-900); margin: 0; }
.page-subtitle { font-size: 12px; color: var(--gray-400); margin-top: 2px; }

/* ── Status Detail Card ─────────────────────────────────────── */
.detail-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.detail-card-head {
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
  padding: 20px;
  color: white;
}
.detail-code { font-family: 'JetBrains Mono', monospace; font-size: 14px; opacity: .75; }
.detail-title { font-size: 18px; font-weight: 800; margin: 6px 0 10px; }
.detail-body { padding: 20px; }
.detail-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row-label { font-weight: 600; color: var(--gray-500); min-width: 100px; }
.detail-row-value { color: var(--gray-800); }

/* ── Mobile Sidebar ─────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}
/* ══════════════════════════════════════════════════════
   RESPONSIVE — Tablet (< 991px)
══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .admin-sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-w));
    top: 0; bottom: 0;
    transition: left .25s ease;
    z-index: 1000;
    box-shadow: none;
  }
  .admin-sidebar.open {
    left: 0;
    box-shadow: var(--shadow-xl);
  }
  .sidebar-overlay.show { display: block; }
  .admin-content { padding: 16px; }

  /* KPI grid 2 columnas en tablet */
  .kpi-row        { grid-template-columns: repeat(2, 1fr) !important; }
  .kpi-row-3      { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — Mobile (< 768px)
══════════════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* ── Topbar ── */
  .admin-topbar        { padding: 0 12px; height: 52px; }
  .topbar-title        { font-size: 14px; max-width: 160px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .topbar-badge        { display: none; }
  .topbar-right        { gap: 8px; }

  /* ── Content ── */
  .admin-content       { padding: 12px; }

  /* ── Page header ── */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
  }
  .page-header .btn    { align-self: stretch; justify-content: center; }
  .page-title          { font-size: 17px; }

  /* ── Cards ── */
  .card-body           { padding: 14px; }
  .card-header-bar     { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .card-header-bar h2  { font-size: 14px; }

  /* ── Filtros ── */
  .filter-grid         { grid-template-columns: 1fr !important; }
  .filter-form-grid    { grid-template-columns: 1fr !important; }

  /* ── Tablas: scroll horizontal obligatorio ── */
  .table-wrap          { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .data-table          { min-width: 560px; }
  /* Tabla inline sin wrapper */
  table                { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td               { white-space: nowrap; }

  /* ── KPIs ── */
  .kpi-row             { grid-template-columns: repeat(2, 1fr) !important; }
  .kpi-row-3           { grid-template-columns: repeat(2, 1fr) !important; }
  .kpi-card            { padding: 12px 14px; }
  .kpi-card-v2         { padding: 14px 16px; }
  .kpi-v2-value        { font-size: 26px; }
  .kpi-value           { font-size: 24px; }

  /* ── Forms ── */
  .form-grid-2         { grid-template-columns: 1fr !important; }
  .form-grid-3         { grid-template-columns: 1fr !important; }
  .row.cols-2          { grid-template-columns: 1fr; }
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="time"],
  input[type="number"],
  select, textarea     { font-size: 16px !important; } /* evita zoom en iOS */

  /* ── Botones ── */
  .btn-block-mobile    { width: 100% !important; justify-content: center; }
  .status-actions      { flex-direction: column; }
  .status-actions .btn { width: 100%; justify-content: center; }

  /* ── Dashboard charts ── */
  .chart-row           { grid-template-columns: 1fr !important; }

  /* ── PTW list cards ── */
  .ptw-list-actions    { flex-wrap: wrap; gap: 6px; }

  /* ── Footer ── */
  .admin-footer        { flex-direction: column; gap: 4px; text-align: center; padding: 10px; }
  .footer-text         { font-size: 11px; }

  /* ── Notificaciones dropdown ── */
  #notif-dropdown      { width: calc(100vw - 24px) !important; right: -50px !important; }

  /* ── Modal / overlay ── */
  .modal-overlay-inner { padding: 16px !important; border-radius: 14px !important; }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — Small mobile (< 480px)
══════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .admin-content       { padding: 10px; }
  .page-title          { font-size: 15px; }
  .badge               { font-size: 9px; padding: 2px 7px; }
  .kpi-row             { grid-template-columns: repeat(2, 1fr) !important; }
  .kpi-v2-value        { font-size: 22px; }
  .card-body           { padding: 12px; }
  /* Ocultar columnas secundarias en tabla pequeña */
  .hide-mobile         { display: none !important; }
  /* Sidebar más estrecho */
  :root                { --sidebar-w: 240px; }
}

/* ── Utilities ─────────────────────────────────────── */
.text-muted { color: var(--gray-400); }
.text-sm { font-size: 12px; }
.fw-bold { font-weight: 700; }
.fw-800  { font-weight: 800; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.mb-4 { margin-bottom: 20px; }
.p-0 { padding: 0; }

/* Grid helpers */
.row { display: grid; gap: 20px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3-1 { grid-template-columns: 3fr 1fr; }
.cols-2-1 { grid-template-columns: 2fr 1fr; }
@media (max-width: 767px) {
  .cols-2, .cols-3, .cols-4, .cols-3-1, .cols-2-1 { grid-template-columns: 1fr; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
}

/* Status transition buttons */
.status-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--gray-400);
}
.empty-state i { font-size: 48px; opacity: .4; display: block; margin-bottom: 12px; }
.empty-state p { margin: 0; font-size: 14px; }

/* Print */
@media print {
  .admin-sidebar, .admin-topbar, .admin-footer, .btn, .status-actions { display: none !important; }
  .admin-main { margin: 0 !important; }
}
