/* ===================================================
   CashBook — Premium Design System
   =================================================== */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- Design Tokens --- */
:root {
    /* Default theme is now Light Mode with bKash Pink accents to match mobile view */
    --color-bg: #f4f6fb;
    --color-bg-secondary: #ffffff;
    --color-bg-card: rgba(255, 255, 255, 0.92);
    --color-surface: #eef1f8;
    --color-border: rgba(226, 19, 110, 0.12);
    --color-text: #1e1f2b;
    --color-text-secondary: #5a5e78;
    --color-text-muted: #8b8fa3;

    --color-primary: #e2136e;
    --color-primary-light: #be123c;
    --color-primary-dark: #9f1239;

    --color-success: #10b981;
    --color-success-light: #34d399;
    --color-danger: #ef4444;
    --color-danger-light: #f87171;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;

    --color-income: #10b981;
    --color-expense: #ef4444;

    --gradient-primary: linear-gradient(135deg, #e2136e, #bd1160, #900b4b);
    --gradient-dark: linear-gradient(135deg, #1a1d27, #0f1117);
    --gradient-card: linear-gradient(145deg, rgba(226, 19, 110, 0.04), rgba(139, 92, 246, 0.02));

    --shadow-sm: 0 1px 3px rgba(226, 19, 110, 0.06);
    --shadow-md: 0 4px 16px rgba(226, 19, 110, 0.08);
    --shadow-lg: 0 8px 32px rgba(226, 19, 110, 0.10);
    --shadow-glow: 0 0 24px rgba(226, 19, 110, 0.08);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --sidebar-width: 260px;
    --topbar-height: 0px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Dark Mode Override --- */
[data-theme="dark"] {
    --color-bg: #0f1117;
    --color-bg-secondary: #1a1d27;
    --color-bg-card: rgba(26, 29, 39, 0.85);
    --color-surface: #22263a;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-text: #e4e6f0;
    --color-text-secondary: #8b8fa3;
    --color-text-muted: #5e6278;

    --color-primary: #e2136e;
    --color-primary-light: #f43f5e;
    --color-primary-dark: #be123c;

    --gradient-dark: linear-gradient(135deg, #1a1d27, #0f1117);
    --gradient-card: linear-gradient(145deg, rgba(226, 19, 110, 0.05), rgba(139, 92, 246, 0.03));

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 20px rgba(226, 19, 110, 0.15);
}

/* Light mode element-level overrides for hardcoded rgba values */
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235a5e78' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
}

.sidebar-nav .nav-link:hover {
    background: rgba(226, 19, 110, 0.1);
}

.sidebar-nav .nav-link.active {
    background: rgba(226, 19, 110, 0.12);
    color: var(--color-primary);
    box-shadow: inset 3px 0 0 var(--color-primary);
}

table thead {
    background: rgba(226, 19, 110, 0.06);
}

table tbody tr:hover {
    background: rgba(226, 19, 110, 0.05);
}

.guest-layout::before {
    background: radial-gradient(circle, rgba(226, 19, 110, 0.08), transparent 70%);
}

[data-theme="light"] .guest-layout::after {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.06), transparent 70%);
}

/* --- Theme Toggle Button --- */
.theme-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--color-text);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.theme-toggle:hover {
    transform: scale(1.12) rotate(15deg);
    box-shadow: var(--shadow-lg), 0 0 28px rgba(99, 102, 241, 0.25);
    border-color: var(--color-primary);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle .toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

/* Smooth body transitions for theme change */
body,
body *:not(.theme-toggle):not(script):not(style) {
    transition:
        background-color 0.35s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.35s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 15px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

a { color: var(--color-primary-light); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-primary); }

/* --- Guest Layout (Login/Register) --- */
.guest-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    position: relative;
    overflow: hidden;
}

.guest-layout::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12), transparent 70%);
    top: -200px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.guest-layout::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.1), transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

.guest-card {
    position: relative;
    z-index: 1;
    background: var(--color-bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: slideUp 0.6s var(--transition-slow);
}

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

.guest-card .logo-area {
    text-align: center;
    margin-bottom: 2rem;
}

.guest-card .logo-area h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.guest-card .logo-area p {
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* --- App Layout --- */
.app-layout {
    display: flex;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-bg-secondary);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.sidebar-brand h2 {
    font-size: 1.15rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.sidebar-nav .nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--color-text-muted);
    padding: 1rem 0.75rem 0.5rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.sidebar-nav .nav-link:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--color-text);
}

.sidebar-nav .nav-link.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--color-primary-light);
    box-shadow: inset 3px 0 0 var(--color-primary);
}

.sidebar-nav .nav-link .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sidebar-footer .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
}

.sidebar-footer .user-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.sidebar-footer .user-role {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
}

