/* ===================================================================
📘 BASE.CSS STRUCTURE OVERVIEW
=================================================================== 
0️⃣1️⃣  GLOBAL VARIABLES & THEME COLORS
0️⃣2️⃣  GLOBAL RESETS & BASE STYLES
0️⃣3️⃣  HEADER & TOP NAVIGATION
0️⃣4️⃣  LAYOUT & SIDE NAVIGATION
0️⃣5️⃣  LOGIN & AUTHENTICATION PAGES
0️⃣6️⃣  HOME PAGE STYLES
0️⃣7️⃣  CATEGORY APP STYLES
0️⃣8️⃣  CASH / CREDIT CARD APP STYLES
0️⃣9️⃣  TILES, ROWS & FLEX HELPERS
1️⃣0️⃣  BUTTONS & MODALS
1️⃣1️⃣  MESSAGES & ALERTS
1️⃣2️⃣  FORMS
1️⃣3️⃣  MISCELLANEOUS HELPERS
1️⃣4️⃣  CHARTS
1️⃣5️⃣  ACCOUNT DETAIL CAROUSEL
1️⃣6️⃣  ADD ACCOUNT BUTTON
1️⃣7️⃣  RECURRING APP STYLES
1️⃣8️⃣  GOOGLE ACCOUNT LINK
1️⃣9️⃣  BUDGET VS ACTUAL & FILTER PILLS
=================================================================== */

/* =========================================================================== */
/* #region ===== 0️⃣4️⃣  LAYOUT & SIDE NAVIGATION ============================= */
/* =========================================================================== */

/* #endregion ===== 0️⃣4️⃣  LAYOUT & SIDE NAVIGATION ========================== */
/* =========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

/* =========================================================================== */
/* #region ===== 0️⃣1️⃣  GLOBAL VARIABLES & THEME COLORS ====================== */
/* =========================================================================== */

:root {
    /* Core Theme Colors */
    --color-primary-darker: hsl(from var(--color-primary-base) h s calc(l - 10));
    --color-primary-dark: hsl(from var(--color-primary-base) h s calc(l - 5));
    --color-primary-base: hsl(207, 100%, 35%);    /* French Blue */
    --color-primary-light: hsl(from var(--color-primary-base) h s calc(l + 5));
    --color-primary-lighter: hsl(from var(--color-primary-base) h s calc(l + 20));
    --color-primary-tint: hsl(from var(--color-primary-base) h s calc(l + 40));
    --color-primary-faint: hsl(from var(--color-primary-base) h s calc(l + 50));

    --color-error-darker: hsl(from var(--color-error) h s calc(l - 10));
    --color-error-dark: hsl(from var(--color-error) h s calc(l - 5));
    --color-error: hsl(0, 66%, 46%);;

    --color-error-light: #ef5350;      /* Lighter red */
    --color-error-lighter: #f58b89;    /* Even lighter */
    --color-error-tint: #f9bcbc;       /* Light pastel red */
    --color-error-faint: #fdeaea;      /* Very faint pinkish red */

    --color-success-dark: #1b5e20;      /* Much darker */
    --color-success-light: #66bb6a;     /* Lighter green */
    --color-success-lighter: #98d89d;   /* Even lighter */
    --color-success-tint: #c7ebcb;      /* Soft tint */
    --color-success-faint: #eaf7ec;     /* Very faint green background */


    /* Complementary Palette */
    --color-success: #2e8540;
    --color-warning: #ffcc00;
    --color-info: #3366cc;

    /* Neutrals */
    --color-bg: hsl(210, 50%, 98%);
    --color-surface: #ffffff;
    --color-border: rgba(0, 0, 0, 0.1);
    --color-text: #333333;

    --box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;

    --font-size-tiny: 0.7em;
}

/* #endregion == 0️⃣1️⃣  GLOBAL VARIABLES & THEME COLORS ====================== */
/* =========================================================================== */

/* =========================================================================== */
/* #region ===== 0️⃣2️⃣  GLOBAL RESETS & BASE STYLES ========================== */
/* =========================================================================== */

html, body {
    height: 100%;
    overflow-y: scroll;
}

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

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
}

