/* assets/css/style.css */
:root {
    --primary-color: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #60A5FA;

    --income-color: #16A34A;
    --expense-color: #DC2626;

    --bg-color: #F8FAFC;
    --card-bg: rgba(255, 255, 255, .8);

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-light: #94A3B8;

    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;

    /* Glass */
    --glass-border: rgba(255, 255, 255, 0.55);
    --glass-highlight: rgba(255, 255, 255, 0.75);
    --glass-shadow: rgba(15, 23, 42, .08);
    --glass-bg: rgba(255, 255, 255, .60);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
}

/* App Bar */
.app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-bar-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
}

.app-bar-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: white;
}

/* Navbar - Global Bottom Navigation */
.navbar {
    position: fixed;
    top: auto;
    bottom: 16px;
    /* Centered floating bar */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 800px;
    border-radius: 50px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    background: var(--card-bg);
    z-index: 1000;
    display: block;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.nav-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 8px 12px;
    display: flex;
    justify-content: center;
    height: 70px;
    align-items: center;
}

.nav-brand,
.desktop-only,
.logout-btn {
    display: none !important;
}

.nav-links {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: space-around;
    align-items: center;
    gap: 0;
    padding-bottom: 0;
}

.nav-item {
    font-size: 11px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: 100%;
    flex: 1;
    max-width: 72px;
    text-align: center;
    color: var(--text-light);
    text-decoration: none;
    background: transparent !important;
    transition: all 0.3s ease;
    border-radius: 50px !important;
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.1) !important;
    /* Light primary color */
    color: var(--primary-color) !important;
}

.nav-icon {
    margin-bottom: 4px;
    stroke: currentColor;
}

.nav-fab {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: var(--primary-color) !important;
    border-radius: 50% !important;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    color: white !important;
    z-index: 1001;
    transition: transform 0.2s;
    text-decoration: none;
    padding: 0 !important;
}

.nav-fab:active {
    transform: scale(0.95);
}

@media (min-width: 840px) {
    .nav-fab {
        right: calc((100vw - 800px) / 2 + 20px);
    }
}

/* Layout */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 16px;
    padding-top: 76px;
    /* Space for top app bar (56px + 20px) */
    padding-bottom: 115px;
    /* Space for bottom nav */
}