.page-header {
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.page-header .breadcrumb {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

/* --- Cards --- */
.card {
    background: var(--color-bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* --- Stat Cards --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.65rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                border-color 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: 0.75s;
    z-index: 2;
}

.stat-card:hover::before {
    left: 150%;
    transition: 0.75s;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gradient-primary);
    opacity: 0.04;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.stat-card:hover::after {
    transform: scale(1.4);
    opacity: 0.07;
}

/* Hover elevations & color-matched neon glows */
.stat-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-primary);
    box-shadow: 0 12px 24px rgba(226, 19, 110, 0.08), 
                0 4px 12px rgba(226, 19, 110, 0.04);
}

.stat-card.success-card:hover {
    border-color: var(--color-success);
    box-shadow: 0 12px 24px rgba(16, 185, 129, 0.08), 
                0 4px 12px rgba(16, 185, 129, 0.04);
}

.stat-card.danger-card:hover {
    border-color: var(--color-danger);
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.08), 
                0 4px 12px rgba(239, 68, 68, 0.04);
}

.stat-card.info-card:hover {
    border-color: var(--color-info);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.08), 
                0 4px 12px rgba(59, 130, 246, 0.04);
}

.stat-card.warning-card:hover {
    border-color: var(--color-warning);
    box-shadow: 0 12px 24px rgba(245, 158, 11, 0.08), 
                0 4px 12px rgba(245, 158, 11, 0.04);
}

/* Stat Icon details & hover wiggles */
.stat-card .stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1.15rem;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.stat-card:hover .stat-icon {
    transform: scale(1.12) rotate(8deg);
}

.stat-card .stat-icon.primary { background: rgba(226, 19, 110, 0.1); color: var(--color-primary); }
.stat-card .stat-icon.success { background: rgba(16, 185, 129, 0.1); color: #059669; }
.stat-card .stat-icon.danger  { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.stat-card .stat-icon.info    { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.stat-card .stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: #d97706; }

.stat-card .stat-value {
    font-size: 1.95rem;
    font-weight: 800;
    letter-spacing: -0.8px;
    margin-bottom: 0.35rem;
    line-height: 1.2;
    color: var(--color-text);
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* --- Tables --- */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    max-width: 100%;
}

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

table thead {
    background: rgba(99, 102, 241, 0.06);
}

table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    vertical-align: middle;
}

table tbody tr {
    transition: background var(--transition-fast);
}

table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control::placeholder {
    color: var(--color-text-muted);
}

.form-control.is-invalid {
    border-color: var(--color-danger);
}

.invalid-feedback {
    color: var(--color-danger-light);
    font-size: 0.8rem;
    margin-top: 0.35rem;
    display: block;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b8fa3' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-inline {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.form-inline .form-control {
    min-width: 200px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

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

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
    color: white;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--color-success);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: var(--color-success-light);
    color: white;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--color-danger-light);
    color: white;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--color-warning);
    color: #1a1d27;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
    transform: translateY(-1px);
    color: #1a1d27;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-ghost:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--color-text);
    border-color: rgba(99, 102, 241, 0.2);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: inline-flex;
    gap: 0.4rem;
}

/* --- Alerts --- */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideDown 0.3s ease;
    border: 1px solid transparent;
}

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

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--color-success-light);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--color-danger-light);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--color-warning);
}

/* --- Search Bar --- */
.search-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.search-bar .form-control {
    max-width: 320px;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.pagination a {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.pagination a:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--color-primary);
    color: var(--color-primary-light);
}

.pagination .active span {
    background: var(--color-primary);
    color: white;
    border: 1px solid var(--color-primary);
}