li {
    text-decoration: none;
    color: black;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: black;
}

table {
    border-collapse: collapse;
}

main {
    overflow-y: auto;
}

/* #endregion == 0️⃣2️⃣  GLOBAL RESETS & BASE STYLES ========================== */
/* =========================================================================== */

/* =========================================================================== */
/* #region ===== 0️⃣3️⃣  HEADER & TOP NAVIGATION ============================== */
/* =========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-primary-base);
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    z-index: 1000;
    height: 60px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.profile-icon {
    font-size: 22px;
    color: white;
    text-decoration: none;
    transition: color 0.2s ease;
}

.profile-icon:hover {
    color: var(--color-primary-lighter);
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-title span {
        color: white;
    }

.logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
}

.site-title:hover {
    color: var(--color-primary-lighter);
}

@media (max-width: 768px) {
    .site-header {
        height: 45px;
        padding: 8px 5px;
    }

    .site-title {
        font-size: 1rem;
    }

    .nav-toggle {
        font-size: 22px;
        margin-left: auto; /* still pushes it right */
        padding: 4px 15px;
    }

    .profile-icon {
        font-size: 18px;
    }
}

/* #endregion == 0️⃣3️⃣  HEADER & TOP NAVIGATION ============================== */
/* =========================================================================== */

/* =========================================================================== */
/* #region ===== 0️⃣4️⃣  LAYOUT & SIDE NAVIGATION ============================= */
/* =========================================================================== */

/* LAYOUT CONTAINER */
.layout {
    display: flex;
    padding-top: 60px;
    height: 100vh;
}

.site-content {
    flex: 1 1 auto;
    min-width: 0;       /* critical: allow shrinking */
    max-width: 100%;
    overflow-x: hidden; /* avoid accidental horizontal scroll */
}

@media (max-width: 768px) {
    .layout {
        padding-top: 45px;
    }
}


/* SIDE NAVIGATION */
.side-nav {
    width: 200px;
    background-color: var(--color-surface); /* Light background */
    display: flex;
    flex: 0 0 200px;
    flex-direction: column;
    border-right: 1px solid var(--color-border);
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.03);
}

.side-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.side-nav li {
    margin: 0;
}

.side-nav li:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.side-nav a {
    display: block;
    padding: 12px 20px;
    color: var(--color-text); /* Dark text */
    text-decoration: none;
    transition: background-color 0.2s;
}

.side-nav a.active {
    color: var(--color-primary-base);
    background-color: transparent;
}

.side-nav a:hover {
    color: var(--color-primary-base);
    background-color: transparent;
}

.logout-btn {
    all: unset;
    display: block;
    padding: 12px 20px;
    color: var(--color-text);
    transition: color 0.2s;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.logout-btn:hover {
    color: var(--color-primary-base);
    background-color: transparent;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 26px;
    cursor: pointer;
    margin-left: auto;
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .nav-toggle {
        display: block;
    }

    .site-content {
        padding: 0;
    }

    .side-nav {
        position: absolute;
        top: 45px;
        left: 0;
        width: 100%;
        background-color: var(--color-surface);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
        z-index: 999;
        padding: 0;
        flex-direction: column;
    }

    .side-nav--open {
        max-height: 500px;
        padding: 20px 0;
    }

    .side-nav ul {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .side-nav li {
        text-align: left;
        flex-grow: 1;
    }

    .side-nav a,
    .logout-btn {
        padding: 12px 20px;
        display: block;
        font-size: 15px;
        border-left: none;
    }

    .side-nav a.active {
        color: var(--color-primary-base);
        font-weight: bold;
        background-color: transparent;
    }

    .side-nav a:hover {
        color: var(--color-primary-base);
        background-color: transparent;
    }
}

/* #endregion ===== 0️⃣4️⃣  LAYOUT & SIDE NAVIGATION ========================== */
/* =========================================================================== */



/* #region LOGIN */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--color-bg);
    min-height: 75vh;
}

