@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap");

:root {
  --blue: #2e5bea;
  --blue-deep: #173987;
  --blue-soft: #eaf1ff;
  --cyan: #08b6af;
  --cyan-soft: #e9fbf7;
  --ink: #112250;
  --muted: #66779c;
  --line: #e4eaf5;
  --surface: #ffffff;
  --canvas: #f8faff;
  --success: #16a45a;
  --success-soft: #eafaf0;
  --violet: #7551e8;
  --violet-soft: #f0ebff;
  --warning: #7652dc;
  --shadow: 0 12px 28px rgba(34, 64, 121, 0.08);
}

body[data-theme="dark"] {
  --ink: #f2f6ff;
  --muted: #aebbd6;
  --line: #26375a;
  --surface: #131f38;
  --canvas: #0c1425;
  --blue-soft: #162c5c;
  --cyan-soft: #123b40;
  --success-soft: #123d29;
  --violet-soft: #30255b;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
[hidden] { display: none !important; }
body {
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  background: var(--canvas);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.page-shell { min-height: 100vh; }
.noise { display: none; }
#app { min-height: 100vh; }

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--blue-deep); }
.brand-mark {
  width: 32px;
  height: 36px;
  position: relative;
  display: block;
}
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  width: 25px;
  height: 10px;
  border-radius: 4px;
  transform: rotate(-43deg);
  background: linear-gradient(135deg, #48d8e4, #1b8ef6);
}
.brand-mark::before { top: 5px; left: 3px; }
.brand-mark::after { bottom: 5px; right: 3px; background: linear-gradient(135deg, #5544e9, #2373ea); }
.brand-name { font-family: Outfit, sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -0.04em; }

.app-frame { min-height: 100vh; background: var(--canvas); }
.top-nav {
  height: 74px;
  padding: 0 clamp(20px, 4vw, 58px);
  display: flex;
  align-items: center;
  gap: 42px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top-nav .brand { min-width: 230px; }
.nav-links { align-self: stretch; display: flex; align-items: stretch; gap: 8px; }
.nav-link {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  min-width: 82px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
}
.nav-link.active { color: var(--blue); }
.nav-link.active::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.round-button, .profile-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 7px;
  display: inline-grid;
  place-items: center;
}
.notification { position: relative; }
.notification-badge { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--violet); font-size: 10px; font-weight: 700; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #2367df, #3a4ba8); font-size: 13px; font-weight: 700; }

.dashboard { max-width: 1440px; margin: 0 auto; padding: 26px clamp(20px, 4vw, 52px) 48px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; font-family: Outfit, sans-serif; font-size: 24px; letter-spacing: -0.03em; }
.page-heading p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.period-picker, .health-pill, .theme-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
}
.period-picker { color: var(--cyan); }
.health-pill { color: var(--success); }
.theme-button { color: var(--muted); }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.summary-card {
  min-height: 118px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
.summary-icon { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); }
.summary-icon.cyan { color: var(--cyan); background: var(--cyan-soft); }
.summary-icon.violet { color: var(--violet); background: var(--violet-soft); }
.summary-card p, .summary-card small { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.summary-card strong { display: block; margin: 4px 0; font-family: Outfit, sans-serif; font-size: 22px; letter-spacing: -0.03em; }
.summary-card .positive { color: var(--success); }
.progress-track { width: 100%; height: 8px; margin-top: 10px; overflow: hidden; border-radius: 8px; background: #dce5fc; }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1b80f2, #2e59e6); }
.summary-progress { width: 100%; }
.summary-progress .progress-caption { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--blue); font-size: 11px; font-weight: 700; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2.5fr) minmax(270px, 0.95fr); gap: 22px; margin-top: 16px; }
.surface-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.chart-card { min-height: 300px; padding: 18px 18px 12px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-heading h2 { margin: 0; font-family: Outfit, sans-serif; font-size: 16px; letter-spacing: -0.02em; }
.legend { display: flex; gap: 16px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.legend i { width: 12px; height: 7px; margin-right: 5px; display: inline-block; border-radius: 8px; background: var(--cyan); }
.legend i.pending { background: #dce3f7; }
.chart-year { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 12px; font-weight: 700; }
.chart { height: 190px; padding: 16px 8px 0 35px; position: relative; display: flex; align-items: end; justify-content: space-between; gap: 11px; border-bottom: 1px solid #cbd6ed; background: repeating-linear-gradient(to bottom, transparent 0, transparent 37px, #dbe5f5 38px, transparent 39px); }
.chart::before { content: "Meta anual"; position: absolute; top: 44px; left: 38px; right: 0; color: var(--blue); border-top: 1px dashed #3f70ff; text-align: right; font-size: 11px; font-weight: 700; }
.bar-col { height: 100%; flex: 1; min-width: 22px; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 600; }
.bar { width: min(100%, 19px); height: var(--bar-height); min-height: 4px; border-radius: 5px 5px 0 0; background: #dbe3f7; }
.bar.paid { background: linear-gradient(90deg, #0faea8, #06c4c1); box-shadow: 0 4px 9px rgba(8, 182, 175, 0.22); }
.goal-card { padding: 18px; text-align: center; }
.goal-card .card-heading { text-align: left; }
.donut { width: 142px; height: 142px; margin: 14px auto 9px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--cyan) var(--progress), #e8edf6 0); position: relative; }
.donut::after { content: ""; position: absolute; width: 104px; height: 104px; border-radius: 50%; background: var(--surface); }
.donut-content { z-index: 1; }
.donut-content strong { display: block; font-family: Outfit, sans-serif; font-size: 28px; letter-spacing: -0.05em; }
.donut-content small { font-size: 11px; font-weight: 600; }
.goal-card p { margin: 0; color: var(--muted); font-size: 13px; }
.goal-note { margin-top: 9px !important; padding: 10px; border-radius: 7px; color: var(--success) !important; background: var(--success-soft); font-size: 11px !important; font-weight: 700; }

.bottom-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr); gap: 22px; margin-top: 16px; }
.payments-card { overflow: hidden; }
.payments-card .card-heading { padding: 16px 18px 12px; }
.text-link { border: 0; padding: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 700; }
.payment-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.payment-table tr { border-top: 1px solid var(--line); }
.payment-table td { padding: 11px 14px; vertical-align: middle; }
.payment-table td:first-child { padding-left: 22px; color: var(--muted); white-space: nowrap; }
.payment-check { width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; background: var(--success); }
.payment-table strong { font-size: 13px; }
.receipt-thumb { width: 30px; height: 37px; display: block; object-fit: cover; border: 1px solid var(--line); border-radius: 3px; background: #f4f5f8; }
.status { display: inline-flex; padding: 5px 10px; border-radius: 6px; font-size: 10px; font-weight: 700; }
.status.paid { color: var(--success); background: var(--success-soft); }
.status.pending { color: var(--warning); background: var(--violet-soft); }
.payment-menu { border: 0; padding: 4px; color: var(--muted); background: transparent; }

.register-card { padding: 18px; background: linear-gradient(145deg, #f7f7ff 0%, #eff1ff 100%); }
body[data-theme="dark"] .register-card { background: linear-gradient(145deg, #192448 0%, #111d3c 100%); }
.register-title { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; font-family: Outfit, sans-serif; font-size: 16px; font-weight: 700; }
.register-title span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #6940da, #2e5bea); }
.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: grid; gap: 6px; }
.field label { color: var(--ink); font-size: 11px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 38px; padding: 9px 10px; border: 1px solid #d6dfee; border-radius: 7px; outline: none; color: var(--ink); background: var(--surface); font-size: 12px; }
.field textarea { min-height: 58px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46, 91, 234, 0.12); }
.drop-zone { margin-top: 13px; padding: 13px; border: 1px dashed #b9caea; border-radius: 9px; text-align: center; background: rgba(255,255,255,.5); }
body[data-theme="dark"] .drop-zone { background: rgba(10, 18, 42, .26); }
.drop-zone .icon { width: 28px; height: 28px; color: #8091b3; }
.drop-zone p { margin: 4px 0; color: var(--blue-deep); font-size: 12px; font-weight: 700; }
.drop-zone small { color: var(--muted); font-size: 10px; }
.drop-zone input { width: 100%; margin-top: 8px; font-size: 11px; }
.btn { border: 0; border-radius: 7px; min-height: 38px; padding: 0 14px; font-weight: 700; font-size: 13px; }
.btn-primary { color: #fff; background: linear-gradient(100deg, #234cdf, #315df5); box-shadow: 0 7px 13px rgba(46, 91, 234, 0.2); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { color: var(--blue); background: var(--blue-soft); }
.save-button { width: 100%; margin-top: 12px; }

.view-panel { max-width: 1120px; margin: 0 auto; }
.view-panel .surface-card { padding: 24px; }
.view-panel .payment-table { margin-top: 16px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr); gap: 18px; }
.settings-card { padding: 20px; }
.settings-card h2 { margin: 0 0 6px; font-family: Outfit, sans-serif; font-size: 20px; }
.settings-card p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.qr-box { display: grid; grid-template-columns: 146px minmax(0, 1fr); align-items: center; gap: 18px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.qr-box img { width: 146px; border-radius: 7px; background: #fff; }
.qr-box code { display: none; }
.toggle-state { display: inline-flex; align-items: center; gap: 7px; margin: 10px 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.toggle-state i { width: 10px; height: 10px; border-radius: 50%; background: #94a3bf; }
.toggle-state.on i { background: var(--success); }
.totp-form { display: flex; align-items: end; gap: 10px; margin-top: 16px; }
.totp-form .field { flex: 1; }
.devices-list { display: grid; gap: 10px; margin-top: 18px; }
.device-row { padding: 12px; border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.device-row strong { display: block; font-size: 13px; }
.device-row span { color: var(--muted); font-size: 11px; }

.mobile-nav { display: none; }

.login-page { min-height: 100vh; padding: 6vh clamp(22px, 9vw, 190px); display: grid; grid-template-columns: minmax(380px, 520px) minmax(430px, 1fr); align-items: center; gap: clamp(50px, 13vw, 210px); background: radial-gradient(circle at 18% 10%, #d7e6ff 0, #ecf4ff 21%, transparent 46%), linear-gradient(100deg, #f7fbff, #fff 72%); }
body[data-theme="dark"] .login-page { background: radial-gradient(circle at 18% 10%, #1d3e76 0, #111e3a 32%, transparent 54%), var(--canvas); }
.login-column { display: grid; gap: 28px; }
.login-brand { justify-self: center; }
.login-brand .brand-name { font-size: 29px; }
.login-card { padding: 35px 44px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 15px 34px rgba(47, 72, 135, .13); }
.login-card h1 { margin: 0; text-align: center; font-family: Outfit, sans-serif; font-size: 22px; }
.login-card > p { margin: 8px 0 28px; color: var(--muted); text-align: center; font-size: 14px; }
.login-field { position: relative; }
.login-field .icon { position: absolute; left: 13px; top: 32px; color: #7e8dab; width: 19px; height: 19px; }
.login-field input { min-height: 48px; padding-left: 42px; border-radius: 7px; font-size: 14px; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 24px; color: var(--muted); font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 7px; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.login-submit { width: 100%; min-height: 48px; border-radius: 7px; font-size: 15px; }
.login-status { min-height: 20px; margin-top: 13px; color: var(--muted); text-align: center; font-size: 12px; }
.security-note { display: flex; align-items: center; gap: 15px; padding: 17px; border: 1px solid #cbd9ff; border-radius: 10px; background: rgba(255,255,255,.55); color: var(--blue-deep); }
.security-note .note-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #315df5, #2247db); }
.security-note strong { display: block; margin-bottom: 4px; font-size: 12px; }
.security-note span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.login-footer { color: var(--muted); text-align: center; font-size: 12px; }
.login-visual { min-height: 560px; padding: 34px; border: 1px solid var(--line); border-radius: 0 32px 32px 0; background: rgba(255,255,255,.58); display: grid; place-items: center; }
.login-security { width: min(100%, 550px); padding: 48px 54px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 12px 28px rgba(47, 72, 135, .09); text-align: center; }
.login-security h2 { margin: 20px 0 8px; font-family: Outfit, sans-serif; font-size: 25px; }
.login-security p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.lock-orb { width: 72px; height: 72px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: radial-gradient(circle at 50% 35%, #fff, #dae7ff); box-shadow: inset 0 0 0 1px #dce7fc; }
.security-callout { margin-top: 25px; padding: 15px; border: 1px solid #c7d7ff; border-radius: 7px; display: flex; align-items: center; gap: 12px; text-align: left; color: var(--muted); font-size: 13px; line-height: 1.45; }
.security-callout .icon { color: var(--blue); }
.visual-theme { margin-top: 24px; }

@media (max-width: 1080px) {
  .top-nav { gap: 14px; }
  .top-nav .brand { min-width: auto; }
  .nav-link { min-width: auto; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom-grid { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: minmax(360px, 520px) 1fr; gap: 36px; padding-inline: 5vw; }
}

@media (max-width: 760px) {
  .top-nav { height: 72px; padding: 0 20px; }
  .top-nav .brand-name { font-size: 19px; }
  .top-nav .brand-mark { transform: scale(.84); transform-origin: left center; margin-right: -5px; }
  .nav-links, .profile-button, .notification-badge { display: none; }
  .top-actions { gap: 0; }
  .dashboard { padding: 20px 14px 94px; }
  .page-heading { align-items: flex-start; margin-bottom: 17px; }
  .page-heading h1 { font-size: 21px; }
  .page-heading p { font-size: 13px; }
  .heading-actions .theme-button { display: none; }
  .period-picker, .health-pill { min-height: 35px; padding: 0 10px; font-size: 11px; }
  .health-pill { display: none; }
  .summary-grid { gap: 10px; }
  .summary-card { min-height: 126px; padding: 12px; align-items: flex-start; gap: 9px; }
  .summary-icon { width: 38px; height: 38px; }
  .summary-icon .icon { width: 19px; height: 19px; }
  .summary-card p, .summary-card small { font-size: 10px; }
  .summary-card strong { font-size: 16px; }
  .summary-progress { width: calc(100% + 37px); margin-left: -37px; margin-top: 50px; }
  .dashboard-grid { grid-template-columns: 1fr; margin-top: 10px; gap: 10px; }
  .chart-card { display: none; }
  .goal-card { min-height: 82px; padding: 12px; display: grid; grid-template-columns: 78px 1fr 18px; align-items: center; text-align: left; }
  .goal-card .card-heading { display: none; }
  .donut { width: 64px; height: 64px; margin: 0; }
  .donut::after { width: 48px; height: 48px; }
  .donut-content strong { font-size: 0; }
  .donut-content strong::after { content: attr(data-mobile); font-size: 13px; }
  .donut-content small { display: none; }
  .goal-card p { font-family: Outfit, sans-serif; color: var(--ink); font-size: 14px; font-weight: 700; }
  .goal-card p::after { content: "\A" attr(data-progress); white-space: pre; color: var(--muted); font-family: "DM Sans", sans-serif; font-size: 10px; font-weight: 600; }
  .goal-note { display: none; }
  .goal-card::after { content: "›"; color: var(--blue); font-size: 28px; }
  .bottom-grid { gap: 10px; margin-top: 10px; }
  .payments-card .card-heading { padding: 13px 14px; }
  .payment-table td { padding: 10px 6px; font-size: 11px; }
  .payment-table td:first-child { padding-left: 12px; }
  .payment-table td:nth-child(4), .payment-table td:nth-child(5) { display: none; }
  .payment-check { width: 15px; height: 15px; }
  .receipt-thumb { width: 22px; height: 28px; }
  .register-card { display: none; }
  .mobile-nav { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; height: 72px; padding: 7px 17px 5px; display: flex; align-items: end; justify-content: space-between; border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -6px 20px rgba(33, 60, 114, .06); }
  .mobile-nav button { width: 47px; border: 0; padding: 0; display: grid; justify-items: center; gap: 3px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 600; }
  .mobile-nav button.active { color: var(--blue); }
  .mobile-nav .mobile-add { width: 47px; height: 47px; margin-top: -25px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2351e7, #5d45e1); box-shadow: 0 7px 12px rgba(43, 77, 213, .28); }
  .mobile-nav .mobile-add .icon { width: 25px; height: 25px; }
  .view-panel .surface-card { padding: 15px; }
  .settings-grid { grid-template-columns: 1fr; }
  .qr-box { grid-template-columns: 1fr; justify-items: center; }
  .totp-form { align-items: stretch; flex-direction: column; }
  .login-page { min-height: 100svh; padding: 30px 20px; display: block; background: radial-gradient(circle at 20% 0, #d7e6ff, #f8fbff 34%, #fff 70%); }
  .login-column { max-width: 480px; margin: 0 auto; gap: 19px; }
  .login-card { padding: 28px 22px; }
  .login-brand .brand-name { font-size: 25px; }
  .login-visual { display: none; }
  .security-note { display: none; }
  .login-footer { margin-top: 8px; }
}
