:root {
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;

  --success-50: #ecfdf5;
  --success-600: #059669;

  --warning-50: #fffbeb;
  --warning-600: #b45309;

  --danger-50: #fef2f2;
  --danger-600: #b91c1c;

  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-soft: #f8fafc;

  --text-main: #0f172a;
  --text-soft: #64748b;
  --text-muted-2: #94a3b8;

  --border-soft: rgba(15, 23, 42, 0.08);
  --border-input: #dbe2ea;

  --shadow-soft: 0 14px 40px rgba(15, 23, 42, 0.08);
  --shadow-brand: 0 12px 28px rgba(37, 99, 235, 0.22);

  --sidebar-width: 280px;
  --top-gap: 1rem;

  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg-app) 100%);
  color: var(--text-main);
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
}

/* =========================================================
   APP LAYOUT
========================================================= */
.app-page {
  padding: 1rem;
}

.app-shell {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  min-height: calc(100vh - 2rem);
}

.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  position: sticky;
  top: var(--top-gap);
  align-self: flex-start;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 1rem;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
}

.topbar-mobile {
  display: none;
  margin-bottom: 1rem;
}

.topbar-mobile-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  padding: 0.9rem 1rem;
}

/* =========================================================
   BRAND / SIDEBAR
========================================================= */
.brand-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-radius: 18px;
  padding: 1rem;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
  color: #fff;
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.24);
  margin-bottom: 1rem;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.1;
}

.brand-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  opacity: 0.92;
}

.sidebar-section-title {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted-2);
  margin: 1rem 0.65rem 0.5rem;
  font-weight: 700;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  color: #334155;
  font-weight: 600;
  transition: 0.2s ease;
}

.sidebar-link i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link:hover {
  color: var(--brand-700);
  background: rgba(37, 99, 235, 0.08);
}

.sidebar-link.active {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.sidebar-link-muted {
  color: #475569;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid var(--border-soft);
}

.user-chip-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  color: var(--brand-700);
  font-weight: 700;
  flex-shrink: 0;
}

.user-chip-name {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-chip-sub {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* =========================================================
   FLASH / ALERTS
========================================================= */
.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.alert {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  padding: 1rem;
}

.alert-success {
  background: var(--success-50);
  color: #065f46;
}

.alert-danger {
  background: var(--danger-50);
  color: #991b1b;
}

.alert-warning {
  background: var(--warning-50);
  color: #92400e;
}

.alert-info {
  background: var(--brand-50);
  color: var(--brand-700);
}

/* =========================================================
   BUTTON SYSTEM
========================================================= */
.btn {
  min-height: 44px;
  border-radius: 14px;
  font-weight: 600;
  padding: 0.68rem 1rem;
  transition: 0.2s ease;
}

.btn-sm {
  min-height: 36px;
  border-radius: 12px;
  padding: 0.45rem 0.8rem;
  font-size: 0.88rem;
}

.btn-lg {
  min-height: 50px;
  border-radius: 16px;
  padding: 0.8rem 1.2rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  border: none;
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-800));
  border: none;
  transform: translateY(-1px);
}

.btn-outline-primary {
  color: var(--brand-700);
  border-color: rgba(37, 99, 235, 0.25);
  background: #fff;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-800);
  border-color: rgba(37, 99, 235, 0.35);
}

.btn-outline-secondary {
  color: #334155;
  border-color: rgba(15, 23, 42, 0.12);
  background: #fff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: #f8fafc;
  color: var(--text-main);
  border-color: rgba(15, 23, 42, 0.18);
}

.btn-success {
  border: none;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 12px 26px rgba(16, 185, 129, 0.22);
}

.btn-success:hover,
.btn-success:focus {
  transform: translateY(-1px);
}

.btn-danger {
  border: none;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.22);
}

.btn-outline-danger {
  background: #fff;
  border-color: rgba(239, 68, 68, 0.22);
  color: #dc2626;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  background: #fef2f2;
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.35);
}

