/* ===== VARIABLES ===== */
:root {
  --bg: #0c0c0f;
  --surface: #131318;
  --surface2: #1c1c24;
  --border: #232330;
  --red: #e53e3e;
  --red-dark: #c53030;
  --red-soft: rgba(229,62,62,0.1);
  --green: #38a169;
  --green-soft: rgba(56,161,105,0.12);
  --yellow: #d97706;
  --yellow-soft: rgba(217,119,6,0.12);
  --text: #f0f0f5;
  --text2: #9090a8;
  --text3: #50506a;
  --shadow: 0 8px 24px rgba(0,0,0,0.5);
  --radius: 12px;
  --radius-sm: 8px;
}
[data-theme="light"] {
  --bg: #f2f2f7; --surface: #ffffff; --surface2: #e8e8f0;
  --border: #d8d8e8; --text: #0a0a14; --text2: #44445a;
  --text3: #9090a8; --shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* ===== BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 15px; transition: background .2s, color .2s; }
a { color: var(--red); text-decoration: none; font-weight: 600; }
select option { background: var(--surface); color: var(--text); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== SHARED FORM ELEMENTS ===== */
.field-group { margin-bottom: 14px; }
.field-group label { display: block; font-size: 12px; font-weight: 700; color: var(--text2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .06em; }
.field-input {
  width: 100%; background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14px;
  font-family: inherit; color: var(--text); outline: none; transition: border-color .2s, background .2s;
}
.field-input:focus { border-color: var(--red); }
.field-select {
  width: 100%; background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 11px; font-size: 13px;
  font-family: inherit; color: var(--text); outline: none; cursor: pointer; transition: border-color .2s;
}
.field-select:focus { border-color: var(--red); }
.field-error { color: #fc8181; font-size: 13px; margin-top: 8px; display: none; }
.field-date-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.field-amt-wrap { position: relative; }
.field-amt-prefix { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 700; color: var(--text2); font-family: 'Space Mono', monospace; }
.field-input--amt { padding-left: 30px; font-family: 'Space Mono', monospace; font-size: 14px; }

/* ===== SHARED BUTTONS ===== */
.btn-primary {
  padding: 12px 20px; background: var(--red); border: none; border-radius: var(--radius-sm);
  color: white; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; transition: background .2s, transform .1s;
}
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:active { transform: scale(.99); }
.btn-primary--full { width: 100%; }
.btn-secondary {
  padding: 10px 18px; background: none; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text2); font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: all .2s;
}
.btn-secondary:hover { border-color: var(--text2); color: var(--text); }
.btn-danger {
  padding: 10px 18px; background: none; border: 1.5px solid var(--red);
  border-radius: var(--radius-sm); color: var(--red); font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: all .2s;
}
.btn-danger:hover { background: var(--red-soft); }

/* ===== SHARED SURFACE CARD ===== */
.surface-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: background .2s; }
.surface-card__title { font-size: 12px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 18px; }

/* ===== LOGIN PAGE ===== */
#login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 30% 40%, rgba(229,62,62,.08) 0%, transparent 55%), var(--bg);
}
.login-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 44px 38px; width: 100%; max-width: 400px; box-shadow: var(--shadow);
}
.login-card__brand { text-align: center; margin-bottom: 32px; }
.login-card__brand h1 { font-size: 34px; font-weight: 800; letter-spacing: -1px; color: var(--red); }
.login-card__brand p { font-size: 14px; color: var(--text2); margin-top: 4px; }
.login-card__footer { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text2); }

