:root {
    --brand-primary: #4154f1;
    --brand-secondary: #2db6fa;
    --brand-deep: #0b1f4c;
    --brand-surface: #ffffff;
    --muted: #6b7285;
    --border: #e6e8f5;
    --shadow-soft: 0 15px 40px rgba(16, 24, 40, 0.08);
    --radius-lg: 24px;
    --radius-md: 14px;
}

body {
    font-family: 'Poppins', 'Roboto', sans-serif;
    color: var(--brand-deep);
    background: radial-gradient(120% 90% at 15% 20%, rgba(65, 84, 241, 0.08), transparent), 
                radial-gradient(80% 60% at 85% 0%, rgba(45, 182, 250, 0.08), transparent),
                #f6f8ff;
    min-height: 100vh;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
}

a:hover {
    color: #2d3edd;
}

.page-shell {
    position: relative;
}

/* Navigation */
.app-navbar {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(65, 84, 241, 0.08);
    box-shadow: 0 10px 30px rgba(12, 23, 52, 0.04);
    backdrop-filter: blur(10px);
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(140deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 8px 18px rgba(65, 84, 241, 0.35);
}

.brand-title {
    font-weight: 700;
    color: var(--brand-deep);
    letter-spacing: -0.02em;
}

.brand-subtitle {
    color: var(--muted);
}

.navbar-nav .nav-link {
    font-weight: 600;
    color: var(--brand-deep);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: var(--brand-primary);
}

.navbar-toggler {
    border: none;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Hero */
.hero-section {
    background: linear-gradient(135deg, #f7f9ff 0%, #eef2ff 50%, #f6fcff 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.hero-section::after {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(45, 182, 250, 0.2), transparent 70%);
    top: -80px;
    right: -60px;
    transform: rotate(20deg);
}

.hero-section::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(65, 84, 241, 0.14), transparent 70%);
    bottom: -60px;
    left: -40px;
    filter: blur(3px);
}

.hero-section .lead {
    color: var(--muted);
    font-weight: 500;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(65, 84, 241, 0.08);
    color: var(--brand-primary);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.hero-actions .btn {
    padding: 0.8rem 1.4rem;
    font-weight: 700;
}

.hero-actions .btn-outline-primary {
    border: 1px solid rgba(65, 84, 241, 0.25);
    background: #fff;
    color: var(--brand-deep);
}

.hero-actions .btn-outline-primary:hover {
    color: #fff;
    background: var(--brand-primary);
}

.hero-metric {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    border-radius: 14px;
    background: rgba(11, 31, 76, 0.04);
    color: var(--brand-deep);
    font-weight: 600;
    border: 1px solid rgba(11, 31, 76, 0.06);
}

.hero-metric i {
    color: var(--brand-primary);
}

.hero-panel {
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.hero-panel .list-group-item {
    border: none;
    padding: 0.85rem 0;
}

.hero-panel .list-group-item + .list-group-item {
    border-top: 1px dashed #e5e8f5;
}

.workspace-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

.workspace-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 320px;
    padding: 1.6rem;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: var(--brand-deep);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 20px 45px rgba(12, 23, 52, 0.08);
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
    overflow: hidden;
    position: relative;
}

.workspace-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.9;
    pointer-events: none;
}

.workspace-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 54px rgba(12, 23, 52, 0.12);
}

.workspace-card-expense::before {
    background: linear-gradient(155deg, rgba(65, 84, 241, 0.08), rgba(65, 84, 241, 0.02) 45%, transparent 100%);
}

.workspace-card-investing::before {
    background: linear-gradient(155deg, rgba(27, 154, 223, 0.12), rgba(45, 182, 250, 0.04) 45%, transparent 100%);
}

.workspace-card-top,
.workspace-card-body,
.workspace-card-footer {
    position: relative;
    z-index: 1;
}

.workspace-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.workspace-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: rgba(11, 31, 76, 0.06);
    color: var(--brand-deep);
}

.workspace-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 16px 28px rgba(12, 23, 52, 0.16);
}