/* =========================================================
   FORM SYSTEM
========================================================= */
.form-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.45rem;
}

.form-control,
.form-select {
  border-radius: 14px;
  border: 1px solid var(--border-input);
  min-height: 46px;
  box-shadow: none;
  background: #fff;
  color: var(--text-main);
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

textarea.form-control {
  min-height: 110px;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.form-control::placeholder {
  color: #94a3b8;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 0.22rem rgba(37, 99, 235, 0.12);
}

.form-text {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.input-group-text {
  border-radius: 14px;
  border: 1px solid var(--border-input);
  background: #f8fafc;
  color: var(--text-soft);
  font-weight: 600;
}

/* =========================================================
   CARD SYSTEM
========================================================= */
.card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card-header {
  background: #fff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

/* =========================================================
   BADGES
========================================================= */
.badge {
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 0.5rem 0.7rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  text-transform: capitalize;
}

.status-paid,
.status-active,
.status-approved {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.status-pending,
.status-draft,
.status-sent,
.status-converted {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.status-overdue,
.status-cancelled,
.status-rejected,
.status-deleted,
.status-void {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.status-warning,
.status-low {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

/* =========================================================
   TABLE SYSTEM
========================================================= */
.table {
  margin-bottom: 0;
}

.table thead th {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom-width: 1px;
  background: #f8fafc;
}

.table > :not(caption) > * > * {
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  vertical-align: middle;
  border-color: rgba(15, 23, 42, 0.06);
}

.table-hover tbody tr:hover {
  background: rgba(37, 99, 235, 0.03);
}

/* =========================================================
   SUMMARY / DOCUMENT BLOCKS
========================================================= */
.summary-box {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.summary-label {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-bottom: 0.35rem;
}

.summary-value {
  font-weight: 800;
  color: var(--text-main);
}

.surface-soft {
  background: #f8fafc;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}

.doc-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  padding: 0.35rem;
}

.doc-logo-fallback {
  width: 68px;
  height: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
  color: #fff;
  font-size: 1.4rem;
  box-shadow: var(--shadow-brand);
}

.doc-inner-card {
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: none;
}

.doc-total-box {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #f8fafc;
  padding: 1rem;
}

.doc-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  color: #334155;
}

.doc-total-row.total {
  margin-top: 0.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 1.05rem;
  color: #0f172a;
}

/* =========================================================
   AUTH / UTILITIES
========================================================= */
.section-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.section-subtitle {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.auth-shell {
  min-height: calc(100vh - 120px);
}

.auth-icon {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
  color: #fff;
  font-size: 1.7rem;
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.22);
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 991.98px) {
  .app-shell {
    display: block;
  }

  .app-sidebar {
    display: none;
  }

  .topbar-mobile {
    display: block;
  }

  .app-main {
    width: 100%;
  }

  .app-page {
    padding: 0.75rem;
  }
}

/* =========================================================
   🔥 PRO+++ VISUAL UPGRADE (SAFE)
========================================================= */

/* Fondo más premium */
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg-app) 100%);
  color: var(--text-main);
}

/* Dark mode SOLO para la app principal */
body.app-dark {
  background:
    radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.12), transparent 35%),
    linear-gradient(180deg, #020617 0%, #020617 40%, #0f172a 100%);
  color: #e2e8f0;
}

/* Main area */
.app-main {
  background: transparent;
}

/* Sidebar más PRO */
.app-sidebar {
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* Links sidebar */
.sidebar-link {
  color: #cbd5f5;
}

.sidebar-link:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.sidebar-link.active {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
}

/* Cards PRO */
.card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.08);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
}

/* Tablas */
.table {
  color: #e2e8f0;
}

.table thead th {
  background: rgba(15, 23, 42, 0.9);
  color: #94a3b8;
}

.table-hover tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}

/* Botones más premium */
.btn-primary {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.5);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.6);
}

/* Inputs */
.form-control,
.form-select {
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
}