/* ===== REGISTER PAGE ===== */
.register-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 70% 30%, rgba(229,62,62,.07) 0%, transparent 55%), var(--bg);
}
.register-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 44px 38px; width: 100%; max-width: 400px; box-shadow: var(--shadow);
}
.register-card__brand { text-align: center; margin-bottom: 28px; }
.register-card__brand h1 { font-size: 30px; font-weight: 800; letter-spacing: -1px; color: var(--red); }
.register-card__brand p { font-size: 14px; color: var(--text2); margin-top: 4px; }
.register-card__footer { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text2); }
.register-card__success { color: #68d391; font-size: 14px; text-align: center; margin-top: 10px; display: none; }

/* ===== APP HEADER ===== */
#app-screen { display: none; }
.app-header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 20px; display: flex; align-items: center; justify-content: space-between;
  height: 58px; position: sticky; top: 0; z-index: 100; transition: background .2s;
}
.app-header__brand { font-size: 22px; font-weight: 800; letter-spacing: -.5px; color: var(--red); flex-shrink: 0; }
.app-header__nav { display: flex; gap: 4px; }
.app-header__nav-btn {
  padding: 7px 16px; border-radius: 7px; border: none; background: none;
  color: var(--text2); font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all .2s;
}
.app-header__nav-btn:hover { background: var(--surface2); color: var(--text); }
.app-header__nav-btn.is-active { background: var(--red-soft); color: var(--red); }
.app-header__right { display: flex; align-items: center; gap: 8px; }
.app-header__install-btn {
  display: none; align-items: center; gap: 6px; padding: 7px 14px;
  background: var(--red-soft); border: 1px solid var(--red); border-radius: var(--radius-sm);
  color: var(--red); font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer; transition: all .2s; flex-shrink: 0;
}
.app-header__install-btn:hover { background: var(--red); color: white; }
.app-header__install-btn.is-visible { display: flex; }
.app-header__theme-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
  background: none; color: var(--text2); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .2s; flex-shrink: 0;
}
.app-header__theme-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.app-header__user { display: flex; align-items: center; gap: 8px; }
.app-header__avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--red);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: white; flex-shrink: 0;
}
.app-header__username { font-size: 14px; font-weight: 600; color: var(--text2); }
.app-header__logout-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text3); font-size: 13px; font-family: inherit; padding: 5px 10px; cursor: pointer; transition: all .2s;
}
.app-header__logout-btn:hover { border-color: var(--red); color: var(--red); }
.app-header__admin-btn {
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--yellow);
  background: var(--yellow-soft); color: var(--yellow); font-size: 12px; font-weight: 700;
  font-family: inherit; cursor: pointer; transition: all .2s; display: none;
}
.app-header__admin-btn:hover { background: var(--yellow); color: #000; }
.app-header__admin-btn.is-visible { display: block; }
.app-header__hamburger {
  display: none; width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: none; color: var(--text2);
  font-size: 20px; cursor: pointer; align-items: center; justify-content: center; transition: all .2s;
}
.app-header__hamburger:hover { border-color: var(--red); color: var(--red); }

/* ===== MOBILE DRAWER ===== */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.drawer-overlay.is-open { opacity: 1; pointer-events: all; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 280px;
  background: var(--surface); border-left: 1px solid var(--border); z-index: 201;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: translateX(0); }
.drawer__header {
  padding: 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer__close { background: none; border: none; font-size: 22px; color: var(--text2); cursor: pointer; padding: 4px; border-radius: 6px; transition: color .2s; }
.drawer__close:hover { color: var(--red); }
.drawer__user { display: flex; align-items: center; gap: 12px; }
.drawer__avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--red);
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; color: white;
}
.drawer__name { font-size: 16px; font-weight: 700; color: var(--text); }
.drawer__body { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.drawer__item {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--text); background: var(--bg); cursor: pointer; transition: border-color .2s;
}
.drawer__item:hover { border-color: var(--red); }
.drawer__item span { color: var(--text2); font-size: 13px; }
.drawer__toggle { width: 44px; height: 24px; border-radius: 12px; background: var(--border); position: relative; transition: background .2s; flex-shrink: 0; }
.drawer__toggle.is-on { background: var(--red); }
.drawer__toggle-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; transition: left .2s; }
.drawer__toggle.is-on .drawer__toggle-knob { left: 23px; }
.drawer__install {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--red); background: var(--red-soft);
  font-size: 14px; font-weight: 600; color: var(--red); cursor: pointer; transition: all .2s;
}
.drawer__install:hover { background: var(--red); color: white; }
.drawer__admin {
  display: none; align-items: center; gap: 10px; padding: 14px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--yellow); background: var(--yellow-soft);
  font-size: 14px; font-weight: 600; color: var(--yellow); cursor: pointer; transition: all .2s;
}
.drawer__admin:hover { background: var(--yellow); color: #000; }
.drawer__admin.is-visible { display: flex; }
.drawer__footer { padding: 20px; border-top: 1px solid var(--border); }
.drawer__logout {
  width: 100%; padding: 12px; background: none; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text2); font-size: 14px; font-weight: 700;
  font-family: inherit; cursor: pointer; transition: all .2s;
}
.drawer__logout:hover { border-color: var(--red); color: var(--red); }

