:root {
    --color-primary: #2563EB;
    --color-secondary: #0F172A;
    --color-success: #16A34A;
    --color-warning: #F59E0B;
    --color-danger: #DC2626;
    --color-bg: #F8FAFC;
    --color-card: #FFFFFF;
    --color-text: #0F172A;
    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-soft: 0 2px 12px rgba(15, 23, 42, 0.06);
}

[data-bs-theme="dark"] {
    --color-bg: #0B1120;
    --color-card: #131C31;
    --color-text: #E2E8F0;
    --shadow-soft: 0 2px 12px rgba(0,0,0,0.4);
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Modern auth pages (login / landing) ---------- */
.auth-body {
    min-height: 100vh;
    background: linear-gradient(160deg, #0F172A 0%, #1E293B 45%, #2563EB 130%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 24px 16px;
}

.auth-bg-orbs { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.35; animation: orbFloat 12s ease-in-out infinite; }
.orb-1 { width: 380px; height: 380px; background: #2563EB; top: -100px; left: -80px; animation-delay: 0s; }
.orb-2 { width: 300px; height: 300px; background: #7C3AED; bottom: -80px; right: -60px; animation-delay: 3s; }
.orb-3 { width: 240px; height: 240px; background: #16A34A; top: 40%; right: 10%; animation-delay: 6s; opacity: 0.2; }
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -30px) scale(1.08); }
}

.auth-wrapper { position: relative; z-index: 1; width: 100%; max-width: 420px; }

.auth-card-modern {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.1);
    padding: 40px 32px;
    animation: cardRise 0.5s ease;
}
[data-bs-theme="dark"] .auth-card-modern { background: rgba(19, 28, 49, 0.98); }
@keyframes cardRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.auth-logo-mark {
    width: 64px; height: 64px; border-radius: 18px; margin: 0 auto;
    background: linear-gradient(135deg, #2563EB, #7C3AED);
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; color: #fff; box-shadow: 0 8px 20px rgba(37,99,235,0.35);
}
.auth-logo-mark-lg { width: 84px; height: 84px; font-size: 40px; border-radius: 22px; }
.auth-logo-img { max-height: 64px; max-width: 220px; object-fit: contain; }
.landing-logo-img { max-height: 90px; max-width: 280px; object-fit: contain; }

.auth-subtitle { color: #64748B; font-size: 14px; margin: 0; }
.landing-title { color: #fff; letter-spacing: 2px; font-size: 34px; }
.fw-800 { font-weight: 800; }

.auth-tabs {
    display: flex; background: #F1F5F9; border-radius: 999px; padding: 4px; margin-top: 20px;
}
[data-bs-theme="dark"] .auth-tabs { background: rgba(255,255,255,0.06); }
.auth-tab {
    flex: 1; text-align: center; padding: 9px 0; border-radius: 999px; font-size: 13.5px; font-weight: 600;
    color: #64748B; text-decoration: none; transition: all .15s ease;
}
.auth-tab.active { background: #fff; color: var(--color-primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
[data-bs-theme="dark"] .auth-tab.active { background: #1E293B; color: #60A5FA; }

.auth-method-pills .nav-link { border-radius: 999px; font-size: 13px; font-weight: 600; color: #64748B; }
.auth-method-pills .nav-link.active { background: var(--color-primary); color: #fff; }

.auth-input { border-radius: 12px; border: 1.5px solid #E2E8F0; padding: 12px 16px; font-size: 14.5px; }
.auth-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }

.btn-auth-primary {
    background: linear-gradient(135deg, #2563EB, #1D4ED8); color: #fff; border: none; border-radius: 12px;
    padding: 13px; font-weight: 600; font-size: 15px; transition: transform .12s ease, box-shadow .12s ease;
}
.btn-auth-primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(37,99,235,0.35); }

.btn-google-modern {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    background: #fff; border: 1.5px solid #E2E8F0; border-radius: 12px; padding: 13px;
    font-weight: 600; font-size: 14.5px; color: #1E293B; text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.btn-google-modern:hover:not(:disabled) { border-color: #CBD5E1; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); color: #1E293B; }
.btn-google-modern:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-landing-primary { background: linear-gradient(135deg, #2563EB, #1D4ED8); color: #fff; border: none; }
.btn-landing-primary i, .btn-landing-primary span { color: #fff; }
.btn-landing-secondary { background: rgba(255,255,255,0.95); }

.auth-link { color: #93C5FD; text-decoration: none; font-weight: 500; }
.auth-card-modern .auth-link { color: var(--color-primary); }
.auth-footer-text { color: rgba(255,255,255,0.55); }

/* ---------- Sidebar logo ---------- */
.sidebar-logo-img { max-height: 32px; max-width: 32px; object-fit: contain; border-radius: 8px; }

/* ---------- Landing / auth (legacy, kept for compatibility) ---------- */
.landing-body { min-height: 100vh; background: linear-gradient(160deg, #EFF6FF 0%, #F8FAFC 60%); }
.brand-logo { font-size: 48px; color: var(--color-primary); }
.brand-logo-sm { font-size: 32px; color: var(--color-primary); }
.auth-card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 36px 30px;
    width: 100%;
    max-width: 380px;
}

/* ---------- App shell ---------- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.app-topbar {
    height: 64px;
    background: var(--color-card);
    border-bottom: 1px solid rgba(15,23,42,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.topbar-title { font-weight: 600; font-size: 18px; }
.btn-icon {
    border: none; background: transparent; font-size: 20px; color: var(--color-text);
    width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: rgba(37,99,235,0.08); }
.notif-badge {
    position: absolute; top: 2px; right: 2px; background: var(--color-danger); color: #fff;
    font-size: 10px; border-radius: 50%; min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

.app-body-row { display: flex; flex: 1; }

.app-sidebar {
    width: 250px; background: var(--color-card); border-right: 1px solid rgba(15,23,42,0.06);
    display: flex; flex-direction: column; padding: 20px 0; flex-shrink: 0;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; padding: 0 20px 16px; color: var(--color-primary); }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-md);
    color: var(--color-text); text-decoration: none; font-size: 14.5px; font-weight: 500;
}
.sidebar-link:hover { background: rgba(37,99,235,0.08); }
.sidebar-link.active { background: var(--color-primary); color: #fff; }

.app-main { flex: 1; padding: 24px; max-width: 100%; overflow-x: hidden; }

@media (max-width: 991.98px) {
    .app-sidebar { position: fixed; left: -260px; top: 0; bottom: 0; z-index: 1050; transition: left .25s ease; }
    .app-sidebar.show { left: 0; }
    .app-main { padding: 16px; padding-bottom: 90px; }
}

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; height: 64px; background: var(--color-card);
    border-top: 1px solid rgba(15,23,42,0.08); display: flex; z-index: 1040;
    box-shadow: 0 -2px 12px rgba(15,23,42,0.06);
}
.bottom-nav-item {
    flex: 1; border: none; background: transparent; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2px; font-size: 11px; color: #64748B; text-decoration: none;
}
.bottom-nav-item i { font-size: 20px; }
.bottom-nav-item.active { color: var(--color-primary); }

/* ---------- Cards ---------- */
.card, .stat-card, .content-card {
    background: var(--color-card); border-radius: var(--radius-lg); border: none; box-shadow: var(--shadow-soft);
}
.stat-card { padding: 18px 20px; }
.stat-card .stat-label { font-size: 12.5px; color: #64748B; font-weight: 500; }
.stat-card .stat-value { font-size: 24px; font-weight: 700; margin-top: 2px; }
.content-card { padding: 20px; }

/* ---------- Status badges ---------- */
.badge-status { padding: 5px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .3px; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-success { background: #DCFCE7; color: #166534; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-info    { background: #DBEAFE; color: #1E40AF; }
.badge-secondary { background: #E2E8F0; color: #334155; }

/* ---------- Buttons ---------- */
.btn-primary { background: var(--color-primary); border-color: var(--color-primary); }
.btn { border-radius: var(--radius-md); font-weight: 500; }
.rounded-pill { border-radius: 999px !important; }

/* ---------- Mobile record card (table replacement) ---------- */
.record-card {
    background: var(--color-card); border-radius: var(--radius-md); box-shadow: var(--shadow-soft);
    padding: 16px; margin-bottom: 12px;
}
.record-card .record-title { font-weight: 700; font-size: 15px; }
.record-card .record-meta { font-size: 13px; color: #64748B; }

@media (min-width: 992px) {
    .mobile-cards { display: none; }
}
@media (max-width: 991.98px) {
    .desktop-table { display: none; }
}

/* ---------- Progress ---------- */
.budget-progress { height: 10px; border-radius: 999px; background: #E2E8F0; overflow: hidden; }
.budget-progress-bar { height: 100%; border-radius: 999px; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: #64748B; }
.empty-state i { font-size: 44px; color: #CBD5E1; margin-bottom: 12px; display: block; }

/* ---------- Skeleton loader ---------- */
.skeleton { background: linear-gradient(90deg, #E2E8F0 25%, #EDF2F7 37%, #E2E8F0 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: 8px; }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: #E2E8F0; }
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item::before { content: ''; position: absolute; left: -28px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--color-primary); }
.timeline-item.done::before { background: var(--color-success); }
.timeline-item .t-title { font-weight: 600; font-size: 14px; }
.timeline-item .t-date { font-size: 12px; color: #94A3B8; }