.workspace-card-expense .workspace-icon {
    background: linear-gradient(145deg, #4154f1, #3243c7);
}

.workspace-card-investing .workspace-icon {
    background: linear-gradient(145deg, #0fa67f, #1b9adf);
}

.workspace-points {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.workspace-points span {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(11, 31, 76, 0.05);
    color: var(--brand-deep);
    font-size: 0.85rem;
    font-weight: 600;
}

.workspace-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(11, 31, 76, 0.08);
    font-weight: 700;
}

.workspace-cta {
    color: var(--brand-deep);
}

/* Sections */
.section-heading {
    margin-bottom: 1.5rem;
}

.section-heading .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

/* Cards */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 15px 30px rgba(14, 23, 52, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
    background-color: #fff;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 45px rgba(16, 24, 40, 0.08);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    padding: 1.1rem 1.25rem;
    color: var(--brand-deep);
}

.feature-card {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 1.35rem;
    background: #fff;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

@media (max-width: 991.98px) {
    .workspace-split {
        grid-template-columns: 1fr;
    }
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 38px rgba(12, 23, 52, 0.08);
}

.feature-icon {
    display: inline-flex;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    background: rgba(65, 84, 241, 0.08);
    color: var(--brand-primary);
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.icon-secondary {
    background: rgba(45, 182, 250, 0.12);
    color: #1b9adf;
}

.option-card {
    border: 1px dashed var(--border);
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.2s ease;
}

.option-card:hover {
    border-color: rgba(65, 84, 241, 0.4);
    box-shadow: 0 12px 30px rgba(65, 84, 241, 0.15);
}

/* Buttons */
.btn {
    border-radius: 12px;
    font-weight: 700;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    border: none;
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(120deg, var(--brand-primary), #2d3edd);
    box-shadow: 0 12px 25px rgba(65, 84, 241, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 15px 28px rgba(65, 84, 241, 0.32);
}

.btn-outline-primary {
    border: 1px solid rgba(65, 84, 241, 0.3);
    color: var(--brand-deep);
}

.btn-outline-primary:hover {
    background: var(--brand-primary);
    color: #fff;
}

.btn-secondary {
    background: linear-gradient(120deg, #1b9adf, var(--brand-secondary));
    box-shadow: 0 12px 25px rgba(45, 182, 250, 0.25);
    border: none;
}

/* Tabs */
.nav-tabs {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.35rem;
    gap: 0.3rem;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 700;
    padding: 0.75rem 1.2rem;
}

.nav-tabs .nav-link.active {
    color: var(--brand-deep);
    background: #fff;
    box-shadow: 0 10px 25px rgba(12, 23, 52, 0.06);
}

/* Alerts */
.alert {
    border: 1px solid var(--border);
    border-radius: 14px;
    font-weight: 600;
    background: #fff;
}

.alert-info {
    border-left: 5px solid var(--brand-secondary);
}

.alert-success {
    border-left: 5px solid #2bbf76;
}

.alert-warning {
    border-left: 5px solid #f5b021;
}

/* Tables */
.table {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.table thead th {
    background: #f3f5ff;
    color: var(--brand-deep);
    font-weight: 700;
    border: none;
    padding: 1rem;
}

.table tbody td {
    padding: 0.85rem 1rem;
    color: #1f2937;
    border-color: var(--border);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(65, 84, 241, 0.02);
}

/* Forms */
.form-control {
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 0.85rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: rgba(65, 84, 241, 0.7);
    box-shadow: 0 0 0 0.15rem rgba(65, 84, 241, 0.15);
}

.form-label {
    font-weight: 700;
    color: var(--brand-deep);
}

.border-dashed {
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
}

/* Modals */
.modal-content {
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 18px 48px rgba(13, 16, 51, 0.18);
}

.modal-header,
.modal-footer {
    border-color: var(--border);
}

/* Lists */
.list-group-item {
    border: none;
    padding: 0.85rem 0;
    color: var(--brand-deep);
}

.list-group-numbered {
    counter-reset: item;
}

.list-group-numbered .list-group-item::before {
    content: counter(item) ".";
    counter-increment: item;
    font-weight: 800;
    margin-right: 0.5rem;
    color: var(--brand-primary);
}

/* Dashboard */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

#monthlyExpensesTable {
    width: 100%;
    min-height: 400px;
}

.category-total {
    background: #f6f8ff;
    font-weight: 700;
    border-top: 2px solid var(--border);
}

.category-total .badge {
    background: var(--brand-primary) !important;
}

.handsontable {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.handsontable .wtHolder {
    -webkit-overflow-scrolling: touch;
}

/* Auth cards */
.auth-card {
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
}

/* Footer */
.app-footer {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(13, 16, 51, 0.04);
}

.footer-dot {
    width: 10px;
    height: 10px;
    background: linear-gradient(120deg, var(--brand-primary), var(--brand-secondary));
    display: inline-block;
    border-radius: 50%;
}

/* Touch & mobile */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .hero-panel {
        margin-top: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 1.6rem;
    }
    
    .btn {
        width: 100%;
    }
}

/* Loading animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
