/* ============================================================
   Fiscora — Hoja de estilos principal
   Sistema para Contadores Públicos en México
   Paleta: Azul navy #1a3c5e | Azul acento #2563eb | Verde #059669
   ============================================================ */

/* --- Variables --- */
:root {
  --color-primary:   #1a3c5e;
  --color-accent:    #2563eb;
  --color-success:   #059669;
  --color-warning:   #d97706;
  --color-danger:    #dc2626;
  --color-text:      #1e293b;
  --color-muted:     #64748b;
  --color-border:    #e2e8f0;
  --color-bg:        #f1f5f9;
  --color-white:     #ffffff;
  --radius:          8px;
  --shadow-sm:       0 1px 3px rgba(0,0,0,.08);
  --shadow-md:       0 4px 12px rgba(0,0,0,.10);
  --font:            'Segoe UI', system-ui, -apple-system, sans-serif;
  --sidebar-w:       260px;
}

html.dark {
  --color-primary:   #93c5fd;
  --color-accent:    #60a5fa;
  --color-success:   #34d399;
  --color-warning:   #fbbf24;
  --color-danger:    #f87171;
  --color-text:      #e2e8f0;
  --color-muted:     #94a3b8;
  --color-border:    #2d3748;
  --color-bg:        #0f172a;
  --color-white:     #1e2a3b;
  --shadow-sm:       0 1px 3px rgba(0,0,0,.4);
  --shadow-md:       0 4px 12px rgba(0,0,0,.5);
}

/* --- Reset básico --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ============================================================
   LAYOUT DE AUTENTICACIÓN (login, registro, activación)
   ============================================================ */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a3c5e 0%, #2563eb 100%);
  padding: 24px 16px;
}

.auth-card {
  background: var(--color-white);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
}

.auth-header {
  background: var(--color-primary);
  padding: 32px 40px 24px;
  text-align: center;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 4px;
}

.auth-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--color-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.auth-logo-text {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: -.5px;
}

.auth-subtitle {
  color: #93c5fd;
  font-size: 13px;
  margin-top: 4px;
}

.auth-body-inner {
  padding: 32px 40px 40px;
}

.auth-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 24px;
}

/* ============================================================
   FORMULARIOS
   ============================================================ */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-white);
  transition: border-color .2s, box-shadow .2s, background .2s, color .2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-control.is-invalid {
  border-color: var(--color-danger);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220,38,38,.12);
}

.invalid-feedback {
  font-size: 12px;
  color: var(--color-danger);
  margin-top: 4px;
  display: block;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--color-muted);
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--color-accent);
  flex-shrink: 0;
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s, box-shadow .2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background: #1d4ed8; box-shadow: 0 4px 12px rgba(37,99,235,.3); text-decoration: none; color:#fff; }

.btn-secondary {
  background: var(--color-primary);
  color: #fff;
}
.btn-secondary:hover { background: #0f2440; color:#fff; text-decoration:none; }

.btn-success {
  background: var(--color-success);
  color: #fff;
}
.btn-success:hover { background: #047857; color:#fff; text-decoration:none; }

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}
.btn-danger:hover { background: #b91c1c; color:#fff; text-decoration:none; }

.btn-warning {
  background: var(--color-warning);
  color: #fff;
}
.btn-warning:hover { background: #b45309; color:#fff; text-decoration:none; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
}
.btn-outline:hover { background: var(--color-bg); text-decoration:none; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-full { width: 100%; }

/* ============================================================
   ALERTAS
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid #059669; }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #dc2626; }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid #d97706; }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #2563eb; }

/* ============================================================
   SIDEBAR + LAYOUT PRINCIPAL
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform .3s;
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-brand-text { font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.sidebar-brand-sub  { font-size: 11px; color: #93c5fd; margin-top: 1px; }

.sidebar-nav { padding: 16px 0; flex: 1; }

.sidebar-section {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7fb3d3;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 500;
  transition: background .2s, color .2s;
  text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255,255,255,.1);
  color: #fff;
  text-decoration: none;
}

.sidebar-link.active {
  border-right: 3px solid var(--color-accent);
}

.sidebar-link svg,
.sidebar-link .icon { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-name  { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-user-email { font-size: 11px; color: #94a3b8; }

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  box-sizing: border-box;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

/* Campana de notificaciones */
.topbar-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--color-muted);
  text-decoration: none;
  transition: background .2s, color .2s;
}
.topbar-bell:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}
.bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
}
.bell-badge-hidden {
  display: none;
}

