:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.6);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.4);
    --secondary: #10b981;
    --alert: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background-image: radial-gradient(circle at top right, #1e3a8a 0%, transparent 40%),
                      radial-gradient(circle at bottom left, #064e3b 0%, transparent 40%);
    background-attachment: fixed;
    padding: 2rem;
}

.app-container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    gap: 2rem;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem 1rem;
    height: calc(100vh - 4rem);
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view.active {
    display: block;
}

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

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
}

.highlight {
    background: linear-gradient(to right, #60a5fa, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.premium-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.alert-card {
    border-top: 4px solid #f59e0b;
}

.amount {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 0.5rem;
}

.profit-amount {
    font-size: 3.5rem;
    background: linear-gradient(to right, #34d399, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-center { text-align: center; }

/* Forms & Buttons */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

input[type="text"], input[type="number"], input[type="date"], select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

input:focus, select:focus {
    border-color: var(--primary);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Ledger Table */
.ledger-container {
    overflow-x: auto;
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
}

.ledger-table th, .ledger-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.ledger-table th {
    color: var(--text-muted);
    font-weight: 600;
}

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

.delete-btn {
    color: var(--alert);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 400px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