.form-control:focus,
.form-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Badges */
.badge {
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Topbar mobile */
.topbar-mobile-card {
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

/* =========================================================
   FIX FORMULARIOS DARK MODE 🔥
========================================================= */

/* Labels */
.form-label {
  color: #e2e8f0;
}

/* Texto secundario */
.text-muted {
  color: #94a3b8 !important;
}

/* Inputs */
.form-control,
.form-select {
  color: #e2e8f0;
}

/* Placeholder */
.form-control::placeholder {
  color: #64748b;
}

/* Input disabled */
.form-control:disabled,
.form-select:disabled {
  background-color: rgba(15, 23, 42, 0.5);
  color: #94a3b8;
}

/* Input group */
.input-group-text {
  background: rgba(2, 6, 23, 0.8);
  color: #cbd5f5;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Select dropdown (mejora visibilidad) */
.form-select option {
  background: #020617;
  color: #e2e8f0;
}

/* Tables texto general */
.table {
  color: #e2e8f0;
}

/* Small text */
small,
.form-text {
  color: #94a3b8;
}

/* Headers dentro de cards */
.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6 {
  color: #f1f5f9;
}

/* Links */
a {
  color: #93c5fd;
}

a:hover {
  color: #60a5fa;
}

/* =========================================================
   KARDEX UX PREMIUM
========================================================= */
.kardex-table thead th {
  white-space: nowrap;
}

.kardex-badge {
  gap: 0.45rem;
  font-size: 0.78rem;
}

.kardex-sale {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.2);
}

.kardex-sale-void {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.2);
}

.kardex-in {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.2);
}

.kardex-out {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.2);
}

.kardex-adjustment {
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.2);
}

.kardex-default {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.18);
}

.kardex-ref {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: #cbd5e1;
}

.kardex-note {
  color: #cbd5e1;
  max-width: 320px;
  white-space: normal;
}

.kardex-table td,
.kardex-table th {
  vertical-align: middle;
}

/* =========================================================
   AUTH MODE (LOGIN / REGISTER FIX)
========================================================= */

/* Card blanca de login */
.auth-shell .card {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

/* Labels */
.auth-shell .form-label {
  color: #334155;
}

/* Inputs */
.auth-shell .form-control,
.auth-shell .form-select {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #d1d5db;
}

/* Placeholder */
.auth-shell .form-control::placeholder {
  color: #9ca3af;
}

/* Texto secundario */
.auth-shell .text-muted,
.auth-shell small,
.auth-shell .form-text {
  color: #6b7280 !important;
}

/* Links */
.auth-shell a {
  color: #2563eb;
}

.auth-shell a:hover {
  color: #1d4ed8;
}

/* Botón login */
.auth-shell .btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
}

/* Icono */
.auth-shell .auth-icon {
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.25);
}

/* =========================================================
   AUTH TEXT FIX (FORZADO NEGRO)
========================================================= */

.auth-scope {
  color: #e5eefc;
}

.auth-scope .auth-card-dashboard .auth-card-title {
  color: #f8fbff !important;
}

.auth-scope .auth-card-dashboard .auth-card-copy,
.auth-scope .auth-mini-note {
  color: #94a3b8 !important;
}

.auth-scope .auth-card-dashboard .form-label,
.auth-scope .auth-card-dashboard .form-check-label {
  color: #dbe7fb !important;
}

.auth-scope .auth-card-dashboard .form-control,
.auth-scope .auth-card-dashboard .form-select {
  background: rgba(15, 23, 42, 0.88) !important;
  color: #f8fbff !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
}

.auth-scope .auth-card-dashboard .form-control::placeholder {
  color: #7f93b7 !important;
}

.auth-scope .auth-card-dashboard .input-group-text {
  background: rgba(15, 23, 42, 0.88) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  border-right: 0 !important;
}

.auth-scope .auth-link {
  color: #93c5fd !important;
}

.auth-scope .auth-link:hover {
  color: #dbeafe !important;
}

/* Mantener botones correctos */
.auth-shell .btn-primary {
  color: #ffffff !important;
}

