:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #3b82f6;
    --bg-body: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --success: #10b981;
    --font-family: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
}

/* Utilities */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-light);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e7ff;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
}

.full-width {
    width: 100%;
    justify-content: center;
}

/* Layout */
.app-container {
    min-height: 100vh;
}

.top-nav {
    background: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

/* Net Worth Card - Dark Theme */
.net-worth-card {
    background-color: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
    border: none;
}

.label-text {
    font-size: 0.9rem;
    color: #94a3b8;
    display: block;
    margin-bottom: 0.5rem;
}

.total-value {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.sub-text {
    font-size: 0.85rem;
    color: #64748b;
}

.stats-row {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    flex: 1;
}

.stat-icon {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 4px;
}

.stat-val {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Allocation Card */
.allocation-card {
    position: relative;
    display: flex;
    flex-direction: column;
}

.chart-container {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.chart-center-text {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    padding: 0.5rem;
}

.chart-center-text small {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.net-worth-short {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Filters */
.filter-container {
    margin-bottom: 2rem;
    overflow-x: auto;
}

.filter-tabs {
    display: flex;
    gap: 0.75rem;
}

.filter-btn {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Assets Grid */
.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.asset-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform 0.2s;
}

.asset-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.asset-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.asset-icon-box {
    width: 40px;
    height: 40px;
    background: #eff6ff;
    color: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.asset-info {
    flex: 1;
}

.asset-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.asset-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    color: var(--text-muted);
    font-weight: 500;
}

.asset-stats {
    display: flex;
    justify-content: space-between;
    align-items: end;
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
}

.asset-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-card {
    width: 500px;
    max-width: 90vw;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: 2px solid var(--accent);
    border-color: transparent;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
    padding: 4rem;
    text-align: center;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-muted);
}

.empty-icon {
    width: 64px;
    height: 64px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-action {
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
}

.empty-action:hover {
    text-decoration: underline;
}

/* Mobile Optimization */
@media (max-width: 600px) {
    .main-content {
        padding: 1rem;
    }

    .top-nav {
        padding: 1rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    /* Net Worth Card */
    .net-worth-card {
        min-height: auto;
        padding: 1.25rem;
    }

    .total-value {
        font-size: 2.5rem;
    }

    .stats-row {
        margin-top: 1.5rem;
        flex-wrap: wrap;
    }

    .stat-box {
        min-width: 45%;
        /* 2 per row */
        flex: 1 0 40%;
    }

    /* Filters */
    .filter-tabs {
        padding-bottom: 5px;
        /* Space for scrollbar */
    }

    .filter-btn {
        padding: 6px 16px;
        font-size: 0.85rem;
    }

    /* Forms */
    .row-group {
        grid-template-columns: 1fr;
        /* Stack inputs */
    }

    /* Asset Cards */
    .assets-grid {
        grid-template-columns: 1fr;
        /* Single column */
        gap: 1rem;
    }

    .asset-card {
        padding: 1rem;
    }

    .asset-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }


    .asset-total {
        font-size: 1.25rem;
    }
}

/* Autocomplete Styles */
.autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    margin-top: 5px;
    /* Spacing from input */
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #d4d4d4;
}

.autocomplete-items div:hover {
    background-color: #e9e9e9;
}

.autocomplete-items div strong {
    color: var(--primary);
}