/* ===== PANELS ===== */
.app-panel { display: none; padding: 24px 20px; max-width: 1100px; margin: 0 auto; }
.app-panel.is-active { display: block; }

/* ===== REGISTRO PANEL ===== */
.registro-grid { display: grid; grid-template-columns: 390px 1fr; gap: 20px; align-items: start; }
.registro-form__type-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.registro-form__type-btn {
  padding: 12px; border-radius: var(--radius-sm); border: 2px solid var(--border);
  background: none; color: var(--text2); font-size: 14px; font-weight: 700;
  font-family: inherit; cursor: pointer; transition: all .2s; text-align: center;
}
.registro-form__type-btn--ingreso.is-active { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.registro-form__type-btn--gasto.is-active { border-color: var(--yellow); background: var(--yellow-soft); color: var(--yellow); }
.registro-form__cat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; margin-bottom: 4px; }
.registro-form__cat-btn {
  padding: 9px 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: none; color: var(--text2); font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: all .15s; text-align: left;
}
.registro-form__cat-btn:hover { border-color: var(--red); color: var(--text); }
.registro-form__cat-btn.is-active { border-color: var(--yellow); background: var(--yellow-soft); color: var(--yellow); }

/* Recent list */
.recent-list { display: flex; flex-direction: column; gap: 7px; }
.recent-item {
  display: flex; align-items: center; padding: 12px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); gap: 10px;
}
.recent-item__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.recent-item__dot--ingreso { background: var(--green); box-shadow: 0 0 6px var(--green); }
.recent-item__dot--gasto { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.recent-item__info { flex: 1; min-width: 0; }
.recent-item__desc { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item__meta { font-size: 12px; color: var(--text2); margin-top: 2px; }
.recent-item__amount { font-family: 'Space Mono', monospace; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.recent-item__amount--ingreso { color: var(--green); }
.recent-item__amount--gasto { color: var(--yellow); }
.recent-item__edit-btn {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 15px; padding: 4px 6px; border-radius: 5px; transition: all .2s; flex-shrink: 0;
}
.recent-item__edit-btn:hover { color: var(--red); background: var(--red-soft); }

/* ===== DASHBOARD PANEL ===== */
.dash-month-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.dash-month-nav__btn {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text2); padding: 8px 14px; cursor: pointer; font-family: inherit; font-size: 20px; transition: all .2s;
}
.dash-month-nav__btn:hover { border-color: var(--red); color: var(--red); }
.dash-month-nav__label { flex: 1; text-align: center; font-size: 20px; font-weight: 800; letter-spacing: -.3px; text-transform: capitalize; }

/* Summary cards */
.dash-summary-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 20px; }
.dash-summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden; transition: background .2s; }
.dash-summary-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.dash-summary-card--income::before { background: var(--green); }
.dash-summary-card--expense::before { background: var(--yellow); }
.dash-summary-card--balance::before { background: var(--red); }
.dash-summary-card--balance.is-deficit { background: rgba(229,62,62,.07); border-color: rgba(229,62,62,.4); }
.dash-summary-card--balance.is-deficit::before { background: var(--red); }
.dash-summary-card__label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text2); margin-bottom: 8px; }
.dash-summary-card__value { font-family: 'Space Mono', monospace; font-size: 21px; font-weight: 700; }
.dash-summary-card--income .dash-summary-card__value { color: var(--green); }
.dash-summary-card--expense .dash-summary-card__value { color: var(--yellow); }
.dash-summary-card--balance .dash-summary-card__value { color: var(--red); }
.dash-summary-card--balance.is-deficit .dash-summary-card__value { color: var(--red); }
.dash-summary-card__sub { font-size: 13px; color: var(--text2); margin-top: 4px; }
.dash-summary-card__deficit-badge {
  display: none; margin-top: 10px; padding: 6px 10px; background: rgba(229,62,62,.15);
  border: 1px solid rgba(229,62,62,.4); border-radius: 6px;
  font-size: 12px; font-weight: 700; color: var(--red); text-align: center;
}
.is-deficit .dash-summary-card__deficit-badge { display: block; }
.dash-prog-wrap { margin-top: 10px; }
.dash-prog-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text2); margin-bottom: 5px; }
.dash-prog-label__pct { font-weight: 700; color: var(--yellow); }
.dash-prog-label__pct.is-over { color: var(--red); }
.dash-prog-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.dash-prog-fill { height: 100%; border-radius: 3px; background: var(--yellow); transition: width .5s; }
.dash-prog-fill.is-over { background: var(--red); }