/* Inputs */
.auth-shell .form-control,
.auth-shell .form-select {
  color: #0f172a !important;
  background: #ffffff !important;
}

/* Placeholder */
.auth-shell .form-control::placeholder {
  color: #6b7280 !important;
}

/* Links */
.auth-shell a {
  color: #2563eb !important;
}

/* Labels */
.auth-shell label {
  color: #111827 !important;
}

/* =========================================================
   INVENTORY ADJUST PREMIUM
========================================================= */
.summary-box,
.surface-soft {
  backdrop-filter: blur(8px);
}

.card .summary-value.fs-3,
.card .summary-value.fs-4 {
  letter-spacing: -0.02em;
}

.nav-link {
  border-radius: 0.75rem;
  padding: 0.55rem 0.75rem;
  font-weight: 500;
  color: #94a3b8;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(59, 130, 246, 0.08);
  color: #1e3a8a;
}

.nav-link.active {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}

.nav,
.sidebar ul {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

/* Sidebar: iconos con color dinámico por módulo */
.sidebar .nav-link {
  border-radius: 0.75rem;
  padding: 0.6rem 0.8rem;
  transition: all 0.2s ease;
}

.sidebar .nav-link .nav-icon {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: rgba(148, 163, 184, 0.10);
  color: #cbd5e1;
}

/* Hover general */
.sidebar .nav-link:hover .nav-icon {
  transform: translateY(-1px);
}

/* Estado activo: mantiene legibilidad */
.sidebar .nav-link.active .nav-icon {
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
}

/* Colores por módulo */
.sidebar .nav-link.nav-dashboard .nav-icon {
  background: rgba(37, 99, 235, 0.16);
  color: #60a5fa;
}

.sidebar .nav-link.nav-invoices .nav-icon {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
}

.sidebar .nav-link.nav-estimates .nav-icon {
  background: rgba(139, 92, 246, 0.16);
  color: #a78bfa;
}

.sidebar .nav-link.nav-customers .nav-icon {
  background: rgba(6, 182, 212, 0.16);
  color: #22d3ee;
}

.sidebar .nav-link.nav-products .nav-icon,
.sidebar .nav-link.nav-inventory .nav-icon {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

.sidebar .nav-link.nav-reports .nav-icon {
  background: rgba(99, 102, 241, 0.16);
  color: #818cf8;
}

.sidebar .nav-link.nav-fiscal .nav-icon {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
}

.sidebar .nav-link.nav-settings .nav-icon {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

/* Cuando el link está activo, el color del icono se vuelve sólido */
.sidebar .nav-link.active.nav-dashboard .nav-icon {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}
.sidebar .nav-link.active.nav-invoices .nav-icon {
  background: linear-gradient(135deg, #15803d, #22c55e);
}
.sidebar .nav-link.active.nav-estimates .nav-icon {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
}
.sidebar .nav-link.active.nav-customers .nav-icon {
  background: linear-gradient(135deg, #0891b2, #06b6d4);
}
.sidebar .nav-link.active.nav-products .nav-icon,
.sidebar .nav-link.active.nav-inventory .nav-icon {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}
.sidebar .nav-link.active.nav-reports .nav-icon {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
}
.sidebar .nav-link.active.nav-fiscal .nav-icon {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}
.sidebar .nav-link.active.nav-settings .nav-icon {
  background: linear-gradient(135deg, #475569, #64748b);
}

/* =========================================
   AUTH PRO — Login / Register
========================================= */

.auth-pro-page {
  min-height: calc(100vh - 120px);
  background:
    radial-gradient(circle at top left, rgba(13, 110, 253, 0.10), transparent 28%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.10), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

.min-vh-75 {
  min-height: 75vh;
}

.auth-showcase {
  padding: 1rem 1.5rem 1rem 0.5rem;
}

.auth-showcase-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: rgba(13, 110, 253, 0.08);
  color: #0b57d0;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(13, 110, 253, 0.10);
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.08);
}

.auth-showcase-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.03;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  margin-bottom: 1rem;
  max-width: 620px;
}

.auth-showcase-text {
  font-size: 1.04rem;
  line-height: 1.72;
  color: #475569;
  max-width: 580px;
  margin-bottom: 1.5rem;
}

.auth-showcase-grid {
  display: grid;
  gap: 1rem;
  max-width: 560px;
}

.auth-mini-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(13, 110, 253, 0.08);
  box-shadow:
    0 16px 36px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
}

.auth-mini-card h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.2rem;
  letter-spacing: -0.01em;
}

.auth-mini-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.55;
}

.auth-mini-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d6efd 0%, #0b57d0 100%);
  color: #fff;
  font-size: 1.12rem;
  box-shadow: 0 14px 28px rgba(13, 110, 253, 0.20);
}

