/* ============================
   WEBAPP — SpendIS
   Variables & Reset
   ============================ */
:root {
    --primary:       #0F3D2E;
    --primary-l:     #1a5c44;
    --secondary:     #FFD750;
    --bg:            #0b2a1f;
    --surface:       rgba(255,255,255,0.07);
    --surface-hover: rgba(255,255,255,0.12);
    --border:        rgba(255,255,255,0.12);
    --gold-dim:      rgba(255,215,80,0.18);
    --text:          rgba(255,255,255,0.90);
    --text-muted:    rgba(255,255,255,0.52);
    --green:         #4caf50;
    --red:           #ef5350;
    --ease:          cubic-bezier(0.4,0,0.2,1);
    --r:             14px;
    --sidebar-w:     250px;
}

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

/* ============================
   LOGIN PAGE
   ============================ */
.login-body {
    font-family: 'Montserrat', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0F3D2E 0%, #1a5c44 50%, #c9a820 100%);
    position: relative;
    overflow: hidden;
}

.futur-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 65% 45% at 85% 8%, rgba(255,215,80,0.28) 0%, transparent 70%),
        radial-gradient(ellipse 45% 35% at 8% 88%, rgba(15,61,46,0.6)   0%, transparent 70%);
    filter: blur(22px);
}

.login-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: rgba(255,255,255,0.10);
    backdrop-filter: blur(20px);
    border: 1.5px solid rgba(255,255,255,0.20);
    border-radius: 24px;
    padding: 44px 36px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    animation: fadeInUp 0.7s cubic-bezier(0.4,0,0.2,1) both;
}

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

.login-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    border: 2.5px solid #FFD750;
    box-shadow: 0 0 20px rgba(255,215,80,0.45);
    margin-bottom: 16px;
    animation: float 3.5s ease-in-out infinite;
}

@keyframes float {
    0%,100% { transform:translateY(0); }
    50%      { transform:translateY(-7px); }
}

.login-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-shadow: 0 0 14px rgba(255,215,80,0.55);
    margin-bottom: 8px;
}

.logo-w { color: #fff; }
.logo-g { color: #FFD750; }

.login-sub {
    color: rgba(255,255,255,0.65);
    font-size: 0.85rem;
    margin-bottom: 32px;
}

.login-error {
    background: rgba(239,83,80,0.18);
    border: 1px solid rgba(239,83,80,0.45);
    color: #ffb3b3;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.88rem;
    margin-bottom: 16px;
    text-align: left;
}

.login-loading {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background: rgba(255,255,255,0.95);
    color: #333;
    border: none;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.97rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
    box-shadow: 0 4px 18px rgba(0,0,0,0.2);
}

.btn-google:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(0,0,0,0.3);
}

.btn-google:disabled { opacity: 0.6; cursor: not-allowed; }

.google-icon { width: 22px; height: 22px; }

.login-footer-text {
    color: rgba(255,255,255,0.45);
    font-size: 0.78rem;
    margin-top: 20px;
    line-height: 1.5;
}

.login-back {
    display: inline-block;
    margin-top: 20px;
    color: rgba(255,255,255,0.5);
    font-size: 0.82rem;
    text-decoration: none;
    transition: color 0.2s;
}
.login-back:hover { color: #FFD750; }

/* ============================
   APP LAYOUT
   ============================ */
.webapp-body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: linear-gradient(180deg, #0a2217 0%, #0e3025 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 200;
    transition: transform 0.28s var(--ease);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo-img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid #FFD750;
    box-shadow: 0 0 10px rgba(255,215,80,0.35);
}

.sidebar-logo-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.70);
    text-decoration: none;
    font-size: 0.90rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, transform 0.15s;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 1.0em;
    transition: transform 0.15s;
}

.nav-item:hover {
    background: var(--surface-hover);
    color: #fff;
}

.nav-item.active {
    background: rgba(255,215,80,0.15);
    color: #FFD750;
    font-weight: 700;
}

.nav-item.active i { transform: scale(1.1); }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px;
    border-top: 1px solid var(--border);
    min-width: 0;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,215,80,0.5);
    flex-shrink: 0;
}

