/* ==========================================================================
   OMEGA FINANCE IA · styles.css
   Cyber-Fintech Design System — OMEGA SYSTEM
   Mobile-first · PWA-ready · Dark Glassmorphism Neón
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

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

body {
  font-family: var(--font-base);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-main);
  background-color: var(--bg-base);
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(0, 229, 255, 0.09) 0%, rgba(0, 229, 255, 0) 60%),
    radial-gradient(90% 50% at 100% 110%, rgba(0, 136, 255, 0.07) 0%, rgba(0, 136, 255, 0) 55%),
    linear-gradient(rgba(0, 229, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 42px 42px, 42px 42px;
  background-attachment: fixed, fixed, fixed, fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom, 0px));
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

ul,
ol {
  list-style: none;
}

::selection {
  background: rgba(0, 229, 255, 0.32);
  color: #ffffff;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.28);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.45);
}

:root {
  --bg-base: #02060D;
  --surface-1: #071324;
  --surface-2: #0B1B32;
  --surface-3: #0E2440;
  --border-neon: rgba(0, 229, 255, 0.22);
  --border-soft: rgba(0, 229, 255, 0.12);
  --border-strong: rgba(0, 229, 255, 0.55);
  --accent: #00E5FF;
  --accent-2: #0088FF;
  --text-main: #E8F7FF;
  --text-soft: #7BA3C7;
  --green: #00E676;
  --yellow: #FFC400;
  --red: #FF3D71;
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --app-max: 480px;
  --header-h: 68px;
  --nav-h: 68px;
  --font-base: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  --glow-cyan-sm: 0 0 12px rgba(0, 229, 255, 0.30);
  --glow-cyan-md: 0 0 20px rgba(0, 229, 255, 0.35);
  --glow-cyan-lg: 0 0 34px rgba(0, 229, 255, 0.30);
}

.hidden,
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(0, 229, 255, 0.65);
  outline-offset: 2px;
}

#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  width: 100%;
  max-width: var(--app-max);
  min-height: var(--header-h);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px 12px;
  background: linear-gradient(180deg, rgba(2, 6, 13, 0.97) 0%, rgba(7, 19, 36, 0.88) 100%);
  border-bottom: 1px solid var(--border-neon);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(0, 229, 255, 0.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex-shrink: 1;
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  object-fit: cover;
  background: #061120;
  border: 1px solid rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.35), inset 0 0 10px rgba(0, 229, 255, 0.15);
}

.brand-text {
  min-width: 0;
  overflow: hidden;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.14em;
  color: var(--text-main);
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.50);
  white-space: nowrap;
}

.brand-subtitle {
  margin-top: 1px;
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.28em;
  color: var(--accent);
  opacity: 0.9;
  white-space: nowrap;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.currency-select {
  min-height: 44px;
  max-width: 92px;
  padding: 0 22px 0 8px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background-color: rgba(2, 10, 20, 0.75);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2300E5FF' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.currency-select:hover {
  border-color: rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.18);
}

.currency-select:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
  outline: none;
}

.currency-select option {
  background: var(--surface-1);
  color: var(--text-main);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 54px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(2, 10, 20, 0.75);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.lang-toggle:hover,
.lang-toggle:active {
  border-color: rgba(0, 229, 255, 0.60);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.25);
}

.install-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 229, 255, 0.55);
  background: linear-gradient(135deg, rgba(0, 136, 255, 0.28) 0%, rgba(0, 229, 255, 0.28) 100%);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.22);
  transition: filter 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.install-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.35);
}

.install-btn:active {
  transform: scale(0.97);
}

main {
  width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
  padding: 14px 14px 26px 14px;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeUp 0.32s ease both;
}

#view-home,
#view-schedule,
#view-expenses {
  width: 100%;
}

.card {
  position: relative;
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-neon);
  background-image:
    radial-gradient(120% 90% at 50% -20%, rgba(0, 229, 255, 0.10) 0%, rgba(0, 229, 255, 0) 62%),
    linear-gradient(160deg, var(--surface-1) 0%, var(--surface-2) 100%);
  background-color: var(--surface-1);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-main);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}

#daily-traffic-card {
  border-color: rgba(0, 229, 255, 0.30);
  background-image:
    radial-gradient(130% 100% at 50% -25%, rgba(0, 229, 255, 0.16) 0%, rgba(0, 229, 255, 0) 62%),
    linear-gradient(160deg, #0A1A30 0%, var(--surface-1) 100%);
  box-shadow: var(--shadow-card), 0 0 44px rgba(0, 229, 255, 0.08);
}

#daily-traffic-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 229, 255, 0.85) 50%, transparent 100%);
  opacity: 0.85;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  flex: 0 0 7px;
}

.status-green {
  color: var(--green);
  background: rgba(0, 230, 118, 0.10);
  border-color: rgba(0, 230, 118, 0.38);
  box-shadow: 0 0 14px rgba(0, 230, 118, 0.16);
}

.status-yellow {
  color: var(--yellow);
  background: rgba(255, 196, 0, 0.10);
  border-color: rgba(255, 196, 0, 0.40);
  box-shadow: 0 0 14px rgba(255, 196, 0, 0.16);
}

.status-red {
  color: var(--red);
  background: rgba(255, 61, 113, 0.10);
  border-color: rgba(255, 61, 113, 0.42);
  box-shadow: 0 0 14px rgba(255, 61, 113, 0.18);
}

.hero-label {
  margin-top: 16px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.hero-amount {
  margin-top: 2px;
  font-size: 44px;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.55), 0 0 48px rgba(0, 229, 255, 0.28);
}

.hero-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: rgba(0, 229, 255, 0.045);
}

.metric-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-soft);
  line-height: 1.3;
}

.metric-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.metric-value.danger {
  color: var(--red);
  text-shadow: 0 0 14px rgba(255, 61, 113, 0.40);
}

.debt-progress {
  margin-top: 16px;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.progress-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.progress-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
}

.progress-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(0, 229, 255, 0.07);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2) 0%, var(--accent) 100%);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.60);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.config-card {
  padding-top: 14px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(2, 6, 13, 0.55);
  margin-bottom: 16px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--text-main);
  border-color: rgba(0, 229, 255, 0.55);
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.16) 0%, rgba(0, 229, 255, 0.05) 100%);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.25), inset 0 0 12px rgba(0, 229, 255, 0.08);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.55);
}

.tab-panel {
  display: block;
  animation: fadeUp 0.25s ease both;
}

.input,
.textarea,
.select-input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background-color: rgba(2, 10, 20, 0.72);
  color: var(--text-main);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(123, 163, 199, 0.62);
}

.input:hover,
.textarea:hover,
.select-input:hover {
  border-color: rgba(0, 229, 255, 0.30);
}

.input:focus,
.textarea:focus,
.select-input:focus {
  border-color: var(--border-strong);
  background-color: rgba(2, 14, 28, 0.92);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12), 0 0 18px rgba(0, 229, 255, 0.18);
}

.textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.55;
  padding: 13px 14px;
}

.select-input {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2300E5FF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.select-input option {
  background: var(--surface-1);
  color: var(--text-main);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.income-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 10px;
  align-items: end;
}

.block {
  margin-top: 22px;
}

.block-title {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.25s ease, filter 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn:active {
  transform: scale(0.985);
}

.btn-primary {
  color: #02121A;
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 100%);
  border-color: rgba(0, 229, 255, 0.60);
  box-shadow: 0 8px 24px rgba(0, 229, 255, 0.28), 0 0 0 1px rgba(0, 229, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.40);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 30px rgba(0, 229, 255, 0.40), 0 0 0 1px rgba(0, 229, 255, 0.60), inset 0 1px 0 rgba(255, 255, 255, 0.40);
}

.btn-ghost {
  color: var(--text-soft);
  background: transparent;
  border-color: var(--border-soft);
}

.btn-ghost:hover {
  color: var(--text-main);
  border-color: rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.15);
}

#btn-analyze-ai {
  margin-top: 14px;
}

#btn-calculate-plan {
  margin-top: 22px;
}

#btn-reset-month {
  margin-top: 16px;
}

.ai-response {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-neon);
  background: rgba(0, 229, 255, 0.05);
  box-shadow: inset 0 0 26px rgba(0, 229, 255, 0.06), 0 0 18px rgba(0, 229, 255, 0.10);
  animation: fadeUp 0.35s ease both;
}

.ai-response-label {
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
}

.ai-response-text {
  font-size: 14px;
  line-height: 1.62;
  color: var(--text-main);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.debt-form {
  display: grid;
  grid-template-columns: 1fr 92px 46px;
  gap: 8px;
  align-items: stretch;
}

.btn-add {
  display: grid;
  place-items: center;
  width: 46px;
  min-height: 46px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 229, 255, 0.50);
  background: rgba(0, 229, 255, 0.10);
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.15);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.btn-add:hover {
  background: rgba(0, 229, 255, 0.18);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.30);
}

.btn-add:active {
  transform: scale(0.95);
}

.debts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.debts-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(0, 229, 255, 0.045);
  font-size: 13.5px;
  color: var(--text-main);
  animation: fadeUp 0.25s ease both;
}

.debt-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.debt-item-amount {
  font-weight: 700;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.debt-remove {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 61, 113, 0.35);
  background: rgba(255, 61, 113, 0.08);
  color: var(--red);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.debt-remove:hover {
  background: rgba(255, 61, 113, 0.16);
  box-shadow: 0 0 14px rgba(255, 61, 113, 0.28);
}

.priority-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.priority-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 8px 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.07) 0%, rgba(0, 229, 255, 0.02) 100%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.priority-item:hover {
  border-color: rgba(0, 229, 255, 0.32);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.10);
}

.priority-order {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.18);
}

.priority-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.prio-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(2, 10, 20, 0.60);
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.prio-btn:hover,
.prio-btn:active {
  color: var(--accent);
  border-color: rgba(0, 229, 255, 0.50);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.22);
}

.brand-footer {
  margin: 4px 0 2px 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}

.brand-footer p {
  margin-bottom: 4px;
}

.brand-footer a {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: text-shadow 0.2s ease, color 0.2s ease;
}

.brand-footer a:hover {
  color: #FFFFFF;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.65);
}

.brand-footer-link {
  display: inline-block;
  font-size: 10.5px;
  opacity: 0.9;
}

.breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(0, 229, 255, 0.035);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.breakdown-row:hover {
  border-color: rgba(0, 229, 255, 0.28);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.08);
}

.dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.dot-food { color: var(--green); }
.dot-debt { color: var(--red); }
.dot-essentials { color: var(--yellow); }
.dot-savings { color: var(--accent); }

.breakdown-label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breakdown-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.week-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: linear-gradient(160deg, rgba(11, 27, 50, 0.92) 0%, rgba(7, 19, 36, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.week-card:hover {
  border-color: rgba(0, 229, 255, 0.30);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.08);
}

.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(0, 229, 255, 0.14);
}

.week-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.40);
}

.week-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.check-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 2px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.18s ease;
}

.check-item:hover {
  background: rgba(0, 229, 255, 0.045);
}

.check-item input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.check-box {
  position: relative;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 6px;
  border: 1.5px solid rgba(0, 229, 255, 0.35);
  background: rgba(2, 10, 20, 0.65);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.check-box::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 5px;
  border-left: 2px solid #02121A;
  border-bottom: 2px solid #02121A;
  transform: translate(-50%, -60%) rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.check-item input:checked ~ .check-box {
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 100%);
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.50);
}

.check-item input:checked ~ .check-box::after {
  transform: translate(-50%, -60%) rotate(-45deg) scale(1);
}

.check-item input:focus-visible ~ .check-box {
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.25);
}

.check-label {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.35;
  transition: color 0.2s ease;
}

.check-item input:checked ~ .check-label {
  color: var(--text-soft);
  text-decoration: line-through;
  text-decoration-color: rgba(123, 163, 199, 0.55);
}

.expense-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.expense-amount {
  min-height: 58px;
  padding: 12px 14px;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.01em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.40);
}

.expense-amount::placeholder {
  color: rgba(0, 229, 255, 0.45);
  font-weight: 700;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 86px;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: linear-gradient(160deg, rgba(0, 229, 255, 0.07) 0%, rgba(0, 229, 255, 0.02) 100%);
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
}

.cat-btn:hover,
.cat-btn:active {
  transform: translateY(-1px);
  border-color: rgba(0, 229, 255, 0.60);
  background: linear-gradient(160deg, rgba(0, 229, 255, 0.12) 0%, rgba(0, 229, 255, 0.04) 100%);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.22), inset 0 0 18px rgba(0, 229, 255, 0.06);
}

.cat-btn:active {
  transform: scale(0.975);
}

.cat-icon {
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.40));
}

.cat-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  line-height: 1.25;
  color: var(--text-soft);
  transition: color 0.2s ease;
}

.cat-btn:hover .cat-label {
  color: var(--text-main);
}

.expenses-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.expenses-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(0, 229, 255, 0.04);
  font-size: 13.5px;
  color: var(--text-main);
  animation: fadeUp 0.25s ease both;
}

.expenses-list li.empty-state {
  justify-content: center;
  text-align: center;
  font-style: italic;
  color: var(--text-soft);
  background: transparent;
  border-style: dashed;
  border-color: rgba(0, 229, 255, 0.16);
}

.expense-item-icon {
  font-size: 16px;
  line-height: 1;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.35));
}

.expense-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.expense-item-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-item-time {
  font-size: 10.5px;
  color: var(--text-soft);
}

.expense-item-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 120;
  width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) 10px;
  background: linear-gradient(180deg, rgba(7, 19, 36, 0.94) 0%, rgba(2, 6, 13, 0.99) 100%);
  border-top: 1px solid var(--border-neon);
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.55), 0 -1px 0 rgba(0, 229, 255, 0.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  padding: 6px 4px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.nav-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: filter 0.22s ease;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(0, 229, 255, 0.045);
}

.nav-btn.active {
  color: var(--accent);
  border-color: rgba(0, 229, 255, 0.30);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: inset 0 0 18px rgba(0, 229, 255, 0.10), 0 0 18px rgba(0, 229, 255, 0.14);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.55);
}

.nav-btn.active svg {
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.75));
}

#ios-install-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(2, 6, 13, 0.78);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn 0.22s ease both;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  padding: 22px 20px 20px 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-neon);
  background-image:
    radial-gradient(120% 90% at 50% -20%, rgba(0, 229, 255, 0.12) 0%, rgba(0, 229, 255, 0) 62%),
    linear-gradient(160deg, var(--surface-2) 0%, var(--surface-1) 100%);
  background-color: var(--surface-2);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.62), 0 0 44px rgba(0, 229, 255, 0.14);
  animation: sheetUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-title {
  margin-bottom: 14px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-main);
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.45);
}

.modal-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
  padding-left: 22px;
  list-style: decimal;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-main);
}

.modal-steps li {
  padding-left: 4px;
}

.modal-steps li::marker {
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.45);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheetUp {
  from { opacity: 0; transform: translateY(28px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 14px rgba(0, 229, 255, 0.25); }
  50% { box-shadow: 0 0 26px rgba(0, 229, 255, 0.50); }
}

@media (min-width: 400px) {
  :root { --header-h: 70px; }
  main { padding: 16px 16px 28px 16px; }
  .card { padding: 20px 18px; }
  .brand-logo { width: 40px; height: 40px; flex-basis: 40px; }
  .brand-title { font-size: 16px; }
  .hero-amount { font-size: 50px; }
  .cat-grid { gap: 12px; }
  .cat-btn { min-height: 92px; }
}

@media (max-width: 359px) {
  :root { --header-h: 108px; }
  #app-header { flex-wrap: wrap; justify-content: center; row-gap: 8px; padding-left: 10px; padding-right: 10px; }
  .header-controls { width: 100%; justify-content: center; }
  main { padding: 10px 10px 22px 10px; }
  .card { padding: 16px 12px; }
  .hero-amount { font-size: 38px; }
  .hero-metrics { gap: 8px; }
  .metric { padding: 10px 10px; }
  .metric-value { font-size: 15px; }
  .income-row { grid-template-columns: 1fr; }
  .debt-form { grid-template-columns: 1fr 76px 46px; gap: 6px; }
  .priority-item { gap: 8px; padding-left: 8px; }
  .priority-actions { gap: 4px; }
  .cat-btn { min-height: 80px; }
}

@media (min-width: 481px) {
  body { background-attachment: fixed, fixed, fixed, fixed; }
  #app-header, #bottom-nav { border-left: 1px solid rgba(0, 229, 255, 0.10); border-right: 1px solid rgba(0, 229, 255, 0.10); }
  main { padding-top: 20px; }
  .card { box-shadow: 0 14px 38px rgba(0, 0, 0, 0.50), 0 0 0 1px rgba(0, 229, 255, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.035); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}


/* ==========================================================================
   HEADER COMPACTO EN MÓVILES (<= 430px)
   Evita que el subtítulo "FINANCE IA" se recorte cuando aparece "Instalar".
   Se mantiene min-height: 44px en todos los controles (área táctil segura).
   ========================================================================== */

@media (max-width: 430px) {
  .header-controls {
    gap: 4px;
  }

  .currency-select {
    max-width: 82px;
    padding: 0 18px 0 6px;
    font-size: 13px;
    min-height: 44px;
  }

  .lang-toggle {
    padding: 0 6px;
    min-width: 46px;
    font-size: 10.5px;
    letter-spacing: 0.03em;
    min-height: 44px;
  }

  .install-btn {
    padding: 0 8px;
    font-size: 10.5px;
    letter-spacing: 0.02em;
    min-height: 44px;
  }
}