.topbar-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-primary);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 6px 12px 6px 6px;
  border-radius: 24px;
  transition: background .2s;
}
.topbar-user:hover {
  background: var(--color-bg);
}
.topbar-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}
.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
}
.topbar-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #00448A;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.page-content {
  padding: 32px;
  flex: 1;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0;
}

.card-body { padding: 24px; overflow: visible; position: relative; }

/* Tables inside cards scroll horizontally instead of overflowing layout */
@media (max-width: 768px) {
  .card-body table,
  .card > table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
}

/* ============================================================
   TABLA
   ============================================================ */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  padding: 10px 16px;
  background: #f8fafc;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--color-border);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success  { background: #d1fae5; color: #065f46; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-info     { background: #dbeafe; color: #1e40af; }
.badge-muted    { background: #f1f5f9; color: var(--color-muted); }

/* ============================================================
   PAQUETES (cards de selección)
   ============================================================ */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.package-card {
  background: var(--color-white);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--color-border);
  padding: 28px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}

.package-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.package-card.selected {
  border-color: var(--color-success);
  background: #f0fdf4;
}

.package-name  { font-size: 20px; font-weight: 700; color: var(--color-primary); margin-bottom: 8px; }
.package-desc  { font-size: 14px; color: var(--color-muted); flex: 1; margin-bottom: 20px; line-height: 1.6; }
.package-price { font-size: 28px; font-weight: 700; color: var(--color-accent); margin-bottom: 6px; }
.package-price span { font-size: 14px; font-weight: 400; color: var(--color-muted); }

/* ============================================================
   STAT CARDS (dashboard)
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon-blue   { background: #dbeafe; }
.stat-icon-green  { background: #d1fae5; }
.stat-icon-yellow { background: #fef3c7; }
.stat-icon-red    { background: #fee2e2; }

.stat-label { font-size: 12px; color: var(--color-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--color-text); }

/* ============================================================
   UTILIDADES
   ============================================================ */
.d-flex   { display: flex; }
.gap-2    { gap: 8px; }
.gap-3    { gap: 12px; }
.flex-wrap{ flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-1  { margin-top: 4px; }
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 16px; }
.mt-4  { margin-top: 24px; }
.mb-3  { margin-bottom: 16px; }
.mb-4  { margin-bottom: 24px; }
.text-muted   { color: var(--color-muted); }
.text-small   { font-size: 13px; }
.text-center  { text-align: center; }
.fw-600 { font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .page-content {
    padding: 20px 16px;
  }
  .topbar {
    padding: 0 16px;
  }
  .auth-body-inner { padding: 24px; }
  .auth-header { padding: 24px; }

  .sidebar-brand { padding: 20px 16px; }
  .sidebar-link { padding: 12px 16px; }
  .sidebar-section { padding: 8px 16px 4px; }

  .card-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .card-body { padding: 16px; }

  .form-group { margin-bottom: 14px; }
  .btn { padding: 10px 16px; }

  .stat-card { padding: 16px; }
  .packages-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .topbar { padding: 0 12px; height: 56px; }
  .topbar-title { font-size: 15px; }
  .topbar-user { padding: 4px 8px; }
  .topbar-name { display: none; }

  .page-content { padding: 16px 12px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 14px; flex-direction: column; text-align: center; }
  .stat-icon { width: 40px; height: 40px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 10px; }

  .packages-grid { gap: 16px; }
  .package-card { padding: 20px; }
  .package-name { font-size: 18px; }
  .package-price { font-size: 24px; }

  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  table { font-size: 13px; }
  th, td { padding: 10px 12px; }

  .alert { padding: 10px 12px; font-size: 13px; }

  .search-box { flex-direction: column; }
  .search-box > * { width: 100%; }
}

