/**
 * SAPPI - Main Stylesheet
 * Dark/Light Theme Design System
 */

/* ==========================================================================
   CSS Variables / Design Tokens
   ========================================================================== */

/* Dark Theme (default) */
:root {
    /* Colors - Background */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-input: #1f2940;
    --bg-hover: #252a40;

    /* Colors - Text */
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #6b7280;

    /* Colors - Accent */
    --accent: #4caf50;
    --accent-hover: #45a049;
    --danger: #ff6b6b;
    --danger-hover: #ff5252;
    --warning: #ffd93d;
    --info: #3b82f6;
    --success: #10b981;

    /* Border colors */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.05);

    /* Colors - Categories */
    --color-food: #4CAF50;
    --color-fun: #FF9800;
    --color-home: #2196F3;
    --color-auto: #9C27B0;
    --color-supply: #00BCD4;
    --color-school: #FFEB3B;
    --color-health: #F44336;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;

    /* Font */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Courier New', monospace;
}

/* Light Theme */
[data-theme="light"] {
    /* Colors - Background */
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f0f0f2;
    --bg-hover: #e8e8ea;

    /* Colors - Text */
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a6e;
    --text-muted: #8a8a9e;

    /* Colors - Accent (slightly darker for light theme) */
    --accent: #43a047;
    --accent-hover: #388e3c;
    --danger: #e53935;
    --danger-hover: #d32f2f;
    --warning: #f9a825;
    --info: #1e88e5;
    --success: #00897b;

    /* Border colors */
    --border-color: rgba(0, 0, 0, 0.1);
    --border-light: rgba(0, 0, 0, 0.05);

    /* Shadows (lighter for light theme) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar-wrapper {
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: var(--space-md);
    gap: var(--space-md);
}

.navbar-left {
    display: flex;
    align-items: center;
}

.navbar-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.navbar-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.navbar-logo-icon svg {
    width: 32px;
    height: 32px;
}

.navbar-logo-icon:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

.navbar-menu {
    display: flex;
    gap: var(--space-sm);
    max-width: 600px;
}

.navbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* Legacy support for old navbar structure */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.navbar-brand a {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-module {
    font-size: 0.75rem;
    color: var(--accent);
    background: rgba(76, 175, 80, 0.15);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.nav-link {
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 0.875rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Legacy - for modules not yet updated */
.navbar-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-left: auto;
}

.user-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.nav-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm);
}

.nav-logout:hover {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.1);
}

.nav-divider {
    color: var(--text-muted);
    margin: 0 var(--space-xs);
    opacity: 0.3;
}

.nav-module-switch {
    opacity: 0.6;
}