.auth-card-pro {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(13, 110, 253, 0.08);
  box-shadow:
    0 30px 60px rgba(15, 23, 42, 0.12),
    0 1px 0 rgba(255,255,255,0.7) inset;
  position: relative;
}

.auth-card-pro::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #0d6efd, #38bdf8);
}

.auth-brand-icon {
  width: 82px;
  height: 82px;
  margin: 0 auto;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d6efd 0%, #0b57d0 100%);
  color: #ffffff;
  font-size: 2rem;
  box-shadow: 0 20px 45px rgba(13, 110, 253, 0.22);
}

.auth-input-group {
  border-radius: 1rem;
  overflow: hidden;
}

.auth-input-group .input-group-text {
  background: #f8fafc;
  border: 1px solid #dbe5f0;
  border-right: 0;
  color: #64748b;
  padding-left: 1rem;
  padding-right: 1rem;
}

.auth-input-group .form-control {
  border: 1px solid #dbe5f0;
  border-left: 0;
  box-shadow: none;
  background: #ffffff;
}

.auth-input-group .form-control::placeholder {
  color: #94a3b8;
}

.auth-input-group .form-control:focus {
  border-color: rgba(13, 110, 253, 0.45);
  box-shadow: none;
}

.auth-input-group:focus-within .input-group-text,
.auth-input-group:focus-within .form-control {
  border-color: rgba(13, 110, 253, 0.45);
}

.auth-main-btn {
  min-height: 56px;
  box-shadow: 0 14px 30px rgba(13, 110, 253, 0.20);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-main-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(13, 110, 253, 0.24);
}

.auth-main-btn:active {
  transform: translateY(0);
}

.auth-divider {
  position: relative;
  text-align: center;
}

.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid #e2e8f0;
}

.auth-divider span {
  position: relative;
  z-index: 1;
  display: inline-block;
  background: #ffffff;
  padding: 0 0.8rem;
  color: #94a3b8;
  font-size: 0.9rem;
}

.auth-link {
  color: #0b57d0;
  text-decoration: none;
  font-weight: 600;
}

.auth-link:hover {
  color: #084298;
  text-decoration: underline;
}

.auth-pro-page .form-label {
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.auth-pro-page .form-check-label {
  color: #64748b;
}

.auth-pro-page .text-muted {
  color: #64748b !important;
}

.auth-pro-page .card-body {
  position: relative;
  z-index: 1;
}

@media (max-width: 991.98px) {
  .auth-pro-page {
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  }

  .auth-card-pro {
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.10);
  }
}

@media (max-width: 767.98px) {
  .auth-pro-page {
    min-height: auto;
  }

  .auth-brand-icon {
    width: 74px;
    height: 74px;
    border-radius: 22px;
    font-size: 1.8rem;
  }

  .auth-main-btn {
    min-height: 52px;
  }
}

/* =========================================
   MOBILE NAV PRO — Offcanvas
========================================= */

.mobile-menu-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.mobile-menu-btn i {
  font-size: 1.2rem;
}

.mobile-offcanvas {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  width: min(320px, 88vw);
}

.mobile-offcanvas .offcanvas-header {
  padding: 1rem 1rem 0.9rem;
}

.mobile-offcanvas .offcanvas-body {
  padding: 1rem;
}