@media (max-width: 480px) {
  .packages-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }

  .auth-body { padding: 16px 12px; }
  .auth-card { border-radius: 8px; }
  .auth-body-inner { padding: 20px; }
  .auth-header { padding: 20px; }
  .auth-logo-text { font-size: 22px; }
  .auth-title { font-size: 18px; }

  .btn-full-mobile { width: 100%; }
}

/* ============================================================
   RESPONSIVE PARA ESTILOS INLINE COMUNES
   Cubre tanto "display: grid" (con espacio) como "display:grid" (sin espacio)
   ============================================================ */
@media (max-width: 768px) {
  [style*="display: grid"],
  [style*="display:grid"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns:repeat(3"] {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 600px) {
  [style*="display: grid"],
  [style*="display:grid"],
  [style*="grid-template-columns"],
  [style*="grid-template-columns:"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .card,
  [class*="card"][style*="max-width"] {
    max-width: 100% !important;
    margin: 0 -8px;
    border-radius: 8px;
  }
}

/* ============================================================
   DARK MODE — sobreescrituras para colores hardcodeados
   ============================================================ */

/* Tablas */
html.dark th                { background: #162032; color: #94a3b8; }
html.dark tr:hover td       { background: #1a2a3d; }
html.dark td                { border-color: #2d3748; }

/* Badges */
html.dark .badge-success { background: #064e3b; color: #6ee7b7; }
html.dark .badge-danger  { background: #7f1d1d; color: #fca5a5; }
html.dark .badge-warning { background: #78350f; color: #fcd34d; }
html.dark .badge-info    { background: #1e3a5f; color: #93c5fd; }
html.dark .badge-muted   { background: #1e293b; color: #94a3b8; }

/* Alertas */
html.dark .alert-success { background: #064e3b; color: #6ee7b7; border-left-color: #34d399; }
html.dark .alert-error   { background: #7f1d1d; color: #fca5a5; border-left-color: #f87171; }
html.dark .alert-warning { background: #78350f; color: #fcd34d; border-left-color: #fbbf24; }
html.dark .alert-info    { background: #1e3a5f; color: #93c5fd; border-left-color: #60a5fa; }

/* Stat icons */
html.dark .stat-icon-blue   { background: #1e3a5f; }
html.dark .stat-icon-green  { background: #064e3b; }
html.dark .stat-icon-yellow { background: #78350f; }
html.dark .stat-icon-red    { background: #7f1d1d; }

/* Paquetes */
html.dark .package-card          { border-color: #2d3748; }
html.dark .package-card.selected { background: #0d2e1a; border-color: #34d399; }
html.dark .package-card:hover    { border-color: #60a5fa; }

/* Cards con borde visible en dark */
html.dark .card { border: 1px solid #2d3748; }

/* Inputs y forms */
html.dark .form-control {
  background: #162032;
  border-color: #2d3748;
  color: #e2e8f0;
}
html.dark .form-control:focus { border-color: #60a5fa; }
html.dark .form-control::placeholder { color: #4a5568; }
html.dark select.form-control option { background: #1e2a3b; }

/* Botones */
html.dark .btn-outline {
  border-color: #2d3748;
  color: #cbd5e1;
}
html.dark .btn-outline:hover {
  background: #1e2a3b;
  border-color: #60a5fa;
  color: #93c5fd;
}
html.dark .btn-secondary {
  background: #2d3748;
  color: #e2e8f0;
}
html.dark .btn-secondary:hover { background: #374151; }

/* Topbar */
html.dark .topbar {
  background: #162032;
  border-bottom-color: #2d3748;
}
html.dark .topbar-title { color: #e2e8f0; }

/* Dashboard — KPI cards */
html.dark .kpi-card        { background: #1e2a3b; border-color: #2d3748; }
html.dark .kpi-icon.blue   { background: #1e3a5f; color: #93c5fd; }
html.dark .kpi-icon.green  { background: #064e3b; color: #6ee7b7; }
html.dark .kpi-icon.amber  { background: #78350f; color: #fcd34d; }
html.dark .kpi-icon.purple { background: #3b1f6e; color: #c4b5fd; }
html.dark .kpi-value       { color: #e2e8f0; }

/* Dashboard — Barras */
html.dark .bar-fill { background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%); }
html.dark .bar-val  { color: #93c5fd; }
html.dark .bar-lbl  { color: #94a3b8; }

/* Dashboard — Acciones rápidas */
html.dark .quick-btn {
  background: #162032;
  border-color: #2d3748;
  color: #cbd5e1;
}
html.dark .quick-btn:hover {
  background: #1e3a5f;
  border-color: #60a5fa;
  color: #93c5fd;
}

/* Dashboard — Sección por vencer */
html.dark .bd-green  { background: #064e3b; color: #6ee7b7; }
html.dark .bd-amber  { background: #78350f; color: #fcd34d; }
html.dark .bd-red    { background: #7f1d1d; color: #fca5a5; }
html.dark .bd-blue   { background: #1e3a5f; color: #93c5fd; }
html.dark .bd-muted  { background: #1e293b; color: #94a3b8; }

/* Dashboard — Alerta strip */
html.dark .alert-strip {
  background: #2d2208;
  border-color: #92400e;
  color: #fcd34d;
}
html.dark .alert-strip a { color: #fbbf24; }

/* Dashboard — Welcome banner (ya tiene gradiente, sin cambio) */

/* Distribución barra inline */
html.dark .bar-fill-inline { background: #3b82f6 !important; }

/* Tablas del dashboard */
html.dark .dt th { background: #162032; color: #94a3b8; }
html.dark .dt td { border-color: #2d3748; color: #e2e8f0; }
html.dark .dt tbody tr:hover td { background: #1a2a3d; }

/* Footer */
html.dark .page-footer {
  color: #4a5568;
  border-top-color: #2d3748;
  background: #0f172a;
}

/* ── Dashboard usuario — KPI icons ─────────────────────────── */
html.dark .kpi-icon.blue   { background: #1e3a5f; color: #93c5fd; }
html.dark .kpi-icon.green  { background: #064e3b; color: #6ee7b7; }
html.dark .kpi-icon.orange { background: #78350f; color: #fdba74; }
html.dark .kpi-icon.red    { background: #7f1d1d; color: #fca5a5; }
html.dark .kpi-icon.purple { background: #3b1f6e; color: #c4b5fd; }

/* ── Dashboard usuario — textos hardcodeados ────────────────── */
html.dark [style*="color:#64748b"],
html.dark [style*="color: #64748b"] { color: #94a3b8 !important; }

html.dark [style*="color:#333"],
html.dark [style*="color: #333"]    { color: #e2e8f0 !important; }

html.dark [style*="color:#1a1a"],
html.dark [style*="color:#1e29"],
html.dark [style*="color:#111"]     { color: #e2e8f0 !important; }

/* ── Page footer main layout ────────────────────────────────── */
html.dark .sidebar-footer { border-top-color: rgba(255,255,255,.08); }

/* ── Topbar ─────────────────────────────────────────────────── */
html.dark .topbar          { background: #162032; border-bottom-color: #2d3748; }
html.dark .topbar-title    { color: #e2e8f0; }
html.dark .topbar-name     { color: #cbd5e1; }

/* ── Section titles (inline font-weight/color combos) ───────── */
html.dark [style*="font-weight:700"][style*="color:var(--color-primary)"],
html.dark [style*="font-weight: 700"][style*="color: var(--color-primary)"] {
  color: var(--color-primary) !important;
}

/* ── Notificación dot ring ───────────────────────────────────── */
html.dark [style*="box-shadow:0 0 0 4px #eff6ff"],
html.dark [style*="box-shadow: 0 0 0 4px #eff6ff"] {
  box-shadow: 0 0 0 4px #1e3a5f !important;
}

/* ── action-btn (hero buttons) ──────────────────────────────── */
html.dark .action-btn:hover { background: #1e3a5f; color: #93c5fd; }

/* ── Inline footer de main layout ───────────────────────────── */
html.dark .page-footer { color: #4b5563 !important; border-top-color: #2d3748 !important; }

/* ── Selector y tablas globales ─────────────────────────────── */
html.dark thead tr th { background: #162032 !important; color: #94a3b8; }
html.dark tbody tr:hover td { background: #1a2a3d !important; }
html.dark table td, html.dark table th { border-color: #2d3748; }
