:root {
  --brand-primary: #2563eb;
  --brand-secondary: #1d4ed8;
  --tblr-primary: #2563eb;
  --tblr-primary-rgb: 37, 99, 235;
  --sidebar-bg: #0f172a;
}

body {
  background-color: #f1f5f9;
  font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
  color: #1e293b;
}

/* ---------- Menú lateral ---------- */
.sidebar-brand {
  background: var(--sidebar-bg) !important;
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo {
  height: 56px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}
.navbar-vertical .nav-link {
  border-radius: 8px;
  margin: 2px 8px;
  color: rgba(255,255,255,.75);
}
.navbar-vertical .nav-link:hover,
.navbar-vertical .dropdown-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.navbar-vertical .nav-link.active,
.navbar-vertical .dropdown-item.active {
  background: rgba(37,99,235,.35) !important;
  color: #fff !important;
}
.navbar-vertical .dropdown-menu {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.navbar-vertical .dropdown-item {
  border-radius: 8px;
  margin: 1px 8px;
  color: rgba(255,255,255,.7);
}
.navbar-vertical .dropdown-menu .dropdown-header {
  color: rgba(255,255,255,.45);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
}

.sidebar-user {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 14px 12px 12px;
}
.sidebar-user-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.sidebar-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.sidebar-user-name {
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  white-space: normal;
}
.sidebar-role {
  display: inline-block;
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(37,99,235,.35);
  color: #bfdbfe;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.btn-sidebar-logout {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
}
.btn-sidebar-logout:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

/* ---------- Botones ---------- */
.btn {
  min-height: 40px;
  padding: .5rem 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
}
.btn-sm {
  min-height: 34px;
  padding: .35rem .8rem;
  font-size: .8125rem;
}
.btn-lg {
  min-height: 48px;
  padding: .65rem 1.4rem;
}
.btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-success { background: #15803d; border-color: #15803d; color: #fff; }
.btn-success:hover { background: #166534; border-color: #166534; color: #fff; }
.btn-danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-warning { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.btn-outline-primary { color: #2563eb; border-color: #93c5fd; background: #fff; }
.btn-outline-primary:hover { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-outline-danger { color: #dc2626; border-color: #fca5a5; background: #fff; }
.btn-outline-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }

/* ---------- Formularios ---------- */
.form-control,
.form-select {
  min-height: 40px;
  border-radius: 8px;
  border-color: #cbd5e1;
}
.form-control:focus,
.form-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-label {
  font-weight: 600;
  color: #334155;
}

/* ---------- Badges suaves ---------- */
.badge {
  padding: .4em .8em;
  font-size: .75rem;
  font-weight: 600;
  border-radius: 6px;
  letter-spacing: .01em;
}
.badge.bg-success   { background: #dcfce7 !important; color: #166534 !important; }
.badge.bg-danger    { background: #fee2e2 !important; color: #991b1b !important; }
.badge.bg-warning   { background: #fef3c7 !important; color: #92400e !important; }
.badge.bg-info      { background: #e0f2fe !important; color: #075985 !important; }
.badge.bg-primary   { background: #dbeafe !important; color: #1e40af !important; }
.badge.bg-secondary { background: #e2e8f0 !important; color: #334155 !important; }
.badge.bg-light     { background: #f1f5f9 !important; color: #334155 !important; }
.badge.bg-dark      { background: #e2e8f0 !important; color: #0f172a !important; }

/* ---------- Tablas y alertas ---------- */
.table thead th {
  color: #64748b;
  font-size: .72rem;
  letter-spacing: .04em;
}
.table-warning, .table-warning > td, .table-warning > th {
  --tblr-table-bg: #fffbeb;
  --bs-table-bg: #fffbeb;
  background-color: #fffbeb !important;
}
.table-danger, .table-danger > td, .table-danger > th {
  --tblr-table-bg: #fef2f2;
  --bs-table-bg: #fef2f2;
  background-color: #fef2f2 !important;
}
.table-success, .table-success > td, .table-success > th {
  --tblr-table-bg: #f0fdf4;
  --bs-table-bg: #f0fdf4;
  background-color: #f0fdf4 !important;
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.card {
  border-radius: 14px;
  border: 1px solid #e2e8f0;
}

/* ---------- Login y otros ---------- */
.login-bg {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
}
.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
}
.login-logo {
  height: 80px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
}

.kpi-card {
  border-radius: 14px;
  transition: transform .15s ease;
}
.kpi-card:hover {
  transform: translateY(-3px);
}
.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 18px;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 190px;
}

.mc-table {
  font-size: 0.82rem;
}
.mc-table th, .mc-table td {
  white-space: nowrap;
  padding: 0.35rem 0.5rem;
}
.print-header {
  text-align: center;
  padding: 10px 0;
}

@media print {
  .no-print, .navbar-vertical, footer, form {
    display: none !important;
  }
  .page-wrapper {
    margin-left: 0 !important;
  }
  .print-header {
    display: block !important;
  }
  main {
    padding: 0 !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
  }
  .table-responsive {
    overflow: visible !important;
    width: 100% !important;
  }
  .mc-table {
    width: 100% !important;
    font-size: 9px;
    table-layout: fixed;
  }
  .mc-table th, .mc-table td {
    border: 1px solid #000 !important;
    padding: 3px 5px;
    white-space: normal !important;
  }
  @page {
    size: landscape;
    margin: 10mm;
  }
}
.inicio-card {
  border: 1px solid #e2e8f0;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.inicio-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
  border-color: #93c5fd;
}
.inicio-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.resumen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  height: 100%;
}
.resumen-box {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.resumen-head {
  color: #fff;
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  text-align: center;
  padding: 8px 6px;
}
.resumen-val {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 14px 6px;
  color: #0f172a;
}
.dona-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}
@media (max-width: 575px) {
  .resumen-grid { grid-template-columns: repeat(2, 1fr); }
}