.pagination .disabled span {
    opacity: 0.3;
    cursor: not-allowed;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

/* --- Mobile Toggle --- */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

/* --- Print Styles --- */
@media print {
    /* Enforce light-mode values on all elements regardless of screen theme */
    :root, [data-theme], [data-theme="dark"], [data-theme="light"] {
        --color-bg: #ffffff !important;
        --color-bg-secondary: #ffffff !important;
        --color-bg-card: #ffffff !important;
        --color-surface: #ffffff !important;
        --color-border: #e2e8f0 !important;
        --color-text: #0f172a !important;
        --color-text-secondary: #475569 !important;
        --color-text-muted: #94a3b8 !important;
        --color-primary: #e2136e !important;
        --color-primary-light: #be123c !important;
        --color-primary-dark: #9f1239 !important;
        --gradient-primary: none !important;
        --gradient-card: none !important;
    }

    /* Hide layout navigation, sidebars, buttons, and toggles */
    .sidebar, 
    .sidebar-toggle, 
    .no-print, 
    .search-bar, 
    .btn-group, 
    .pagination, 
    .theme-toggle, 
    .mobile-bottom-nav { 
        display: none !important; 
    }
    
    /* Force wrappers to block layouts for correct rendering */
    html, body, .app-layout, .main-content {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        height: auto !important;
        overflow: visible !important;
        position: static !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body { 
        background: white !important; 
        color: #0f172a !important; 
        font-family: 'Hind Siliguri', 'Inter', sans-serif !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Force dark text color on general elements to prevent white-on-white text */
    body, p, span, div:not(.mobile-txn-icon-enhanced):not(.mobile-txn-left-accent), td, th, h1, h2, h3, h4, strong {
        color: #0f172a !important;
    }
    
    /* Keep status colors visible */
    .income, .income *, td[data-label="Income"], td[data-label="Total Income"] {
        color: #059669 !important;
    }
    
    .expense, .expense *, td[data-label="Expense"], td[data-label="Total Expense"] {
        color: #dc2626 !important;
    }
    
    .balance, .balance * {
        color: #e2136e !important;
    }
    
    /* Header layout */
    .page-header {
        border-bottom: 3px solid #e2136e !important;
        padding-bottom: 1.5rem !important;
        margin-bottom: 2rem !important;
    }
    
    .page-header h1 {
        color: #e2136e !important;
        font-size: 2.2rem !important;
        font-weight: 800 !important;
    }
    
    /* Report cards wrapper */
    .card { 
        border: none !important; 
        box-shadow: none !important; 
        background: white !important; 
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        display: block !important;
    }
    
    .card-header h2 {
        font-size: 1.25rem !important;
        border-bottom: 2px solid #f1f1f5 !important;
        padding-bottom: 0.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Ensure table container has visible overflow to prevent page cropping */
    .table-container {
        overflow: visible !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Premium report table grid */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 1rem !important;
        display: table !important;
    }
    
    thead {
        display: table-header-group !important;
    }
    
    tbody {
        display: table-row-group !important;
    }
    
    tr {
        display: table-row !important;
    }
    
    th, td {
        display: table-cell !important;
    }
    
    table th {
        background: #fdf2f7 !important; /* light pink tint */
        color: #bd1160 !important;
        font-weight: 700 !important;
        border: 1px solid #f1d5e3 !important;
        padding: 0.85rem !important;
        font-size: 0.85rem !important;
        text-transform: uppercase !important;
    }
    
    table td {
        border: 1px solid #f1e6ed !important;
        padding: 0.75rem !important;
        font-size: 0.85rem !important;
    }
    
    /* Total / summary rows inside print tables */
    .total-row td {
        font-weight: 700 !important;
        background: #fdf2f7 !important;
        border-top: 2px solid #e2136e !important;
        border-bottom: 1px solid #e2136e !important;
    }
    
    .balance-row td {
        font-weight: 800 !important;
        background: #fbe3ef !important;
        color: #e2136e !important;
        font-size: 1rem !important;
        border-bottom: 2px solid #e2136e !important;
    }

    /* Print page spacing setup */
    @page {
        size: A4 portrait;
        margin: 1.5cm;
    }
    
    .print-only-summary-header {
        display: block !important;
    }
}

.print-only-summary-header {
    display: none;
}

/* --- Money Formatting --- */
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.money.income { color: var(--color-income); }
.money.expense { color: var(--color-expense); }
.money.balance { color: var(--color-primary-light); }

/* --- Report Total Rows --- */
.total-row td {
    font-weight: 700 !important;
    background: rgba(99, 102, 241, 0.06) !important;
    border-top: 2px solid var(--color-border) !important;
}

.balance-row td {
    font-weight: 800 !important;
    background: rgba(99, 102, 241, 0.1) !important;
    font-size: 1rem;
}

/* --- Empty States --- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* --- Mobile-only / Desktop-only visibility helpers --- */
.mobile-only { display: none; }
.desktop-only { display: block; }
.mobile-hero { display: none; }
.mobile-quick-actions { display: none; }
.mobile-transaction-list { display: none; }

/* --- Mobile Bottom Navigation (hidden on desktop) --- */
.mobile-bottom-nav {
    display: none;
}

/* =====================================================
   RESPONSIVE — bKash-Style Premium Mobile Experience
   ===================================================== */
@media (max-width: 768px) {
    /* --- Visibility toggles --- */
    .mobile-only { display: block !important; }
    .desktop-only { display: none !important; }
    .mobile-hero { display: block !important; }
    .mobile-quick-actions { display: block !important; }
    .mobile-transaction-list { display: block !important; }

    /* --- Force light mode on mobile & set Bangla font priority --- */
    html {
        overflow-x: hidden;
    }

    body {
        overflow-x: hidden;
        width: 100%;
        background: #f4f6f9;
        color: #1a1a24;
        font-family: 'Hind Siliguri', 'Inter', -apple-system, sans-serif;
    }

    /* --- Slide-in Navigation Drawer --- */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
        width: 38px;
        height: 38px;
        font-size: 1rem;
        border-radius: 12px;
        top: 0.75rem;
        left: 0.75rem;
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid rgba(0, 0, 0, 0.05);
        color: #333;
        z-index: 600;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .sidebar-overlay.active {
        display: block;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .app-layout {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* --- Main Content Container --- */
    .main-content {
        margin-left: 0;
        padding: 0;
        padding-top: 3rem;
        padding-bottom: 5.5rem;
        max-width: 100vw;
        overflow-x: hidden;
        width: 100%;
        min-height: 100vh;
        background: #f4f6f9;
        animation: mobileFadeIn 0.4s ease-out;
    }

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

    /* ===================================================
       MOBILE HERO BANNER — Premium Gradient & Floating Circles
       =================================================== */
    .mobile-hero {
        background: linear-gradient(135deg, #e2136e 0%, #bd1160 50%, #900b4b 100%);
        padding: 1.5rem 1.25rem 2rem;
        color: white;
        position: relative;
        overflow: hidden;
        margin-top: -3rem;
        padding-top: 5rem;
        border-radius: 0 0 28px 28px;
        box-shadow: 0 8px 32px rgba(226, 19, 110, 0.25);
    }

    /* Floating glowing orb animation */
    .mobile-hero::before {
        content: '';
        position: absolute;
        top: -40px;
        right: -40px;
        width: 160px;
        height: 160px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
        animation: floatOrb 8s ease-in-out infinite alternate;
    }

    .mobile-hero::after {
        content: '';
        position: absolute;
        bottom: -20px;
        left: -20px;
        width: 120px;
        height: 120px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
        animation: floatOrb 6s ease-in-out infinite alternate-reverse;
    }

    @keyframes floatOrb {
        0% { transform: translate(0, 0) scale(1); }
        100% { transform: translate(15px, -15px) scale(1.15); }
    }

    .mobile-hero-greeting {
        font-size: 0.92rem;
        font-weight: 500;
        opacity: 0.95;
        margin-bottom: 0.85rem;
        display: flex;
        align-items: center;
        gap: 0.45rem;
    }

    .mobile-hero-wave {
        font-size: 1.25rem;
        display: inline-block;
        animation: wave 2.2s ease-in-out infinite;
        transform-origin: 70% 70%;
    }

    @keyframes wave {
        0%, 100% { transform: rotate(0deg); }
        20% { transform: rotate(15deg); }
        40% { transform: rotate(-10deg); }
        60% { transform: rotate(10deg); }
        80% { transform: rotate(-5deg); }
    }

    .mobile-hero-balance-label {
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 1.2px;
        opacity: 0.8;
        font-weight: 600;
        margin-bottom: 0.35rem;
    }

    /* bKash-style Tap-to-Reveal Balance capsule */
    .mobile-balance-capsule {
        display: inline-flex;
        align-items: center;
        background: white;
        color: #e2136e;
        padding: 0.45rem 1.25rem;
        border-radius: 30px;
        font-size: 0.95rem;
        font-weight: 700;
        margin-bottom: 1.65rem;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        position: relative;
        overflow: hidden;
        min-width: 160px;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.4);
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-balance-capsule:active {
        transform: scale(0.95);
    }

    .mobile-balance-icon-label {
        font-size: 0.75rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 0.35rem;
        transition: opacity 0.2s ease;
    }

    .mobile-balance-val {
        font-size: 1.05rem;
        font-weight: 800;
        letter-spacing: -0.2px;
        display: none;
        animation: balanceFadeIn 0.3s ease-out forwards;
    }

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

    .mobile-hero-row {
        display: flex;
        gap: 0.85rem;
    }

    .mobile-hero-stat {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 0.65rem;
        background: rgba(255, 255, 255, 0.12);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        padding: 0.8rem 0.95rem;
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        transition: transform 0.2s ease;
    }

    .mobile-hero-stat:active {
        transform: scale(0.96);
    }

    .mobile-hero-stat-icon {
        font-size: 0.85rem;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
    }

    .mobile-hero-stat.income .mobile-hero-stat-icon {
        background: #10b981;
        color: white;
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    }

    .mobile-hero-stat.expense .mobile-hero-stat-icon {
        background: #ef4444;
        color: white;
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    }

    .mobile-hero-stat-label {
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        opacity: 0.9;
        font-weight: 600;
    }

    .mobile-hero-stat-value {
        font-size: 1.05rem;
        font-weight: 700;
        letter-spacing: -0.2px;
    }

    /* ===================================================
       QUICK ACTIONS GRID — bKash App Layout Style
       =================================================== */
    .mobile-quick-actions {
        padding: 1.35rem 1rem 0;
        position: relative;
        z-index: 2;
    }

    .mobile-section-title {
        font-size: 1.05rem;
        font-weight: 700;
        color: #1a1a24;
        margin-bottom: 0.85rem;
        padding-left: 0.15rem;
        letter-spacing: -0.2px;
    }

    .quick-actions-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem 0.6rem;
        background: white;
        border-radius: 20px;
        padding: 1.25rem 0.95rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.035);
        border: 1px solid rgba(0, 0, 0, 0.01);
    }

    .quick-action-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.55rem;
        padding: 0.65rem 0.2rem;
        border-radius: 14px;
        text-decoration: none;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), 
                    background-color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        animation: quickActionPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }

    @keyframes quickActionPop {
        from { opacity: 0; transform: scale(0.85) translateY(12px); }
        to { opacity: 1; transform: scale(1) translateY(0); }
    }

    /* Stagger quick action items */
    .quick-action-item:nth-child(1) { animation-delay: 0.03s; }
    .quick-action-item:nth-child(2) { animation-delay: 0.06s; }
    .quick-action-item:nth-child(3) { animation-delay: 0.09s; }
    .quick-action-item:nth-child(4) { animation-delay: 0.12s; }
    .quick-action-item:nth-child(5) { animation-delay: 0.15s; }
    .quick-action-item:nth-child(6) { animation-delay: 0.18s; }

    .quick-action-item:active {
        transform: scale(0.9) translateY(1px);
        background-color: rgba(226, 19, 110, 0.03);
    }

    .quick-action-icon {
        width: 48px;
        height: 48px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.45rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .quick-action-item:active .quick-action-icon {
        transform: scale(0.95);
    }

    .quick-action-label {
        font-size: 0.75rem;
        font-weight: 600;
        color: #2e2e3a;
        text-align: center;
        line-height: 1.25;
    }

    /* ===================================================
       MOBILE TRANSACTION LIST — Clean List Design
       =================================================== */
    .mobile-transaction-list {
        padding: 0 0.15rem;
    }

    .mobile-txn-item {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        padding: 0.95rem 0.25rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        transition: background 0.2s ease, transform 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

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

    .mobile-txn-item:active {
        background: rgba(0, 0, 0, 0.015);
        transform: scale(0.995);
    }

    .mobile-txn-icon {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.85rem;
        font-weight: 700;
        flex-shrink: 0;
        box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2);
    }

    .mobile-txn-icon.income {
        background: rgba(16, 185, 129, 0.08);
        color: #059669;
        border: 1px solid rgba(16, 185, 129, 0.15);
    }

    .mobile-txn-icon.expense {
        background: rgba(239, 68, 68, 0.08);
        color: #dc2626;
        border: 1px solid rgba(239, 68, 68, 0.15);
    }

    .mobile-txn-details {
        flex: 1;
        min-width: 0;
    }

    .mobile-txn-title {
        font-size: 0.92rem;
        font-weight: 600;
        color: #1a1a24;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-txn-subtitle {
        font-size: 0.75rem;
        color: #7d849a;
        margin-top: 0.15rem;
    }

    .mobile-txn-amount {
        font-size: 0.95rem;
        font-weight: 700;
        flex-shrink: 0;
        letter-spacing: -0.2px;
    }

    .mobile-txn-amount.income {
        color: #059669;
    }

    .mobile-txn-amount.expense {
        color: #dc2626;
    }

    /* ===================================================
       CARDS & CONTENT — Glassmorphism & soft shadows
       =================================================== */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.85rem;
        padding: 1rem 1rem 0;
    }

    .page-header h1 {
        font-size: 1.3rem;
        font-weight: 800;
        color: #1a1a24;
    }

    .page-header .breadcrumb {
        font-size: 0.75rem;
        color: #7d849a;
    }

    .card {
        background: white;
        border: 1px solid rgba(0, 0, 0, 0.03);
        border-radius: 18px;
        padding: 1.15rem;
        margin: 0.5rem 1rem;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    }

    .card-header {
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .card-header h2 {
        font-size: 0.95rem;
        color: #1a1a24;
    }

    /* --- List Card elements on internal views --- */
    .table-container {
        overflow-x: hidden;
        border: none;
        border-radius: 0;
        max-width: 100%;
        margin: 0;
    }

    table {
        min-width: unset;
        width: 100%;
    }

    table thead {
        display: none;
    }

    table tbody tr {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        gap: 0.35rem;
    }

    table tbody tr:last-child {
        border-bottom: none;
    }

    table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.15rem 0;
        border: none;
        font-size: 0.85rem;
        color: #1a1a24;
    }

    table td:before {
        content: attr(data-label);
        font-size: 0.68rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #7d849a;
        display: block;
        margin-bottom: 0;
    }

    table td.money {
        font-size: 0.92rem;
        font-weight: 700;
    }

    table td.money.income {
        color: #059669;
    }

    table td.money.expense {
        color: #dc2626;
    }

    table td .btn-group {
        width: 100%;
        margin-top: 0.5rem;
        justify-content: flex-end;
    }

    /* --- Search & Input Fields --- */
    .search-bar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-bar .form-control {
        max-width: 100%;
        padding: 0.8rem 1rem;
        font-size: 0.92rem;
        border-radius: 12px;
        background: #f4f6f9;
        border: 1px solid rgba(0, 0, 0, 0.05);
        color: #1a1a24;
    }

    .form-group {
        margin-bottom: 1.15rem;
    }

    .form-group label {
        font-size: 0.75rem;
        color: #7d849a;
        margin-bottom: 0.4rem;
        font-weight: 600;
    }

    .form-control {
        padding: 0.85rem 1.15rem;
        font-size: 0.95rem;
        border-radius: 12px;
        background: #f4f6f9;
        border: 1px solid rgba(0, 0, 0, 0.05);
        color: #1a1a24;
        transition: all 0.2s ease;
    }

    .form-control:focus {
        border-color: #e2136e;
        background: white;
        box-shadow: 0 0 0 4px rgba(226, 19, 110, 0.08);
    }

    select.form-control {
        padding-right: 2.5rem;
    }

    /* --- Premium Buttons --- */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.88rem;
        border-radius: 12px;
        min-height: 44px;
        transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

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

    .btn-primary {
        background: linear-gradient(135deg, #e2136e, #bd1160);
        box-shadow: 0 4px 12px rgba(226, 19, 110, 0.25);
    }

    .btn-ghost {
        background: white;
        border: 1px solid rgba(0, 0, 0, 0.06);
        color: #2e2e3a;
    }

    .btn-ghost:hover, .btn-ghost:active {
        background: #f4f6f9;
    }

    .btn-lg {
        padding: 0.95rem 1.85rem;
        font-size: 1rem;
        border-radius: 14px;
        min-height: 52px;
    }

    .btn-sm {
        padding: 0.4rem 0.85rem;
        font-size: 0.78rem;
        min-height: 34px;
        border-radius: 8px;
    }

    /* --- Alerts --- */
    .alert {
        padding: 0.8rem 1.15rem;
        font-size: 0.85rem;
        border-radius: 14px;
        margin: 0.5rem 1rem;
        border: 1px solid transparent;
    }

    /* ===================================================
       MOBILE BOTTOM NAVIGATION — Premium app look
       =================================================== */
    .mobile-bottom-nav {
        display: flex;
        align-items: center;
        justify-content: space-around;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 500;
        height: 62px;
        background: rgba(255, 255, 255, 0.95);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
        padding: 0 0.25rem;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        flex: 1;
        padding: 0.35rem 0;
        color: #8b8fa3;
        text-decoration: none;
        transition: all 0.2s ease;
        position: relative;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav-item .bottom-nav-icon {
        font-size: 1.3rem;
        line-height: 1;
        transition: transform 0.2s ease;
    }

    .bottom-nav-item .bottom-nav-label {
        font-size: 0.6rem;
        font-weight: 600;
        letter-spacing: 0.3px;
        text-transform: uppercase;
    }

    .bottom-nav-item.active {
        color: #e2136e;
    }

    .bottom-nav-item.active .bottom-nav-icon {
        transform: scale(1.15);
    }

    .bottom-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 30px;
        height: 3px;
        background: linear-gradient(135deg, #e2136e, #bd1160);
        border-radius: 0 0 4px 4px;
        box-shadow: 0 1px 4px rgba(226, 19, 110, 0.4);
    }

    .bottom-nav-item:active .bottom-nav-icon {
        transform: scale(0.9);
    }

    /* --- Floating Action Button (center of bottom nav) --- */
    .bottom-nav-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: linear-gradient(135deg, #e2136e, #bd1160);
        color: white;
        font-size: 1.6rem;
        font-weight: 300;
        text-decoration: none;
        margin-top: -24px;
        box-shadow: 0 4px 18px rgba(226, 19, 110, 0.35);
        transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
        -webkit-tap-highlight-color: transparent;
        position: relative;
        z-index: 10;
        border: 4px solid white;
    }

    .bottom-nav-fab:active {
        transform: scale(0.88);
        box-shadow: 0 2px 10px rgba(226, 19, 110, 0.4);
        color: white;
    }

    /* --- Theme toggle above bottom nav --- */
    .theme-toggle {
        bottom: 5rem;
        right: 0.75rem;
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        background: white;
        border: 1px solid rgba(0, 0, 0, 0.05);
        color: #333;
    }

    /* --- Inline style overrides --- */
    .card[style*="max-width"] {
        max-width: 100% !important;
    }

    /* Override .money color for non-table contexts on mobile */
    .money { color: #1a1a24; }
    .money.income { color: #059669; }
    .money.expense { color: #dc2626; }
    .money.balance { color: #e2136e; }

    /* --- Links on mobile --- */
    a { color: #e2136e; }
    a:hover { color: #bd1160; }

    /* --- Nav link colors in sidebar on mobile --- */
    .sidebar-nav .nav-link.active {
        color: #e2136e;
        box-shadow: inset 3px 0 0 #e2136e;
}

/* --- Premium Recent Transactions Design --- */
.recent-txn-section {
    margin-top: 2rem;
    padding: 0;
}
@media (max-width: 768px) {
    .recent-txn-section {
        padding: 0 1rem;
    }
}
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
    padding: 0 0.15rem;
}
.section-title-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
}
@media (max-width: 768px) {
    .section-title-text {
        font-size: 1rem;
        color: #1a1a24;
        margin-bottom: 0;
    }
}
.view-all-link-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary-light);
    text-decoration: none;
    transition: color 0.2s ease;
}
@media (max-width: 768px) {
    .view-all-link-text {
        font-size: 0.8rem;
        color: #e2136e;
    }
}
.view-all-link-text:hover {
    color: var(--color-primary);
}
.txn-card-wrapper {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}
@media (max-width: 768px) {
    .txn-card-wrapper {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
}

/* Premium Desktop Table Styles */
.premium-txn-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}
.premium-txn-table th {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-secondary);
    border-bottom: none;
}
.premium-txn-table tr {
    background: transparent;
}
.premium-txn-table td {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}
.premium-txn-table td:first-child {
    border-left: 1px solid var(--color-border);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.premium-txn-table td:last-child {
    border-right: 1px solid var(--color-border);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.txn-row-hover:hover td {
    background: rgba(255, 255, 255, 0.04);
}
.calendar-icon {
    margin-right: 0.35rem;
    opacity: 0.8;
}
.acc-badge-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.acc-avatar-bubble {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.acc-name-txt {
    font-weight: 500;
}
.txn-type-pill {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.txn-type-pill.income-pill {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success-light);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.txn-type-pill.expense-pill {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger-light);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Light theme overrides for desktop table */
[data-theme="light"] .premium-txn-table td {
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .premium-txn-table td:first-child {
    border-left: 1px solid rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .premium-txn-table td:last-child {
    border-right: 1px solid rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .txn-row-hover:hover td {
    background: #f8fafc;
}

/* Mobile enhanced list items */
.mobile-txn-item-enhanced {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.02);
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.015);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.3s ease;
    animation: mobileCardPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

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

/* Stagger animations for list items */
.mobile-txn-item-enhanced:nth-child(1) { animation-delay: 0.05s; }
.mobile-txn-item-enhanced:nth-child(2) { animation-delay: 0.1s; }
.mobile-txn-item-enhanced:nth-child(3) { animation-delay: 0.15s; }
.mobile-txn-item-enhanced:nth-child(4) { animation-delay: 0.2s; }
.mobile-txn-item-enhanced:nth-child(5) { animation-delay: 0.25s; }

.mobile-txn-item-enhanced:active {
    transform: scale(0.96) translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.01);
}
.mobile-txn-left-accent {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
}
.mobile-txn-left-accent.income {
    background: #10b981;
}
.mobile-txn-left-accent.expense {
    background: #ef4444;
}
.mobile-txn-icon-enhanced {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}
.mobile-txn-icon-enhanced.income {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
}
.mobile-txn-icon-enhanced.expense {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}
.mobile-txn-middle-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.mobile-txn-title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    flex: 1;
}
.mobile-txn-acc-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a24;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}
.mobile-txn-type-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 20px;
}
.mobile-txn-type-badge.income {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}
.mobile-txn-type-badge.expense {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}
.mobile-txn-details-txt {
    font-size: 0.78rem;
    color: #64748b;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-txn-footer-meta {
    display: flex;
    font-size: 0.72rem;
    color: #94a3b8;
}
.mobile-txn-right-amount {
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
}
.mobile-txn-amount-val.income {
    color: #059669;
}
.mobile-txn-amount-val.expense {
    color: #dc2626;
}}

/* --- Today's Market Rates Section --- */
.market-rates-section {
    margin-top: 2rem;
    padding: 0;
}
@media (max-width: 768px) {
    .market-rates-section {
        padding: 0 1rem;
        margin-bottom: 1.5rem;
    }
}
.live-data-badge, .cached-data-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
}
.live-data-badge {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}
.cached-data-badge {
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
}

.market-rates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-top: 0.85rem;
}
@media (max-width: 768px) {
    .market-rates-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

.rate-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                border-color 0.3s ease;
}
@media (max-width: 768px) {
    .rate-card {
        background: white;
        border-color: rgba(0, 0, 0, 0.02);
        padding: 1.15rem;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
        animation: quickActionPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }
    .rate-card:nth-child(1) { animation-delay: 0.22s; }
    .rate-card:nth-child(2) { animation-delay: 0.28s; }
}

.rate-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
@media (max-width: 768px) {
    .rate-card:active {
        transform: scale(0.96) translateY(-1px);
    }
}

.rate-card.gold-rate:hover {
    border-color: #f59e0b;
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.08);
}
.rate-card.usd-rate:hover {
    border-color: #10b981;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.08);
}

.rate-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rate-card:hover .rate-icon {
    transform: scale(1.15) rotate(8deg);
}

.rate-card.gold-rate .rate-icon {
    background: rgba(245, 158, 11, 0.1);
}
.rate-card.usd-rate .rate-icon {
    background: rgba(16, 185, 129, 0.1);
}

.rate-info {
    flex: 1;
    min-width: 0;
}

.rate-label-text {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}
@media (max-width: 768px) {
    .rate-label-text {
        font-size: 0.72rem;
        color: #7d849a;
    }
}

.rate-value-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -0.5px;
}
@media (max-width: 768px) {
    .rate-value-text {
        font-size: 1.35rem;
        color: #1a1a24;
    }
}

/* Light theme card background overrides for rates */
[data-theme="light"] .rate-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .rate-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}
/* --- Premium 3D Icons Style (All Modes) --- */
.nav-icon, 
.bottom-nav-icon, 
.bottom-nav-fab span {
    font-style: normal;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15)) drop-shadow(0 4px 10px rgba(0,0,0,0.1));
    transform: perspective(100px) translate3d(0, 0, 4px);
    text-shadow: 
        0 1px 0 rgba(0, 0, 0, 0.08),
        0 2px 0 rgba(0, 0, 0, 0.06),
        0 3px 0 rgba(0, 0, 0, 0.04),
        0 4px 1px rgba(0,0,0,0.08),
        0 0 5px rgba(0,0,0,0.1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                filter 0.3s ease;
}

.quick-action-icon, 
.stat-icon, 
.rate-icon {
    font-style: normal;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15)) drop-shadow(0 4px 10px rgba(0,0,0,0.1));
    transform: perspective(100px) translate3d(0, 0, 4px);
    text-shadow: 
        0 1px 0 rgba(0, 0, 0, 0.08),
        0 2px 0 rgba(0, 0, 0, 0.06),
        0 3px 0 rgba(0, 0, 0, 0.04),
        0 4px 1px rgba(0,0,0,0.08),
        0 0 5px rgba(0,0,0,0.1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                filter 0.3s ease;
}

/* 3D Pop Hover Animations */
.nav-link:hover .nav-icon,
.quick-action-item:hover .quick-action-icon,
.stat-card:hover .stat-icon,
.rate-card:hover .rate-icon,
.bottom-nav-item:hover .bottom-nav-icon,
.bottom-nav-fab:hover span {
    transform: perspective(100px) translate3d(0, -4px, 12px) rotate(5deg) !important;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.22)) drop-shadow(0 8px 20px rgba(0,0,0,0.18)) !important;
}

