/* ==========================================
   FinansTracker — Minimalist Modern Theme
   Light / Dark mode support
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* === Light Theme (default) === */
:root {
    --bg-body: #f5f5f7;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f5f5f7;
    --bg-hover: #f0f0f3;
    --bg-topbar: rgba(255, 255, 255, 0.85);
    --bg-modal-overlay: rgba(0, 0, 0, 0.3);
    --bg-modal: #ffffff;

    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-white: #ffffff;

    --accent: #7c3aed;
    --accent-light: #ede9fe;
    --accent-hover: #6d28d9;
    --green: #10b981;
    --green-light: #d1fae5;
    --red: #ef4444;
    --red-light: #fee2e2;
    --orange: #f59e0b;
    --orange-light: #fef3c7;
    --blue: #3b82f6;
    --blue-light: #dbeafe;

    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);

    --sidebar-width: 240px;
    --topbar-height: 56px;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --transition: all 0.2s ease;
}

/* === Dark Theme === */
[data-theme="dark"] {
    --bg-body: #0f1117;
    --bg-sidebar: #161822;
    --bg-card: #1c1e2e;
    --bg-input: #252738;
    --bg-hover: #252738;
    --bg-topbar: rgba(22, 24, 34, 0.9);
    --bg-modal-overlay: rgba(0, 0, 0, 0.5);
    --bg-modal: #1c1e2e;

    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --accent-light: rgba(124, 58, 237, 0.15);
    --green-light: rgba(16, 185, 129, 0.15);
    --red-light: rgba(239, 68, 68, 0.15);
    --orange-light: rgba(245, 158, 11, 0.15);
    --blue-light: rgba(59, 130, 246, 0.15);

    --border: #2a2d3e;
    --border-light: #232536;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* === Reset === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    opacity: 0.8;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* === LAYOUT === */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 28px;
    padding-top: calc(var(--topbar-height) + 24px);
    transition: var(--transition);
}

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: var(--transition);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.sidebar-logo h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-section {
    padding: 12px 12px 0;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 0 8px 6px;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 1px;
}

.sidebar-nav li a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav li a.active {
    background: var(--accent);
    color: #fff;
}

.sidebar-nav li a .nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* === TOPBAR === */
.top-bar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 900;
    transition: var(--transition);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 14px;
    min-width: 240px;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--accent);
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    width: 100%;
    font-family: inherit;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar .search-icon {
    color: var(--text-muted);
    font-size: 14px;
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 320px;
    overflow-y: auto;
    z-index: 200;
    display: none;
    min-width: 320px;
}

