/* ===== VARIABLES ===== */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --text: #f1f5f9;
    --text-light: #e2e8f0;
    --text-lighter: #94a3b8;
    --background: #0a0f1c;
    --background-light: #111827;
    --background-lighter: #1f2937;
    --white: #1f2937;
    --border: #374151;
    --border-light: #4b5563;
    --error: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;
    --gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== NAVIGATION ===== */
.nav {
    background: rgba(17, 24, 39, 0.95);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0;
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.5rem;
}

/* ===== USER DROPDOWN MENU ===== */
.nav-user-dropdown {
    position: relative;
}

.nav-user-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--background-lighter);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-user-toggle:hover {
    background: var(--background);
    border-color: var(--primary);
    color: var(--text);
}

.dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    color: var(--text-lighter);
}

.nav-user-menu.active + .nav-user-toggle .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--background-light);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

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

.nav-user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
}

.nav-user-item:hover {
    background: var(--background-lighter);
    color: var(--text);
}

.nav-user-item:first-child {
    border-radius: 0.75rem 0.75rem 0 0;
}

.nav-user-item:last-child {
    border-radius: 0 0 0.75rem 0.75rem;
}

.nav-user-item.text-error {
    color: var(--error);
}

.nav-user-item.text-error:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* ===== MAIN CONTENT ===== */
.main {
    min-height: calc(100vh - 8rem);
    padding: 2rem 0;
}

/* ===== HERO SECTIONS ===== */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: var(--background-light);
    border-radius: 1rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Compact Hero */
.hero-compact {
    background: var(--background-light);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
}

.hero-compact .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.hero-compact .hero-content {
    flex: 1;
}

.hero-compact .hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-compact .hero-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
}

.hero-compact .hero-actions {
    display: flex;
    gap: 0.75rem;
}

/* ===== FEATURES SECTION ===== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 4rem 0;
}

.feature-card {
    background: var(--background-light);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

.feature-description {
    color: var(--text-light);
    line-height: 1.6;
}

/* ===== AUTH PAGES ===== */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* ===== CARDS ===== */
.card {
    background: var(--background-light);
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.card-body {
    padding: 2rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.card-subtitle {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header .card-title {
    margin-bottom: 0;
}

.btn-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--background);
    color: var(--text);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-input::placeholder {
    color: var(--text-lighter);
}

.form-input.invalid {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.form-input.valid {
    border-color: var(--success);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.toggle-password {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.toggle-password:hover {
    background: var(--background-lighter);
}

/* Form Text */
.form-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.text-link {
    color: var(--primary);
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient);
    color: var(--text);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: var(--background-lighter);
    color: var(--text);
    border: 1px solid var(--border);
}

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

.btn-outline {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
}

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

.w-full {
    width: 100%;
}

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info);
    color: var(--info);
}

/* ===== ERROR MESSAGES ===== */
.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.error-message.show {
    max-height: 50px;
    display: block;
}

/* ===== MAIN CONTENT GRID ===== */
.main-content {
    padding: 2rem 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.content-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== SECTION HEADER ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.section-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===== STATS COMPONENTS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--background-light);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--border);
}

.stat-card.income {
    border-left: 4px solid var(--success);
}

.stat-card.expense {
    border-left: 4px solid var(--error);
}

.stat-card.balance {
    border-left: 4px solid var(--primary);
}

.stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.stat-card.income .stat-icon {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.stat-card.expense .stat-icon {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.stat-card.balance .stat-icon {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-value.positive {
    color: var(--success);
}

.stat-value.negative {
    color: var(--error);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Stats List */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
}

.stat-item.total {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    padding-bottom: 0;
}

.stat-item .stat-label {
    font-size: 0.9rem;
}

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

/* ===== LISTS ===== */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--background-lighter);
    border-radius: 0.5rem;
}

.transaction-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.transaction-icon.income {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.transaction-icon.expense {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.transaction-details {
    flex: 1;
}

.transaction-category {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.transaction-meta {
    font-size: 0.8rem;
    color: var(--text-light);
}

.transaction-amount {
    font-weight: 700;
    font-size: 0.9rem;
}

.transaction-amount.income {
    color: var(--success);
}

.transaction-amount.expense {
    color: var(--error);
}

/* Categories List */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--background-lighter);
    border-radius: 0.5rem;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.category-icon.income {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.category-icon.expense {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.category-details {
    flex: 1;
}

.category-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.category-meta {
    font-size: 0.75rem;
    color: var(--text-light);
}

.category-amount {
    text-align: right;
}

.category-amount .amount {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.category-amount .amount.income {
    color: var(--success);
}

.category-amount .amount.expense {
    color: var(--error);
}

.category-amount .percentage {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--background-lighter);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.quick-action:hover {
    background: var(--background);
    transform: translateY(-2px);
}

.quick-action i {
    font-size: 1.25rem;
    color: var(--primary);
}

.quick-action span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 1rem;
}

/* ===== OPERATION TYPE SELECTOR ===== */
.operation-type-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.operation-type-selector input[type="radio"] {
    display: none;
}

.operation-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    background: var(--background);
    color: var(--text-light);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.operation-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}

.operation-type-selector input[type="radio"]:checked + .operation-btn.income {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.operation-type-selector input[type="radio"]:checked + .operation-btn.expense {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.operation-btn i {
    font-size: 1rem;
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }

.bg-green-500\/20 { background-color: rgba(16, 185, 129, 0.2); }
.text-green-400 { color: #10b981; }
.bg-red-500\/20 { background-color: rgba(239, 68, 68, 0.2); }
.text-red-400 { color: #ef4444; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.bg-background-lighter { background: var(--background-lighter); }

/* Auth Links */
.auth-link {
    color: var(--text-light);
}

.auth-link a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background: var(--background-light);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-light);
}

/* ===== COMPACT CHART STYLES ===== */
.compact-chart-card {
    margin-bottom: 1.5rem;
}

.compact-chart-container {
    position: relative;
    height: 200px;
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chart-total-badge {
    background: var(--background-lighter);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    border: 1px solid var(--border);
}

/* Центральный текст на диаграмме */
.chart-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    line-height: 1.2;
}

.center-income {
    font-size: 0.8rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 0.2rem;
}

.center-expense {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ef4444;
    margin-bottom: 0.2rem;
}

.center-balance {
    font-size: 0.9rem;
    font-weight: 800;
    margin-top: 0.2rem;
    padding-top: 0.2rem;
    border-top: 1px solid var(--border-light);
}

.center-balance.positive {
    color: #10b981;
}

.center-balance.negative {
    color: #ef4444;
}

/* Легенда */
.chart-legend-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.8rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.6rem;
}

.legend-color.income-color {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.legend-color.expense-color {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.legend-label {
    flex: 1;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.legend-amount {
    font-weight: 600;
    color: var(--text);
    font-size: 0.75rem;
}

/* ===== FLOATING ACTION BUTTON ===== */
.floating-action {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.btn-floating {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.btn-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
}

/* ===== CARD ACTIONS ===== */
.card-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ===== QUICK ACTIONS ENHANCED ===== */
.quick-action.primary {
    background: var(--gradient);
    color: white;
    border: none;
}

.quick-action.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.quick-action.primary i {
    color: white;
}

/* ===== PROGRESS BARS ===== */
.progress-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text);
}

.progress-bar {
    height: 6px;
    background: var(--background-lighter);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-fill.income {
    background: var(--success);
}

.progress-fill.expense {
    background: var(--error);
}

.progress-summary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.progress-total {
    font-weight: 600;
    color: var(--text);
}

/* ===== MODERN PAGE HEADER ===== */
.page-header-modern {
    background: linear-gradient(135deg, var(--background-light) 0%, var(--background) 100%);
    border-bottom: 1px solid var(--border);
    padding: 3rem 0 2rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.page-header-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient);
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 3rem;
    margin-bottom: 2rem;
}

.header-content {
    flex: 1;
    max-width: 600px;
}

.header-badge {
    display: inline-block;
    background: var(--gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text);
    line-height: 1.1;
}

.header-description {
    font-size: 1.125rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

.header-action {
    flex-shrink: 0;
}

/* Modern Button */
.btn-modern-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--gradient);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
    border: none;
    cursor: pointer;
}

.btn-modern-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.4);
    color: white;
}

.btn-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Header Stats */
.header-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--background-lighter);
    border: 1px solid var(--border);
    border-radius: 2rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.stat-pill:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
}

.stat-pill.income {
    border-left: 3px solid var(--success);
}

.stat-pill.expense {
    border-left: 3px solid var(--error);
}

.stat-pill.total {
    border-left: 3px solid var(--primary);
}

.stat-pill i {
    font-size: 0.875rem;
}

.stat-pill.income i {
    color: var(--success);
}

.stat-pill.expense i {
    color: var(--error);
}

.stat-pill.total i {
    color: var(--primary);
}

.stat-count {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text);
}

.stat-label {
    color: var(--text-light);
    font-weight: 500;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-main {
        gap: 2rem;
    }
    
    .header-title {
        font-size: 2.25rem;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--background-light);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
        gap: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-user-dropdown {
        width: 100%;
    }
    
    .nav-user-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .nav-user-menu {
        position: static;
        margin-top: 0.5rem;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        width: 100%;
    }
    
    .nav-user-menu.active {
        display: block;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .hero-compact .container {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

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

    .container {
        padding: 0 1rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    .auth-container {
        padding: 1rem;
    }
    
    .floating-action {
        bottom: 1rem;
        right: 1rem;
    }
    
    .btn-floating {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .card-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .compact-chart-container {
        height: 180px;
    }
    
    .chart-legend-compact {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    
    .legend-item {
        font-size: 0.75rem;
    }
    
    .center-income,
    .center-expense {
        font-size: 0.7rem;
    }
    
    .center-balance {
        font-size: 0.8rem;
    }
    
    .page-header-modern {
        padding: 2rem 0 1.5rem 0;
    }
    
    .header-main {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .header-content {
        max-width: none;
    }
    
    .header-title {
        font-size: 2rem;
    }
    
    .header-description {
        font-size: 1rem;
    }
    
    .header-action {
        width: 100%;
    }
    
    .btn-modern-primary {
        width: 100%;
        justify-content: center;
    }
    
    .header-stats {
        justify-content: center;
    }
    
    .stat-pill {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 1rem 0;
    }
    
    .card-body {
        padding: 1rem;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .operation-type-selector {
        flex-direction: column;
    }
    
    .quick-amounts {
        flex-direction: column;
        align-items: stretch;
    }
    
    .quick-amounts-label {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
    
    .page-header-modern {
        padding: 1.5rem 0 1.25rem 0;
    }
    
    .header-title {
        font-size: 1.75rem;
    }
    
    .header-description {
        font-size: 0.95rem;
    }
    
    .header-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-pill {
        width: 100%;
        max-width: 200px;
    }
    
    .btn-modern-primary {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* Additional responsive improvements */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Стили для кнопок управления транзакциями */
.transaction-item-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-left: 1rem;
}

.transaction-item:hover .transaction-item-actions {
    opacity: 1;
}

.transaction-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.transaction-action-btn.transaction-action-edit:hover {
    background: var(--primary);
    color: white;
}

.transaction-action-btn.transaction-action-delete {
    color: var(--error);
}

.transaction-action-btn.transaction-action-delete:hover {
    background: var(--error);
    color: white;
}

.transaction-action-form {
    display: inline;
}

/* Стили для пагинации транзакций */
.transactions-pagination {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    margin-top: 1rem;
}

.transactions-pagination-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.transactions-pagination-info {
    color: var(--text-light);
    font-size: 0.9rem;
}

.transactions-pagination-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.transactions-pagination-current {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.transactions-pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
    justify-content: center;
    padding: 0.5rem 1rem;
}

/* Адаптивность для кнопок транзакций */
@media (max-width: 768px) {
    .transaction-item-actions {
        opacity: 1; /* Всегда показываем кнопки на мобильных */
        margin-left: 0.5rem;
    }
    
    .transaction-item {
        padding: 1rem 0.75rem;
    }
    
    .transactions-pagination-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .transactions-pagination-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .transactions-pagination-current {
        order: -1;
    }
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 480px) {
    .transaction-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .transaction-item-actions {
        margin-left: auto;
        opacity: 1;
    }
    
    .transaction-details {
        min-width: 0;
        flex: 1;
    }
}