/* 3D Claymorphic Icon Circular Containers */
.quick-action-icon, 
.stat-icon, 
.rate-icon {
    box-shadow: 
        inset 0 -3px 6px rgba(0, 0, 0, 0.12),
        inset 0 3px 6px rgba(255, 255, 255, 0.5),
        0 6px 16px rgba(0, 0, 0, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.quick-action-item:hover .quick-action-icon,
.stat-card:hover .stat-icon,
.rate-card:hover .rate-icon {
    box-shadow: 
        inset 0 -1px 3px rgba(0, 0, 0, 0.08),
        inset 0 4px 8px rgba(255, 255, 255, 0.6),
        0 10px 24px rgba(0, 0, 0, 0.08) !important;
}

/* Dark Mode 3D Container Variables */
[data-theme="dark"] .quick-action-icon, 
[data-theme="dark"] .stat-icon, 
[data-theme="dark"] .rate-icon {
    box-shadow: 
        inset 0 -3px 6px rgba(0, 0, 0, 0.35),
        inset 0 3px 6px rgba(255, 255, 255, 0.12),
        0 6px 16px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .quick-action-item:hover .quick-action-icon,
[data-theme="dark"] .stat-card:hover .stat-icon,
[data-theme="dark"] .rate-card:hover .rate-icon {
    box-shadow: 
        inset 0 -1px 3px rgba(0, 0, 0, 0.25),
        inset 0 4px 8px rgba(255, 255, 255, 0.12),
        0 10px 24px rgba(0, 0, 0, 0.3) !important;
}

/* --- Utility --- */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-secondary); }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none; }
.w-full { width: 100%; }

