:root {
    /* Modern Color Palette */
    --bg-primary: #0a0e27;
    --bg-secondary: #151932;
    --bg-tertiary: #1e2438;
    --bg-card: #1a1f3a;
    --bg-hover: #252b47;

    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;

    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;

    --success-color: #22c55e;
    --success-dark: #16a34a;
    --success-light: #4ade80;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --danger-light: #f87171;
    --warning-color: #f59e0b;
    --warning-dark: #d97706;
    --info-color: #06b6d4;

    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --accent-orange: #f97316;

    --border-color: #2d3348;
    --border-light: #3d4563;

    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 20px -5px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 30px -10px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Background Gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundShift 15s ease-in-out infinite alternate;
}

@keyframes backgroundShift {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-20px) scale(1.05); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--accent-purple));
    border-radius: 10px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-hover), var(--accent-purple));
}

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
}

.container-narrow {
    max-width: 1000px;
}

.container-fluid {
    max-width: 100%;
    padding: 0 clamp(1rem, 3vw, 2rem);
}

/* Layout Structure */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    overflow-y: auto;
    z-index: 1000;
    transition: transform var(--transition-base);
}

body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    background: linear-gradient(135deg, var(--primary-light), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    padding: 1.5rem 0;
}

.sidebar-nav-section {
    margin-bottom: 2rem;
}

.sidebar-nav-section-title {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    font-weight: 500;
}

.sidebar-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, var(--primary-color), var(--accent-purple));
    border-radius: 0 2px 2px 0;
    transition: height var(--transition-fast);
}

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

.sidebar-nav-item:hover::before,
.sidebar-nav-item.active::before {
    height: 60%;
}

.sidebar-nav-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Header/Topbar */
.header {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    height: 64px;
    background: rgba(21, 25, 50, 0.8);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--border-color);
    z-index: 999;
    transition: left var(--transition-base);
}

