:root {
  --bs-body-bg: #e8ecf0 !important;
}
body {
  background-color: #e8ecf0 !important;
}
.ui-dialog {
  font-family: inherit;
}
.popup-modal {
  padding: 0;
  background: transparent;
  border: none !important;
  margin: 0 auto !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
}
.popup-modal .ui-dialog-titlebar {
  background: #0E0E0E !important;
  border: none !important;
  margin-bottom: 5px;
}
.popup-modal .ui-dialog-titlebar .ui-dialog-title {
  font-size: 20px;
  color: white;
}
.popup-modal .ui-dialog-titlebar .ui-icon {
  filter: brightness(100);
}
.popup-modal .confirmation {
  margin: 10px 0;
}
/* ══════════════════════════════════════
   PAGINACIÓN
══════════════════════════════════════ */
.bank-pager-wrapper {
  display: flex;
  justify-content: center;
  padding: 20px 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.bank-pager {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.bank-pager a,
.bank-pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.bank-pager a {
  color: #374151;
  background: transparent;
}
.bank-pager a:hover {
  background: #e8f0ff;
  color: #0066FF;
}
.bank-pager .pager-current {
  background: #0066FF;
  color: #fff;
  font-weight: 700;
}
.bank-pager .pager__ellipsis {
  min-width: 24px;
  color: #9ca3af;
  cursor: default;
  padding: 0 4px;
  font-size: 16px;
  letter-spacing: 1px;
}
.bank-pager .pager__ellipsis:hover {
  background: transparent;
  color: #9ca3af;
}
.bank-pager .pager__prev,
.bank-pager .pager__next {
  font-size: 20px;
  line-height: 1;
  color: #6b7280;
}
.bank-pager .pager__prev:hover,
.bank-pager .pager__next:hover {
  color: #0066FF;
  background: #e8f0ff;
}
.bank-pager .pager__disabled {
  color: #d1d5db;
  cursor: default;
}
.bank-pager .pager__disabled:hover {
  background: transparent;
  color: #d1d5db;
}
@media (max-width: 480px) {
  .bank-pager {
    padding: 4px 6px;
    gap: 2px;
  }
  .bank-pager a,
  .bank-pager span {
    min-width: 30px;
    height: 30px;
    font-size: 13px;
    padding: 0 6px;
  }
  .bank-pager .pager__prev,
  .bank-pager .pager__next {
    font-size: 18px;
  }
}
#categorias {
  margin: 20px 0;
}
.chip {
  padding: 6px 12px;
  margin: 4px;
  border-radius: 20px;
  border: none;
  background: #eee;
  cursor: pointer;
}
.chip.active {
  background: #ff4d4d;
  color: white;
}
/* ══════════════════════════════════════
   YEAR NAVIGATION
══════════════════════════════════════ */
.year-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.year-navigation strong {
  min-width: 64px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.3px;
  user-select: none;
}
.year-navigation a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  text-decoration: none;
  color: #6b7280;
  transition: background 0.15s, color 0.15s;
}
.year-navigation a svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}
.year-navigation a:hover {
  background: #e8f0ff;
  color: #0066FF;
}
html[data-theme="dark"] .year-navigation {
  background: #1a2235;
  border-color: #2a3347;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .year-navigation strong {
  color: #f1f5f9;
}
html[data-theme="dark"] .year-navigation a {
  color: #94a3b8;
}
html[data-theme="dark"] .year-navigation a:hover {
  background: rgba(0, 102, 255, 0.15);
  color: #60a5fa;
}
/* ══════════════════════════════════════
   PAGE TITLE
══════════════════════════════════════ */
.page-title-wrapper {
  display: flex;
  align-items: stretch;
  background: #ffffff;
  border-radius: 10px;
  margin-top: 28px;
  margin-bottom: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  overflow: hidden;
}
.page-title-accent {
  width: 5px;
  background: linear-gradient(180deg, #0066FF 0%, #0040cc 100%);
  flex-shrink: 0;
}
.page-title-content {
  padding: 18px 24px;
  flex: 1;
}
h1.page-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
html[data-theme="dark"] .page-title-wrapper {
  background: #1a2235;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] h1.page-title {
  color: #f1f5f9;
}
/* ══════════════════════════════════════
   DASHBOARD SECTION TITLES
══════════════════════════════════════ */
.dashboard-section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin: 28px 0 14px;
  padding: 6px 14px;
  border-radius: 6px;
}
.dashboard-section-title::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dashboard-section-title--blue {
  color: #0055dd;
  background: rgba(0, 102, 255, 0.08);
}
.dashboard-section-title--blue::before {
  background: #0066FF;
}
.dashboard-section-title--green {
  color: #15803d;
  background: rgba(22, 163, 74, 0.08);
}
.dashboard-section-title--green::before {
  background: #16a34a;
}
.dashboard-section-title--purple {
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.08);
}
.dashboard-section-title--purple::before {
  background: #7c3aed;
}
.dashboard-section-title--orange {
  color: #b45309;
  background: rgba(217, 119, 6, 0.08);
}
.dashboard-section-title--orange::before {
  background: #d97706;
}
.dashboard-section-title--compare {
  color: #9f1239;
  background: rgba(244, 63, 94, 0.08);
}
.dashboard-section-title--compare::before {
  background: #e11d48;
}
html[data-theme="dark"] .dashboard-section-title--blue {
  color: #60a5fa;
  background: rgba(0, 102, 255, 0.15);
}
html[data-theme="dark"] .dashboard-section-title--green {
  color: #4ade80;
  background: rgba(22, 163, 74, 0.15);
}
html[data-theme="dark"] .dashboard-section-title--purple {
  color: #c084fc;
  background: rgba(124, 58, 237, 0.15);
}
html[data-theme="dark"] .dashboard-section-title--orange {
  color: #fbbf24;
  background: rgba(217, 119, 6, 0.15);
}
html[data-theme="dark"] .dashboard-section-title--compare {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.15);
}
/* ══════════════════════════════════════
   COMPARATIVA ANUAL (YTD)
══════════════════════════════════════ */

/* Wrapper container */
.ytd-compare-wrapper {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  margin-bottom: 8px;
}

/* Title bar */
.ytd-compare-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.07) 0%, rgba(99, 102, 241, 0.02) 100%);
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}
.ytd-compare-titlebar__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  flex-shrink: 0;
}
.ytd-compare-titlebar__icon svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  display: block;
}
.ytd-compare-titlebar__text {
  font-size: 13px;
  font-weight: 700;
  color: #4338ca;
  letter-spacing: 0.2px;
}
.ytd-compare-titlebar__text em {
  font-style: normal;
  color: #6366f1;
  font-weight: 500;
}