.mobile-nav-section + .mobile-nav-section {
  margin-top: 0.5rem;
}

.mobile-nav-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.7rem;
  padding: 0 0.25rem;
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 48px;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  text-decoration: none;
  color: #0f172a;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.10);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  transition: all 0.18s ease;
}

.mobile-nav-link:hover {
  text-decoration: none;
  color: #0b57d0;
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.16);
  background: rgba(239, 246, 255, 0.95);
}

.mobile-nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.20);
}

.mobile-nav-link i {
  width: 22px;
  text-align: center;
  font-size: 1.05rem;
}

.mobile-nav-link-muted {
  color: #475569;
}

.mobile-nav-link-muted:hover {
  color: #0f172a;
}

.mobile-user-chip {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 0.9rem;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

@media (min-width: 992px) {
  .topbar-mobile,
  .mobile-offcanvas {
    display: none !important;
  }
}

/* =========================================
   NAV FIX QUIRÚRGICO — sin tocar fondos
========================================= */

/* Sidebar: solo orden y alineación */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 46px;
}

.sidebar-link i {
  width: 20px;
  min-width: 20px;
  text-align: center;
}

/* Offcanvas mobile */
.mobile-offcanvas {
  width: min(320px, 88vw);
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 48px;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  text-decoration: none;
}

.mobile-nav-link i {
  width: 22px;
  min-width: 22px;
  text-align: center;
}

/* Desktop: ocultar solo lo mobile */
@media (min-width: 992px) {
  .topbar-mobile,
  .mobile-offcanvas,
  .offcanvas-backdrop {
    display: none !important;
  }
}

/* Mobile: ocultar solo el sidebar desktop */
@media (max-width: 991.98px) {
  .app-sidebar {
    display: none !important;
  }

  .topbar-mobile {
    display: block !important;
  }
}

/* =========================================
   AUTH PRO V3 — MATCH DASHBOARD / REPORTS
========================================= */

.auth-pro-dark {
  position: relative;
  min-height: calc(100vh - 120px);
  color: #e5eefc;
  padding: 0.5rem 0 1.5rem;
}

.auth-pro-dark::before {
  content: "";
  position: absolute;
  inset: -1rem -0.5rem auto -0.5rem;
  height: 30rem;
  background:
    radial-gradient(circle at 10% 10%, rgba(37, 99, 235, 0.18), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(56, 189, 248, 0.12), transparent 24%),
    radial-gradient(circle at 45% 0%, rgba(139, 92, 246, 0.10), transparent 28%);
  pointer-events: none;
  z-index: 0;
  filter: blur(10px);
}

.auth-pro-dark .auth-layer {
  position: relative;
  z-index: 1;
}

.auth-hero-pro {
  padding-right: 1rem;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #cfe1ff;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.18);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.auth-hero-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f8fbff;
  margin-bottom: 1rem;
}

.auth-hero-copy {
  max-width: 620px;
  color: #c7d5ee;
  font-size: 1.02rem;
  line-height: 1.7;
  margin-bottom: 1.4rem;
}

.auth-feature-grid {
  display: grid;
  gap: 1rem;
  max-width: 580px;
}

.auth-feature-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)),
    rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow:
    0 12px 30px rgba(2, 6, 23, 0.28),
    0 1px 0 rgba(255,255,255,0.03) inset;
}

.auth-feature-icon {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.16);
  color: #dbeafe;
  font-size: 1.1rem;
}

.auth-feature-title {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fbff;
  margin: 0 0 0.2rem;
}

.auth-feature-copy {
  margin: 0;
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.6;
}

.auth-card-dashboard {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)),
    linear-gradient(135deg, rgba(37,99,235,0.20), rgba(2,6,23,0.04) 40%, rgba(56,189,248,0.10));
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 28px;
  box-shadow:
    0 12px 30px rgba(2, 6, 23, 0.34),
    0 1px 0 rgba(255,255,255,0.03) inset;
  overflow: hidden;
  position: relative;
}