body.sidebar-collapsed .header {
    left: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 100%;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.625rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

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

/* Old Navigation - Hidden */
.nav {
    display: none;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: linear-gradient(135deg, var(--danger-color), var(--accent-pink));
    color: white;
    border-radius: 12px;
    padding: 3px 7px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-dropdown {
    min-width: 380px;
    max-width: 420px;
    right: 0;
    left: auto;
}

.notification-dropdown-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.notification-dropdown-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.notification-dropdown-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

.notification-dropdown-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.notification-dropdown-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.notification-dropdown-item.unread {
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid var(--primary-color);
}

.notification-dropdown-item .title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.notification-dropdown-item .message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.notification-dropdown-item .time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    margin-top: 64px;
    transition: margin-left var(--transition-base);
    min-height: calc(100vh - 64px);
}

body.sidebar-collapsed .main-content {
    margin-left: 0;
}

main {
    min-height: calc(100vh - 64px);
    padding: clamp(2rem, 4vw, 3rem) 0;
}

/* Section Spacing */
.section {
    margin-bottom: 3rem;
}

.section:last-child {
    margin-bottom: 0;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-description {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Typography */
h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    margin-top: 0;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.page-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    margin-bottom: 0.5rem;
}

.page-description {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 3vw, 2rem);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-purple), var(--accent-cyan));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-xl);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.card-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Grid System */
.grid {
    display: grid;
    gap: 1.5rem;
}

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

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

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 640px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width var(--transition-slow), height var(--transition-slow);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-dark));
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), var(--danger-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-light), var(--danger-dark));
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), var(--success-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-light), var(--success-dark));
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.05rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: var(--bg-secondary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Filters */
.filters {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    padding: 2rem;
    overflow-y: auto;
    backdrop-filter: blur(8px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    animation: slideUp var(--transition-base);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-content form {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Utility Classes */
.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.align-center {
    align-items: center;
}

.align-start {
    align-items: flex-start;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

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

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

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

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

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

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

/* Transaction/List Items */
.transaction-item,
.import-item,
.invoice-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.transaction-item:hover,
.import-item:hover,
.invoice-item:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.transaction-type {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.transaction-type.income {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    color: var(--success-color);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.transaction-type.expense {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.transaction-category {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.transaction-description {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.transaction-amount {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

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

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

.transaction-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Import Status */
.import-status {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.import-status.processing {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.import-status.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    color: var(--success-color);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.import-status.failed {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Preview Table */
.preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    overflow-x: auto;
    display: block;
}

.preview-table thead,
.preview-table tbody {
    display: table;
    width: 100%;
    table-layout: fixed;
}

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

.preview-table th {
    background: var(--bg-tertiary);
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.preview-table td {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.preview-table tbody tr:hover {
    background: var(--bg-hover);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    color: var(--success-color);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1));
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.1));
    color: var(--info-color);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-secondary {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.2), rgba(100, 116, 139, 0.1));
    color: var(--text-secondary);
    border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Loading & Empty States */
.loading,
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    font-size: 1rem;
}

.empty-state {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    text-align: center;
    padding: 2.5rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 1024px) {
    /* Start with collapsed sidebar on mobile */
    body:not(.sidebar-open) .sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .header {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .filters-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .header-content {
        padding: 0 1rem;
    }

    main {
        padding: 1.5rem 0;
    }

    .page-header {
        margin-bottom: 2rem;
        padding-bottom: 1rem;
    }

    h1 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    h2 {
        font-size: 1.35rem;
        margin-bottom: 1rem;
    }

    .section {
        margin-bottom: 2rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .modal {
        padding: 0.5rem;
    }

    .modal-content {
        max-height: 95vh;
        border-radius: var(--radius-md);
    }

    .notification-dropdown {
        min-width: 280px;
        max-width: calc(100vw - 2rem);
        left: auto;
        right: -10px;
    }

    .card {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .transaction-item,
    .import-item,
    .invoice-item {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .preview-table {
        font-size: 0.85rem;
    }

    .preview-table th,
    .preview-table td {
        padding: 0.625rem 0.5rem;
    }

    /* Stack action buttons vertically on mobile */
    .transaction-actions,
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.875rem;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .card {
        padding: 1rem;
        border-radius: var(--radius-md);
    }

    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .sidebar {
        width: 260px;
    }

    .sidebar-header {
        padding: 0 1.25rem 1.5rem;
    }

    .sidebar-nav-item {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .notification-dropdown {
        min-width: 260px;
        right: -5px;
    }
}

/* Utility Classes for Spacing */
.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2 { padding-left: 1rem; padding-right: 1rem; }
.px-3 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

.w-full { width: 100%; }
.w-auto { width: auto; }

/* Responsive visibility */
.hide-mobile {
    display: initial;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }

    .show-mobile {
        display: initial;
    }
}

/* Print Styles */
@media print {
    body::before {
        display: none;
    }

    .header,
    .footer,
    .btn,
    .nav {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   DASHBOARD PROFESSIONAL STYLES
   ========================================================================== */

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.dashboard-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.current-month {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-card);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Main Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-purple));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.balance-card .metric-icon {
    background: rgba(234, 179, 8, 0.1);
}

.income-card .metric-icon {
    background: rgba(34, 197, 94, 0.1);
}

.expense-card .metric-icon {
    background: rgba(239, 68, 68, 0.1);
}

.savings-card .metric-icon {
    background: rgba(99, 102, 241, 0.1);
}

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

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

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

.metric-value.negative {
    color: var(--danger-color);
}

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

.metric-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.metric-change {
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-top: 0.25rem;
}

.metric-change.positive {
    color: var(--success-color);
    background: rgba(34, 197, 94, 0.1);
}

.metric-change.negative {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.metric-change.neutral {
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.1);
}

/* Secondary Metrics */
.secondary-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.small-metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: all var(--transition-base);
}

.small-metric-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.small-metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.small-metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.small-metric-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    min-height: 400px;
}

.chart-card .card-body {
    padding: 1.5rem;
    height: 350px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Category Breakdown */
.category-breakdown {
    padding: 0;
}

.category-list {
    padding: 1.5rem;
}

.category-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

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

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

.category-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.category-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.category-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.category-amount strong {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.category-percent {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.category-progress {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.category-progress-bar {
    height: 100%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-sm);
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Table Improvements */
.table-responsive {
    overflow-x: auto;
}

.table th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.table td {
    vertical-align: middle;
}

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

/* Error State */
.error-state {
    padding: 3rem 2rem;
    text-align: center;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

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

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

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

    .chart-card .card-body {
        height: 300px;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .category-amount {
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .dashboard-title {
        font-size: 1.5rem;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .small-metric-value {
        font-size: 1.1rem;
    }

    .secondary-metrics {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   AUTH PAGES (Login & Cadastro) - RESPONSIVE
   ========================================================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--bg-primary);
    position: relative;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(168, 85, 247, 0.15) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

.auth-card {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.auth-card h1 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card .form-group {
    margin-bottom: 1.5rem;
}

.auth-card .form-group:last-of-type {
    margin-bottom: 2rem;
}

.auth-card label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.auth-card .form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    font-family: inherit;
}

.auth-card .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: var(--bg-primary);
}

.auth-card .form-control::placeholder {
    color: var(--text-muted);
}

.auth-card .btn-block {
    width: 100%;
    padding: 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.auth-link {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-link p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.auth-link a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Validation Styles */
.auth-card .form-control:invalid:not(:placeholder-shown) {
    border-color: var(--danger-color);
}

.auth-card .form-control:valid:not(:placeholder-shown) {
    border-color: var(--success-color);
}

/* Button Loading State */
.auth-card .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }

    .auth-card h1 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    .auth-card .form-group {
        margin-bottom: 1.25rem;
    }

    .auth-card .form-control {
        padding: 0.75rem 0.875rem;
        font-size: 0.95rem;
    }

    .auth-card .btn-block {
        padding: 0.875rem;
        font-size: 1rem;
    }

    .auth-link {
        margin-top: 1.5rem;
        padding-top: 1.25rem;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 0.5rem;
    }

    .auth-card {
        padding: 1.5rem 1rem;
        border-radius: var(--radius-md);
    }

    .auth-card h1 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .auth-card .form-group {
        margin-bottom: 1rem;
    }

    .auth-card .form-control {
        padding: 0.625rem 0.75rem;
        font-size: 0.9rem;
    }

    .auth-card .btn-block {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .auth-link {
        margin-top: 1.25rem;
        padding-top: 1rem;
    }

    .auth-link p {
        font-size: 0.875rem;
    }
}

/* Landscape Mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem;
        margin: 1rem auto;
    }

    .auth-card h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .auth-card .form-group {
        margin-bottom: 0.875rem;
    }

    .auth-card .form-group:last-of-type {
        margin-bottom: 1rem;
    }
}

/* Tablet Portrait */
@media (min-width: 481px) and (max-width: 768px) {
    .auth-card {
        max-width: 500px;
    }
}

/* Large Screens */
@media (min-width: 1200px) {
    .auth-card {
        max-width: 480px;
        padding: 3.5rem 3rem;
    }

    .auth-card h1 {
        font-size: 2.25rem;
    }
}
