/**
 * ProbiNotes - Modern Fluid UI
 * Design: Open, breathable, non-boxy layout
 * No heavy cards, natural flow
 */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors - Subtle & Modern */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #10b981;
    --error: #ef4444;
    
    /* Backgrounds */
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-hover: #f1f5f9;
    
    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    
    /* Borders */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Spacing */
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    
    /* Shadows - Minimal */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.06);
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
}

/* Container - More Spacious */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-8);
}

/* Header - Clean & Elevated */
.header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: var(--space-4) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
}

.logo-text {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-img {
    width: 32px;
    height: 32px;
}

/* Navigation - Minimal */
.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    list-style: none;
}

.nav-link {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s;
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--primary);
    background: #eff6ff;
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.nav-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--space-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-link {
    display: block;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.15s;
}

.dropdown-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.dropdown-link.active {
    color: var(--primary);
    background: #eff6ff;
}

/* Main Content Area - Open & Airy */
main {
    padding: var(--space-12) 0;
}

/* Section Spacing - No Heavy Cards */
section {
    margin-bottom: var(--space-12);
}

/* Welcome Section - Clean, No Box */
.welcome-section {
    margin-bottom: var(--space-12);
}

.welcome-section h1 {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    letter-spacing: -0.03em;
}

.welcome-section p {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
}

/* Financial Summary - Modern Grid, No Heavy Borders */
.financial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-12);
}

.stat-item {
    background: linear-gradient(135deg, var(--bg-surface) 0%, #fafbfc 100%);
    padding: var(--space-8);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.stat-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.stat-item:hover::before {
    opacity: 1;
}

.stat-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-4);
}

.stat-value {
    font-size: var(--text-4xl);
    font-weight: 700;
    line-height: 1;
    margin-bottom: var(--space-2);
}

.stat-description {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* Color Variants */
.stat-item.income {
    --accent-color: var(--success);
}

.stat-item.income .stat-value {
    color: var(--success);
}

.stat-item.expense {
    --accent-color: var(--error);
}

.stat-item.expense .stat-value {
    color: var(--error);
}

.stat-item.net {
    --accent-color: var(--primary);
}

.stat-item.net .stat-value {
    color: var(--primary);
}

.stat-item.net.negative .stat-value {
    color: var(--error);
}

/* Section Headers - Clean Typography */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.section-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.section-link {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s;
}

.section-link:hover {
    color: var(--primary-hover);
}

/* Buttons - Modern, Flat */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

/* Action Grid - No Heavy Cards */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

/* Tables - Clean, Minimal */
.table-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-hover);
}

th {
    padding: var(--space-4);
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-primary);
    border-top: 1px solid var(--border-light);
}

tbody tr {
    transition: background 0.15s;
}

tbody tr:hover {
    background: var(--bg-hover);
}

/* Info Box - Subtle, Not Heavy */
.info-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 3px solid var(--primary);
    padding: var(--space-6);
    border-radius: 8px;
    margin: var(--space-8) 0;
}

.info-box h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-3);
}

.info-box p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-3);
}

.info-box p:last-child {
    margin-bottom: 0;
}

/* Empty State - Clean */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-state-text {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

/* Forms - Minimal */
.form-container {
    max-width: 480px;
    margin: var(--space-12) auto;
    padding: var(--space-8);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.form-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-8);
    text-align: center;
}

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Footer - Minimal */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: var(--space-8) 0;
    margin-top: var(--space-20);
}

.footer-text {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Messages */
.message {
    padding: var(--space-4);
    font-size: var(--text-sm);
    border-radius: 8px;
    margin-bottom: var(--space-4);
    border-left: 3px solid;
}

.message-success {
    background: #f0fdf4;
    border-color: var(--success);
    color: #166534;
}

.message-error {
    background: #fef2f2;
    border-color: var(--error);
    color: #991b1b;
}

.message-info {
    background: #eff6ff;
    border-color: var(--primary);
    color: #1e40af;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    padding: var(--space-2);
    cursor: pointer;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Legacy Support */
.card {
    background: none;
    border: none;
    padding: 0;
    margin-bottom: var(--space-8);
    box-shadow: none;
}

.card-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-6);
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-surface);
        border-left: 1px solid var(--border);
        padding: var(--space-20) var(--space-6);
        transition: right 0.3s;
        z-index: 999;
        overflow-y: auto;
    }
    
    .nav.active {
        right: 0;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: var(--space-2);
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: var(--bg-hover);
        margin-top: var(--space-2);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s;
    }
    
    .nav-dropdown.active .dropdown-menu {
        max-height: 500px;
    }
    
    .container {
        padding: 0 var(--space-4);
    }
    
    .financial-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-section h1 {
        font-size: var(--text-3xl);
    }
    
    .stat-value {
        font-size: var(--text-3xl);
    }
}