.auth-card-dashboard::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 34%),
    radial-gradient(circle at bottom left, rgba(37, 99, 235, 0.12), transparent 30%);
  pointer-events: none;
}

.auth-card-dashboard .card-body {
  position: relative;
  z-index: 1;
}

.auth-brand-badge {
  width: 82px;
  height: 82px;
  margin: 0 auto;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #ffffff;
  font-size: 2rem;
  box-shadow: 0 20px 45px rgba(37, 99, 235, 0.22);
}

.auth-brand-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.auth-brand-logo {
  max-width: 180px;
  max-height: 70px;
  width: auto;
  height: auto;
  object-fit: contain;
  background: rgba(255,255,255,0.98);
  border-radius: 14px;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.18);
  filter: none;
}

.auth-card-title {
  color: #f8fbff;
}

.auth-card-copy {
  color: #c7d5ee !important;
}

.auth-input-group {
  border-radius: 1rem;
  overflow: hidden;
}

.auth-input-group .input-group-text {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-right: 0;
  color: #94a3b8;
  padding-left: 1rem;
  padding-right: 1rem;
}

.auth-input-group .form-control {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-left: 0;
  color: #f8fbff;
  box-shadow: none;
}

.auth-input-group .form-control::placeholder {
  color: #7f93b7;
}

.auth-input-group .form-control:focus {
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  border-color: rgba(96, 165, 250, 0.24);
  box-shadow: none;
}

.auth-input-group:focus-within .input-group-text,
.auth-input-group:focus-within .form-control {
  border-color: rgba(96, 165, 250, 0.24);
}

.auth-pro-dark .form-label,
.auth-pro-dark .form-check-label {
  color: #dbe7fb;
}

.auth-main-btn {
  min-height: 56px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  border: 0;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-main-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.30);
}

.auth-divider {
  position: relative;
  text-align: center;
}

.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.auth-divider span {
  position: relative;
  z-index: 1;
  display: inline-block;
  background: rgba(15, 23, 42, 0.96);
  padding: 0 0.8rem;
  color: #94a3b8;
  font-size: 0.9rem;
}

.auth-link {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 700;
}

.auth-link:hover {
  color: #dbeafe;
  text-decoration: underline;
}

.auth-mini-note {
  color: #94a3b8 !important;
}

@media (max-width: 991.98px) {
  .auth-hero-pro {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .auth-pro-dark {
    min-height: auto;
  }

  .auth-main-btn {
    min-height: 52px;
  }

  .auth-brand-badge {
    width: 74px;
    height: 74px;
    border-radius: 22px;
    font-size: 1.8rem;
  }
}

.lang-switcher .btn {
  min-width: 44px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.8rem;
}

.topbar .lang-switcher .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.topbar .lang-switcher .btn-outline-light:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.auth-shell .lang-switcher .btn-outline-secondary {
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
  background: transparent;
}

.auth-shell .lang-switcher .btn-outline-secondary:hover {
  border-color: rgba(148, 163, 184, 0.6);
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.lang-switcher-pro {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow:
    0 8px 18px rgba(2, 6, 23, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.lang-switcher-pro .lang-switcher-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 64px;
  height: 38px;
  padding: 0 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #cbd5e1;
  transition: all 0.18s ease;
  border: 1px solid transparent;
}

.lang-switcher-pro .lang-switcher-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  transform: translateY(-1px);
}

.lang-switcher-pro .lang-switcher-btn.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  border-color: rgba(96, 165, 250, 0.26);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}

.lang-switcher-pro .lang-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.9;
}

.app-toolbar .lang-switcher-pro {
  margin-left: auto;
}

.mobile-lang-switcher .lang-switcher-pro {
  width: 100%;
}

.mobile-lang-switcher .lang-switcher-pro .lang-switcher-btn {
  flex: 1 1 0;
}

@media (max-width: 991.98px) {
  .app-toolbar .lang-switcher-pro .lang-switcher-btn {
    min-width: 58px;
    height: 36px;
    font-size: 0.82rem;
  }
}
/* ===== SUBSCRIPTION PRO FIX ===== */