/* Charts */
.dash-charts-grid { display: grid; grid-template-columns: 1fr 360px; gap: 14px; margin-bottom: 20px; }
.dash-chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: background .2s; }
.dash-chart-card__title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); margin-bottom: 14px; }
.dash-chart-card__canvas-wrap { position: relative; height: 210px; }

/* Pie legend */
.dash-pie-legend { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.dash-pie-legend__item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border);
  cursor: pointer; transition: border-color .2s;
}
.dash-pie-legend__item:hover { border-color: var(--red); }
.dash-pie-legend__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dash-pie-legend__name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); }
.dash-pie-legend__pct { font-size: 12px; font-weight: 700; color: var(--text2); min-width: 36px; text-align: right; }
.dash-pie-legend__amt { font-family: 'Space Mono', monospace; font-size: 13px; font-weight: 700; color: var(--yellow); flex-shrink: 0; }

/* Month tx list */
.dash-tx-list { display: flex; flex-direction: column; gap: 6px; max-height: 400px; overflow-y: auto; }
.dash-tx-item { display: flex; align-items: center; padding: 10px 14px; border-radius: var(--radius-sm); gap: 10px; }
.dash-tx-item--ingreso { background: var(--green-soft); border: 1px solid rgba(56,161,105,.2); }
.dash-tx-item--gasto { background: var(--yellow-soft); border: 1px solid rgba(217,119,6,.2); }
.dash-tx-item__day { font-size: 12px; font-family: 'Space Mono', monospace; color: var(--text2); min-width: 26px; }
.dash-tx-item__cat { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; flex-shrink: 0; }
.dash-tx-item--ingreso .dash-tx-item__cat { background: rgba(56,161,105,.2); color: var(--green); }
.dash-tx-item--gasto .dash-tx-item__cat { background: rgba(217,119,6,.2); color: var(--yellow); }
.dash-tx-item__desc { flex: 1; font-size: 13px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.dash-tx-item__amount { font-family: 'Space Mono', monospace; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.dash-tx-item--ingreso .dash-tx-item__amount { color: var(--green); }
.dash-tx-item--gasto .dash-tx-item__amount { color: var(--yellow); }

/* ===== ADMIN PANEL ===== */
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-header__title { font-size: 20px; font-weight: 800; }
.admin-user-list { display: flex; flex-direction: column; gap: 10px; }
.admin-user-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color .2s;
}
.admin-user-card.is-inactive { opacity: .6; }
.admin-user-card__header {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  cursor: pointer; transition: background .15s;
}
.admin-user-card__header:hover { background: var(--surface2); }
.admin-user-card__avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--red);
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: white; flex-shrink: 0;
}
.admin-user-card__info { flex: 1; min-width: 0; }
.admin-user-card__name { font-size: 15px; font-weight: 700; }
.admin-user-card__meta { font-size: 12px; color: var(--text2); margin-top: 2px; }
.admin-user-card__badges { display: flex; gap: 6px; }
.badge {
  padding: 3px 9px; border-radius: 10px; font-size: 11px; font-weight: 700;
}
.badge--admin { background: var(--yellow-soft); color: var(--yellow); border: 1px solid rgba(217,119,6,.3); }
.badge--user { background: var(--surface2); color: var(--text3); border: 1px solid var(--border); }
.badge--active { background: var(--green-soft); color: var(--green); border: 1px solid rgba(56,161,105,.3); }
.badge--inactive { background: var(--red-soft); color: var(--red); border: 1px solid rgba(229,62,62,.3); }
.admin-user-card__toggle { font-size: 12px; color: var(--text3); }
.admin-user-card__body { display: none; padding: 0 18px 18px; border-top: 1px solid var(--border); }
.admin-user-card__body.is-open { display: block; }
.admin-user-card__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.admin-user-card__logs { margin-top: 16px; }
.admin-user-card__logs-title { font-size: 12px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.admin-log-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.admin-log-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 6px; background: var(--bg); font-size: 12px;
}
.admin-log-item__type { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.admin-log-item__type--ingreso { background: var(--green); }
.admin-log-item__type--gasto { background: var(--yellow); }
.admin-log-item__date { color: var(--text2); min-width: 60px; font-family: 'Space Mono', monospace; font-size: 11px; }
.admin-log-item__desc { flex: 1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-log-item__amount { font-family: 'Space Mono', monospace; font-weight: 700; flex-shrink: 0; }
.admin-log-item--ingreso .admin-log-item__amount { color: var(--green); }
.admin-log-item--gasto .admin-log-item__amount { color: var(--yellow); }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.is-open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px; width: 100%; max-width: 440px; box-shadow: var(--shadow);
  transform: translateY(20px); transition: transform .2s; max-height: 90vh; overflow-y: auto;
}
.modal-overlay.is-open .modal-box { transform: translateY(0); }
.modal-box__title { font-size: 17px; font-weight: 800; margin-bottom: 22px; color: var(--text); }
.modal-box__footer { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 6px; }
.modal-box__footer--two { grid-template-columns: 1fr 1fr; }

/* Category drill-down modal */
.cat-modal__header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.cat-modal__dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.cat-modal__tx-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.cat-modal__tx-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); }
.cat-modal__tx-day { font-size: 11px; font-family: 'Space Mono', monospace; color: var(--text2); min-width: 24px; }
.cat-modal__tx-desc { flex: 1; font-size: 13px; color: var(--text); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-modal__tx-amt { font-family: 'Space Mono', monospace; font-size: 13px; font-weight: 700; color: var(--yellow); flex-shrink: 0; }

/* iOS install modal */
.ios-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 400;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.ios-modal-overlay.is-open { opacity: 1; pointer-events: all; }
.ios-modal-box {
  background: var(--surface); border-radius: 20px 20px 0 0; border-top: 1px solid var(--border);
  width: 100%; max-width: 480px; padding: 28px 24px 40px;
  transform: translateY(100%); transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.ios-modal-overlay.is-open .ios-modal-box { transform: translateY(0); }
.ios-modal-box__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.ios-modal-box__header h3 { font-size: 18px; font-weight: 800; color: var(--text); }
.ios-modal-box__close { background: none; border: none; font-size: 22px; color: var(--text2); cursor: pointer; }
.ios-steps { display: flex; flex-direction: column; gap: 12px; }
.ios-step { display: flex; align-items: center; gap: 14px; padding: 13px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.ios-step__num { width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: white; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ios-step__icon { font-size: 24px; flex-shrink: 0; }
.ios-step__text strong { display: block; font-size: 14px; font-weight: 700; color: var(--text); }
.ios-step__text span { font-size: 12px; color: var(--text2); }
.ios-modal-box__note { margin-top: 16px; font-size: 12px; color: var(--text3); text-align: center; }

/* ===== SHARED STATES ===== */
.state-empty { text-align: center; padding: 30px; color: var(--text3); font-size: 14px; }
.state-loading { text-align: center; padding: 20px; color: var(--text2); font-size: 14px; }
.state-no-data { text-align: center; padding: 42px; color: var(--text3); font-size: 14px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 22px; right: 22px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 9px; padding: 13px 18px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
  transform: translateY(70px); opacity: 0; transition: all .3s; z-index: 999; color: var(--text);
}
.toast.is-show { transform: translateY(0); opacity: 1; }
.toast--ok { border-color: var(--green); color: var(--green); }
.toast--err { border-color: var(--red); color: var(--red); }

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) { .dash-charts-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .registro-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .dash-summary-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  .app-header__user, .app-header__install-btn, .app-header__theme-btn, .app-header__admin-btn { display: none !important; }
  .app-header__hamburger { display: flex; }
  .app-header { padding: 0 16px; }
  .app-panel { padding: 16px; }
  .surface-card { padding: 16px; }
  .login-card, .register-card { padding: 32px 24px; margin: 16px; }
  .modal-box__footer { grid-template-columns: 1fr; }
  .admin-user-card__actions { grid-template-columns: 1fr; }
  .dash-month-nav__label { font-size: 16px; }
  .dash-summary-card__value { font-size: 18px; }
}