.user-avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-l);
    border: 2px solid rgba(255,215,80,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #FFD750;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.user-name  { font-size: 0.80rem; font-weight: 600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-email { font-size: 0.70rem; color: var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.logout-form { flex-shrink: 0; }

.btn-logout {
    background: none;
    border: none;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 1rem;
    transition: color 0.2s, background 0.2s;
}
.btn-logout:hover { color: var(--red); background: rgba(239,83,80,0.12); }

/* ── Overlay ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 199;
}

/* ── Main wrapper ── */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    height: 58px;
    background: rgba(10,34,23,0.95);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: fadeInDown 0.5s var(--ease) both;
}

@keyframes fadeInDown {
    from { opacity:0; transform:translateY(-20px); }
    to   { opacity:1; transform:translateY(0); }
}

.topbar-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}
.topbar-menu-btn:hover { background: var(--surface); }

.topbar-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #FFD750;
    text-shadow: 0 0 10px rgba(255,215,80,0.4);
    flex: 1;
}

.topbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Flash messages ── */
.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: flashIn 0.4s var(--ease) both;
}

@keyframes flashIn {
    from { opacity:0; transform:translateY(-8px); }
    to   { opacity:1; transform:translateY(0); }
}

.flash-success { background: rgba(76,175,80,0.18); border-bottom: 1px solid rgba(76,175,80,0.3); color: #a8f0c0; }
.flash-error   { background: rgba(239,83,80,0.18); border-bottom: 1px solid rgba(239,83,80,0.3); color: #ffb3b3; }

/* ── Main content ── */
.main-content {
    flex: 1;
    padding: 28px 28px 48px;
    max-width: 1200px;
}

/* ============================
   BUTTONS
   ============================ */
.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
}

.btn-sm:hover { transform: translateY(-1px); filter: brightness(1.1); }

.btn-primary { background: #FFD750; color: var(--primary); }
.btn-outline  {
    background: transparent;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.22);
}
.btn-outline:hover { border-color: #FFD750; color: #FFD750; }
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-warning { background: rgba(255,152,0,0.22); color: #ffa726; border: 1px solid rgba(255,152,0,0.35); }
.btn-danger  { background: rgba(239,83,80,0.22); color: #ef5350; border: 1px solid rgba(239,83,80,0.35); }
.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.88rem;
    transition: color 0.2s, background 0.2s;
}
.btn-icon:hover { color: #fff; background: var(--surface); }
.btn-icon-danger:hover { color: var(--red); background: rgba(239,83,80,0.12); }
.btn-icon-del {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 0.82rem;
    transition: color 0.2s, background 0.2s;
}
.btn-icon-del:hover { color: var(--red); background: rgba(239,83,80,0.12); }

.btn-primary-lg {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #FFD750;
    color: var(--primary);
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 18px rgba(255,215,80,0.35);
}
.btn-primary-lg:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(255,215,80,0.5); }

.btn-danger-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: transparent;
    color: var(--red);
    border: 1.5px solid var(--red);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.btn-danger-outline:hover { background: rgba(239,83,80,0.12); transform: translateY(-1px); }

/* ============================
   FORMS
   ============================ */
.form-page-wrap {
    max-width: 720px;
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 32px;
    animation: fadeInUp 0.5s var(--ease) both;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.72);
    margin-bottom: 7px;
}

.req { color: #FFD750; }

.form-input {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    font-family: inherit;
    font-size: 0.93rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

.form-input::placeholder { color: rgba(255,255,255,0.32); }

.form-input:focus {
    border-color: #FFD750;
    box-shadow: 0 0 14px rgba(255,215,80,0.18);
    background: rgba(255,255,255,0.10);
}

select.form-input option { background: #0e2d1e; color: #fff; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-section { margin-top: 28px; }

.form-section-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #FFD750;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    align-items: center;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #FFD750;
    color: var(--primary);
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.93rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    box-shadow: 0 4px 16px rgba(255,215,80,0.32);
}
.btn-submit:hover { transform: translateY(-2px); filter: brightness(1.07); }

.btn-submit-sm {
    padding: 10px 18px;
    background: #FFD750;
    color: var(--primary);
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s;
    white-space: nowrap;
}
.btn-submit-sm:hover { filter: brightness(1.08); }

.btn-cancel {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    padding: 12px 0;
    transition: color 0.2s;
}
.btn-cancel:hover { color: var(--text); }

/* Transaction type toggle */
.type-toggle-group {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
}

.type-btn {
    flex: 1;
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.type-btn.active.expense-btn {
    background: rgba(239,83,80,0.18);
    border-color: rgba(239,83,80,0.5);
    color: #ef5350;
}

.type-btn.active.income-btn {
    background: rgba(76,175,80,0.18);
    border-color: rgba(76,175,80,0.5);
    color: #4caf50;
}

/* Forecast grid */
.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.forecast-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
}

.forecast-cat-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.70);
    margin-bottom: 8px;
}

.cat-icon { font-size: 1.1em; }

.forecast-input { padding: 8px 10px; }

/* Collapsible */
.collapsible-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 24px;
    overflow: hidden;
}

.collapsible-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    background: none;
    border: none;
    color: var(--secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.collapsible-trigger:hover { background: var(--surface-hover); }

.collapsible-arrow { margin-left: auto; transition: transform 0.2s; }

.collapsible-body { padding: 16px 18px; border-top: 1px solid var(--border); }

.inline-form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.inline-form-row .form-input { flex: 1; min-width: 120px; }

.icon-input  { max-width: 70px; text-align: center; }
.color-input { max-width: 56px; padding: 6px 4px; height: 44px; cursor: pointer; }
.type-select { max-width: 120px; }

/* ============================
   PLAN SELECTOR BAR
   ============================ */
.plan-selector-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.plan-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.plan-form { flex: 1; min-width: 180px; }

.plan-select {
    width: 100%;
    padding: 9px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}
.plan-select:focus { border-color: #FFD750; }
.plan-select option { background: #0e2d1e; }

/* ============================
   KPI CARDS
   ============================ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
    animation: fadeInUp 0.55s var(--ease) both;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kpi-balance .kpi-icon { background: rgba(255,215,80,0.15); color: #FFD750; }
.kpi-income  .kpi-icon { background: rgba(76,175,80,0.15);  color: var(--green); }
.kpi-expense .kpi-icon { background: rgba(239,83,80,0.15);  color: var(--red); }
.kpi-count   .kpi-icon { background: rgba(33,150,243,0.15); color: #42a5f5; }

.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.kpi-value { font-size: 1.1rem; font-weight: 700; color: var(--text); }

.kpi-balance.positive .kpi-value { color: var(--green); }
.kpi-balance.negative .kpi-value { color: var(--red); }

/* ============================
   CHARTS
   ============================ */
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 22px;
    margin-bottom: 22px;
}

.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.chart-card-header h3 {
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-plan-name {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.chart-wrap { position: relative; }
.pie-wrap   { max-width: 280px; margin: auto; }

.pie-legend {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.pie-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pie-cat    { flex: 1; color: var(--text-muted); }
.pie-amount { font-weight: 600; white-space: nowrap; }

/* ============================
   TRANSACTIONS
   ============================ */
.transactions-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.section-header h3 {
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tx-list { padding: 0 8px; }

.tx-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.18s;
}
.tx-item:last-child { border-bottom: none; }
.tx-item:hover { background: rgba(255,255,255,0.04); }

.tx-left { display: flex; align-items: center; gap: 12px; }

.tx-indicator {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.tx-indicator.income  { background: rgba(76,175,80,0.18);  color: var(--green); }
.tx-indicator.expense { background: rgba(239,83,80,0.18);  color: var(--red); }

.tx-details { display: flex; flex-direction: column; min-width: 0; }
.tx-title   { font-size: 0.88rem; font-weight: 600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:200px; }
.tx-meta    { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }

.tx-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.tx-amount { font-size: 0.92rem; font-weight: 700; }
.tx-amount.income  { color: var(--green); }
.tx-amount.expense { color: var(--red); }

.tx-delete-form { display: flex; }

/* ============================
   PLANS GRID
   ============================ */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.plan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    border-color: rgba(255,215,80,0.3);
}

.plan-closed {
    opacity: 0.72;
    border-color: rgba(255,255,255,0.07);
}

.plan-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.plan-name-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.plan-lock-icon { color: var(--text-muted); font-size: 0.85em; flex-shrink: 0; }

.plan-name {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plan-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-active { background: rgba(76,175,80,0.2); color: var(--green); }
.badge-closed { background: rgba(255,255,255,0.1); color: var(--text-muted); }

.plan-dates {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.80rem;
    color: var(--text-muted);
}

.plan-forecasts-mini { font-size: 0.78rem; }

.forecast-label {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
}

.forecast-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.forecast-tag {
    background: rgba(255,215,80,0.10);
    border: 1px solid rgba(255,215,80,0.22);
    color: rgba(255,215,80,0.80);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.74rem;
}

.forecast-tag-more {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.74rem;
}

.plan-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

/* ============================
   CATEGORIES
   ============================ */
.categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.cat-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}

.cat-section-title {
    font-size: 0.88rem;
    font-weight: 700;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.expense-title { color: var(--red); }
.income-title  { color: var(--green); }

.cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}
.cat-item:last-child { border-bottom: none; }
.cat-item:hover { background: rgba(255,255,255,0.04); }

.cat-left { display: flex; align-items: center; gap: 10px; }

.cat-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 1px solid;
}

.cat-name { font-size: 0.88rem; font-weight: 500; }
.cat-actions { display: flex; gap: 4px; }
.cat-empty { padding: 20px; color: var(--text-muted); font-size: 0.85rem; }

/* ============================
   REPORT
   ============================ */
.report-plan-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.report-dates {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-muted);
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.forecast-table { overflow-x: auto; }

.forecast-table-header,
.forecast-table-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1.5fr 2fr;
    gap: 12px;
    align-items: center;
    padding: 10px 4px;
}

.forecast-table-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 4px;
}

.forecast-table-row {
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.forecast-table-row:last-child { border-bottom: none; }

.fc-cat { font-weight: 600; }
.fc-value { color: var(--text-muted); }
.over-budget   { color: var(--red); font-weight: 700; }
.under-budget  { color: var(--green); font-weight: 700; }

.fc-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.fc-bar {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    transition: width 0.6s var(--ease);
}

.fc-bar-over { background: var(--red); }

.fc-pct {
    position: absolute;
    right: 0;
    font-size: 0.70rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 0 2px;
}

/* ============================
   SETTINGS
   ============================ */
.settings-section { margin-bottom: 28px; }

.settings-section-title {
    font-size: 0.90rem;
    font-weight: 700;
    color: #FFD750;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.danger-title { color: var(--red); }

.currency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.currency-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 10px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
    gap: 4px;
}

.currency-option input { display: none; }

.currency-option.selected {
    border-color: #FFD750;
    background: rgba(255,215,80,0.10);
}

.currency-symbol { font-size: 1.3rem; font-weight: 700; color: #FFD750; }
.currency-code   { font-size: 0.80rem; font-weight: 700; }
.currency-name   { font-size: 0.72rem; color: var(--text-muted); }

.lang-options { display: flex; gap: 12px; }

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: border-color 0.2s, background 0.2s;
}

.lang-option input { display: none; }

.lang-option.selected {
    border-color: #FFD750;
    background: rgba(255,215,80,0.10);
}

.lang-flag { font-size: 1.4rem; }

.settings-danger-zone {
    margin-top: 28px;
    background: var(--surface);
    border: 1px solid rgba(239,83,80,0.22);
    border-radius: var(--r);
    padding: 22px 24px;
}

.account-info-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.account-name  { font-size: 0.92rem; font-weight: 600; }
.account-email { font-size: 0.80rem; color: var(--text-muted); margin-top: 2px; }

/* ============================
   MODAL
   ============================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    background: #0e2d1e;
    border: 1px solid rgba(255,215,80,0.25);
    border-radius: 18px;
    padding: 28px 28px;
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.35s var(--ease) both;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #FFD750;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

/* ============================
   EMPTY STATES
   ============================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 70px 20px;
    text-align: center;
    gap: 14px;
}

.empty-icon {
    font-size: 3.5rem;
    color: rgba(255,215,80,0.35);
    margin-bottom: 6px;
}

.empty-state h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.88rem;
    max-width: 360px;
    line-height: 1.6;
}

.empty-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.empty-mini i { font-size: 1.3rem; opacity: 0.5; }

/* ============================
   SCROLL REVEAL
   ============================ */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-wrapper { margin-left: 0; }
    .topbar-menu-btn { display: flex; }
    .categories-grid { grid-template-columns: 1fr; }
    .report-grid { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .main-content { padding: 18px 16px 40px; }
}

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .plans-grid { grid-template-columns: 1fr; }
    .currency-grid { grid-template-columns: repeat(2, 1fr); }
    .lang-options { flex-direction: column; }
    .type-toggle-group { flex-direction: row; }
    .topbar { padding: 0 14px; }
    .topbar-title { font-size: 0.9rem; }
}