.search-results.show {
    display: block;
    animation: fadeIn 0.15s ease;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.search-result-icon.income {
    background: var(--green-light);
    color: var(--green);
}

.search-result-icon.expense {
    background: var(--red-light);
    color: var(--red);
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-info h4 {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-info p {
    font-size: 11px;
    color: var(--text-muted);
}

.search-result-amount {
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.search-result-amount.positive {
    color: var(--green);
}

.search-result-amount.negative {
    color: var(--red);
}

.search-no-result {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.top-bar-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.top-bar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}

.user-avatar:hover {
    opacity: 0.85;
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* === STAT CARDS === */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    margin-bottom: 12px;
}

.stat-card .stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-card.stat-accent .stat-icon {
    background: var(--accent-light);
    color: var(--accent);
}

.stat-card.stat-green .stat-icon {
    background: var(--green-light);
    color: var(--green);
}

.stat-card.stat-red .stat-icon {
    background: var(--red-light);
    color: var(--red);
}

.stat-card.stat-orange .stat-icon {
    background: var(--orange-light);
    color: var(--orange);
}

.stat-card.stat-blue .stat-icon {
    background: var(--blue-light);
    color: var(--blue);
}

/* === WELCOME CARD === */
.welcome-card {
    background: var(--accent);
    border: none;
    border-radius: var(--radius-lg);
    padding: 28px;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.welcome-card::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.welcome-card .welcome-label {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 2px;
}

.welcome-card .welcome-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.welcome-card .welcome-balance {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 16px;
}

/* === TABLES === */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent);
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

table tbody tr:hover {
    background: var(--bg-hover);
}

table tbody td {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-primary);
    vertical-align: middle;
}

.table-category {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-category .cat-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: var(--bg-input);
}

.amount-gelir {
    color: var(--green);
    font-weight: 600;
}

.amount-gider {
    color: var(--red);
    font-weight: 600;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-success {
    background: var(--green);
    color: #fff;
}

.btn-success:hover {
    opacity: 0.9;
    color: #fff;
}

.btn-danger {
    background: var(--red);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    justify-content: center;
    border-radius: 6px;
}

.btn-group {
    display: flex;
    gap: 6px;
}

/* === FORMS === */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

select.form-control option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

/* === TOGGLE SWITCH === */
.toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    border-radius: 11px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle input:checked+.toggle-slider {
    background: var(--accent);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(18px);
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-modal-overlay);
    backdrop-filter: blur(3px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-modal);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.2s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--red);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

/* === FILTER === */
.filter-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.filter-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    align-items: end;
}

/* === TABS === */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 14px;
}

.tab-btn {
    padding: 8px 18px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    font-family: inherit;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* === CHART === */
.chart-container {
    position: relative;
    width: 100%;
    padding: 4px 0;
}

.chart-container canvas {
    max-height: 280px;
}

/* === GRIDS === */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

/* === CATEGORY ITEMS === */
.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: var(--transition);
}

.category-item:hover {
    border-color: var(--border);
}

.category-item .cat-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
}

.category-item .cat-info .cat-emoji {
    font-size: 18px;
}

.category-actions {
    display: flex;
    gap: 4px;
}

/* === GOAL CARDS === */
.goal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.goal-card:hover {
    box-shadow: var(--shadow-md);
}

.goal-progress {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}

.goal-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* === TRANSACTION ITEMS === */
.transaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.transaction-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.transaction-icon.income {
    background: var(--green-light);
}

.transaction-icon.expense {
    background: var(--red-light);
}

.transaction-info h4 {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 1px;
}

.transaction-info p {
    font-size: 11px;
    color: var(--text-muted);
}

.transaction-amount {
    font-weight: 600;
    font-size: 13px;
}

.transaction-amount.positive {
    color: var(--green);
}

.transaction-amount.negative {
    color: var(--red);
}

/* === ALERTS === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.25s ease;
}

.alert-success {
    background: var(--green-light);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--green);
}

.alert-error {
    background: var(--red-light);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--red);
}

.alert-info {
    background: var(--accent-light);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: var(--accent);
}

/* === BADGE === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.badge-gelir {
    background: var(--green-light);
    color: var(--green);
}

.badge-gider {
    background: var(--red-light);
    color: var(--red);
}

/* === DROPDOWN === */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 150px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    padding: 4px;
    margin-top: 4px;
}

.dropdown-menu.show {
    display: block;
    animation: fadeIn 0.15s ease;
}

.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: 4px;
    transition: var(--transition);
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* === AUTH === */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo .logo-icon {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.auth-logo h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.auth-card .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 10px;
    font-size: 14px;
    margin-top: 6px;
}

.auth-footer {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--accent);
    font-weight: 500;
}

/* === PAGE HEADER === */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 20px;
    font-weight: 700;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.breadcrumb a {
    color: var(--accent);
}

/* === RECEIPT === */
.receipt-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.receipt-thumb:hover {
    transform: scale(1.05);
}

