/* 
   GLOBAL STYLES
*/

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

body {
    font-family: Arial, Helvetica, sans-serif;
    min-height: 100vh;
    color: #ffffff;

    background:
        radial-gradient(
            circle at top right,
            rgba(70, 130, 200, 0.25),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #11151c,
            #202832
        );
}


/*
   LOGIN PAGE
*/

.login-page {
    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 20px;
}


/* 
   LOGIN CARD
*/

.login-card {
    width: 100%;
    max-width: 430px;

    padding: 40px;

    background: rgba(30, 36, 45, 0.92);

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 20px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.35);

    backdrop-filter: blur(10px);
}


/* 
   BRAND
*/

.brand {
    text-align: center;
    margin-bottom: 30px;
}

.brand h1 {
    font-size: 2.3rem;
    margin-bottom: 8px;
}

.brand p {
    color: #aeb7c4;
    font-size: 0.95rem;
}


/* 
   FORM
*/

form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 600;
}

.input-group input {
    width: 100%;

    padding: 13px 15px;

    border-radius: 10px;
    border: 1px solid #454d59;

    background: #15191f;
    color: white;

    font-size: 1rem;

    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input::placeholder {
    color: #737c89;
}

.input-group input:focus {
    outline: none;

    border-color: #4da3ff;

    box-shadow:
        0 0 0 3px rgba(77, 163, 255, 0.15);
}


/* 
   BUTTON
*/

.primary-button {
    border: none;
    border-radius: 10px;

    padding: 13px;

    background: #3288d8;
    color: white;

    font-size: 1rem;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.2s,
        opacity 0.2s;
}

.primary-button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.primary-button:active {
    transform: translateY(0);
}


/*
   MESSAGE
*/

.message {
    min-height: 20px;

    text-align: center;

    color: #ff8f8f;

    font-size: 0.9rem;
}


/*
   REGISTER LINK
*/

.register-link {
    text-align: center;

    margin-top: 25px;

    color: #aeb7c4;
}

.register-link a {
    color: #62b2ff;

    font-weight: 600;

    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}


/* 
   MOBILE
*/

@media (max-width: 500px) {

    .login-card {
        padding: 28px 22px;
    }

    .brand h1 {
        font-size: 2rem;
    }
}

/*
   DASHBOARD
*/

.dashboard {
    width: min(1150px, 90%);
    margin: 40px auto;
}

.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h1 {
    margin: 5px 0;
    font-size: 2.2rem;
}

.dashboard-header p:not(.eyebrow) {
    color: #aeb7c4;
}

.eyebrow {
    color: #62b2ff;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
    font-weight: 700;
}


/* Summary cards */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.summary-card {
    padding: 24px;

    background: rgba(30, 36, 45, 0.92);

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 16px;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.2);

    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-label {
    color: #aeb7c4;
    font-size: 0.9rem;
}

.summary-card strong {
    font-size: 1.8rem;
}


/* Dashboard sections */

.dashboard-section {
    margin-top: 35px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 18px;
}

.section-heading h2 {
    margin-top: 5px;
}

.text-link {
    color: #62b2ff;
    text-decoration: none;
    font-weight: 600;
}

.text-link:hover {
    text-decoration: underline;
}


/* Quick actions */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.action-card {
    display: flex;
    flex-direction: column;
    gap: 10px;

    padding: 22px;

    background: rgba(30, 36, 45, 0.92);

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 16px;

    text-decoration: none;

    transition:
        transform 0.2s,
        border-color 0.2s;
}

.action-card:hover {
    transform: translateY(-3px);
    border-color: rgba(98, 178, 255, 0.5);
}

.action-card strong {
    font-size: 1rem;
}

.action-card span {
    color: #aeb7c4;
    font-size: 0.85rem;
    line-height: 1.5;
}


/* Recent transactions */

.recent-transactions {
    padding: 24px;

    background: rgba(30, 36, 45, 0.92);

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 16px;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 14px 0;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-details span {
    color: #aeb7c4;
    font-size: 0.85rem;
}

.income {
    color: #7ee787;
}

.expense {
    color: #ff8f8f;
}


/* Navigation button */

.nav-button {
    border: none;
    border-radius: 8px;

    padding: 8px 12px;

    background: #343a44;
    color: white;

    cursor: pointer;
}

.nav-button:hover {
    opacity: 0.85;
}


/* Dashboard responsive layout */

@media (max-width: 900px) {

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media (max-width: 600px) {

    .summary-grid,
    .quick-actions {
        grid-template-columns: 1fr;
    }

    .dashboard {
        width: 92%;
    }
}

/*
   TOP NAVIGATION
*/

.topbar {
    width: 100%;

    padding: 18px 5%;

    display: flex;
    justify-content: space-between;
    align-items: center;

    background: rgba(20, 25, 32, 0.95);

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar .brand {
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar nav a {
    color: #aeb7c4;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.topbar nav a:hover {
    color: #62b2ff;
}

@media (max-width: 700px) {

    .topbar {
        flex-direction: column;
        gap: 15px;
    }

    .topbar nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/*
   FORM PAGES
*/

.form-page {
    width: min(700px, 90%);
    margin: 50px auto;
}

.form-card {
    padding: 35px;

    background: rgba(30, 36, 45, 0.92);

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 18px;

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.25);
}

.form-header {
    margin-bottom: 30px;
}

.form-header h1 {
    margin: 6px 0;
    font-size: 2rem;
}

.form-header p:not(.eyebrow) {
    color: #aeb7c4;
}

.input-group select {
    width: 100%;

    padding: 13px 15px;

    border-radius: 10px;
    border: 1px solid #454d59;

    background: #15191f;
    color: white;

    font-size: 1rem;
}

.input-group select:focus {
    outline: none;

    border-color: #4da3ff;

    box-shadow:
        0 0 0 3px rgba(77, 163, 255, 0.15);
}

.input-group input[type="date"] {
    color-scheme: dark;
}

/*
   TRANSACTION HISTORY
*/

.page-container {
    width: min(1100px, 90%);
    margin: 50px auto;
}

.page-heading {
    margin-bottom: 30px;
}

.page-heading h1 {
    margin: 6px 0;
    font-size: 2rem;
}

.page-heading p:not(.eyebrow) {
    color: #aeb7c4;
}

.transaction-controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.transaction-controls input,
.transaction-controls select {
    padding: 13px 15px;

    border-radius: 10px;
    border: 1px solid #454d59;

    background: #15191f;
    color: white;

    font-size: 0.95rem;
}

.transaction-controls input:focus,
.transaction-controls select:focus {
    outline: none;
    border-color: #4da3ff;
}

.table-card {
    overflow-x: auto;

    background: rgba(30, 36, 45, 0.92);

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 18px;
}

.table-card table {
    width: 100%;
    border-collapse: collapse;
}

.table-card th,
.table-card td {
    padding: 16px;

    text-align: left;

    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.table-card th {
    color: #aeb7c4;
    font-size: 0.85rem;
}

.table-card td {
    color: white;
}

.empty-message {
    padding: 25px;
    text-align: center;
    color: #aeb7c4;
}

@media (max-width: 800px) {

    .transaction-controls {
        grid-template-columns: 1fr;
    }
}

/* 
   BUDGET MANAGEMENT
*/

.budget-card {
    padding: 30px;
    margin-bottom: 25px;

    background: rgba(30, 36, 45, 0.92);

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: 18px;
}

.budget-card h2 {
    margin-top: 0;
    margin-bottom: 25px;
}

.budget-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;

    margin-bottom: 25px;
}

.progress-container {
    width: 100%;
    height: 18px;

    background: #15191f;

    border-radius: 20px;

    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;

    background: #4da3ff;

    border-radius: 20px;

    transition: width 0.3s ease;
}

#budgetPercentage {
    color: #aeb7c4;
    margin-top: 12px;
}

@media (max-width: 700px) {

    .budget-summary {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
    padding: 20px;
    background: #1e1e1e;
    border-radius: 12px;
}

.chart-container canvas {
    width: 100% !important;
    height: auto !important;
}

/* Reports and Analytics charts */

.chart-container {
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin: 30px auto;
    padding: 20px;
    background: #1e1e1e;
    border-radius: 12px;
    box-sizing: border-box;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}
/* ==========================================================
   SPENDSMART VISUAL POLISH — presentation-only CSS overrides
   Keeps existing HTML hooks and JavaScript behaviour intact.
   ========================================================== */
:root {
    color-scheme: dark;
    --ss-bg: #0b0d14;
    --ss-surface: rgba(22, 25, 39, 0.88);
    --ss-surface-strong: #171a2a;
    --ss-surface-soft: #1e2135;
    --ss-border: rgba(177, 164, 255, 0.16);
    --ss-text: #f5f3ff;
    --ss-muted: #aaa9c4;
    --ss-purple: #9b6bff;
    --ss-purple-bright: #b28aff;
    --ss-blue: #6b9dff;
    --ss-green: #5fe0b0;
    --ss-red: #ff829e;
    --ss-radius: 20px;
    --ss-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

html { scroll-behavior: smooth; }
body {
    color: var(--ss-text);
    background:
        radial-gradient(ellipse at 12% 0%, rgba(128, 74, 255, .18), transparent 34%),
        radial-gradient(ellipse at 95% 18%, rgba(75, 114, 255, .12), transparent 30%),
        linear-gradient(135deg, #0b0d14 0%, #111322 52%, #0d1020 100%);
    background-attachment: fixed;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(155, 107, 255, .35); color: #fff; }

/* Gentle entrance motion, disabled for reduced-motion preferences */
@keyframes ss-rise-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes ss-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(155, 107, 255, 0); }
    50% { box-shadow: 0 0 26px rgba(155, 107, 255, .13); }
}
.dashboard, .page-container, .form-page, .login-card {
    animation: ss-rise-in .48s ease both;
}

/* Brand and navigation */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 17px clamp(20px, 5vw, 76px);
    gap: 22px;
    background: rgba(11, 13, 24, .82);
    border-bottom: 1px solid rgba(177, 164, 255, .13);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
    backdrop-filter: blur(18px);
}
.topbar .brand {
    margin: 0;
    font-size: 1.42rem;
    letter-spacing: -.7px;
    background: linear-gradient(100deg, #fff 10%, #c6a8ff 65%, #8cb4ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.topbar nav { gap: 7px; }
.topbar nav a {
    padding: 10px 13px;
    border-radius: 11px;
    color: #b6b4cf;
    transition: color .22s ease, background .22s ease, transform .22s ease;
}
.topbar nav a:hover {
    color: #fff;
    background: rgba(155, 107, 255, .13);
    transform: translateY(-1px);
}
.nav-button {
    border: 1px solid rgba(255, 130, 158, .25);
    border-radius: 11px;
    padding: 10px 15px;
    background: rgba(255, 130, 158, .09);
    color: #ffb0c1;
    font-weight: 700;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.nav-button:hover {
    opacity: 1;
    background: rgba(255, 130, 158, .17);
    border-color: rgba(255, 130, 158, .48);
    transform: translateY(-1px);
}

/* Headings */
.eyebrow {
    color: #b99aff;
    letter-spacing: 1.8px;
    font-size: .72rem;
}
.dashboard-header h1, .page-heading h1, .form-header h1 {
    color: #fbfaff;
    letter-spacing: -1.1px;
    line-height: 1.15;
}
.dashboard-header h1 { font-size: clamp(2.25rem, 4vw, 3rem); }
.page-heading h1, .form-header h1 { font-size: clamp(2rem, 3.5vw, 2.65rem); }
.dashboard-header p:not(.eyebrow), .page-heading p:not(.eyebrow), .form-header p:not(.eyebrow) {
    color: var(--ss-muted);
}

/* Cards and sections */
.summary-card, .action-card, .recent-transactions, .form-card,
.budget-card, .table-card, .report-section, .chart-container {
    background: linear-gradient(145deg, rgba(27, 29, 47, .96), rgba(19, 22, 36, .94));
    border: 1px solid var(--ss-border);
    border-radius: var(--ss-radius);
    box-shadow: var(--ss-shadow);
}
.summary-card {
    position: relative;
    overflow: hidden;
    padding: 25px;
    gap: 13px;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.summary-card::before {
    content: "";
    position: absolute;
    top: 0; left: 22px; right: 22px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ss-purple), var(--ss-blue), transparent);
    opacity: .75;
}
.summary-card:hover {
    transform: translateY(-4px);
    border-color: rgba(177, 140, 255, .38);
    box-shadow: 0 22px 55px rgba(0, 0, 0, .32), 0 0 25px rgba(155, 107, 255, .07);
}
.summary-label { color: #b4b2cd; font-weight: 600; }
.summary-card strong { color: #fbfaff; font-size: clamp(1.6rem, 2.5vw, 2rem); letter-spacing: -.7px; }
.income { color: var(--ss-green) !important; }
.expense { color: var(--ss-red) !important; }

.action-card {
    position: relative;
    overflow: hidden;
    min-height: 130px;
    padding: 23px;
    gap: 12px;
    transition: transform .24s ease, border-color .24s ease, background .24s ease, box-shadow .24s ease;
}
.action-card::after {
    content: "↗";
    position: absolute;
    right: 18px; top: 16px;
    color: #b99aff;
    font-size: 1.15rem;
    opacity: .75;
    transition: transform .24s ease, opacity .24s ease;
}
.action-card:hover {
    transform: translateY(-5px);
    border-color: rgba(177, 140, 255, .48);
    background: linear-gradient(145deg, rgba(42, 34, 70, .96), rgba(20, 24, 43, .98));
    box-shadow: 0 20px 44px rgba(0, 0, 0, .28), 0 0 24px rgba(155, 107, 255, .09);
}
.action-card:hover::after { transform: translate(2px, -2px); opacity: 1; }
.action-card strong { color: #f7f4ff; font-size: 1.02rem; }
.action-card span { color: var(--ss-muted); line-height: 1.6; }

.dashboard-section { margin-top: 42px; }
.section-heading h2, .budget-card h2, .report-section h2 { color: #f4f0ff; letter-spacing: -.35px; }
.text-link, .register-link a { color: #c0a2ff; transition: color .2s ease; }
.text-link:hover, .register-link a:hover { color: #fff; }
.recent-transactions { padding: 25px 28px; }
.recent-item { border-bottom-color: rgba(177, 164, 255, .12); }
.recent-item strong { color: #f8f6ff; }
.recent-details span { color: #a5a4bf; }

/* Forms and all common controls */
.login-card, .form-card, .budget-card {
    background: linear-gradient(145deg, rgba(27, 29, 47, .97), rgba(17, 20, 34, .97));
    border-color: rgba(177, 164, 255, .18);
    box-shadow: 0 25px 80px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .025);
}
.login-card { border-radius: 25px; padding: 42px; }
.form-card { padding: clamp(26px, 4vw, 42px); }
.brand h1 { letter-spacing: -1.2px; }
.brand p { color: var(--ss-muted); }
.input-group label { color: #e5e0f7; }
.input-group input, .input-group select,
.transaction-controls input, .transaction-controls select {
    border: 1px solid rgba(177, 164, 255, .2);
    border-radius: 12px;
    background: rgba(10, 12, 22, .72);
    color: #f8f6ff;
    min-height: 47px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.input-group input::placeholder, .transaction-controls input::placeholder { color: #77758f; }
.input-group input:focus, .input-group select:focus,
.transaction-controls input:focus, .transaction-controls select:focus {
    outline: none;
    border-color: #a783ff;
    background: rgba(16, 16, 31, .98);
    box-shadow: 0 0 0 4px rgba(155, 107, 255, .15), 0 0 20px rgba(155, 107, 255, .06);
}

button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.primary-button {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    padding: 14px 20px;
    background: linear-gradient(110deg, #8554ed 0%, #a16cff 48%, #697dff 100%);
    color: white;
    font-weight: 750;
    letter-spacing: .1px;
    box-shadow: 0 9px 22px rgba(126, 81, 230, .24), inset 0 1px 0 rgba(255,255,255,.16);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.primary-button:hover {
    opacity: 1;
    transform: translateY(-2px);
    filter: saturate(1.12) brightness(1.06);
    box-shadow: 0 13px 30px rgba(126, 81, 230, .35), inset 0 1px 0 rgba(255,255,255,.2);
}
.primary-button:active { transform: translateY(0) scale(.99); }
button:focus-visible, a:focus-visible {
    outline: 3px solid rgba(192, 162, 255, .85);
    outline-offset: 3px;
}
.category-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.category-actions button, .table-card button, .transaction-controls button {
    border: 1px solid rgba(177, 164, 255, .22);
    border-radius: 10px;
    padding: 9px 13px;
    background: rgba(155, 107, 255, .11);
    color: #d9caff;
    font-weight: 650;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.category-actions button:hover, .table-card button:hover, .transaction-controls button:hover {
    transform: translateY(-1px);
    background: rgba(155, 107, 255, .2);
    border-color: rgba(177, 140, 255, .48);
}
.message { color: #ff9bb0; }

/* Transaction table and action controls */
.table-card { overflow-x: auto; }
.table-card table { border-collapse: separate; border-spacing: 0; }
.table-card th {
    background: rgba(155, 107, 255, .09);
    color: #c9b7ff;
    text-transform: uppercase;
    letter-spacing: .8px;
    font-size: .74rem;
    white-space: nowrap;
}
.table-card th, .table-card td {
    border-bottom: 1px solid rgba(177, 164, 255, .11);
    padding: 17px 16px;
}
.table-card tbody tr { transition: background .18s ease; }
.table-card tbody tr:hover { background: rgba(155, 107, 255, .055); }
.table-card tbody tr:last-child td { border-bottom: none; }
.table-card td { color: #eeebfa; }
.empty-message { color: var(--ss-muted); }

/* Budget and charts */
.budget-card { margin-bottom: 25px; }
.budget-summary { gap: 18px; }
.progress-container {
    height: 13px;
    background: rgba(5, 7, 15, .8);
    border: 1px solid rgba(177, 164, 255, .13);
    border-radius: 999px;
}
.progress-bar {
    background: linear-gradient(90deg, #8052e8, #b18aff 55%, #6f9dff);
    box-shadow: 0 0 18px rgba(155, 107, 255, .32);
    border-radius: 999px;
    transition: width .65s cubic-bezier(.2,.8,.2,1);
}
#budgetPercentage { color: #bdb7d7; }
.report-section { padding: 25px; margin: 25px 0; }
.chart-container {
    background: rgba(12, 15, 27, .62);
    border-color: rgba(177, 164, 255, .12);
    padding: 22px;
}
#categoryBreakdown p, #financialSummary p { color: #c4c0d9; line-height: 1.8; }
#categoryBreakdown p { padding: 10px 13px; margin: 7px 0; background: rgba(155, 107, 255, .06); border: 1px solid rgba(177, 164, 255, .1); border-radius: 10px; }

/* Scrollbars, responsive polish and motion accessibility */
* { scrollbar-width: thin; scrollbar-color: #59418b #111321; }
@media (max-width: 900px) {
    .topbar { position: relative; flex-direction: column; }
    .topbar nav { justify-content: center; flex-wrap: wrap; }
    .dashboard, .page-container { width: min(92%, 760px); }
}
@media (max-width: 700px) {
    .topbar { padding: 16px 18px; }
    .topbar nav { gap: 5px; }
    .topbar nav a { padding: 8px 10px; }
    .dashboard, .page-container { margin: 30px auto; }
    .dashboard-header h1, .page-heading h1 { font-size: 2rem; }
    .summary-grid, .quick-actions, .budget-summary { grid-template-columns: 1fr; }
    .summary-card { padding: 21px; }
    .transaction-controls { gap: 11px; }
    .table-card th, .table-card td { padding: 13px 12px; }
    .chart-container { height: 320px; padding: 14px; }
}
@media (max-width: 500px) {
    .login-card { padding: 29px 22px; }
    .form-card, .budget-card, .report-section { padding: 22px; }
    .category-actions { flex-direction: column; }
    .category-actions button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}


/* =========================================================
   SPENDSMART POLISH LAYER
   Presentation-only refinements; no JavaScript changes.
   ========================================================= */

:root {
    --ss-bg: #0b1020;
    --ss-panel: rgba(20, 27, 47, 0.82);
    --ss-panel-raised: rgba(25, 33, 56, 0.92);
    --ss-line: rgba(172, 187, 225, 0.14);
    --ss-text: #f4f6ff;
    --ss-muted: #a6b0ca;
    --ss-accent: #9b7bff;
    --ss-accent-bright: #b6a0ff;
    --ss-positive: #54d6a0;
    --ss-negative: #ff8399;
}

html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    color: var(--ss-text);
    line-height: 1.55;
    background:
        radial-gradient(ellipse at 12% 0%, rgba(93, 79, 190, .19), transparent 34rem),
        radial-gradient(ellipse at 100% 25%, rgba(46, 121, 181, .12), transparent 32rem),
        linear-gradient(145deg, #0b1020 0%, #10172a 52%, #0b1020 100%);
    background-attachment: fixed;
}

::selection {
    background: rgba(155, 123, 255, .35);
    color: #fff;
}

a {
    transition: color .18s ease, opacity .18s ease;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    gap: 24px;
    padding: 17px clamp(20px, 4vw, 54px);
    background: rgba(10, 15, 29, .82);
    border-bottom: 1px solid var(--ss-line);
    box-shadow: 0 12px 35px rgba(0, 0, 0, .12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.topbar .brand {
    margin: 0;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -.5px;
    text-decoration: none;
    white-space: nowrap;
}

.topbar .brand::first-letter {
    color: inherit;
}

.topbar nav {
    align-items: center;
    gap: 7px;
}

.topbar nav a {
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #b8c1d9;
    font-size: .91rem;
    font-weight: 650;
    text-decoration: none;
}

.topbar nav a:hover {
    color: #fff;
    background: rgba(155, 123, 255, .09);
    border-color: rgba(155, 123, 255, .16);
}

/* Highlight the current page without adding classes or changing HTML. */
body:has(.dashboard) .topbar nav a[href="dashboard.html"],
body:has(.transaction-controls) .topbar nav a[href="transactions.html"],
body:has(.report-section) .topbar nav a[href="reports.html"],
body:has(.budget-card):not(:has(.report-section)) .topbar nav a[href="budget.html"] {
    color: #fff;
    background: rgba(155, 123, 255, .16);
    border-color: rgba(177, 154, 255, .26);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.nav-button {
    border: 1px solid rgba(255, 131, 153, .25);
    border-radius: 10px;
    padding: 9px 13px;
    background: rgba(255, 131, 153, .07);
    color: #ffb0bd;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.nav-button:hover {
    background: rgba(255, 131, 153, .14);
    border-color: rgba(255, 131, 153, .42);
    transform: translateY(-1px);
}

.dashboard,
.page-container {
    animation: ss-rise-in .45s ease both;
}

.dashboard {
    padding-bottom: 44px;
}

.dashboard-header,
.page-heading {
    margin-bottom: 30px;
}

.dashboard-header h1,
.page-heading h1,
.form-header h1 {
    color: #fff;
    font-weight: 800;
    letter-spacing: -1.2px;
    line-height: 1.15;
}

.dashboard-header h1,
.page-heading h1 {
    font-size: clamp(2rem, 4vw, 2.65rem);
}

.dashboard-header p:not(.eyebrow),
.page-heading p:not(.eyebrow),
.form-header p:not(.eyebrow) {
    color: var(--ss-muted);
}

.eyebrow {
    color: var(--ss-accent-bright);
    letter-spacing: 1.5px;
    font-size: .72rem;
}

.summary-grid,
.budget-summary {
    gap: 16px;
}

.summary-card,
.table-card,
.budget-card,
.form-card,
.report-section,
.chart-container,
.quick-action,
.action-card {
    background: linear-gradient(145deg, rgba(24, 32, 54, .91), rgba(16, 23, 41, .88));
    border: 1px solid var(--ss-line);
    border-radius: 18px;
    box-shadow: 0 16px 38px rgba(0, 0, 0, .17), inset 0 1px 0 rgba(255,255,255,.025);
}

.summary-card {
    position: relative;
    overflow: hidden;
    padding: 23px;
    gap: 10px;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.summary-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--ss-accent-bright), rgba(155, 123, 255, 0));
    opacity: .8;
}

.summary-card:hover {
    transform: translateY(-3px);
    border-color: rgba(177, 154, 255, .3);
    box-shadow: 0 20px 44px rgba(0, 0, 0, .23), 0 0 25px rgba(120, 91, 214, .06);
}

.summary-label {
    color: var(--ss-muted);
    font-size: .84rem;
    font-weight: 650;
}

.summary-card strong {
    color: #f8f8ff;
    font-size: clamp(1.45rem, 2.4vw, 1.9rem);
    letter-spacing: -.7px;
    overflow-wrap: anywhere;
}

.dashboard-section {
    margin-top: 34px;
}

.section-heading {
    gap: 16px;
}

.section-heading h2,
.budget-card h2,
.report-section h2 {
    color: #f3f4ff;
    font-size: 1.15rem;
    letter-spacing: -.25px;
}

.text-link,
.register-link a {
    color: var(--ss-accent-bright);
}

.text-link:hover,
.register-link a:hover {
    color: #d1c5ff;
}

.login-card {
    background: linear-gradient(145deg, rgba(25, 33, 56, .96), rgba(15, 21, 39, .97));
    border: 1px solid rgba(178, 163, 255, .2);
    border-radius: 24px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .38), 0 0 55px rgba(108, 81, 194, .1), inset 0 1px 0 rgba(255,255,255,.04);
}

.login-card .brand h1 {
    color: #fff;
    font-weight: 850;
    letter-spacing: -1.1px;
}

.login-card .brand p {
    color: var(--ss-muted);
}

.input-group label {
    color: #e0e5f6;
    font-weight: 650;
}

.input-group input,
.input-group select,
.transaction-controls input,
.transaction-controls select {
    min-height: 47px;
    border: 1px solid rgba(172, 187, 225, .2);
    border-radius: 11px;
    background: rgba(8, 13, 27, .62);
    color: #f4f6ff;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.input-group input:hover,
.input-group select:hover,
.transaction-controls input:hover,
.transaction-controls select:hover {
    border-color: rgba(172, 154, 255, .42);
}

.input-group input:focus,
.input-group select:focus,
.transaction-controls input:focus,
.transaction-controls select:focus {
    border-color: var(--ss-accent-bright);
    background: rgba(9, 14, 29, .96);
    box-shadow: 0 0 0 4px rgba(155, 123, 255, .13);
}

input::placeholder {
    color: #7f8aa8;
}

.primary-button {
    min-height: 47px;
    border-radius: 11px;
    background: linear-gradient(110deg, #7955e8 0%, #9b7bff 52%, #6d8dff 100%);
    box-shadow: 0 10px 24px rgba(119, 83, 224, .22), inset 0 1px 0 rgba(255,255,255,.18);
}

.primary-button:hover {
    box-shadow: 0 14px 30px rgba(119, 83, 224, .31), inset 0 1px 0 rgba(255,255,255,.2);
}

.transaction-controls {
    gap: 12px;
    margin-bottom: 20px;
}

.table-card {
    padding: 7px;
}

.table-card table {
    width: 100%;
}

.table-card th {
    padding: 15px 16px;
    background: rgba(155, 123, 255, .08);
    color: #c6b8ff;
    letter-spacing: .9px;
}

.table-card td {
    padding: 15px 16px;
}

.table-card tbody tr:hover {
    background: rgba(155, 123, 255, .07);
}

.budget-card,
.form-card {
    padding: clamp(22px, 3vw, 34px);
}

.budget-card h2 {
    margin-bottom: 20px;
}

.budget-summary {
    margin-top: 24px;
}

.progress-container {
    overflow: hidden;
}

.report-section {
    padding: clamp(20px, 3vw, 30px);
}

.report-section h2 {
    margin-bottom: 16px;
}

.chart-container {
    border-radius: 15px;
}

#categoryBreakdown p {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #d4d9ed;
}

.message {
    border-radius: 9px;
    line-height: 1.45;
}

.category-actions button,
.table-card button {
    min-height: 38px;
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
    transform: none;
}

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

@media (max-width: 900px) {
    .topbar {
        position: sticky;
        flex-direction: column;
        gap: 12px;
        padding: 15px 18px;
    }
    .topbar nav {
        width: 100%;
        gap: 5px;
    }
    .topbar nav a,
    .nav-button {
        font-size: .85rem;
    }
}

@media (max-width: 600px) {
    .topbar nav {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 2px 1px 5px;
        flex-wrap: nowrap;
    }
    .topbar nav a,
    .nav-button {
        flex: 0 0 auto;
    }
    .dashboard,
    .page-container {
        width: min(92%, 760px);
        margin-top: 26px;
    }
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .transaction-controls {
        display: grid;
        grid-template-columns: 1fr;
    }
    .table-card {
        border-radius: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .dashboard,
    .page-container {
        animation: none;
    }
}

/* ================================================================
   SpendSmart polish pass — consistent, restrained fintech styling
   Visual-only overrides; application logic and markup are unchanged.
   ================================================================ */
:root {
    --ss-bg: #0a0d17;
    --ss-surface: #121827;
    --ss-surface-raised: #171f31;
    --ss-border: rgba(165, 177, 211, .14);
    --ss-text: #f5f7ff;
    --ss-muted: #a5aec4;
    --ss-purple: #a78bfa;
    --ss-purple-strong: #8b5cf6;
    --ss-green: #4adea1;
    --ss-red: #fb7185;
    --ss-shadow: 0 18px 48px rgba(0, 0, 0, .24);
}

html { scroll-padding-top: 90px; }
body {
    background:
        radial-gradient(ellipse at 8% -8%, rgba(139, 92, 246, .15), transparent 34rem),
        radial-gradient(ellipse at 100% 8%, rgba(59, 130, 246, .09), transparent 29rem),
        var(--ss-bg);
    color: var(--ss-text);
    line-height: 1.6;
}

/* Header and logo: crisp, consistent, and fully white. */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 12px clamp(16px, 4vw, 56px);
    background: rgba(10, 13, 23, .9);
    border-bottom: 1px solid rgba(167, 139, 250, .14);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
}
.topbar .brand,
.topbar .brand:first-letter,
.topbar .brand::first-letter {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: none !important;
    font-weight: 850;
    letter-spacing: -.65px;
}
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.topbar nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #b8c1d6;
    font-size: .92rem;
    font-weight: 650;
    text-decoration: none;
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.topbar nav a:hover { color: #fff; background: rgba(167, 139, 250, .09); transform: translateY(-1px); }
/* Explicit page state rules prevent Reports and Budget being highlighted together. */
.topbar nav a[aria-current="page"] { color: #fff; background: rgba(139, 92, 246, .19); border-color: rgba(167, 139, 250, .32); }
body:has(.report-section) .topbar nav a[href="budget.html"],
body:has(.report-section) .topbar nav a[href$="budget.html"] { color: #b8c1d6; background: transparent; border-color: transparent; box-shadow: none; }
body:has(.report-section) .topbar nav a[href="reports.html"],
body:has(.report-section) .topbar nav a[href$="reports.html"] { color: #fff; background: rgba(139, 92, 246, .19); border-color: rgba(167, 139, 250, .32); }
body:has(.budget-card):not(:has(.report-section)) .topbar nav a[href="budget.html"],
body:has(.budget-card):not(:has(.report-section)) .topbar nav a[href$="budget.html"] { color: #fff; background: rgba(139, 92, 246, .19); border-color: rgba(167, 139, 250, .32); }
.nav-button { min-height: 42px; padding: 9px 15px; border-radius: 11px; }

/* Page rhythm and headings. */
.dashboard, .page-container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.dashboard, .page-container { padding-top: clamp(28px, 4vw, 48px); padding-bottom: 56px; }
.dashboard-header, .page-heading, .form-header { margin-bottom: clamp(22px, 3vw, 34px); }
.dashboard-header h1, .page-heading h1, .form-header h1 { letter-spacing: -1.15px; text-wrap: balance; }
.eyebrow { display: inline-block; margin-bottom: 7px; color: #c4b5fd; font-weight: 750; text-transform: uppercase; }
.dashboard-header p:not(.eyebrow), .page-heading p:not(.eyebrow), .form-header p:not(.eyebrow) { max-width: 70ch; color: var(--ss-muted); }

/* Consistent surface treatment across dashboard, budgets, forms and reports. */
.summary-card, .action-card, .recent-transactions, .form-card, .budget-card,
.table-card, .report-section, .chart-container {
    border: 1px solid var(--ss-border);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(23, 31, 49, .96), rgba(16, 22, 36, .96));
    box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
}
.summary-card, .action-card, .budget-card, .report-section, .form-card { padding: clamp(20px, 2.5vw, 28px); }
.summary-card, .action-card, .budget-card, .report-section, .table-card, .form-card {
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.summary-card:hover, .action-card:hover, .budget-card:hover {
    border-color: rgba(167, 139, 250, .28);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .2);
}
.summary-card strong { font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.summary-label, .muted, .empty-message { color: var(--ss-muted); }
.budget-card h2, .report-section h2, .dashboard-section h2 { color: #f7f7ff; letter-spacing: -.35px; }

/* Inputs: clearer focus ring and comfortable touch targets. */
input, select, textarea, button { font: inherit; }
input, select, textarea {
    accent-color: var(--ss-purple-strong);
}
.input-group input, .transaction-controls input, .transaction-controls select,
.form-card input, .form-card select, .form-card textarea {
    min-height: 44px;
    border: 1px solid rgba(165, 177, 211, .22);
    border-radius: 11px;
    background: #0d1321;
    color: var(--ss-text);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.input-group input:focus, .transaction-controls input:focus, .transaction-controls select:focus,
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
    outline: none;
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, .16);
}
::placeholder { color: #77829a; opacity: 1; }

/* Buttons: consistent shape, restrained gradient and visible keyboard focus. */
.primary-button, .table-card button, button:not(.nav-button) {
    border-radius: 11px;
    transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.primary-button {
    min-height: 44px;
    background: linear-gradient(135deg, #8b5cf6, #6d5ce8);
    box-shadow: 0 7px 18px rgba(109, 92, 232, .18);
}
.primary-button:hover { filter: brightness(1.08); box-shadow: 0 10px 24px rgba(109, 92, 232, .25); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid #c4b5fd;
    outline-offset: 3px;
}

/* Tables: tidy hierarchy, stable numeric alignment, clear hover feedback. */
.table-card { overflow-x: auto; }
.table-card table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-card th { color: #c4b5fd; background: rgba(10, 14, 25, .62); font-size: .78rem; letter-spacing: .65px; text-transform: uppercase; }
.table-card th, .table-card td { padding: 14px 16px; border-bottom: 1px solid rgba(165, 177, 211, .1); }
.table-card tbody tr { transition: background .16s ease; }
.table-card tbody tr:hover { background: rgba(167, 139, 250, .06); }
.table-card td { color: #edf0fa; }
.table-card td, .summary-card strong { font-variant-numeric: tabular-nums; }

/* Chart frames and progress visuals keep the data as the focus. */
.report-section { margin: 22px 0; }
.chart-container { padding: 18px; background: rgba(10, 14, 25, .34); box-shadow: none; }
progress { accent-color: var(--ss-purple-strong); }

/* Respect reduced-motion settings and make narrow screens comfortable. */
@media (max-width: 760px) {
    .topbar { align-items: flex-start; flex-direction: column; gap: 12px; padding: 14px 18px; }
    .topbar nav { width: 100%; gap: 5px; }
    .topbar nav a { min-height: 39px; padding: 8px 10px; font-size: .86rem; }
    .nav-button { min-height: 39px; padding: 8px 11px; }
    .dashboard, .page-container { width: min(100% - 28px, 1180px); }
    .dashboard, .page-container { padding-top: 26px; }
    .summary-card, .action-card, .budget-card, .report-section, .form-card { padding: 18px; }
    .table-card th, .table-card td { padding: 11px 12px; white-space: nowrap; }
}
@media (max-width: 420px) {
    .topbar nav a { padding-inline: 8px; font-size: .8rem; }
    .dashboard-header h1 { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Creator credit footer */
.site-footer {
    width: min(100% - 40px, 1180px);
    margin: 44px auto 0;
    padding: 20px 12px 24px;
    text-align: center;
    border-top: 1px solid rgba(167, 155, 255, 0.16);
    color: var(--muted-text, #9ba5bb);
    font-size: 0.88rem;
    letter-spacing: 0.02em;
}
.site-footer p { margin: 0; }
.site-footer span {
    color: #ffffff;
    font-weight: 700;
}
@media (max-width: 600px) {
    .site-footer { width: calc(100% - 28px); margin-top: 30px; }
}


/* Footer placement: keep the credit at the bottom on short pages */
html { min-height: 100%; }
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.login-page {
    flex: 1 0 auto;
    min-height: 0;
}
.page-container {
    flex: 1 0 auto;
}
.site-footer {
    flex-shrink: 0;
    margin-top: auto;
}