.login-container {
    background-color: var(--color-surface);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    padding: 20px 16px;
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.login-container form {
    width: 100%;
    padding-top: 15px;
}

.login-container form label {
    padding-top: 10px;
}

.login-container input[type="email"],
.login-container input[type="password"] {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.9rem;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.login-container form button {
    background-color: var(--color-primary-base);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.05rem;
    width: 100%;
}

.login-container form button:hover {
    background-color: var(--color-primary-dark);
}

.login-logo {
    width: 150px;
    margin-bottom: 20px;
}

.login-error {
    color: var(--color-error);
    text-align: center;
    margin: -10px 0 15px 0;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 3px var(--color-primary-light);
}

.form-group.remember-me {
    flex-direction: row;
    align-items: center;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

input[type="submit"],
button[type="submit"] {
    margin-top: 12px;
}


/* Responsive update for tablets and below */
@media (max-width: 768px) {
    .login-page {
        padding: 15px;
    }

    .login-container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 10px 5px;
    }

}

.google-signin-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    text-decoration: none;
}

.google-signin-content {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 10px;
    background-color: white;
    border: 1px solid var(--color-primary);
    border-radius: 8px;
    padding: 10px 20px;
    box-shadow: var(--box-shadow);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.google-signin-content:hover {
    background-color: var(--color-primary-faint);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

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

.google-text {
    font-size: 0.95rem;
    color: var(--color-text);
}

.or-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 25px 0px;
    font-size: 0.9rem;
    color: var(--color-text);
    width: 100%;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background-color: var(--color-primary-dark);
    margin: 0 10px;
}

.sign-up-wrapper {
    color: var(--color-primary-darker);
    margin-top: 50px;
    font-size: small;
}

.have-an-account-wrapper {
    color: var(--color-primary-darker);
    margin-top: 20px;
    font-size: small;
}

.have-an-account-wrapper a,
.sign-up-wrapper a{
    color: var(--color-primary-darker);
}


/* #endregion LOGIN */

/* #region HOME PAGE */
.quickentry-home {
    display: flex;
    justify-content: center;
    width: 100%;
    color: var(--color-text);
    font-weight: bold;
    border: 1px solid var(--color-primary-faint);
    background-color: var(--color-primary-faint);
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.quickentry-home:hover {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary-light);
    color: white;
}


/* #endregion HOME PAGE */

/* #region CATEGORY APP PAGE */

.toggle-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

/* #endregion */

/* #region CASH APP PAGE */

/* Reuse base button styles */
.icon-btn {
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px;
    transition: color 0.2s ease;
}

.icon-btn:hover {
    color: var(--color-primary-base);
}

.closed-accounts {
    font-size: 0.8rem;
    font-style: italic;
}

/* #endregion */

/* #region TILES */

.tile {
    margin: 15px 10px;
    background-color: var(--color-surface);
    box-shadow: var(--box-shadow);
    padding: 10px;
}

.tile--page-header {
    background-color: var(--color-surface);
    box-shadow: var(--box-shadow);
    padding: 15px;
    font-size: large;
    font-weight: bold;
}

@media (max-width: 768px) {
    .tile--page-header {
        width: 100vw;
        box-sizing: border-box;
    }

    .tile {
        margin: 15px 0px;
    }
}

/* #endregion */

/* #region ROWS */
.row {
    font-size: 0.9em;
    padding: 10px 5px;
    border-bottom: 1px solid var(--color-border);
}

.row--clickable {
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}
.row--clickable:hover {
    background-color: var(--color-primary-light);
    color: white;
    cursor: pointer;
}

/* .row--clickable.negative-balance:hover  {
    color: white;
} */

.row--header {
    padding: 0px 5px 2px 0px;
    font-weight: 600;
    border-bottom: 1px solid var(--color-border);
}

.row--data-plain {
    display: flex;
    align-items: center;
    font-size: smaller;
    text-decoration: none;
    color: inherit;
}

.row--data {
    display: flex;
    align-items: center;
    font-size: smaller;
    text-decoration: none;
    color: inherit;
}

.row--data:hover {
    background-color: var(--color-primary-light);
    color: white;
    cursor: pointer;
}

.row--date {
    font-size: 0.9rem;
    padding: 15px 15px 2px 7px;
    margin: 0px 5px;
    border-bottom: 1px solid var(--color-border);
}

.row--posted {
    font-size: 0.8rem;
    padding: 10px 15px;
    margin: 0px 5px;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.2s;
    /* background-color: #e0f7fa; */
}

.row--posted:hover {
    font-size: 0.8rem;
    padding: 10px 15px;
    margin: 0px 5px;
    background-color: #b2ebf2;
}

.row--pending {
    font-size: 0.8rem;
    padding: 10px 15px;
    margin: 0px 5px;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.2s;
    background-color: #fff8e1;
}

.row--pending:hover {
    font-size: 0.8rem;
    padding: 10px 15px;
    margin: 0px 5px;
    background-color: #ffe082;
}

.row--budget {
    font-size: 0.8rem;
    padding: 10px 15px;
    margin: 0px 5px;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.2s;
    background-color: #ede7f6;
}

.row--budget:hover {
    font-size: 0.8rem;
    padding: 10px 15px;
    margin: 0px 5px;
    background-color: #d1c4e9;
}
/* #endregion */

/* #region FLEX */

.flex-row form button {
    margin: 0;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-spread {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-row {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.flex-evenly {
    display: flex;
    justify-content: space-evenly;
}

/* #endregion */

/* #region BUTTONS */

.delete-button {
    background: var(--color-error, #c62828);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
}

.delete-button:hover {
    background: #b71c1c;
}

.save-button {
    background: var(--color-success, #2e7d32); /* Fallback to green if variable not defined */
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
}

.save-button:hover {
    background: #1b5e20;
}

.cancel-button {
    display: block;
    width: 100%;
    text-align: center;
    background: #888;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    box-sizing: border-box;
}

.cancel-button:hover {
    background: #555;
}

.toggle-btn {
    background-color: var(--color-primary-base);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.toggle-btn:hover {
    background-color: var(--color-primary-dark);
}

.toggle-btn-clear {
    /* background-color: var(--color-primary-base); */
    color: var(--color-primary-base);
    border: 1px solid var(--color-primary-base);
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.toggle-btn-clear:hover {
    background-color: var(--color-primary-base);
    color: white;
}

.toggle-btn-delete {
    background-color: white;
    color: var(--color-error-darker);
    border: 1px solid var(--color-error-darker);
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.toggle-btn-delete:hover {
    background-color: var(--color-error-darker);
    color: white;
}

.toggle-btn-pending {
    color: var(--color-primary-base);
    border: 1px solid var(--color-warning);
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.toggle-btn--small {
    padding: 5px 10px;
    font-size: x-small;
    border-radius: 3px;
}

.half-button {
    flex: 1;
    margin: 0 4px; /* Optional spacing between */
    text-align: center;
}
.flex-spread .half-button:first-child {
    margin-left: 0;
}
.flex-spread .half-button:last-child {
    margin-right: 0;
}

/* #endregion */

/* #region MODAL */

.modal {
    display: none;
    position: fixed;
    inset: 0; /* shorthand for top/right/bottom/left: 0 */
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* consistent backdrop */
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.modal--visible {
    display: flex;
}

.modal:target {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal__overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.modal__box {
    max-height: 90vh;
    overflow-y: auto;
    background: var(--color-surface);
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
    border-radius: 0.5rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.modal-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-size: medium;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.modal-actions button,
.modal-actions a {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.modal-actions.flex-column {
    margin-top: 40px;
}

.modal--form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 25px;
}

.modal--form label {
    font-size: small;
    margin-bottom: 0.25rem;
}

.modal--form input,
.modal--form select {
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.modal-icon {
    margin-right: 8px;
}

.modal-list {
    list-style: none;
    padding-left: 0;
    margin: 16px 0;
}

.modal-list li {
    margin-bottom: 12px;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .modal__box {
        padding: 1rem;
        margin: 5px;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-actions button,
    .modal-actions a {
        width: 100%;
    }

    .modal--form > .flex-column {
        margin-bottom: 1rem;
    }
}

/* #endregion */

/* #region MESSAGES */
.form-error, .errorlist {
    color: var(--color-error, red);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.no-record-message {
    padding: 30px;
    margin: 20px auto;
    text-align: center;
    background-color: var(--color-bg);
    color: var(--color-primary-base);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 1px 3px var(--box-shadow);
}

.no-record-message .subtext {
    font-size: 0.9em;
    color: var(--color-primary-base);
    margin-top: 10px;
}

.message-box {
    display: flex;
    justify-content: center;
    padding: 10px 15px;
    margin: 5px 0px;
    border-radius: 5px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.success-message {
    background-color: #e0f7e9;
    color: #1e4620;
    border: 1px solid #b2dfdb;
}

.error-message {
    background-color: #fdecea;
    color: #c62828;
    border: 1px solid #f5c6cb;
}

.warning-message {
    background-color: #fff4e5;
    color: #856404;
    border: 1px solid #ffeeba;
}

.info-message {
    background-color: #e7f3fe;
    color: #004085;
    border: 1px solid #bee5eb;
}

.debug-message {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.message-box.dismissible {
    position: relative;
    padding-right: 36px;
}

.close-message {
    position: absolute;
    right: 12px;
    top: 8px;
    font-size: 1.2rem;
    color: #555;
    cursor: pointer;
    background: none;
    border: none;
}

/* #endregion */

/* #region FORMS */

.account-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 4px;
    font-size: smaller;
}

.form-group input,
.form-group select {
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.form-error {
    color: red;
    font-size: 0.9rem;
    margin-top: 4px;
}

.flex-row form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* to add % inside a form field */
.input-with-suffix {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* to add % inside a form field */
.input-with-suffix input {
    padding-right: 30px;
    width: 100%;
}

/* to add % inside a form field */
.input-suffix {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 0.9em;
    pointer-events: none;
}


/* #endregion */

/* #region MISCEL */

.hidden {
    display: none; !important;
}

.negative-number {
    color: var(--color-error);
}

.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-v-center {
    display: flex;
    align-items: center;
}

.width-full {
    width: 100%;
}

.flex-adaptive {
    display: flex;
    align-items: center;
    width: 100%;
}

.flex-adaptive .left,
.flex-adaptive .middle,
.flex-adaptive .right {
    flex: 1;
}

.flex-adaptive .left {
    text-align: left;
}

.flex-adaptive .middle {
    text-align: center;
}

.flex-adaptive .right {
    text-align: right;
}

.pagination-form {
    padding: 6px 12px;
    font-size: x-small;
    font-weight: 600;
    border: 1px solid var(--color-primary-base);
    background-color: white; /* or your preferred blue */
    color: var(--color-primary-base);
    border-radius: 3px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.gap {
    gap: 5px;
}

/* #endregion */

/* #region CHART */
.home-chart-container {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 100px;
    position: relative;
}

.home-chart-title {
    font-weight: 600;
    font-size: small;
    margin-left: 20px;
}

.home-chart-tile.expense {
    margin-top: 20px;
    padding-top: 5px;
    border-top: 1px solid var(--color-border);
}

.value-display {
    margin-bottom: 1px;
    display: flex;
    gap: 3px;
}

.value-display .value-pill {
    font-size: x-small;
}

.value-pill {
    padding: 2px 6px;
    border-radius: 4px;
}

.value-red {
    background-color: var(--color-error);
    color: white;
}

.value-light-red {
    background-color: var(--color-error-lighter);
    color: #333;
    margin-right: 20px;
}

.value-green {
    background-color: var(--color-success);
    color: white;
}

.value-light-green {
    background-color: var(--color-success-lighter);
    color: #333;
    margin-right: 20px;
}


/* #endregion CHART */

/* #region ACCOUNT DETAIL CAROUSEL AND PANEL */
.cc-detail-panel {
    gap: 25px;
    padding-top: 10px;
    font-size: small;
}

.panel-group {
    width: 215px;
}

.panel-01, .panel-02 {
    border-right: 1px solid var(--color-border);
    padding-right: 15px;
}

.account-carousel-container,
.account-carousel-dots {
    display: none;
}

.account-carousel-container {
    overflow-x: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    position: relative;
    font-size: small;
}

.account-carousel-track {
    display: flex;
    transition: transform 0.3s ease-in-out;
}

.carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    padding: 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.account-carousel-dots {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.carousel-dot {
    height: 10px;
    width: 10px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s;
    cursor: pointer;
}

.carousel-dot.active {
    background-color: #333;
}

/* Show carousel only on small screens */
@media (max-width: 768px) {
    .account-carousel-container {
        display: block;
    }

    .account-carousel-dots {
        display: flex;
    }

    .cc-detail-panel {
        display: none;
    }

}
/* #endregion CAROUSEL */

/* #region Add Account */
.add {
    display: flex;
    justify-content: center;
    width: 100%;
    color: var(--color-text);
    font-weight: bold;
    border: 1px solid var(--color-primary-faint);
    background-color: var(--color-primary-faint);
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.add:hover {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary-light);
    color: white;
}


/* #endregion Add Account */

/* #region RECURING */

.recurring--closed {
    font-style: italic;
    font-size: 0.7em;
    opacity: 0.7;
}

/* #endregion RECURING */


.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table th,
.table td {
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
}

.table th.text-left,
.table td.text-left {
    text-align: left;
}

.table th.text-right,
.table td.text-right {
    text-align: right;
}

.table .negative-number {
    color: var(--color-red);
}

.table .text-muted {
    color: var(--color-text-light);
}

@media (max-width: 768px) {
    .hide-sm {
        display: none !important;
    }
}

/* @media (min-width: 768px) {
    .hide-lg {
        display: none !important;
    }
} */

.bug {
    border: 1px solid red;
}

.column {
    flex: 1;
    text-align: left;
    padding: 4px 8px;
    word-break: break-word;
}

.column.right {
    flex: 1;
    text-align: right;
    padding: 4px 8px;
    word-break: break-word;
}

/* #region GOOGLE ACCOUNT LINK */

.badge--provider {
    background-color: var(--color-primary-faint);
    color: var(--color-primary-base);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 4px;
}

.text-muted {
    color: var(--color-text);
    font-size: 0.75rem;
    opacity: 0.75;
    margin-top: 4px;
}

/* Optional: style the info message */
.google-info {
    font-size: 0.85rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.google-info i {
    color: var(--color-primary-base);
}

.google-link-section .toggle-btn-clear {
    margin-top: 8px;
}

/* #endregion GOOGLE ACCOUNT LINK */

.text-tiny {
    font-size: var(--font-size-tiny);
}






/* #region Budget vs Actual Table Styling */
.bva-table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.bva-row {
    display: table-row;
    border-bottom: 1px solid var(--color-border, #ddd);
}

.bva-header {
    font-weight: 600;
    border-bottom: 2px solid var(--color-border, #999);
    background-color: var(--color-surface-alt, #f8f8f8);
}

.bva-col {
    display: table-cell;
    padding: 6px 10px;
    vertical-align: middle;
}

.bva-category {
    width: 40%;
}

.bva-amount {
    width: 20%;
    text-align: right;
}

.text-right {
    text-align: right;
}

.bva-section-header {
    font-weight: 600;
    border-top: 1px solid var(--color-border, #ccc);
    padding: 6px 10px;
}

.bva-total {
    font-weight: 600;
    background-color: var(--color-surface, #f9f9f9);
}

.bva-grand-total {
    font-weight: 700;
    background-color: var(--color-surface-alt, #eee);
    border-top: 2px solid var(--color-border, #999);
    border-bottom: 2px solid var(--color-border, #999);
}
/* #endregion Budget vs Actual Table Styling */

/* #region Filter Pills --- */
.pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pill {
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    background-color: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border, #ccc);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.pill:hover {
    background-color: var(--color-hover, #eef3ff);
}

.pill.selected {
    background-color: var(--color-primary, #2d6cdf);
    color: #fff;
    border-color: var(--color-primary);
}

/* Bulk control pills */
.pill-action {
    background-color: var(--color-surface-alt, #eef3ff);
    border: 1px dashed var(--color-primary, #2d6cdf);
    font-weight: 500;
}

.pill-action:hover {
    background-color: var(--color-primary, #2d6cdf);
    color: #fff;
}


@media (max-width: 768px) {
    .pill {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

/* #endregion Filter Pills --- */