.no-receipt {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 13px;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.pagination a:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.pagination .active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* === FOOTER === */
.app-footer {
    text-align: center;
    padding: 28px 0 14px;
    color: var(--text-muted);
    font-size: 11px;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === UTILITIES === */
.text-accent {
    color: var(--accent) !important;
}

.text-green {
    color: var(--green) !important;
}

.text-red {
    color: var(--red) !important;
}

.text-orange {
    color: var(--orange) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.fw-500 {
    font-weight: 500;
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.mt-8 {
    margin-top: 8px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.gap-16 {
    gap: 16px;
}

.w-full {
    width: 100%;
}

/* === SETTINGS SECTION === */
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.settings-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-row-label {
    font-size: 13px;
    font-weight: 500;
}

.settings-row-label small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

/* === COLOR THEMES === */
[data-color="blue"] {
    --accent: #3b82f6;
    --accent-light: #dbeafe;
    --accent-hover: #2563eb;
}

[data-color="green"] {
    --accent: #10b981;
    --accent-light: #d1fae5;
    --accent-hover: #059669;
}

[data-color="red"] {
    --accent: #ef4444;
    --accent-light: #fee2e2;
    --accent-hover: #dc2626;
}

[data-color="orange"] {
    --accent: #f59e0b;
    --accent-light: #fef3c7;
    --accent-hover: #d97706;
}

[data-color="blue"][data-theme="dark"] {
    --accent-light: rgba(59, 130, 246, 0.15);
}

[data-color="green"][data-theme="dark"] {
    --accent-light: rgba(16, 185, 129, 0.15);
}

[data-color="red"][data-theme="dark"] {
    --accent-light: rgba(239, 68, 68, 0.15);
}

[data-color="orange"][data-theme="dark"] {
    --accent-light: rgba(245, 158, 11, 0.15);
}

/* === SEMI-DARK THEME === */
[data-theme-style="semi-dark"] .sidebar {
    background: #1c1e2e;
    border-right-color: #2a2d3e;
}

[data-theme-style="semi-dark"] .sidebar .sidebar-logo h2,
[data-theme-style="semi-dark"] .sidebar .sidebar-nav li a {
    color: #c0c4d0;
}

[data-theme-style="semi-dark"] .sidebar .sidebar-section-title {
    color: #6b7280;
}

[data-theme-style="semi-dark"] .sidebar .sidebar-nav li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

[data-theme-style="semi-dark"] .sidebar .sidebar-nav li a.active {
    background: var(--accent);
    color: #fff;
}

/* === BORDERED THEME === */
[data-theme-style="bordered"] .card,
[data-theme-style="bordered"] .stat-card,
[data-theme-style="bordered"] .filter-section,
[data-theme-style="bordered"] .goal-card,
[data-theme-style="bordered"] .settings-section {
    box-shadow: none;
    border-width: 2px;
}

[data-theme-style="bordered"] .sidebar {
    border-right-width: 2px;
}

[data-theme-style="bordered"] .top-bar {
    border-bottom-width: 2px;
}

/* === COLLAPSED SIDEBAR === */
body.sidebar-collapsed .sidebar {
    width: 64px;
    overflow: visible;
}

body.sidebar-collapsed .sidebar .sidebar-logo h2,
body.sidebar-collapsed .sidebar .sidebar-section-title,
body.sidebar-collapsed .sidebar .sidebar-nav li a span:not(.nav-icon) {
    display: none;
}

body.sidebar-collapsed .sidebar .sidebar-logo {
    justify-content: center;
    padding: 16px 0;
}

body.sidebar-collapsed .sidebar .sidebar-nav li a {
    justify-content: center;
    padding: 10px;
    position: relative;
}

body.sidebar-collapsed .sidebar .sidebar-nav li a .nav-icon {
    font-size: 18px;
    width: auto;
}

body.sidebar-collapsed .sidebar .sidebar-nav li a:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 68px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1100;
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

body.sidebar-collapsed .main-content {
    margin-left: 64px;
}

body.sidebar-collapsed .top-bar {
    left: 64px;
}

body.sidebar-collapsed .sidebar .sidebar-section {
    padding: 8px 8px 0;
}

/* === WIDE CONTENT === */
body.content-wide .main-content {
    padding-left: 48px;
    padding-right: 48px;
}

/* === STATIC NAVBAR (non-sticky) === */
body.navbar-static .top-bar {
    position: relative;
    left: 0;
}

body.navbar-static .main-content {
    padding-top: 24px;
}

body.navbar-static.sidebar-collapsed .top-bar {
    margin-left: 64px;
}

/* === THEME CUSTOMIZER === */
.theme-customizer-btn {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px 0 0 10px;
    cursor: pointer;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.12);
    transition: var(--transition);
    animation: pulseGear 3s ease-in-out infinite;
}

.theme-customizer-btn:hover {
    width: 48px;
    background: var(--accent-hover);
}

@keyframes pulseGear {

    0%,
    100% {
        transform: translateY(-50%);
    }

    50% {
        transform: translateY(-50%) scale(1.05);
    }
}

.theme-customizer-panel {
    position: fixed;
    top: 0;
    right: -360px;
    width: 340px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 2500;
    overflow-y: auto;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
}

.theme-customizer-panel.open {
    right: 0;
}

.tc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2400;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.tc-overlay.show {
    opacity: 1;
    visibility: visible;
}

.tc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.tc-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.tc-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tc-header-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.tc-header-actions button:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tc-tabs {
    display: flex;
    padding: 0 20px;
    gap: 0;
    border-bottom: 1px solid var(--border);
}

.tc-tab-btn {
    padding: 10px 16px;
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: var(--transition);
    font-family: inherit;
}

.tc-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tc-body {
    padding: 20px;
}

.tc-section {
    margin-bottom: 24px;
}

.tc-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.tc-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tc-option {
    flex: 1;
    min-width: 80px;
    padding: 10px 6px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    font-family: inherit;
}

.tc-option:hover {
    border-color: var(--accent);
}

.tc-option.active {
    border-color: var(--accent);
    background: var(--accent-light);
}

.tc-option .tc-opt-icon {
    font-size: 20px;
    margin-bottom: 4px;
    display: block;
    color: var(--text-secondary);
}

.tc-option.active .tc-opt-icon {
    color: var(--accent);
}

.tc-option .tc-opt-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    display: block;
}

.tc-option.active .tc-opt-label {
    color: var(--accent);
}

/* Color swatch options */
.tc-colors {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tc-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition);
    position: relative;
}

.tc-color-swatch:hover {
    transform: scale(1.1);
}

.tc-color-swatch.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-card);
}