.nav-module-switch:hover {
    opacity: 1;
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.main-content {
    padding: var(--space-md);
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 100px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.page-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.page-header .header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-header .header-action-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.page-header .header-action-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.page-header .header-action-link svg {
    width: 20px;
    height: 20px;
}

/* Page Header Breadcrumb */
.page-header .page-title-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.page-header .breadcrumb-parent {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.page-header .breadcrumb-parent:hover {
    color: var(--text-primary);
}

.page-header .breadcrumb-sep {
    color: var(--text-muted);
    font-weight: 400;
}

.page-header .breadcrumb-current {
    color: var(--text-primary);
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert ul {
    list-style: none;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.link-small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   Stats Grid (Dashboard)
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-total .stat-value { color: var(--accent); }
.stat-count .stat-value { color: var(--info); }

/* ==========================================================================
   Necessity Bars
   ========================================================================== */
.necessity-card h3 {
    margin-bottom: var(--space-md);
}

.bar-container {
    margin-bottom: var(--space-md);
}

.bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: var(--space-xs);
}

.bar {
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    height: 8px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.bar-necessary { background: var(--success); }
.bar-optional { background: var(--warning); }

/* ==========================================================================
   Category List (Dashboard)
   ========================================================================== */
.categories-card h3 {
    margin-bottom: var(--space-md);
}

.category-item {
    margin-bottom: var(--space-md);
}

.category-item:last-child {
    margin-bottom: 0;
}

.category-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.category-color {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.category-name {
    font-size: 0.875rem;
}

.category-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.category-bar {
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    height: 4px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
}

/* ==========================================================================
   Expense List (Dashboard + History)
   ========================================================================== */
.expense-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.expense-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.expense-item:last-child {
    border-bottom: none;
}

.category-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.expense-details {
    flex: 1;
    min-width: 0;
}

.expense-description {
    display: block;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expense-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.expense-amount {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-secondary);
}

/* ==========================================================================
   FAB (Floating Action Button)
   ========================================================================== */
.fab {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: white;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-fast);
    z-index: 50;
}

.fab:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
    color: white;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.expense-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="month"],
select,
textarea {
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Category Grid (Add Form) */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.category-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.category-btn {
    display: block;
    text-align: center;
    padding: var(--space-md) var(--space-sm);
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.category-option input:checked + .category-btn {
    border-color: var(--cat-color);
    background: rgba(255, 255, 255, 0.05);
}

.category-btn:hover {
    background: var(--bg-hover);
}

/* Checkbox Custom */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.875rem;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-delete:hover {
    color: var(--danger);
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.add-another {
    align-self: center;
}

/* ==========================================================================
   History Page
   ========================================================================== */
.filters {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.filter-group {
    flex: 1;
}

.filter-group input,
.filter-group select {
    width: 100%;
}

.history-stats {
    display: flex;
    justify-content: space-between;
    background: var(--bg-card);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.stat-item {
    text-align: center;
}

.stat-item .stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.stat-item .stat-value {
    font-size: 1rem;
    font-weight: 600;
}

/* Expense Group */
.expense-group {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    overflow: hidden;
}

.expense-group-header {
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.expense-date-full {
    font-size: 0.875rem;
    font-weight: 500;
}

.expense-group-items {
    padding: var(--space-sm) var(--space-md);
}

.expense-item-full {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.expense-item-full:last-child {
    border-bottom: none;
}

.expense-category {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 80px;
}

.category-name-small {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.expense-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
}

.badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-necessary {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.expense-actions {
    display: flex;
    gap: var(--space-xs);
}

.day-total {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: right;
}

.export-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

/* ==========================================================================
   Insights Page
   ========================================================================== */
.insights-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.summary-item {
    background: var(--bg-card);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.insights-list {
    margin-bottom: var(--space-xl);
}

.insights-list h2 {
    margin-bottom: var(--space-md);
}

.insight-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    border-left: 3px solid;
}

.insight-info { border-left-color: var(--info); }
.insight-success { border-left-color: var(--success); }
.insight-warning { border-left-color: var(--warning); }
.insight-tip { border-left-color: var(--info); }
.insight-achievement { border-left-color: var(--accent); }
.insight-pattern { border-left-color: #9c27b0; }

.insight-icon {
    flex-shrink: 0;
}

.insight-info .insight-icon { color: var(--info); }
.insight-success .insight-icon { color: var(--success); }
.insight-warning .insight-icon { color: var(--warning); }

.insight-content h3 {
    font-size: 0.875rem;
    margin-bottom: var(--space-xs);
}

.insight-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Pinned Insights on Dashboard */
.insights-card .card-header {
    margin-bottom: var(--space-md);
}

.pinned-insights {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.insight-item {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--info);
}

.insight-item.insight-warning { border-left-color: var(--warning); }
.insight-item.insight-tip { border-left-color: var(--info); }
.insight-item.insight-achievement { border-left-color: var(--accent); }
.insight-item.insight-pattern { border-left-color: #9c27b0; }

.insight-pin {
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.insight-body {
    flex: 1;
}

.insight-body strong {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.insight-body p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Add Insight Card */
.add-insight-card {
    margin-bottom: var(--space-lg);
}

.btn-expand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md);
    background: transparent;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-expand:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.insight-form {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
}

.insight-form.hidden {
    display: none;
}

.insight-form .form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-md);
}

.insight-form .form-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

/* Insight Actions */
.insight-actions {
    display: flex;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-icon.btn-pin:hover,
.btn-icon.btn-unpin {
    color: var(--accent);
}

.btn-icon.btn-delete:hover {
    color: var(--danger);
}

/* Insight Card with Actions */
.insight-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.insight-content {
    flex: 1;
    min-width: 0;
}

/* Pinned Section */
.pinned-section h2 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--accent);
}

.pinned-section h2 svg {
    flex-shrink: 0;
}

.chart-card h2 {
    margin-bottom: var(--space-md);
}

.chart-container {
    position: relative;
    height: 250px;
}

.export-section {
    background: var(--bg-card);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    text-align: center;
}

.export-section h2 {
    margin-bottom: var(--space-sm);
}

.export-section p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
}

.export-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-size: 1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal form {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.modal .form-actions {
    flex-direction: row;
    justify-content: flex-end;
    margin-top: var(--space-sm);
}

/* ==========================================================================
   Calendar Widget (Dashboard)
   ========================================================================== */
.calendar-widget .widget-events-list {
    display: flex;
    flex-direction: column;
}

.calendar-widget .widget-event {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.calendar-widget .widget-event:last-child {
    border-bottom: none;
}

.calendar-widget .widget-date {
    font-weight: 600;
    min-width: 50px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.calendar-widget .widget-icon {
    font-size: 1rem;
}

.calendar-widget .widget-title {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.calendar-widget .widget-countdown {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
/* ==========================================================================
   Burger Menu (Module Navigation)
   ========================================================================== */
.burger-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.burger-menu:hover {
    background: var(--bg-hover);
}

.burger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all var(--transition-fast);
}

.burger-menu.active .burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger-menu.active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Menu overlay (for slide menu) */
.mobile-menu-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

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

@media (max-width: 640px) {
    .main-content {
        padding: var(--space-sm);
        padding-bottom: 80px;
    }

    /* Navbar layout on mobile */
    .navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: var(--space-sm) var(--space-md);
    }

    .navbar-left {
        display: flex;
        align-items: center;
        gap: var(--space-sm);
    }

    .navbar-center {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background: var(--bg-secondary);
        z-index: 100;
        transition: left var(--transition-normal);
        overflow-y: auto;
        padding-top: 60px;
        border-right: 1px solid var(--border-color);
    }

    .navbar-center.open {
        left: 0;
    }

    .navbar-menu {
        flex-direction: column;
        width: 100%;
        padding: var(--space-md);
        gap: var(--space-xs);
    }

    .nav-link {
        display: block;
        padding: var(--space-md);
        font-size: 1rem;
        border-radius: var(--radius-md);
    }

    .nav-link:hover,
    .nav-link.active {
        background: var(--bg-hover);
    }

    /* Close button inside mobile menu */
    .navbar-center::before {
        content: 'Menu';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        padding: var(--space-md);
        font-size: 1rem;
        font-weight: 600;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-secondary);
    }

    .navbar-right {
        flex-shrink: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .insights-summary {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    .export-buttons {
        flex-direction: column;
    }

    .expense-actions {
        position: absolute;
        right: var(--space-sm);
    }

    .expense-item-full {
        position: relative;
        padding-right: 70px;
    }
}

/* ==========================================================================
   Markdown Content
   ========================================================================== */
.markdown-content {
    line-height: 1.7;
    color: var(--text-primary);
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    margin: 1.5em 0 0.5em;
    color: var(--text-primary);
}

.markdown-content h1 { font-size: 1.5rem; }
.markdown-content h2 { font-size: 1.25rem; }
.markdown-content h3 { font-size: 1.1rem; }

.markdown-content p {
    margin: 0.75em 0;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 1.5em;
    margin: 0.75em 0;
}

.markdown-content li {
    margin: 0.25em 0;
}

.markdown-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.875em;
}

.markdown-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1em;
    margin: 1em 0;
    color: var(--text-secondary);
    font-style: italic;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1.5em 0;
}

.markdown-content a {
    color: var(--accent);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content .md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.875rem;
}

.markdown-content .md-table th,
.markdown-content .md-table td {
    padding: 0.5em 0.75em;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.markdown-content .md-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

.markdown-content .md-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   Budget Progress Bars
   ========================================================================== */
.budget-progress {
    margin-top: var(--space-sm);
}

.budget-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.budget-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.budget-bar-fill.safe {
    background: var(--accent);
}

.budget-bar-fill.warning {
    background: var(--warning);
}

.budget-bar-fill.danger {
    background: var(--danger);
}

.budget-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.budget-alert {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    font-size: 0.875rem;
}

.budget-alert.warning {
    background: rgba(255, 217, 61, 0.1);
    border-left: 3px solid var(--warning);
    color: var(--warning);
}

.budget-alert.danger {
    background: rgba(255, 107, 107, 0.1);
    border-left: 3px solid var(--danger);
    color: var(--danger);
}

/* ==========================================================================
   Budget Settings Page
   ========================================================================== */
.stats-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.month-selector-card {
    margin-bottom: var(--space-lg);
}

.month-form {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.month-form label {
    color: var(--text-secondary);
}

.budget-categories-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.budget-category-row {
    display: grid;
    grid-template-columns: 1fr 150px 1fr;
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
}

.category-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.budget-inputs .input-group {
    display: flex;
    align-items: center;
}

.budget-input {
    width: 100px;
    text-align: right;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-suffix {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.budget-status {
    min-width: 0;
}

.copy-budget-form {
    margin-top: var(--space-md);
}

.form-row-inline {
    display: flex;
    align-items: flex-end;
    gap: var(--space-md);
}

.form-row-inline .form-group {
    margin-bottom: 0;
}

.category-budget {
    font-size: 0.75rem;
}

.category-budget.safe {
    color: var(--accent);
}

.category-budget.warning {
    color: var(--warning);
}

.category-budget.danger {
    color: var(--danger);
}

.budget-alerts {
    margin-bottom: var(--space-lg);
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-sm {
    font-size: 0.875rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

@media (max-width: 640px) {
    .budget-category-row {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .stats-grid-2 {
        grid-template-columns: 1fr;
    }

    .form-row-inline {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==========================================================================
   Advanced Stats - Month Comparison
   ========================================================================== */
.comparison-card h2 {
    margin-bottom: var(--space-md);
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.comparison-item {
    text-align: center;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
}

.comparison-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.comparison-value {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
}

.comparison-change.up .comparison-value {
    color: var(--danger);
}

.comparison-change.down .comparison-value {
    color: var(--success);
}

.comparison-change.same .comparison-value {
    color: var(--text-secondary);
}

/* ==========================================================================
   Advanced Stats - Top Expenses
   ========================================================================== */
.top-expenses-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.top-expense-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
}

.top-rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.top-expense-item:nth-child(1) .top-rank {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #1a1a2e;
}

.top-expense-item:nth-child(2) .top-rank {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #1a1a2e;
}

.top-expense-item:nth-child(3) .top-rank {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: #1a1a2e;
}

.top-desc {
    flex: 1;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.top-amount {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* ==========================================================================
   Advanced Stats - Frequent Items
   ========================================================================== */
.frequent-items-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.frequent-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
}

.item-name {
    flex: 1;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-freq {
    font-size: 0.75rem;
    color: var(--info);
    background: rgba(59, 130, 246, 0.15);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 500;
}

.item-total {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ==========================================================================
   Advanced Stats - Weekend vs Weekday
   ========================================================================== */
.weekend-comparison {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.weekend-item {
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    text-align: center;
}

.weekend-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.weekend-total {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.weekend-avg {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.weekend-item:first-child {
    border-left: 3px solid var(--info);
}

.weekend-item:last-child {
    border-left: 3px solid var(--warning);
}

@media (max-width: 640px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .weekend-comparison {
        grid-template-columns: 1fr;
    }

    .top-expense-item {
        flex-wrap: wrap;
    }

    .top-desc {
        order: 3;
        flex-basis: 100%;
        margin-top: var(--space-xs);
    }
}

/* ==========================================================================
   Theme Toggle Switch
   ========================================================================== */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-hover);
}

.theme-toggle-track {
    width: 44px;
    height: 24px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    position: relative;
    transition: background var(--transition-fast);
    border: 1px solid var(--border-color);
}

.theme-toggle-thumb {
    width: 18px;
    height: 18px;
    background: var(--text-primary);
    border-radius: var(--radius-full);
    position: absolute;
    top: 2px;
    left: 3px;
    transition: transform var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

[data-theme="light"] .theme-toggle-thumb {
    transform: translateX(20px);
}

.theme-toggle-icon {
    font-size: 12px;
}

/* Light theme specific overrides for elements with hardcoded rgba */
[data-theme="light"] .navbar-wrapper {
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .navbar-module {
    background: rgba(76, 175, 80, 0.1);
}

[data-theme="light"] .expense-item,
[data-theme="light"] .expense-item-full {
    border-bottom: 1px solid var(--border-light);
}

[data-theme="light"] .card,
[data-theme="light"] .stat-card,
[data-theme="light"] .expense-group,
[data-theme="light"] .widget-card {
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

[data-theme="light"] .modal-content {
    box-shadow: var(--shadow-lg);
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="month"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] select,
[data-theme="light"] textarea {
    border: 1px solid var(--border-color);
}

[data-theme="light"] .btn-secondary {
    border: 1px solid var(--border-color);
}

[data-theme="light"] .btn-icon {
    background: var(--bg-hover);
}

[data-theme="light"] .category-btn {
    border: 1px solid var(--border-light);
}

[data-theme="light"] .category-option input:checked + .category-btn {
    background: rgba(76, 175, 80, 0.1);
}

/* ==========================================================================
   User Menu Dropdown
   ========================================================================== */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.user-menu-toggle:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-menu-toggle .user-name {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.user-menu-arrow {
    color: var(--text-secondary);
    transition: transform var(--transition-fast);
}

.user-menu.open .user-menu-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 150;
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: background var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-item svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.dropdown-item:hover svg {
    color: var(--text-primary);
}

.dropdown-item-danger {
    color: var(--danger);
}

.dropdown-item-danger:hover {
    background: rgba(255, 107, 107, 0.1);
    color: var(--danger);
}

.dropdown-item-danger svg {
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-xs) 0;
}

/* Light theme adjustments */
[data-theme="light"] .user-dropdown {
    box-shadow: var(--shadow-md);
}

@media (max-width: 640px) {
    .user-menu-toggle .user-name {
        display: none;
    }

    .user-menu-arrow {
        display: none;
    }
}

/* ==========================================================================
   Slide Menu (Module Navigation)
   ========================================================================== */
.slide-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    z-index: 200;
    transition: left var(--transition-normal);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.slide-menu.open {
    left: 0;
}

.slide-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.slide-menu-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.slide-menu-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.slide-menu-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.slide-menu-items {
    flex: 1;
    padding: var(--space-md);
    overflow-y: auto;
}

.slide-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    margin-bottom: var(--space-xs);
}

.slide-menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.slide-menu-item.active {
    background: rgba(76, 175, 80, 0.15);
    color: var(--accent);
}

.slide-menu-icon {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
}

.slide-menu-label {
    font-size: 0.95rem;
    font-weight: 500;
}

.slide-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-md) 0;
}

/* ==========================================================================
   Page Header with Breadcrumb and Icon Buttons
   ========================================================================== */
.page-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 56px;
    z-index: 50;
}

.page-title-area {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.breadcrumb-link {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.breadcrumb-link:hover {
    color: var(--accent);
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-weight: 400;
}

.breadcrumb-current {
    color: var(--text-primary);
}

.page-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.action-btn.active {
    background: rgba(76, 175, 80, 0.15);
    color: var(--accent);
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   SPA Loading State
   ========================================================================== */
.spa-loading main {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.1s ease;
}

.spa-loading::after {
    content: '';
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    background-size: 200% 100%;
    animation: spa-loading 0.8s ease-in-out infinite;
    z-index: 9999;
}

@keyframes spa-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