.subscription-box {
  border-radius: 18px;
  padding: 1rem;
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.subscription-label {
  font-size: 0.8rem;
  color: #94a3b8; /* gris claro PRO */
  margin-bottom: 0.35rem;
}

.subscription-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc; /* blanco limpio */
}

/* CARDS */
.plan-card {
  background: linear-gradient(180deg, #020617 0%, #0f172a 100%);
  border: 1px solid rgba(148, 163, 184, 0.1);
  transition: all 0.25s ease;
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.6);
}

.plan-card-pro {
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2),
              0 20px 40px rgba(2, 6, 23, 0.6) !important;
}

/* TEXTOS */
.plan-card .text-muted,
.text-muted {
  color: #94a3b8 !important;
}

/* PRECIO */
.price-currency,
.price-period {
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 600;
}

.price-amount {
  font-size: 2.2rem;
  font-weight: 900;
  color: #f8fafc;
}

/* FEATURES */
.feature-list li {
  color: #cbd5f5;
}

.feature-list i {
  color: #3b82f6;
}

/* BADGES */
.badge.text-bg-light {
  background: rgba(148, 163, 184, 0.1) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* ALERT */
.alert {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: #cbd5f5;
}

/* BOTONES */
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.btn-outline-primary {
  border-color: #3b82f6;
  color: #3b82f6;
}

.btn-outline-primary:hover {
  background: #3b82f6;
  color: #fff;
}

.btn-outline-danger {
  border-color: #ef4444;
  color: #ef4444;
}

.btn-outline-danger:hover {
  background: #ef4444;
  color: #fff;
}
/* =========================================
   SETTINGS / BUSINESS FIX
========================================= */

.settings-page,
.settings-page .card,
.settings-page .card-header,
.settings-page .surface-soft {
  color: #0f172a;
}

.settings-page .card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

.settings-page .card-header {
  background: #ffffff !important;
}

.settings-page .form-label {
  color: #334155;
}

.settings-page .form-control,
.settings-page .form-select {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #dbe2ea;
}

.settings-page .form-control::placeholder {
  color: #94a3b8;
}

.settings-page .text-muted,
.settings-page .form-text,
.settings-page .section-subtitle,
.settings-page .small.text-muted {
  color: #64748b !important;
}

.settings-page .surface-soft {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.settings-page img {
  opacity: 1;
}

/* =========================================
   BODY MODES FIX
========================================= */

body.app-page-body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 22%),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.07), transparent 18%),
    linear-gradient(180deg, #020617 0%, #08101f 100%);
  color: #e5eefc;
}

body.auth-page {
  background:
    radial-gradient(circle at 10% 10%, rgba(37, 99, 235, 0.18), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(56, 189, 248, 0.12), transparent 24%),
    radial-gradient(circle at 45% 0%, rgba(139, 92, 246, 0.10), transparent 28%),
    linear-gradient(180deg, #020617 0%, #08101f 100%);
  color: #e5eefc;
}

/* Mantener el login oscuro y premium */
body.auth-page .auth-pro-dark {
  background: transparent;
  color: #e5eefc;
}

/* Evitar que bloques viejos claros vuelvan a pintar auth */
body.auth-page .auth-pro-page,
body.auth-page .auth-shell {
  background: transparent !important;
}

/* Settings/business sigue aislado por scope */
.settings-page,
.settings-page .card,
.settings-page .card-header,
.settings-page .surface-soft {
  color: #0f172a;
}

.settings-page .card {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

.settings-page .card-header {
  background: #ffffff !important;
}

.settings-page .form-label {
  color: #334155;
}

.settings-page .form-control,
.settings-page .form-select {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #dbe2ea;
}

.settings-page .form-control::placeholder {
  color: #94a3b8;
}

.settings-page .text-muted,
.settings-page .form-text,
.settings-page .section-subtitle,
.settings-page .small.text-muted {
  color: #64748b !important;
}