.main-content.login-mode {
    max-width: 100%;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-container {
    animation: fadeIn 0.3s ease-in-out;
    height: auto !important;
    min-height: calc(100vh - 100px) !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Balance Card */
.overall-balance-section {
    margin-bottom: 20px;
}

.overall-balance-card {
    --overall-text-primary: #ffffff;
    --overall-text-secondary: #eaf2ff;
    --overall-text-muted: #dbeafe;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    color: var(--overall-text-primary);
    background:
        radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(135deg, #1d4ed8 0%, #1e40af 52%, #1e3a8a 100%);
    /* box-shadow: 0 14px 30px -12px rgba(30, 64, 175, 0.6); */
}

.overall-balance-card::after {
    position: absolute;
    z-index: -1;
    right: -42px;
    bottom: -72px;
    width: 170px;
    height: 170px;
    border: 28px solid rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    content: "";
}

.overall-balance-summary {
    display: flex;
    align-items: center;
    gap: 14px;
}

.overall-balance-icon {
    display: flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    color: var(--overall-text-primary);
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.overall-balance-copy {
    min-width: 0;
    flex: 1;
}

.overall-balance-card .balance-label {
    margin-bottom: 3px;
    color: var(--overall-text-secondary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

.overall-balance-context {
    color: var(--overall-text-muted);
}

.overall-balance-amount {
    overflow: hidden;
    color: var(--overall-text-primary) !important;
    font-size: 28px;
    line-height: 1.25;
    text-overflow: ellipsis;
}

.wallet-overview {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.wallet-overview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--overall-text-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wallet-overview-header svg {
    opacity: 1;
}

.wallet-balances-container {
    --mini-wallet-card-width: clamp(132px, 40vw, 154px);
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    margin: 0 -22px -2px;
    padding: 0 22px 6px;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 22px;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.wallet-balances-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.mini-wallet-card {
    flex: 0 0 var(--mini-wallet-card-width);
    width: var(--mini-wallet-card-width);
    min-width: 132px;
    max-width: 154px;
    padding: 12px 13px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 16px rgba(15, 23, 42, 0.08);
    scroll-snap-align: start;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.mini-wallet-card:hover {
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.mini-wallet-card.active {
    border-color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 8px 20px rgba(15, 23, 42, 0.15);
}

.mini-wallet-card-header {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    margin-bottom: 7px;
}

.mini-wallet-icon {
    display: flex;
    flex: 0 0 24px;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    color: var(--overall-text-primary);
    background: rgba(255, 255, 255, 0.14);
}

.mini-wallet-name {
    overflow: hidden;
    color: var(--overall-text-secondary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-wallet-balance {
    overflow: hidden;
    color: var(--overall-text-primary);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-wallet-card.is-negative .mini-wallet-balance {
    color: #fff1f2;
}

.balance-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.current-date {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 12px;
    font-weight: 500;
}

.balance-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
}

.transaction-count {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
    font-weight: 500;
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.stat-card {
    flex: 1;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-card.income .icon {
    color: var(--income-color);
}

.stat-card.expense .icon {
    color: var(--expense-color);
}

.stat-amount {
    font-size: 14px;
    font-weight: 700;
}

/* Utilities */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.m-0 {
    margin: 0;
}

.p-0 {
    padding: 0 !important;
}

.p-3 {
    padding: 12px !important;
}

.w-100 {
    width: 100%;
}

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

.text-danger {
    color: var(--expense-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    font-size: 16px;
    background: var(--bg-color);
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary-color);
}

/* Filters & Time Range */
.time-range-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border-radius: 100px;
    padding: 8px 16px;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.time-range-indicator .nav-button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.time-range-indicator .nav-button:hover {
    background: rgba(0, 0, 0, 0.04);
}

.time-range-indicator .date-container {
    text-align: center;
    flex-grow: 1;
}

.time-range-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.time-range-dates {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-color);
    margin-top: 2px;
}

.wallet-filter-container {
    overflow-x: auto;
    margin-bottom: 16px;
    padding-bottom: 4px;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.wallet-filter-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.wallet-filter-group {
    display: flex;
    gap: 8px;
    width: max-content;
    padding: 2px 2px;
}

.wallet-chip {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid var(--gray-200);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.wallet-chip.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Lists */
.summary-list .list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.tx-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--card-bg);
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.tx-item:hover {
    background: var(--gray-50);
}

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

.tx-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: 600;
    font-size: 18px;
}

.tx-details {
    flex: 1;
}

.tx-desc {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tx-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.tx-amount {
    font-size: 16px;
    font-weight: 700;
}

.empty-text {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    padding: 20px 0;
}

/* Settings */
.settings-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

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

.settings-icon {
    width: 38px;
    height: 38px;
    background: var(--gray-100);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
    font-size: 18px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.settings-icon-blue { background: rgba(37, 99, 235, 0.1); color: #2563eb; }
.settings-icon-indigo { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.settings-icon-teal { background: rgba(20, 184, 166, 0.1); color: #0d9488; }
.settings-icon-amber { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.settings-icon-sky { background: rgba(14, 165, 233, 0.1); color: #0284c7; }
.settings-icon-orange { background: rgba(249, 115, 22, 0.1); color: #ea580c; }
.settings-icon-emerald { background: rgba(16, 185, 129, 0.1); color: #059669; }
.settings-icon-purple { background: rgba(168, 85, 247, 0.1); color: #9333ea; }
.settings-icon-green { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.settings-icon-rose { background: rgba(244, 63, 94, 0.1); color: #e11d48; }
.settings-icon-danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

.settings-content {
    flex: 1;
}

.settings-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.settings-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.settings-arrow {
    color: var(--gray-400);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.back-btn {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

/* Shimmer Loading */
.shimmer {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 100%;
    animation: shimmerAnim 1.5s linear infinite forwards;
    color: transparent !important;
    border-color: transparent !important;
    pointer-events: none;
}

.shimmer * {
    visibility: hidden !important;
}

.shimmer-text {
    border-radius: 8px;
    min-height: 16px;
    display: inline-block;
    width: min(100%, 112px);
    vertical-align: middle;
}

.shimmer-text-large {
    width: min(75%, 220px);
    min-height: 28px;
}

.shimmer-text-small {
    width: 88px;
    min-height: 12px;
}

.shimmer-on-primary {
    background-color: rgba(255, 255, 255, 0.18);
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.32) 40%, rgba(255, 255, 255, 0.12) 80%);
}

.wallet-card-skeleton {
    flex: 0 0 var(--mini-wallet-card-width, 154px);
    width: var(--mini-wallet-card-width, 154px);
    min-width: 132px;
    max-width: 154px;
    height: 70px;
    border-radius: 14px;
}

.overall-balance-card .wallet-card-skeleton {
    border-color: rgba(255, 255, 255, 0.08) !important;
    background-color: rgba(255, 255, 255, 0.1);
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.2) 40%, rgba(255, 255, 255, 0.08) 80%);
}

.insight-card-skeleton {
    height: 156px;
    border-radius: 12px;
}

.report-legend-skeleton {
    height: 56px;
    margin-bottom: 8px;
    border-radius: 8px;
}

.report-transaction-skeleton {
    height: 116px;
    margin-bottom: 12px;
    border-radius: 16px;
}

.chart-skeleton {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg, #fff);
}

.chart-skeleton[hidden] {
    display: none !important;
}

.chart-skeleton-bars {
    width: 90%;
    height: 82%;
    border-radius: 10px;
    clip-path: polygon(0 100%, 0 65%, 6% 65%, 6% 100%, 10% 100%, 10% 40%, 16% 40%, 16% 100%, 20% 100%, 20% 55%, 26% 55%, 26% 100%, 30% 100%, 30% 25%, 36% 25%, 36% 100%, 40% 100%, 40% 48%, 46% 48%, 46% 100%, 50% 100%, 50% 18%, 56% 18%, 56% 100%, 60% 100%, 60% 58%, 66% 58%, 66% 100%, 70% 100%, 70% 32%, 76% 32%, 76% 100%, 80% 100%, 80% 50%, 86% 50%, 86% 100%, 90% 100%, 90% 28%, 96% 28%, 96% 100%);
}

.chart-skeleton-donut {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    mask: radial-gradient(circle, transparent 0 55%, #000 56%);
    -webkit-mask: radial-gradient(circle, transparent 0 55%, #000 56%);
}

@media (prefers-reduced-motion: reduce) {
    .shimmer {
        animation: none;
    }

    .mini-wallet-card {
        transition: none;
    }
}

@media (max-width: 420px) {
    .overall-balance-card {
        padding: 20px;
        border-radius: 18px;
    }

    .overall-balance-icon {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .wallet-balances-container {
        margin-right: -20px;
        margin-left: -20px;
        padding-right: 20px;
        padding-left: 20px;
        scroll-padding-inline: 20px;
    }

    .mini-wallet-card {
        padding: 11px 12px;
    }

    .mini-wallet-balance {
        font-size: clamp(12px, 3.5vw, 14px);
    }
}

@media (max-width: 340px) {
    .overall-balance-card {
        padding: 16px;
    }

    .overall-balance-summary {
        gap: 10px;
    }

    .overall-balance-icon {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .wallet-balances-container {
        margin-right: -16px;
        margin-left: -16px;
        padding-right: 16px;
        padding-left: 16px;
        scroll-padding-inline: 16px;
    }
}

@keyframes shimmerAnim {
    0% {
        background-position: -468px 0;
    }

    100% {
        background-position: 468px 0;
    }
}

.loading-disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

/* Transaction Form Styles from okane-php */
.type-toggle {
    display: flex;
    background: var(--gray-100);
    border-radius: 8px;
    padding: 4px;
}
.type-toggle input {
    display: none;
}
.type-toggle label {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}
#typeExpense:checked + label {
    background: white;
    color: var(--expense-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#typeIncome:checked + label {
    background: white;
    color: var(--income-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.category-chip {
    padding: 8px 12px;
    border-radius: 20px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    user-select: none;
}
.category-chip.selected {
    border-color: var(--primary-color) !important;
    transform: scale(1.05);
}

/* AI Chat Styles from okane-php */
.message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
}
.user-msg {
    align-self: flex-end;
}
.assistant-msg {
    align-self: flex-start;
}
.system-msg {
    align-self: center;
    max-width: 100%;
}
.msg-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}
.user-msg .msg-content {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}
.assistant-msg .msg-content {
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}
.system-msg .msg-content {
    background: var(--gray-100);
    color: var(--text-secondary);
    text-align: center;
    font-size: 13px;
}
.msg-time {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}
.user-msg .msg-time {
    text-align: right;
}
.typing-indicator {
    display: none;
    align-self: flex-start;
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    border-bottom-left-radius: 4px;
    margin-bottom: 0;
}
.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--gray-400);
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
}

.chat-input-area {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    padding: 12px 16px;
    background: white;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    display: flex;
    gap: 12px;
    align-items: center;
    z-index: 1000;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

/* Modals from okane-php */
.modal, .modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-content {
    background: var(--bg-color, #ffffff);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.2s ease-out;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Back button */
.back-btn {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}
.back-btn:hover {
    color: var(--primary-color);
}

/* ============================================================= */
/* GLOBAL UTILITIES & SCROLLBAR HIDING                           */
/* ============================================================= */
.no-scrollbar {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}
.no-scrollbar::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* ============================================================= */
/* APP SPLASH SCREEN                                             */
/* ============================================================= */
.app-splash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 38%, #1e3a8a 0%, #0f172a 70%, #080d1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
}

.app-splash.splash-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px;
    position: relative;
    max-width: 320px;
    width: 100%;
}

.splash-logo-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.splash-logo {
    width: 88px;
    height: 88px;
    border-radius: 20px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.15);
    position: relative;
    z-index: 2;
    animation: splashFloat 3s ease-in-out infinite;
    object-fit: cover;
}

.splash-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.45) 0%, rgba(37, 99, 235, 0) 70%);
    border-radius: 50%;
    filter: blur(14px);
    z-index: 1;
    animation: splashPulse 2.4s ease-in-out infinite alternate;
}

.splash-title {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin: 0 0 6px 0;
    background: linear-gradient(135deg, #ffffff 0%, #bfdbfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.splash-subtitle {
    font-size: 13.5px;
    color: #94a3b8;
    font-weight: 500;
    margin: 0 0 26px 0;
    letter-spacing: 0.02em;
}

.splash-loader {
    width: 140px;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.splash-loader-bar {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 99px;
    position: absolute;
    top: 0;
    left: 0;
    animation: splashLoaderAnim 1.4s ease-in-out infinite;
}

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

@keyframes splashPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.85);
        opacity: 0.45;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0.9;
    }
}

@keyframes splashLoaderAnim {
    0% {
        left: -40%;
    }
    50% {
        left: 45%;
        width: 50%;
    }
    100% {
        left: 100%;
        width: 20%;
    }
}

/* ============================================================= */
/* LOGIN VIEW (GLASSMORPHISM & POLISHED FORM)                    */
/* ============================================================= */
.login-wrapper {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 390px;
    padding: 34px 28px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.login-brand-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-brand-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin: 0 auto 12px auto;
    display: block;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.login-brand-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    letter-spacing: -0.02em;
}

.login-brand-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin: 0;
}

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

.login-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-light);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.login-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    background: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.login-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 6px;
}

.login-password-toggle:hover {
    color: var(--text-primary);
}

.login-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.login-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
}

.login-btn-submit {
    width: 100%;
    padding: 13px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #ffffff;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.42);
}

.login-btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.login-btn-submit:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.login-error-alert {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.4;
}

/* ============================================================= */
/* EMPTY STATES                                                  */
/* ============================================================= */
.empty-state {
    text-align: center;
    padding: 36px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.empty-state-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.empty-state-desc {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 280px;
    margin: 0 auto;
}

/* ============================================================= */
/* GLOBAL CUSTOM DIALOG / MODAL (Alert & Confirm)                */
/* ============================================================= */
.custom-dialog-overlay {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
}

.custom-dialog-card {
    text-align: center;
    max-width: 360px;
    padding: 24px 20px 20px;
    border-radius: 20px;
    background: var(--card-bg, #ffffff);
    color: var(--text-primary, #1e293b);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25), 0 0 1px 1px rgba(0, 0, 0, 0.05);
    animation: dialogPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dialogPopIn {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.custom-dialog-icon-wrapper {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.custom-dialog-icon-wrapper svg {
    width: 28px;
    height: 28px;
}

/* Dialog types */
.custom-dialog-type-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.custom-dialog-type-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.custom-dialog-type-success {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.custom-dialog-type-info {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

.custom-dialog-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary, #1e293b);
}

.custom-dialog-message {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary, #64748b);
    margin: 0 0 20px 0;
    word-break: break-word;
}

.custom-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.custom-dialog-actions .btn {
    flex: 1;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
}

.btn-danger {
    background: var(--expense-color, #dc2626);
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-danger:active {
    background: #991b1b;
}