/* Totals row of cards */
.ytd-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.ytd-total-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 18px;
  border-right: 1px solid #f3f4f6;
  position: relative;
}
.ytd-total-card:last-child { border-right: none; }
.ytd-total-card__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
}
.ytd-total-card__value {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.ytd-total-card__prev {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
}
.ytd-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  align-self: flex-start;
}
.ytd-badge--good    { background: rgba(22, 163, 74, 0.1);  color: #15803d; }
.ytd-badge--bad     { background: rgba(220, 38, 38, 0.1);  color: #b91c1c; }
.ytd-badge--neutral { background: #f3f4f6; color: #9ca3af; font-weight: 500; }

.ytd-total-card--income       { border-top: 3px solid #16a34a; }
.ytd-total-card--income       .ytd-total-card__value { color: #15803d; }
.ytd-total-card--expense      { border-top: 3px solid #dc2626; }
.ytd-total-card--expense      .ytd-total-card__value { color: #b91c1c; }
.ytd-total-card--balance-pos  { border-top: 3px solid #0066FF; }
.ytd-total-card--balance-pos  .ytd-total-card__value { color: #0055dd; }
.ytd-total-card--balance-neg  { border-top: 3px solid #dc2626; }
.ytd-total-card--balance-neg  .ytd-total-card__value { color: #b91c1c; }

/* Category comparison grid */
.ytd-cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0;
  border-top: 1px solid #f3f4f6;
}
.ytd-cat-section {
  overflow: hidden;
}
.ytd-cat-section + .ytd-cat-section {
  border-left: 1px solid #f3f4f6;
}
.ytd-cat-section__header {
  display: grid;
  grid-template-columns: 10px 1fr 90px 90px;
  gap: 6px 20px;
  padding: 9px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid #f3f4f6;
  text-align: right;
}
.ytd-cat-section__header span:nth-child(2) { text-align: left; }
.ytd-cat-section__header--expense { color: #b91c1c; background: rgba(220,38,38,0.04); }
.ytd-cat-section__header--income  { color: #15803d; background: rgba(22,163,74,0.04); }
.ytd-cat-section__body { padding: 4px 0; }

.ytd-cat-row {
  display: grid;
  grid-template-columns: 10px 1fr 90px 90px;
  align-items: center;
  gap: 6px 20px;
  padding: 7px 16px;
  transition: background 0.1s;
}
.ytd-cat-row:hover { background: #f9fafb; }
.ytd-cat-row--total {
  border-top: 1px solid #f3f4f6;
  margin-top: 2px;
  font-weight: 700;
}
.ytd-cat-row--total .ytd-cat-row__name   { font-weight: 700; color: #374151; }
.ytd-cat-row--total .ytd-cat-row__amount { font-weight: 700; color: #0f172a; }
.ytd-cat-row__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ytd-cat-row__name {
  font-size: 13px;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ytd-cat-row__amount {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
  color: #0f172a;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.ytd-cat-row__amount--prev { color: #9ca3af; font-weight: 400; }
.ytd-cat-row__badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  text-align: center;
  min-width: 68px;
}
.ytd-cat-row__badge--good    { background: rgba(22, 163, 74, 0.1);  color: #15803d; }
.ytd-cat-row__badge--bad     { background: rgba(220, 38, 38, 0.1);  color: #b91c1c; }
.ytd-cat-row__badge--new     { background: rgba(0, 102, 255, 0.1);  color: #0055dd; }
.ytd-cat-row__badge--gone    { background: rgba(107, 114, 128, 0.1); color: #6b7280; }
.ytd-cat-row__badge--neutral { background: #f3f4f6; color: #9ca3af; font-weight: 500; }

/* Dark mode */
html[data-theme="dark"] .ytd-compare-wrapper {
  background: #1a2235;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .ytd-compare-titlebar {
  background: rgba(99, 102, 241, 0.08);
  border-bottom-color: rgba(99, 102, 241, 0.2);
}
html[data-theme="dark"] .ytd-compare-titlebar__text { color: #818cf8; }
html[data-theme="dark"] .ytd-compare-titlebar__text em { color: #a5b4fc; }
html[data-theme="dark"] .ytd-total-card { border-right-color: #2a3347; }
html[data-theme="dark"] .ytd-total-card__label { color: #64748b; }
html[data-theme="dark"] .ytd-total-card__prev  { color: #475569; }
html[data-theme="dark"] .ytd-total-card--income      .ytd-total-card__value { color: #4ade80; }
html[data-theme="dark"] .ytd-total-card--expense     .ytd-total-card__value { color: #f87171; }
html[data-theme="dark"] .ytd-total-card--balance-pos .ytd-total-card__value { color: #60a5fa; }
html[data-theme="dark"] .ytd-total-card--balance-neg .ytd-total-card__value { color: #f87171; }
html[data-theme="dark"] .ytd-cats-grid { border-top-color: #2a3347; }
html[data-theme="dark"] .ytd-cat-section + .ytd-cat-section { border-left-color: #2a3347; }
html[data-theme="dark"] .ytd-cat-section__header { border-bottom-color: #2a3347; }
html[data-theme="dark"] .ytd-cat-section__header--expense { background: rgba(220,38,38,0.06); }
html[data-theme="dark"] .ytd-cat-section__header--income  { background: rgba(22,163,74,0.06); }
html[data-theme="dark"] .ytd-cat-row:hover { background: rgba(255,255,255,0.04); }
html[data-theme="dark"] .ytd-cat-row--total { border-top-color: #2a3347; }
html[data-theme="dark"] .ytd-cat-row--total .ytd-cat-row__name   { color: #cbd5e1; }
html[data-theme="dark"] .ytd-cat-row--total .ytd-cat-row__amount { color: #f1f5f9; }
html[data-theme="dark"] .ytd-cat-row__name   { color: #cbd5e1; }
html[data-theme="dark"] .ytd-cat-row__amount { color: #f1f5f9; }
html[data-theme="dark"] .ytd-cat-row__amount--prev { color: #475569; }

@media (max-width: 700px) {
  .ytd-totals { grid-template-columns: 1fr 1fr; }
  .ytd-total-card:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid #f3f4f6; border-right: none; }
  .ytd-cats-grid { grid-template-columns: 1fr; }
  .ytd-cat-section + .ytd-cat-section { border-left: none; border-top: 1px solid #f3f4f6; }
  .ytd-cat-section__header,
  .ytd-cat-row { grid-template-columns: 10px 1fr 80px 80px; gap: 4px 8px; }
}
/* ══════════════════════════════════════
   DASHBOARD RESUMEN STATS
══════════════════════════════════════ */
.resumen-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 10px;
}
.resumen-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border-left: 4px solid transparent;
}
.resumen-stat__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  flex-shrink: 0;
}
.resumen-stat__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.resumen-stat__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.resumen-stat__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  white-space: nowrap;
}
.resumen-stat__value {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.resumen-stat__compare {
  font-size: 11px;
  font-weight: 600;
  white-space: normal;
  line-height: 1.4;
  margin-top: 2px;
}
.resumen-stat__compare em {
  font-style: normal;
  font-weight: 400;
  opacity: 0.75;
}
.resumen-stat__compare--good {
  color: #15803d;
}
.resumen-stat__compare--bad {
  color: #b91c1c;
}
.resumen-stat__compare--neutral {
  color: #9ca3af;
  font-weight: 500;
}
.resumen-stat--income {
  border-left-color: #16a34a;
}
.resumen-stat--income .resumen-stat__icon {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}
.resumen-stat--income .resumen-stat__value {
  color: #15803d;
}
.resumen-stat--expense {
  border-left-color: #dc2626;
}
.resumen-stat--expense .resumen-stat__icon {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}
.resumen-stat--expense .resumen-stat__value {
  color: #b91c1c;
}
.resumen-stat--balance-pos {
  border-left-color: #0066FF;
}
.resumen-stat--balance-pos .resumen-stat__icon {
  background: rgba(0, 102, 255, 0.1);
  color: #0066FF;
}
.resumen-stat--balance-pos .resumen-stat__value {
  color: #0055dd;
}
.resumen-stat--balance-neg {
  border-left-color: #dc2626;
}
.resumen-stat--balance-neg .resumen-stat__icon {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}
.resumen-stat--balance-neg .resumen-stat__value {
  color: #b91c1c;
}
.resumen-stat--avg {
  border-left-color: #7c3aed;
}
.resumen-stat--avg .resumen-stat__icon {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}
.resumen-stat--avg .resumen-stat__value {
  color: #6d28d9;
}
html[data-theme="dark"] .resumen-stat {
  background: #1a2235;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .resumen-stat__label {
  color: #94a3b8;
}
html[data-theme="dark"] .resumen-stat__compare--good {
  color: #4ade80;
}
html[data-theme="dark"] .resumen-stat__compare--bad {
  color: #f87171;
}
html[data-theme="dark"] .resumen-stat__compare--neutral {
  color: #475569;
}
html[data-theme="dark"] .resumen-stat--income .resumen-stat__value {
  color: #4ade80;
}
html[data-theme="dark"] .resumen-stat--expense .resumen-stat__value {
  color: #f87171;
}
html[data-theme="dark"] .resumen-stat--balance-pos .resumen-stat__value {
  color: #60a5fa;
}
html[data-theme="dark"] .resumen-stat--balance-neg .resumen-stat__value {
  color: #f87171;
}
html[data-theme="dark"] .resumen-stat--avg .resumen-stat__value {
  color: #c084fc;
}
@media (max-width: 600px) {
  .resumen-stats {
    grid-template-columns: 1fr 1fr;
  }
  .resumen-stat {
    padding: 12px 14px;
    gap: 10px;
  }
  .resumen-stat__icon {
    width: 32px;
    height: 32px;
  }
  .resumen-stat__label {
    font-size: 10px;
  }
  .resumen-stat__value {
    font-size: 15px;
  }
}
@media (max-width: 420px) {
  .resumen-stats {
    grid-template-columns: 1fr;
  }
  .resumen-stat {
    padding: 12px 16px;
  }
}
/* ══════════════════════════════════════
   CHART WRAPPER
══════════════════════════════════════ */
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 480px;
  margin-bottom: 8px;
}
@media (max-width: 600px) {
  .chart-wrapper {
    height: 280px;
  }
}
.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}
/* ══════════════════════════════════════
   INFORME MENSUAL DETALLADO
══════════════════════════════════════ */
.monthly-report {
  margin-bottom: 32px;
}
.monthly-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  margin-bottom: 16px;
  scrollbar-width: none;
}
.monthly-tabs::-webkit-scrollbar {
  display: none;
}
.monthly-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: #374151;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.monthly-tab:hover:not(.monthly-tab--empty) {
  background: #e8f0ff;
  color: #0066FF;
}
.monthly-tab--active {
  background: #0066FF !important;
  color: #fff !important;
}
.monthly-tab--empty {
  color: #d1d5db;
  cursor: default;
}
.monthly-no-data {
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
  padding: 40px 0;
}
.monthly-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.monthly-summary__card {
  background: #ffffff;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 4px solid transparent;
}
.monthly-summary__card--income {
  border-left-color: #16a34a;
}
.monthly-summary__card--income .monthly-summary__value {
  color: #15803d;
}
.monthly-summary__card--expense {
  border-left-color: #dc2626;
}
.monthly-summary__card--expense .monthly-summary__value {
  color: #b91c1c;
}
.monthly-summary__card--balance.monthly-summary__card--pos {
  border-left-color: #0066FF;
}
.monthly-summary__card--balance.monthly-summary__card--pos .monthly-summary__value {
  color: #0055dd;
}
.monthly-summary__card--balance.monthly-summary__card--neg {
  border-left-color: #dc2626;
}
.monthly-summary__card--balance.monthly-summary__card--neg .monthly-summary__value {
  color: #b91c1c;
}
.monthly-summary__card--media {
  border-left-color: #6b7280;
}
.monthly-summary__card--media .monthly-summary__value {
  color: #374151;
}
.monthly-summary__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
}
.monthly-summary__value {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.monthly-summary__prev {
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
  white-space: normal;
  line-height: 1.4;
}
.monthly-summary__prev em { font-style: normal; font-weight: 400; opacity: 0.75; font-size: 10px; }
.monthly-summary__prev--good    { color: #15803d; }
.monthly-summary__prev--bad     { color: #b91c1c; }
.monthly-summary__prev--neutral { color: #9ca3af; }
.monthly-cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.monthly-cat-section {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.monthly-cat-section__title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
}
.monthly-cat-section__title--expense {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.05);
}
.monthly-cat-section__title--income {
  color: #15803d;
  background: rgba(22, 163, 74, 0.05);
}
.monthly-cat-list {
  padding: 6px 0;
}
.monthly-cat-row {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  transition: background 0.1s;
}
.monthly-cat-row:hover {
  background: #f9fafb;
}
.monthly-cat-row--total {
  border-top: 1px solid #f3f4f6;
  margin-top: 4px;
  font-weight: 700;
}
.monthly-cat-row--total .monthly-cat-row__name {
  font-weight: 700;
  color: #374151;
}
.monthly-cat-row--total .monthly-cat-row__amount {
  font-weight: 700;
  color: #0f172a;
}
.monthly-cat-row__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.monthly-cat-row__name {
  font-size: 13px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.monthly-cat-row__amount {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  text-align: right;
}
.monthly-cat-row__badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  text-align: center;
}
.monthly-cat-row__badge--good {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}
.monthly-cat-row__badge--bad {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}
.monthly-cat-row__badge--new {
  background: rgba(0, 102, 255, 0.1);
  color: #0055dd;
}
.monthly-cat-row__badge--neutral {
  background: #f3f4f6;
  color: #9ca3af;
  font-weight: 500;
}
html[data-theme="dark"] .monthly-tabs {
  background: #1a2235;
  border-color: #2a3347;
}
html[data-theme="dark"] .monthly-tab {
  color: #94a3b8;
}
html[data-theme="dark"] .monthly-tab:hover:not(.monthly-tab--empty) {
  background: rgba(0, 102, 255, 0.15);
  color: #60a5fa;
}
html[data-theme="dark"] .monthly-summary__card,
html[data-theme="dark"] .monthly-cat-section {
  background: #1a2235;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .monthly-summary__label {
  color: #94a3b8;
}
html[data-theme="dark"] .monthly-summary__prev--good    { color: #4ade80; }
html[data-theme="dark"] .monthly-summary__prev--bad     { color: #f87171; }
html[data-theme="dark"] .monthly-summary__prev--neutral { color: #64748b; }
html[data-theme="dark"] .monthly-cat-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
html[data-theme="dark"] .monthly-cat-row--total {
  border-top-color: #2a3347;
}
html[data-theme="dark"] .monthly-cat-row__name {
  color: #cbd5e1;
}
html[data-theme="dark"] .monthly-cat-row__amount {
  color: #f1f5f9;
}
html[data-theme="dark"] .monthly-cat-section__title {
  border-bottom-color: #2a3347;
}
@media (max-width: 600px) {
  .monthly-summary {
    grid-template-columns: 1fr;
  }
  .monthly-summary__value {
    font-size: 15px;
  }
  .monthly-cats-grid {
    grid-template-columns: 1fr;
  }
}
/* ══════════════════════════════════════
   COMPARATIVA MENSUAL VS AÑO ANTERIOR
══════════════════════════════════════ */
.monthly-prev-year-compare {
  margin-top: 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  overflow: hidden;
}
.monthly-prev-year-compare__title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #5b21b6;
  background: linear-gradient(135deg, rgba(99,102,241,0.07) 0%, rgba(99,102,241,0.02) 100%);
  border-bottom: 1px solid rgba(99,102,241,0.15);
}
.monthly-prev-year-compare__title svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}
.monthly-prev-year-cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.monthly-prev-year-cat-section { overflow: hidden; }
.monthly-prev-year-cat-section + .monthly-prev-year-cat-section {
  border-left: 1px solid #f3f4f6;
}
.monthly-prev-year-cat-section__header {
  display: grid;
  grid-template-columns: 10px 1fr 90px 90px 90px;
  gap: 6px 20px;
  padding: 8px 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid #f3f4f6;
  text-align: right;
}
.monthly-prev-year-cat-section__header span:nth-child(2) { text-align: left; }
.monthly-prev-year-cat-section__header--expense { color: #b91c1c; background: rgba(220,38,38,0.04); }
.monthly-prev-year-cat-section__header--income  { color: #15803d; background: rgba(22,163,74,0.04); }
.monthly-prev-year-cat-section__body { padding: 4px 0; }
.monthly-prev-year-cat-row {
  display: grid;
  grid-template-columns: 10px 1fr 90px 90px 90px;
  align-items: center;
  gap: 6px 20px;
  padding: 6px 14px;
  transition: background 0.1s;
}
.monthly-prev-year-cat-row:hover { background: #f9fafb; }
.monthly-prev-year-cat-row--total {
  border-top: 1px solid #f3f4f6;
  margin-top: 2px;
}
.monthly-prev-year-cat-row--total .monthly-prev-year-cat-row__name   { font-weight: 700; color: #374151; }
.monthly-prev-year-cat-row--total .monthly-prev-year-cat-row__amount { font-weight: 700; color: #0f172a; }
.monthly-prev-year-cat-row__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.monthly-prev-year-cat-row__name {
  font-size: 13px;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.monthly-prev-year-cat-row__amount {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.monthly-prev-year-cat-row__amount--prev-month { color: #6b7280; font-weight: 400; }
.monthly-prev-year-cat-row__amount--prev { color: #9ca3af; font-weight: 400; }
.monthly-prev-year-cat-row__badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  text-align: center;
  min-width: 68px;
}
.monthly-prev-year-cat-row__badge--good    { background: rgba(22,163,74,0.1);  color: #15803d; }
.monthly-prev-year-cat-row__badge--bad     { background: rgba(220,38,38,0.1);  color: #b91c1c; }
.monthly-prev-year-cat-row__badge--new     { background: rgba(0,102,255,0.1);  color: #0055dd; }
.monthly-prev-year-cat-row__badge--gone    { background: rgba(107,114,128,0.1); color: #6b7280; }
.monthly-prev-year-cat-row__badge--neutral { background: #f3f4f6; color: #9ca3af; font-weight: 500; }
.mpyc-pct { font-size: 10px; font-weight: 700; white-space: nowrap; }
.mpyc-pct--good    { color: #15803d; }
.mpyc-pct--bad     { color: #b91c1c; }
.mpyc-pct--neutral { color: #9ca3af; }

html[data-theme="dark"] .monthly-prev-year-compare {
  background: #1a2235;
  box-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
html[data-theme="dark"] .monthly-prev-year-compare__title {
  background: rgba(99,102,241,0.08);
  border-bottom-color: rgba(99,102,241,0.2);
  color: #818cf8;
}
html[data-theme="dark"] .monthly-prev-year-cat-section + .monthly-prev-year-cat-section { border-left-color: #2a3347; }
html[data-theme="dark"] .monthly-prev-year-cat-section__header { border-bottom-color: #2a3347; }
html[data-theme="dark"] .monthly-prev-year-cat-section__header--expense { background: rgba(220,38,38,0.06); }
html[data-theme="dark"] .monthly-prev-year-cat-section__header--income  { background: rgba(22,163,74,0.06); }
html[data-theme="dark"] .monthly-prev-year-cat-row:hover { background: rgba(255,255,255,0.04); }
html[data-theme="dark"] .monthly-prev-year-cat-row--total { border-top-color: #2a3347; }
html[data-theme="dark"] .monthly-prev-year-cat-row--total .monthly-prev-year-cat-row__name   { color: #cbd5e1; }
html[data-theme="dark"] .monthly-prev-year-cat-row--total .monthly-prev-year-cat-row__amount { color: #f1f5f9; }
html[data-theme="dark"] .monthly-prev-year-cat-row__name   { color: #cbd5e1; }
html[data-theme="dark"] .monthly-prev-year-cat-row__amount { color: #f1f5f9; }
html[data-theme="dark"] .monthly-prev-year-cat-row__amount--prev-month { color: #64748b; }
html[data-theme="dark"] .monthly-prev-year-cat-row__amount--prev { color: #475569; }

@media (max-width: 700px) {
  .monthly-prev-year-cats { grid-template-columns: 1fr; }
  .monthly-prev-year-cat-section + .monthly-prev-year-cat-section { border-left: none; border-top: 1px solid #f3f4f6; }
  .monthly-prev-year-cat-section__header { display: none; }
  .monthly-prev-year-cat-row {
    grid-template-columns: 10px 1fr 90px;
    grid-template-rows: auto auto;
    gap: 4px 10px;
    padding: 8px 12px;
  }
  .monthly-prev-year-cat-row__dot { grid-row: 1 / 3; align-self: center; }
  .monthly-prev-year-cat-row__name { grid-column: 2; grid-row: 1; }
  .monthly-prev-year-cat-row__amount:not(.monthly-prev-year-cat-row__amount--prev-month):not(.monthly-prev-year-cat-row__amount--prev) { grid-column: 3; grid-row: 1; }
  .monthly-prev-year-cat-row__amount--prev-month { grid-column: 2; grid-row: 2; font-size: 11px; align-items: flex-start; }
  .monthly-prev-year-cat-row__amount--prev { grid-column: 3; grid-row: 2; font-size: 11px; }
  .monthly-prev-year-cat-row__amount--prev-month::before,
  .monthly-prev-year-cat-row__amount--prev::before {
    content: attr(data-label);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #9ca3af;
    display: block;
    margin-bottom: 1px;
  }
}

/* ══════════════════════════════════════
   INPUTS & LABELS
══════════════════════════════════════ */
.form-item label,
.form-item__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7280;
  margin-bottom: 6px;
}
input[type="text"],
input[type="date"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea,
.form-autocomplete {
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
input[type="text"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus,
.form-autocomplete:focus {
  border-color: #0066FF;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}
/* Select: forzar fondo blanco y flecha personalizada */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
  padding-right: 34px;
  cursor: pointer;
}
/* ══════════════════════════════════════
   BOTONES
══════════════════════════════════════ */
.button:not(.button--icon),
button[type="submit"]:not(.button--icon),
input[type="submit"]:not(.button--icon) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  line-height: 1.4;
  /* Primario */
  /* Secundario */
  /* Peligro */
}
.button:not(.button--icon),
button[type="submit"]:not(.button--icon),
input[type="submit"]:not(.button--icon),
.button:not(.button--icon).button--primary,
button[type="submit"]:not(.button--icon).button--primary,
input[type="submit"]:not(.button--icon).button--primary,
.button:not(.button--icon).js-form-submit,
button[type="submit"]:not(.button--icon).js-form-submit,
input[type="submit"]:not(.button--icon).js-form-submit {
  background: #0066FF;
  color: white;
}
.button:not(.button--icon):hover,
button[type="submit"]:not(.button--icon):hover,
input[type="submit"]:not(.button--icon):hover,
.button:not(.button--icon).button--primary:hover,
button[type="submit"]:not(.button--icon).button--primary:hover,
input[type="submit"]:not(.button--icon).button--primary:hover,
.button:not(.button--icon).js-form-submit:hover,
button[type="submit"]:not(.button--icon).js-form-submit:hover,
input[type="submit"]:not(.button--icon).js-form-submit:hover {
  background: #0052cc;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
  color: white;
}
.button:not(.button--icon):active,
button[type="submit"]:not(.button--icon):active,
input[type="submit"]:not(.button--icon):active,
.button:not(.button--icon).button--primary:active,
button[type="submit"]:not(.button--icon).button--primary:active,
input[type="submit"]:not(.button--icon).button--primary:active,
.button:not(.button--icon).js-form-submit:active,
button[type="submit"]:not(.button--icon).js-form-submit:active,
input[type="submit"]:not(.button--icon).js-form-submit:active {
  transform: translateY(1px);
}
.button:not(.button--icon).button--secondary,
button[type="submit"]:not(.button--icon).button--secondary,
input[type="submit"]:not(.button--icon).button--secondary {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
}
.button:not(.button--icon).button--secondary:hover,
button[type="submit"]:not(.button--icon).button--secondary:hover,
input[type="submit"]:not(.button--icon).button--secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
  box-shadow: none;
}
.button:not(.button--icon).button--danger,
button[type="submit"]:not(.button--icon).button--danger,
input[type="submit"]:not(.button--icon).button--danger {
  background: #dc2626;
  color: white;
}
.button:not(.button--icon).button--danger:hover,
button[type="submit"]:not(.button--icon).button--danger:hover,
input[type="submit"]:not(.button--icon).button--danger:hover {
  background: #b91c1c;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
.categorias-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
/* Botón añadir (enlace) */
a.add-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0066FF;
  color: white;
  padding: 9px 20px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
}
a.add-button:hover {
  background: #0052cc;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
  color: white;
}
a.add-button::before {
  content: '+';
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
}
/* ══════════════════════════════════════
   FORMULARIOS FILTRO (card)
══════════════════════════════════════ */
[class*="-filter-form"],
[class*="-form-row"] {
  background: #f0f5ff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  padding: 20px 24px;
  margin-bottom: 24px;
}
[class*="-filter-form"] .js-form-submit,
[class*="-form-row"] .js-form-submit {
  background: #0066FF;
  border-color: #0066FF;
  color: white;
}
/* ══════════════════════════════════════
   FORMULARIO IMPORTAR
══════════════════════════════════════ */
#movimientos-import-form {
  background: #f0f5ff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  padding: 32px 36px;
  max-width: 540px;
  margin: 32px auto;
}
#movimientos-import-form .form-item {
  margin-bottom: 20px;
}
#movimientos-import-form .form-actions {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #dde5f7;
  display: flex;
  justify-content: flex-end;
}
#movimientos-import-form .form-managed-file {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#movimientos-import-form .form-managed-file input[type="file"] {
  border: 2px dashed #b3c6f7;
  border-radius: 8px;
  padding: 12px;
  background: #eef4ff;
  cursor: pointer;
  width: 100%;
}
#movimientos-import-form .form-managed-file input[type="file"]:hover {
  border-color: #0066FF;
  background: #e0edff;
}
.table-actions {
  display: flex;
  margin: 0;
}
.button--icon {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 17px 17px;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.button--icon:hover {
  transform: scale(1.08);
}
.button--icon:active {
  transform: scale(0.95);
}
.button--icon-delete {
  background-image: url('../images/delete.svg');
  background-color: #fee2e2 !important;
}
.button--icon-delete:hover {
  background-color: #fecaca !important;
}
.button--icon-delete:active {
  background-color: #fca5a5 !important;
}
.button--icon-edit {
  background-image: url('../images/edit.svg');
  background-color: #fef3c7 !important;
}
.button--icon-edit:hover {
  background-color: #fde68a !important;
}
.button--icon-edit:active {
  background-color: #fcd34d !important;
}
.button--icon-save {
  background-image: url('../images/save.svg');
  background-color: #dbeafe !important;
}
.button--icon-save:hover {
  background-color: #bfdbfe !important;
}
.button--icon-save:active {
  background-color: #93c5fd !important;
}
.button--icon-plus {
  background-image: url('../images/plus.svg');
  background-color: #d1fae5 !important;
}
.button--icon-plus:hover {
  background-color: #a7f3d0 !important;
}
.button--icon-plus:active {
  background-color: #6ee7b7 !important;
}
.categorias-table .responsive-actions-cell .actions-wrapper,
.movimientos-table .responsive-actions-cell .actions-wrapper,
.bloque_tabla_reglas table .responsive-actions-cell .actions-wrapper {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
@media (max-width: 767px) {
  .bloque_tabla {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  .categorias-table,
  .movimientos-table,
  .bloque_tabla_reglas table {
    border: 0;
  }
  .categorias-table thead,
  .movimientos-table thead,
  .bloque_tabla_reglas table thead {
    display: none;
  }
  .categorias-table tr,
  .movimientos-table tr,
  .bloque_tabla_reglas table tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid #dde5f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
  }
  .categorias-table td,
  .movimientos-table td,
  .bloque_tabla_reglas table td {
    display: block;
    border: none;
    background: transparent !important;
  }
  .categorias-table .responsive-cell,
  .movimientos-table .responsive-cell,
  .bloque_tabla_reglas table .responsive-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .categorias-table .responsive-cell div::before,
  .movimientos-table .responsive-cell div::before,
  .bloque_tabla_reglas table .responsive-cell div::before {
    display: none;
  }
  .categorias-table .responsive-cell::before,
  .movimientos-table .responsive-cell::before,
  .bloque_tabla_reglas table .responsive-cell::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: 1rem;
    flex: 1;
  }
  .categorias-table .responsive-cell > *,
  .movimientos-table .responsive-cell > *,
  .bloque_tabla_reglas table .responsive-cell > * {
    flex: 2;
  }
}
.categorias-filters.two-columns .fieldset-wrapper,
.movimientos-filters.two-columns .fieldset-wrapper {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  align-items: start;
  margin: 0 0 1rem 0;
  border: none;
  padding: 0;
}
@media (max-width: 767px) {
  .categorias-filters.two-columns .fieldset-wrapper,
  .movimientos-filters.two-columns .fieldset-wrapper {
    grid-template-columns: repeat(1, 1fr);
  }
}
.categorias-filters.two-columns .fieldset-wrapper .form-item,
.movimientos-filters.two-columns .fieldset-wrapper .form-item,
.categorias-filters.two-columns .fieldset-wrapper .js-form-item,
.movimientos-filters.two-columns .fieldset-wrapper .js-form-item {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
}
.categorias-filters.two-columns .fieldset-wrapper input[type="text"],
.movimientos-filters.two-columns .fieldset-wrapper input[type="text"],
.categorias-filters.two-columns .fieldset-wrapper input[type="date"],
.movimientos-filters.two-columns .fieldset-wrapper input[type="date"],
.categorias-filters.two-columns .fieldset-wrapper select,
.movimientos-filters.two-columns .fieldset-wrapper select,
.categorias-filters.two-columns .fieldset-wrapper .form-autocomplete,
.movimientos-filters.two-columns .fieldset-wrapper .form-autocomplete {
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  .categorias-filters,
  .movimientos-filters {
    grid-template-columns: 1fr;
  }
}
/* Botón Volver en reglas: clase dedicada para ganar especificidad */
a.reglas-back-btn {
  display: inline-flex !important;
  width: auto !important;
  align-self: flex-start !important;
}
.bloque_tabla {
  background: #f7f9fc;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 24px;
}
.bloque_tabla table {
  width: 100%;
  margin-bottom: 0;
  border-collapse: collapse;
}
.bloque_tabla table th {
  background: #031A34;
  color: rgba(255, 255, 255, 0.85);
  padding: 13px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bloque_tabla table td {
  padding: 12px 14px;
  background: #f7f9fc;
  border-bottom: 1px solid #e8ecf0;
  color: #374151;
  font-size: 14px;
}
.bloque_tabla table tbody tr {
  transition: background 0.12s;
}
.bloque_tabla table tbody tr:last-child td {
  border-bottom: none;
}
.bloque_tabla table tbody tr:hover td {
  background: #f0f5ff;
}
@media (max-width: 767px) {
  .bloque_tabla table .hidden-sm {
    display: none;
  }
}
.bloque_tabla table a {
  color: #0066FF;
  text-decoration: none;
}
.bloque_tabla table a:hover {
  text-decoration: underline;
}
.reglas-form {
  /* La tabla hereda los estilos de .bloque_tabla; solo ajustes específicos */
  /* En responsive: resetear la celda de acciones a ancho normal */
}
.reglas-form .rule-add-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 1rem;
}
.reglas-form .rule-add-wrapper .form-item {
  flex: 1;
  margin-bottom: 0;
}
.reglas-form .rule-add-wrapper .button {
  white-space: nowrap;
}
.reglas-form .form-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 20px;
}
.reglas-form .form-actions .button:not(.button--icon) {
  width: auto !important;
  display: inline-flex !important;
}
.reglas-form .bloque_tabla_reglas {
  /* Anular el padding lateral que Bootstrap .row > * aplica a los hijos */
  padding-right: 0 !important;
  padding-left: 0 !important;
  /* Forzar que la tabla rellene el wrapper para que border-radius funcione */
}
.reglas-form .bloque_tabla_reglas table {
  width: 100% !important;
  /* Celda de acciones: ancho mínimo en escritorio, evitar overflow */
}
.reglas-form .bloque_tabla_reglas table th,
.reglas-form .bloque_tabla_reglas table td {
  vertical-align: middle;
}
.reglas-form .bloque_tabla_reglas table td:last-child {
  width: 1%;
  white-space: nowrap;
}
.reglas-form .bloque_tabla_reglas table td:last-child div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
@media (max-width: 767px) {
  .reglas-form .bloque_tabla_reglas table td:last-child {
    width: auto !important;
    white-space: normal;
  }
  .reglas-form .bloque_tabla_reglas table td:last-child div {
    justify-content: flex-start;
  }
}
/* HEADER */
.app-header {
  background: #031A34;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
/* TOPBAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
}
/* Hub back button */
.hub-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.55);
  transition: background 0.18s, color 0.18s;
  flex-shrink: 0;
  text-decoration: none;
}
.hub-back svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.hub-back:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}
.branding {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo {
  height: 40px;
}
.portal-title {
  font-size: 20px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
/* USER MENU */
.user-menu {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}
.user-menu__profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 5px 10px 5px 5px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}
.user-menu__profile:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}
.user-menu__profile[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.user-menu__profile[aria-expanded="true"] .user-menu__chevron {
  transform: rotate(180deg);
}
.user-menu__avatar {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}
.user-menu__avatar::after {
  content: '';
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 9px;
  height: 9px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #031A34;
}
.user-menu__name {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}
@media (max-width: 480px) {
  .user-menu__name {
    display: none;
  }
}
.user-menu__chevron {
  width: 18px;
  height: 18px;
  fill: rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease, fill 0.15s;
  flex-shrink: 0;
}
.user-menu__login {
  display: inline-block;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.user-menu__login:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
}
/* NAVBAR */
.navbar-main {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #020f1f;
}
.navbar-menu {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 12px 0;
  margin: 0;
}
.navbar-link {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  padding-bottom: 6px;
  transition: all 0.2s;
}
.navbar-link:hover {
  color: rgba(255, 255, 255, 0.95);
}
/* activo */
.navbar-link.active {
  color: white;
  font-weight: 700;
  border-bottom: 3px solid #0066FF;
}
/* MOBILE MENU TOGGLE */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  z-index: 1001;
  min-width: 44px;
  min-height: 44px;
  margin-right: 10px;
}
.hamburger-icon {
  display: block;
  width: 24px;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.85);
  transition: all 0.3s ease;
  border-radius: 2px;
}
/* Animación del icono cuando está abierto */
.mobile-menu-toggle.active .hamburger-icon:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-toggle.active .hamburger-icon:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.active .hamburger-icon:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}
/* RESPONSIVE */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
    order: -1;
  }
  .topbar {
    padding: 12px 20px;
    position: relative;
  }
  .branding {
    flex: 1;
    justify-content: flex-start;
  }
  .portal-title {
    font-size: 16px;
  }
  .logo {
    height: 32px;
  }
  .user-menu {
    font-size: 12px;
    gap: 10px;
  }
  .navbar-main {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: #031A34;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
    border-top: none;
  }
  .navbar-main.active {
    left: 0;
  }
  .navbar-menu {
    flex-direction: column;
    gap: 0;
    padding: 100px 0 20px 0;
    align-items: stretch;
  }
  .navbar-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }
  .navbar-link {
    display: block;
    padding: 16px 20px;
    border-bottom: none !important;
    color: rgba(255, 255, 255, 0.65);
  }
  .navbar-link.active {
    background-color: rgba(0, 102, 255, 0.15);
    border-left: 4px solid #0066FF;
    border-bottom: none;
    color: white;
  }
  /* Overlay para cerrar el menú — z-index entre header(1249) y navbar(1000)
     debe quedar SOBRE el contenido pero BAJO el propio nav drawer */
  body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    /* por debajo del navbar-main (1000) */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  body.mobile-menu-open::after {
    opacity: 1;
    pointer-events: auto;
  }
  body.mobile-menu-open {
    overflow: hidden;
  }
}
/* ══════════════════════════════════════
   MENÚ CUENTA / DARK MODE TOGGLE
══════════════════════════════════════ */
.user-menu {
  position: relative;
}
.user-menu__dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  min-width: 240px;
  z-index: 500;
  overflow: hidden;
}
.user-menu__dropdown[hidden] {
  display: none;
}
.user-menu__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.user-menu__dropdown-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}
.user-menu__dropdown-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #0066FF;
  color: white;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.user-menu__dropdown-profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.user-menu__dropdown-profile-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu__dropdown-profile-mail {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu__dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.user-menu__dropdown-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}
.user-menu__dropdown-link:hover {
  background: #f8fafc;
  color: #0066FF;
}
.user-menu__dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: 14px;
  color: #374151;
  gap: 12px;
}
.user-menu__dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 0;
}
.user-menu__dropdown-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #dc2626;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.user-menu__dropdown-logout svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}
.user-menu__dropdown-logout:hover {
  background: #fef2f2;
  color: #b91c1c;
}
/* Toggle switch */
.theme-toggle {
  flex-shrink: 0;
  position: relative;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}
.theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  display: block;
}
.theme-toggle.active {
  background: #0066FF;
}
.theme-toggle.active .theme-toggle__thumb {
  transform: translateX(20px);
}
.theme-toggle:hover:not(.active) {
  background: #9ca3af;
}
.theme-toggle:hover.active {
  background: #0052cc;
}
/* ══════════════════════════════════════
   PORTADA
══════════════════════════════════════ */
/* Eliminar padding/margin que Bootstrap/Drupal añade al <main> en portada */
.main--portada {
  padding: 0 !important;
  margin: 0 !important;
}
.main--portada .region-content {
  padding: 0 !important;
}
/* HERO — arranca justo después del header portada, sin separación visual */
.portada-hero {
  background: linear-gradient(160deg, #021426 0%, #0a3a7a 50%, #0066FF 100%);
  padding: 80px 40px;
  text-align: center;
  color: white;
}
.portada-hero__inner {
  max-width: 600px;
  margin: 0 auto;
}
.portada-hero__title {
  font-size: 42px;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.5px;
}
.portada-hero__subtitle {
  font-size: 18px;
  opacity: 0.85;
  margin: 0 0 32px;
  line-height: 1.6;
}
.portada-hero__cta {
  display: inline-block;
  background: white;
  color: #0066FF;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 36px;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.portada-hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  color: #0052cc;
}
/* SECTION TITLE */
.portada-section-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 28px;
}
/* BALANCE */
.portada-balance {
  padding: 56px 40px;
  background: #f9fafb;
}
.portada-balance__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 860px;
  margin: 0 auto;
}
.portada-balance__card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.portada-balance__card--highlight {
  border-color: #0066FF;
  box-shadow: 0 2px 12px rgba(0, 102, 255, 0.15);
}
.portada-balance__card--highlight .portada-balance__card-header {
  background: #eff6ff;
}
.portada-balance__card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f3f4f6;
  padding: 16px 20px;
}
.portada-balance__month {
  font-weight: 600;
  font-size: 15px;
  color: #374151;
}
.portada-balance__badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #0066FF;
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
}
.portada-balance__card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.portada-balance__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}
.portada-balance__row--total {
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
  margin-top: 4px;
}
.portada-balance__label {
  color: #6b7280;
}
.portada-balance__value {
  font-weight: 600;
  font-size: 16px;
}
.portada-balance__value--positive {
  color: #059669;
}
.portada-balance__value--negative {
  color: #dc2626;
}
/* ACCIONES RÁPIDAS */
.portada-acciones {
  padding: 56px 40px;
}
.portada-acciones__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}
.portada-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 20px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  color: #111827;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.portada-action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: #0066FF;
  color: #111827;
}
.portada-action-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.portada-action-card__icon svg {
  width: 26px;
  height: 26px;
  color: white;
}
.portada-action-card__icon--import {
  background: #0066FF;
}
.portada-action-card__icon--list {
  background: #7c3aed;
}
.portada-action-card__icon--categories {
  background: #059669;
}
.portada-action-card__icon--dashboard {
  background: #d97706;
}
.portada-action-card__title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
}
.portada-action-card__desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}
/* RESPONSIVE */
@media (max-width: 768px) {
  .portada-hero {
    padding: 60px 20px;
  }
  .portada-hero__title {
    font-size: 30px;
  }
  .portada-hero__subtitle {
    font-size: 16px;
  }
  .portada-balance {
    padding: 40px 20px;
  }
  .portada-balance__grid {
    grid-template-columns: 1fr;
  }
  .portada-acciones {
    padding: 40px 20px;
  }
  .portada-acciones__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .portada-features {
    padding: 40px 20px;
  }
  .portada-features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .portada-acciones__grid,
  .portada-features__grid {
    grid-template-columns: 1fr;
  }
}
/* ── FEATURES (visitantes no logueados) ── */
.portada-features {
  background: #f7f9fc;
  padding: 60px 40px;
}
.portada-features__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .portada-features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.portada-feature-card {
  background: #fff;
  border: 1px solid #e8ecf0;
  border-radius: 14px;
  padding: 28px 22px;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.portada-feature-card:hover {
  box-shadow: 0 8px 24px rgba(0, 102, 255, 0.1);
  transform: translateY(-3px);
}
.portada-feature-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #e8f0ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.portada-feature-card__icon svg {
  width: 24px;
  height: 24px;
  color: #0066FF;
}
.portada-feature-card__title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 10px;
}
.portada-feature-card__desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}
/* ══════════════════════════════════════
   PERFIL
══════════════════════════════════════ */
.perfil-page {
  max-width: 640px;
  margin: 0 auto;
}
.perfil-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #ffffff;
  border-radius: 12px;
  padding: 24px 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
  border-left: 5px solid #0066FF;
}
.perfil-hero__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #0066FF;
  color: white;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.15);
}
.perfil-hero__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.perfil-hero__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.perfil-hero__name {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.perfil-hero__role {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  background: #f1f5f9;
  padding: 2px 10px;
  border-radius: 20px;
  display: inline-block;
  width: fit-content;
}
.perfil-form-wrapper {
  background: #ffffff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.perfil-form-wrapper fieldset {
  border: none;
  padding: 0;
  margin: 0 0 28px;
}
.perfil-form-wrapper fieldset legend {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0066FF;
  padding: 0 0 12px;
  border-bottom: 2px solid #e8f0ff;
  width: 100%;
  margin-bottom: 20px;
}
.perfil-form-wrapper .fieldset-wrapper {
  display: grid;
  gap: 16px;
}
html[data-theme="dark"] .perfil-hero {
  background: #1a2235;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .perfil-hero__name {
  color: #f1f5f9;
}
html[data-theme="dark"] .perfil-hero__role {
  background: #252d3d;
  color: #94a3b8;
}
html[data-theme="dark"] .perfil-form-wrapper {
  background: #1a2235;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
html[data-theme="dark"] .perfil-form-wrapper fieldset legend {
  color: #60a5fa;
  border-bottom-color: #1e3a6e;
}
/* ══════════════════════════════════════
   TFA — Two-Factor Authentication
══════════════════════════════════════ */
.tfa-entry-wrapper {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #021426 0%, #0a3a7a 50%, #0066FF 100%);
  padding: 40px 16px;
}
.tfa-entry-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  padding: 48px 40px 40px;
  max-width: 420px;
  width: 100%;
}
.tfa-entry-header {
  text-align: center;
  margin-bottom: 32px;
}
.tfa-entry-icon {
  width: 64px;
  height: 64px;
  background: #e8f0fe;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.tfa-entry-icon svg {
  width: 32px;
  height: 32px;
  fill: #0066FF;
}
.tfa-entry-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 8px;
}
.tfa-entry-subtitle {
  font-size: 0.9375rem;
  color: #6b7280;
  margin: 0;
}
.tfa-entry-card .tfa-code-input,
.tfa-entry-card input[name="code"] {
  font-size: 2rem !important;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  border-radius: 10px !important;
  border: 2px solid #e2e8f0 !important;
  padding: 14px 16px !important;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tfa-entry-card .tfa-code-input::placeholder,
.tfa-entry-card input[name="code"]::placeholder {
  letter-spacing: 0.2em;
  color: #d1d5db;
}
.tfa-entry-card .tfa-code-input:focus,
.tfa-entry-card input[name="code"]:focus {
  border-color: #0066FF !important;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.15) !important;
  outline: none;
}
.tfa-entry-card .form-actions input[type="submit"],
.tfa-entry-card input[type="submit"] {
  width: 100%;
  margin-top: 8px;
  padding: 14px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  background: #0066FF !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.tfa-entry-card .form-actions input[type="submit"]:hover,
.tfa-entry-card input[type="submit"]:hover {
  background: #0052cc !important;
}
.tfa-entry-card .form-actions input[type="submit"]:active,
.tfa-entry-card input[type="submit"]:active {
  transform: scale(0.99);
}
.tfa-entry-card .tfa-login-plugin-list,
.tfa-entry-card [id*="tfa-login-plugin"] {
  text-align: center;
  margin-top: 20px;
  font-size: 0.875rem;
}
.tfa-entry-card .tfa-login-plugin-list a,
.tfa-entry-card [id*="tfa-login-plugin"] a {
  color: #0066FF;
  text-decoration: none;
}
.tfa-entry-card .tfa-login-plugin-list a:hover,
.tfa-entry-card [id*="tfa-login-plugin"] a:hover {
  text-decoration: underline;
}
.tfa-setup-wrapper {
  max-width: 600px;
}
.tfa-qr-wrapper {
  text-align: center;
  margin: 16px 0;
}
.tfa-qr-wrapper img {
  display: inline-block;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  padding: 8px;
  background: #fff;
  max-width: 200px;
}
.tfa-seed-wrapper input[readonly] {
  font-family: 'Courier New', monospace !important;
  font-size: 0.9rem !important;
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  letter-spacing: 0.06em;
  color: #374151;
  cursor: text;
  user-select: all;
}
.tfa-setup-wrapper .tfa-code-input,
.tfa-setup-wrapper input[name="code"] {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-align: center;
}
.tfa-setup-wrapper .tfa-code-input:focus,
.tfa-setup-wrapper input[name="code"]:focus {
  border-color: #0066FF;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.15);
  outline: none;
}
html[data-theme="dark"] .tfa-entry-card {
  background: #1e2035;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .tfa-entry-icon {
  background: rgba(0, 102, 255, 0.15);
}
html[data-theme="dark"] .tfa-entry-title {
  color: #e8eaf6;
}
html[data-theme="dark"] .tfa-entry-subtitle {
  color: #9ca3af;
}
html[data-theme="dark"] .tfa-entry-card .tfa-code-input,
html[data-theme="dark"] .tfa-entry-card input[name="code"] {
  background: #13152a !important;
  border-color: #2d3154 !important;
  color: #e8eaf6 !important;
}
html[data-theme="dark"] .tfa-entry-card .tfa-code-input::placeholder,
html[data-theme="dark"] .tfa-entry-card input[name="code"]::placeholder {
  color: #3d4166;
}
html[data-theme="dark"] .tfa-qr-wrapper img {
  border-color: #2d3154;
  background: #1e2035;
}
html[data-theme="dark"] .tfa-seed-wrapper input[readonly] {
  background: #13152a !important;
  border-color: #2d3154 !important;
  color: #cbd5e1 !important;
}
@media (max-width: 480px) {
  .tfa-entry-card {
    padding: 32px 20px 28px;
  }
  .tfa-entry-title {
    font-size: 1.25rem;
  }
  .tfa-entry-card .tfa-code-input,
  .tfa-entry-card input[name="code"] {
    font-size: 1.5rem !important;
    letter-spacing: 0.15em;
  }
}
/* ══════════════════════════════════════
   FORMULARIO DE LOGIN
══════════════════════════════════════ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #021426 0%, #0a3a7a 50%, #0066FF 100%);
  padding: 40px 16px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  padding: 48px 40px 40px;
  max-width: 420px;
  width: 100%;
}
.login-header {
  text-align: center;
  margin-bottom: 32px;
}
.login-branding {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 24px;
}
.login-branding__logo {
  height: 38px;
  width: auto;
}
.login-branding__name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a2e;
}
.login-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px;
}
.login-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
}
.login-card .form-item {
  margin-bottom: 16px;
}
.login-card .login-input,
.login-card input[name="name"],
.login-card input[name="pass"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 1rem;
  background: #f9fafb;
  color: #111827;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-card .login-input:focus,
.login-card input[name="name"]:focus,
.login-card input[name="pass"]:focus {
  border-color: #0066FF;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
  outline: none;
}
.login-card .login-input::placeholder,
.login-card input[name="name"]::placeholder,
.login-card input[name="pass"]::placeholder {
  color: #9ca3af;
}
.login-card .form-actions {
  margin-top: 8px;
}
.login-card .form-actions input[type="submit"],
.login-card input[type="submit"] {
  width: 100%;
  padding: 13px;
  background: #0066FF;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.login-card .form-actions input[type="submit"]:hover,
.login-card input[type="submit"]:hover {
  background: #0052cc;
}
.login-card .form-actions input[type="submit"]:active,
.login-card input[type="submit"]:active {
  transform: scale(0.98);
}
.login-card .item-list {
  margin-top: 20px;
  text-align: center;
  font-size: 0.875rem;
}
.login-card .item-list a {
  color: #0066FF;
  text-decoration: none;
}
.login-card .item-list a:hover {
  text-decoration: underline;
}
@media (max-width: 480px) {
  .login-card {
    padding: 32px 20px 28px;
  }
}
/* Login — dark mode */
html[data-theme="dark"] .login-card {
  background: #111827;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .login-branding__name {
  color: #e8eaf6;
}
html[data-theme="dark"] .login-title {
  color: #f1f5f9;
}
html[data-theme="dark"] .login-subtitle {
  color: #94a3b8;
}
html[data-theme="dark"] .login-card .login-input,
html[data-theme="dark"] .login-card input[name="name"],
html[data-theme="dark"] .login-card input[name="pass"] {
  background: #1e2433;
  border-color: #374151;
  color: #e2e8f0;
}
html[data-theme="dark"] .login-card .login-input::placeholder,
html[data-theme="dark"] .login-card input[name="name"]::placeholder,
html[data-theme="dark"] .login-card input[name="pass"]::placeholder {
  color: #6b7280;
}
html[data-theme="dark"] .login-card .login-input:focus,
html[data-theme="dark"] .login-card input[name="name"]:focus,
html[data-theme="dark"] .login-card input[name="pass"]:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
html[data-theme="dark"] .login-card .item-list {
  color: #94a3b8;
}
html[data-theme="dark"] .login-card .item-list a {
  color: #60a5fa;
}

/* ══════════════════════════════════════
   MODO OSCURO  html[data-theme="dark"]
══════════════════════════════════════ */
html[data-theme="dark"] {
  /* Fondo general */
  --bs-body-bg: #0f1117 !important;
  /* ── Tablas ─────────────────────────────── */
  /* Responsive tr-cards en móvil */
  /* ── Formularios filtro ──────────────────── */
  /* ── Formulario importar ─────────────────── */
  /* ── Inputs, selects, textareas ──────────── */
  /* Select: restaurar flecha correctamente (no usar shorthand background) */
  /* ── Labels ──────────────────────────────── */
  /* ── Botones secundarios ─────────────────── */
  /* ── Botones icon: SVG con fill blanco + fondo de color sólido ── */
  /* ── Paginación ──────────────────────────── */
  /* ── Menú cuenta dropdown ────────────────── */
  /* ── Chip/tags ───────────────────────────── */
  /* ── Diálogos popup ──────────────────────── */
  /* ── Reglas form ─────────────────────────── */
  /* ── Placeholders ───────────────────────── */
  /* ══════════════════════════════════════
     PORTADA
  ══════════════════════════════════════ */
  /* ── Features (visitantes) ───────────────── */
}
html[data-theme="dark"] body {
  background-color: #0f1117 !important;
  color: #e2e8f0;
}
html[data-theme="dark"] .bloque_tabla {
  background: #1a1f2e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .bloque_tabla table th {
  background: #0a0f1a;
  color: rgba(255, 255, 255, 0.7);
}
html[data-theme="dark"] .bloque_tabla table td {
  background: #1a1f2e;
  border-bottom-color: #2a3347;
  color: #cbd5e1;
}
html[data-theme="dark"] .bloque_tabla table tbody tr:hover td {
  background: #1e2d4a;
}
html[data-theme="dark"] .bloque_tabla table a {
  color: #60a5fa;
}
html[data-theme="dark"] .bloque_tabla table a:hover {
  color: #93c5fd;
}
html[data-theme="dark"] .categorias-table tr,
html[data-theme="dark"] .movimientos-table tr,
html[data-theme="dark"] .bloque_tabla_reglas table tr {
  background: #1a1f2e !important;
  border-color: #2a3347 !important;
}
html[data-theme="dark"] .categorias-table td,
html[data-theme="dark"] .movimientos-table td,
html[data-theme="dark"] .bloque_tabla_reglas table td {
  background: transparent !important;
}
html[data-theme="dark"] [class*="-filter-form"],
html[data-theme="dark"] [class*="-form-row"] {
  background: #1e2433;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] #movimientos-import-form {
  background: #1e2433;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  color: #e2e8f0;
  /* El texto del fichero adjunto */
}
html[data-theme="dark"] #movimientos-import-form .form-actions {
  border-top-color: #2a3347;
}
html[data-theme="dark"] #movimientos-import-form .form-managed-file .file-upload-help,
html[data-theme="dark"] #movimientos-import-form .form-managed-file .file-upload-button {
  color: #94a3b8;
}
html[data-theme="dark"] #movimientos-import-form .form-managed-file input[type="file"] {
  background: #252d3d;
  border-color: #374151;
  color: #cbd5e1;
}
html[data-theme="dark"] #movimientos-import-form .form-managed-file input[type="file"]:hover {
  border-color: #3b82f6;
  background: #1e2d4a;
}
html[data-theme="dark"] #movimientos-import-form .file--mime-application,
html[data-theme="dark"] #movimientos-import-form .file a {
  color: #60a5fa;
}
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-autocomplete {
  background-color: #252d3d !important;
  border-color: #374151 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] input[type="text"]:focus,
html[data-theme="dark"] input[type="date"]:focus,
html[data-theme="dark"] input[type="email"]:focus,
html[data-theme="dark"] input[type="password"]:focus,
html[data-theme="dark"] input[type="number"]:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] .form-autocomplete:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18) !important;
}
html[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
}
html[data-theme="dark"] .form-item label,
html[data-theme="dark"] .form-item__label {
  color: #64748b;
}
html[data-theme="dark"] .button.button--secondary,
html[data-theme="dark"] button.button--secondary {
  background: #1e2433;
  color: #e2e8f0;
  border-color: #374151;
}
html[data-theme="dark"] .button.button--secondary:hover,
html[data-theme="dark"] button.button--secondary:hover {
  background: #252d3d;
  border-color: #4b5563;
  color: #f1f5f9;
}
html[data-theme="dark"] .button--icon {
  filter: none;
}
html[data-theme="dark"] .button--icon-save {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath fill='%23fff' d='M160 144C151.2 144 144 151.2 144 160L144 480C144 488.8 151.2 496 160 496L480 496C488.8 496 496 488.8 496 480L496 237.3C496 233.1 494.3 229 491.3 226L416 150.6L416 240C416 257.7 401.7 272 384 272L224 272C206.3 272 192 257.7 192 240L192 144L160 144zM240 144L240 224L368 224L368 144L240 144zM96 160C96 124.7 124.7 96 160 96L402.7 96C419.7 96 436 102.7 448 114.7L525.3 192C537.3 204 544 220.3 544 237.3L544 480C544 515.3 515.3 544 480 544L160 544C124.7 544 96 515.3 96 480L96 160zM256 384C256 348.7 284.7 320 320 320C355.3 320 384 348.7 384 384C384 419.3 355.3 448 320 448C284.7 448 256 419.3 256 384z'/%3E%3C/svg%3E") !important;
  background-color: #1e3a5f !important;
}
html[data-theme="dark"] .button--icon-save:hover {
  background-color: #1a4f8a !important;
}
html[data-theme="dark"] .button--icon-delete {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath fill='%23fff' d='M262.2 48C248.9 48 236.9 56.3 232.2 68.8L216 112L120 112C106.7 112 96 122.7 96 136C96 149.3 106.7 160 120 160L520 160C533.3 160 544 149.3 544 136C544 122.7 533.3 112 520 112L424 112L407.8 68.8C403.1 56.3 391.2 48 377.8 48L262.2 48zM128 208L128 512C128 547.3 156.7 576 192 576L448 576C483.3 576 512 547.3 512 512L512 208L464 208L464 512C464 520.8 456.8 528 448 528L192 528C183.2 528 176 520.8 176 512L176 208L128 208zM288 280C288 266.7 277.3 256 264 256C250.7 256 240 266.7 240 280L240 456C240 469.3 250.7 480 264 480C277.3 480 288 469.3 288 456L288 280zM400 280C400 266.7 389.3 256 376 256C362.7 256 352 266.7 352 280L352 456C352 469.3 362.7 480 376 480C389.3 480 400 469.3 400 456L400 280z'/%3E%3C/svg%3E") !important;
  background-color: #6b1a1a !important;
}
html[data-theme="dark"] .button--icon-delete:hover {
  background-color: #8b2020 !important;
}
html[data-theme="dark"] .button--icon-edit {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath fill='%23fff' d='M505 122.9L517.1 135C526.5 144.4 526.5 159.6 517.1 168.9L488 198.1L441.9 152L471 122.9C480.4 113.5 495.6 113.5 504.9 122.9zM273.8 320.2L408 185.9L454.1 232L319.8 366.2C316.9 369.1 313.3 371.2 309.4 372.3L250.9 389L267.6 330.5C268.7 326.6 270.8 323 273.7 320.1zM437.1 89L239.8 286.2C231.1 294.9 224.8 305.6 221.5 317.3L192.9 417.3C190.5 425.7 192.8 434.7 199 440.9C205.2 447.1 214.2 449.4 222.6 447L322.6 418.4C334.4 415 345.1 408.7 353.7 400.1L551 202.9C579.1 174.8 579.1 129.2 551 101.1L538.9 89C510.8 60.9 465.2 60.9 437.1 89zM152 128C103.4 128 64 167.4 64 216L64 488C64 536.6 103.4 576 152 576L424 576C472.6 576 512 536.6 512 488L512 376C512 362.7 501.3 352 488 352C474.7 352 464 362.7 464 376L464 488C464 510.1 446.1 528 424 528L152 528C129.9 528 112 510.1 112 488L112 216C112 193.9 129.9 176 152 176L264 176C277.3 176 288 165.3 288 152C288 138.7 277.3 128 264 128L152 128z'/%3E%3C/svg%3E") !important;
  background-color: #5a3a00 !important;
}
html[data-theme="dark"] .button--icon-edit:hover {
  background-color: #7a5000 !important;
}
html[data-theme="dark"] .button--icon-plus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath fill='%23fff' d='M352 128C352 110.3 337.7 96 320 96C302.3 96 288 110.3 288 128L288 288L128 288C110.3 288 96 302.3 96 320C96 337.7 110.3 352 128 352L288 352L288 512C288 529.7 302.3 544 320 544C337.7 544 352 529.7 352 512L352 352L512 352C529.7 352 544 337.7 544 320C544 302.3 529.7 288 512 288L352 288L352 128z'/%3E%3C/svg%3E") !important;
  background-color: #0a3d20 !important;
}
html[data-theme="dark"] .button--icon-plus:hover {
  background-color: #0f5530 !important;
}
html[data-theme="dark"] .bank-pager {
  background: #1a1f2e;
  border-color: #2a3347;
}
html[data-theme="dark"] .bank-pager a {
  color: #94a3b8;
}
html[data-theme="dark"] .bank-pager a:hover {
  background: #1e2d4a;
  color: #60a5fa;
}
html[data-theme="dark"] .bank-pager .pager-current {
  background: #1d4ed8;
  color: #fff;
}
html[data-theme="dark"] .bank-pager .pager__ellipsis {
  color: #4b5563;
}
html[data-theme="dark"] .bank-pager .pager__disabled {
  color: #374151;
}
html[data-theme="dark"] .user-menu__dropdown {
  background: #1e2433;
  border-color: #2a3347;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .user-menu__dropdown-profile-name {
  color: #f1f5f9;
}
html[data-theme="dark"] .user-menu__dropdown-profile-mail {
  color: #64748b;
}
html[data-theme="dark"] .user-menu__dropdown-link {
  color: #cbd5e1;
}
html[data-theme="dark"] .user-menu__dropdown-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #60a5fa;
}
html[data-theme="dark"] .user-menu__dropdown-header {
  color: #475569;
  border-bottom-color: #2a3347;
}
html[data-theme="dark"] .user-menu__dropdown-item {
  color: #e2e8f0;
}
html[data-theme="dark"] .user-menu__dropdown-divider {
  background: #2a3347;
}
html[data-theme="dark"] .user-menu__dropdown-logout {
  color: #f87171;
}
html[data-theme="dark"] .user-menu__dropdown-logout:hover {
  background: rgba(220, 38, 38, 0.12);
  color: #fca5a5;
}
html[data-theme="dark"] .chip {
  background: #252d3d;
  color: #94a3b8;
}
html[data-theme="dark"] .chip.active {
  background: #7f1d1d;
  color: #fca5a5;
}
html[data-theme="dark"] .popup-modal .ui-dialog-titlebar {
  background: #0a0f1a !important;
}
html[data-theme="dark"] .ui-dialog {
  background: #1e2433 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .reglas-form {
  color: #e2e8f0;
  /* La tabla hereda de .bloque_tabla dark; solo override de los th 
       por si queda fuera del selector general */
}
html[data-theme="dark"] .reglas-form .bloque_tabla_reglas table th {
  background: #0a0f1a;
  color: rgba(255, 255, 255, 0.7);
}
html[data-theme="dark"] .reglas-form .bloque_tabla_reglas table td {
  background: #1a1f2e;
  border-bottom-color: #2a3347;
  color: #cbd5e1;
}
html[data-theme="dark"] .reglas-form .bloque_tabla_reglas table tbody tr:hover td {
  background: #1e2d4a;
}
html[data-theme="dark"] ::placeholder {
  color: #4b5563 !important;
  opacity: 1;
}
html[data-theme="dark"] :-ms-input-placeholder {
  color: #4b5563 !important;
}
html[data-theme="dark"] .portada-balance {
  background: #13171f;
}
html[data-theme="dark"] .portada-section-title {
  color: #e2e8f0;
}
html[data-theme="dark"] .portada-balance__card {
  background: #1a1f2e;
  border-color: #2a3347;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .portada-balance__card--highlight {
  border-color: #1d4ed8;
  box-shadow: 0 2px 12px rgba(29, 78, 216, 0.25);
}
html[data-theme="dark"] .portada-balance__card--highlight .portada-balance__card-header {
  background: #1e2d4a;
}
html[data-theme="dark"] .portada-balance__card-header {
  background: #252d3d;
}
html[data-theme="dark"] .portada-balance__month {
  color: #cbd5e1;
}
html[data-theme="dark"] .portada-balance__row--total {
  border-top-color: #2a3347;
}
html[data-theme="dark"] .portada-balance__label {
  color: #64748b;
}
html[data-theme="dark"] .portada-acciones {
  background: #0f1117;
}
html[data-theme="dark"] .portada-action-card {
  background: #1a1f2e;
  border-color: #2a3347;
  color: #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .portada-action-card:hover {
  background: #1e2d4a;
  border-color: #3b82f6;
  color: #f1f5f9;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .portada-action-card__desc {
  color: #64748b;
}
html[data-theme="dark"] .portada-features {
  background: #0f1117;
}
html[data-theme="dark"] .portada-feature-card {
  background: #1a1f2e;
  border-color: #2a3347;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .portada-feature-card:hover {
  background: #1e2d4a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .portada-feature-card__icon {
  background: #1e2d4a;
}
html[data-theme="dark"] .portada-feature-card__icon svg {
  color: #60a5fa;
}
html[data-theme="dark"] .portada-feature-card__title {
  color: #f1f5f9;
}
html[data-theme="dark"] .portada-feature-card__desc {
  color: #64748b;
}