.tc-color-swatch.active::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
}

.tc-swatch-purple {
    background: #7c3aed;
}

.tc-swatch-blue {
    background: #3b82f6;
}

.tc-swatch-green {
    background: #10b981;
}

.tc-swatch-red {
    background: #ef4444;
}

.tc-swatch-orange {
    background: #f59e0b;
}

/* Theme style preview cards */
.tc-theme-options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.tc-theme-card {
    padding: 8px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.tc-theme-card:hover {
    border-color: var(--accent);
}

.tc-theme-card.active {
    border-color: var(--accent);
    background: var(--accent-light);
}

.tc-theme-preview {
    width: 100%;
    height: 48px;
    border-radius: 4px;
    margin-bottom: 6px;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
}

.tc-theme-preview .tc-prev-sidebar {
    width: 20%;
    height: 100%;
}

.tc-theme-preview .tc-prev-main {
    flex: 1;
    height: 100%;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tc-theme-preview .tc-prev-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
}

.tc-theme-preview .tc-prev-content {
    flex: 1;
    border-radius: 2px;
}

/* Standard theme preview */
.tc-prev-standard .tc-prev-sidebar {
    background: #fff;
}

.tc-prev-standard .tc-prev-main {
    background: #f5f5f7;
}

.tc-prev-standard .tc-prev-content {
    background: #fff;
}

/* Bordered theme preview */
.tc-prev-bordered .tc-prev-sidebar {
    background: #fff;
    border-right: 2px solid #d0d0d0;
}

.tc-prev-bordered .tc-prev-main {
    background: #f5f5f7;
}

.tc-prev-bordered .tc-prev-content {
    background: #fff;
    border: 2px solid #d0d0d0;
}

/* Semi-dark theme preview */
.tc-prev-semidark .tc-prev-sidebar {
    background: #1c1e2e;
}

.tc-prev-semidark .tc-prev-main {
    background: #f5f5f7;
}

.tc-prev-semidark .tc-prev-content {
    background: #fff;
}

.tc-theme-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

.tc-theme-card.active .tc-theme-label {
    color: var(--accent);
}

/* === SIDEBAR OVERLAY (mobile) === */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* === RESPONSIVE === */
@media(max-width:1024px) {

    .dashboard-grid,
    .dashboard-grid-3,
    .categories-grid {
        grid-template-columns: 1fr;
    }

    body.content-wide .main-content {
        padding-left: 28px;
        padding-right: 28px;
    }
}

@media(max-width:768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }

    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
    }

    body.sidebar-collapsed .sidebar.open {
        transform: translateX(0);
    }

    body.sidebar-collapsed .sidebar .sidebar-logo h2,
    body.sidebar-collapsed .sidebar .sidebar-section-title,
    body.sidebar-collapsed .sidebar .sidebar-nav li a span:not(.nav-icon) {
        display: inline;
    }

    body.sidebar-collapsed .sidebar .sidebar-logo {
        justify-content: flex-start;
        padding: 16px 20px;
    }

    body.sidebar-collapsed .sidebar .sidebar-nav li a {
        justify-content: flex-start;
        padding: 8px 10px;
    }

    body.sidebar-collapsed .sidebar .sidebar-nav li a .nav-icon {
        font-size: 16px;
        width: 20px;
    }

    body.sidebar-collapsed .sidebar .sidebar-section {
        padding: 12px 12px 0;
    }

    .main-content,
    body.sidebar-collapsed .main-content {
        margin-left: 0;
        padding: 14px;
        padding-top: calc(var(--topbar-height) + 14px);
    }

    .top-bar,
    body.sidebar-collapsed .top-bar {
        left: 0;
    }

    body.navbar-static .main-content {
        padding-top: 14px;
    }

    body.navbar-static.sidebar-collapsed .top-bar {
        margin-left: 0;
    }

    .btn-menu-toggle {
        display: flex;
    }

    .search-bar {
        display: none;
    }

    .stat-cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .modal {
        width: 95%;
        max-height: 90vh;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .goals-grid {
        grid-template-columns: 1fr;
    }

    /* Theme customizer mobile */
    .theme-customizer-panel {
        width: 300px;
        right: -320px;
    }

    .theme-customizer-btn {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    body.content-wide .main-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .welcome-card .welcome-balance {
        font-size: 22px;
    }

    table thead th {
        font-size: 10px;
        padding: 8px 10px;
    }

    table tbody td {
        font-size: 12px;
        padding: 10px;
    }

    .btn-group {
        flex-wrap: wrap;
    }

    .settings-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media(max-width:480px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 22px;
    }

    .modal {
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius) var(--radius) 0 0;
        max-height: 92vh;
        margin-top: auto;
    }

    .modal-overlay.show {
        align-items: flex-end;
    }

    .theme-customizer-panel {
        width: 100%;
        right: -100%;
    }

    .welcome-card {
        padding: 20px;
    }

    .welcome-card .welcome-balance {
        font-size: 20px;
    }

    .tc-theme-options {
        grid-template-columns: 1fr 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .pagination a,
    .pagination span {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .breadcrumb {
        font-size: 11px;
    }

    .page-header h1 {
        font-size: 18px;
    }
}