/* --- Responsive Adjustments for Small Mobile Viewports (<= 480px) --- */
@media (max-width: 480px) {
    /* Main layout constraints */
    .main-content {
        padding-top: 2.75rem;
        padding-bottom: 5rem;
    }
    
    /* Hero card overrides to avoid overflow */
    .mobile-hero {
        padding: 1.25rem 0.85rem 1.5rem;
        padding-top: 4.25rem;
        border-radius: 0 0 22px 22px;
    }
    
    .mobile-hero-greeting {
        font-size: 0.85rem;
    }
    
    .mobile-balance-capsule {
        padding: 0.55rem 0.85rem;
    }
    
    .mobile-balance-icon-label {
        font-size: 0.72rem;
    }
    
    .mobile-balance-val {
        font-size: 1.2rem;
    }
    
    .mobile-hero-row {
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
    
    .mobile-hero-stat {
        padding: 0.55rem;
        gap: 0.35rem;
        border-radius: 12px;
    }
    
    .mobile-hero-stat-icon {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
    
    .mobile-hero-stat-value {
        font-size: 0.92rem;
        letter-spacing: -0.3px;
    }
    
    .mobile-hero-stat-label {
        font-size: 0.6rem;
    }
    
    /* Quick Action Grid overrides */
    .mobile-quick-actions {
        padding: 1rem 0.75rem 0;
    }
    
    .quick-actions-grid {
        padding: 1rem 0.65rem;
        gap: 0.5rem;
        border-radius: 16px;
    }
    
    .quick-action-item {
        padding: 0.45rem 0.1rem;
        gap: 0.4rem;
    }
    
    .quick-action-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        border-radius: 12px;
    }
    
    .quick-action-label {
        font-size: 0.68rem;
        font-weight: 500;
    }
    
    /* Today's Market Rates Section overrides */
    .market-rates-section {
        padding: 0 0.75rem;
        margin-top: 1.5rem;
    }
    
    .rate-card {
        padding: 0.95rem;
        gap: 0.75rem;
        border-radius: 14px;
    }
    
    .rate-icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
        border-radius: 10px;
    }
    
    .rate-value-text {
        font-size: 1.2rem;
    }
    
    .rate-label-text {
        font-size: 0.68rem;
    }
    
    /* Recent Transactions Card List overrides */
    .mobile-transaction-list {
        padding: 0 0.75rem;
    }
    
    .mobile-txn-item-enhanced {
        padding: 0.85rem;
        gap: 0.6rem;
        border-radius: 14px;
    }
    
    .mobile-txn-icon-enhanced {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .mobile-txn-acc-name {
        font-size: 0.82rem;
    }
    
    .mobile-txn-type-badge {
        font-size: 0.58rem;
        padding: 0.08rem 0.35rem;
    }
    
    .mobile-txn-details-txt {
        font-size: 0.72rem;
    }
    
    .mobile-txn-right-amount {
        font-size: 0.85rem;
    }
    
    /* Index list cards mobile overrides */
    .card {
        padding: 1rem;
        margin: 0.5rem 0.75rem;
        border-radius: 14px;
    }
    
    table td {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.75rem !important;
    }
    
    table td:before {
        font-size: 0.62rem !important;
    }
    
    /* Mobile bottom navigation adjustments */
    .bottom-nav-item {
        padding: 0.35rem 0;
    }
    
    .bottom-nav-icon {
        font-size: 1.1rem;
    }
    
    .bottom-nav-label {
        font-size: 0.62rem;
    }
    
    .bottom-nav-fab {
        width: 48px;
        height: 48px;
        top: -12px;
    }
}
