/* ============================================
   TechVision Financial Services - Design System
   ============================================ */

:root {
    --primary: #4da6ff;
    --primary-dark: #3b82f6;
    --primary-light: #a0c4ff;
    --bg-primary: #0a0e27;
    --bg-secondary: #0f172a;
    --bg-tertiary: #1e293b;
    --bg-card: #0f172a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(100, 160, 255, 0.15);
    --border-focus: rgba(100, 160, 255, 0.4);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
}

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

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

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

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

#particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(100, 160, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 160, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 1;
}

.login-container {
    position: relative;
    z-index: 2;
    perspective: 1000px;
    padding: 20px;
}

.login-card {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 420px;
    max-width: 100%;
    position: relative;
    backdrop-filter: blur(20px);
    animation: cardFloat 6s ease-in-out infinite;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.card-glow {
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(77, 166, 255, 0.3), transparent, rgba(160, 196, 255, 0.2));
    z-index: -1;
    opacity: 0.5;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.card-header {
    text-align: center;
    margin-bottom: 24px;
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(77, 166, 255, 0.1);
    border: 1px solid rgba(77, 166, 255, 0.2);
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--primary);
}

.logo-area {
    text-align: center;
    margin-bottom: 32px;
}

.logo-ring {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    position: relative;
}

.logo-ring-inner {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(77, 166, 255, 0.2);
    border-radius: 50%;
    animation: ringSpin 8s linear infinite;
}

.logo-ring-inner::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(77, 166, 255, 0.15);
    border-radius: 50%;
    animation: ringSpin 6s linear infinite reverse;
}

@keyframes ringSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo-icon {
    position: absolute;
    inset: 0;
    padding: 12px;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.brand-tech { color: var(--primary); }
.brand-vision { color: var(--primary-light); }

.brand-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

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

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
    line-height: 0;
    opacity: 0.7;
}

.input-icon svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.input-wrapper input {
    width: 100%;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-primary);
    transition: all 0.15s ease;
}

.input-icon ~ input {
    padding-left: 48px;
}

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

.input-wrapper input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.1);
}

.toggle-password {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

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

.error-msg {
    font-size: 0.8rem;
    color: var(--error);
    min-height: 18px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.checkbox-label input { display: none; }

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

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

.checkmark::after {
    content: '✓';
    color: white;
    font-size: 11px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.checkbox-label input:checked + .checkmark::after { opacity: 1; }

.link-forgot {
    font-size: 0.85rem;
    color: var(--primary);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-submit:hover::before { left: 100%; }

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(77, 166, 255, 0.3);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

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

.form-footer {
    text-align: center;
    margin-top: 8px;
}

.link-register {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.link-register:hover { color: var(--primary); }

.success-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.success-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-overlay h2 {
    font-size: 1.3rem;
    color: var(--success);
}

.success-overlay p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-bar {
    width: 100%;
    max-width: 200px;
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #34d399);
    border-radius: 100px;
    animation: progressFill 2s ease forwards;
}

@keyframes progressFill {
    from { width: 0; }
    to { width: 100%; }
}

.card-stand {
    width: 340px;
    height: 20px;
    margin: 0 auto;
    position: relative;
    perspective: 200px;
}

.stand-reflection {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(77, 166, 255, 0.1), transparent);
    border-radius: 50%;
    transform: rotateX(60deg);
    filter: blur(8px);
}

/* ============================================
   DASHBOARD / APP SHELL
   ============================================ */

.dashboard-page {
    background: var(--bg-primary);
    min-height: 100vh;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon svg { display: block; }

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.brand-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
    position: relative;
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.nav-item:hover {
    background: rgba(100, 160, 255, 0.05);
    color: var(--text-primary);
}

.nav-item:hover svg { opacity: 1; }

.nav-item.active {
    background: rgba(77, 166, 255, 0.1);
    color: var(--primary);
}

.nav-item.active svg {
    opacity: 1;
    color: var(--primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-color);
}

.logout-form { display: block; }

.logout-btn-sidebar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
    background: transparent;
    border: none;
    cursor: pointer;
}

.logout-btn-sidebar:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.15s ease;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    min-width: 240px;
    transition: all 0.15s ease;
}

.search-box:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.1);
}

.search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    outline: none;
}

.search-box input::placeholder { color: var(--text-muted); }

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(77, 166, 255, 0.3), 0 4px 12px rgba(77, 166, 255, 0.2);
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.5), 0 4px 16px rgba(77, 166, 255, 0.3);
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.content-area {
    flex: 1;
    padding: 32px;
    max-width: 1400px;
}

.flash-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
    position: relative;
    overflow: hidden;
}

.flash-message::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.flash-sucesso {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.flash-sucesso::before { background: var(--success); }

.flash-erro {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.flash-erro::before { background: var(--error); }

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.flash-close:hover { opacity: 1; }

/* Welcome Banner */
.welcome-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(77, 166, 255, 0.15) 0%, rgba(139, 92, 246, 0.08) 50%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(77, 166, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(77, 166, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-text h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.welcome-date {
    text-align: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(77, 166, 255, 0.05));
    border: 1px solid rgba(77, 166, 255, 0.15);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.welcome-date::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.date-day {
    display: block;
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #4da6ff, #a0c4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.date-month {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

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

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease backwards;
}

.kpi-card:nth-child(1) { animation-delay: 0.1s; }
.kpi-card:nth-child(2) { animation-delay: 0.2s; }
.kpi-card:nth-child(3) { animation-delay: 0.3s; }
.kpi-card:nth-child(4) { animation-delay: 0.4s; }

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

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(77, 166, 255, 0.1);
    border-color: rgba(77, 166, 255, 0.25);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.kpi-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    border-radius: inherit;
}

.kpi-icon svg { color: white; position: relative; z-index: 1; }

.kpi-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.kpi-green { background: linear-gradient(135deg, #10b981, #059669); }
.kpi-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.kpi-orange { background: linear-gradient(135deg, #f59e0b, #d97706); }

.kpi-data {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.kpi-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.kpi-trend {
    display: flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

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

.trend-neutral {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.live-pulse {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #34d399;
}

.live-pulse::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #34d399;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Panels */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    animation: fadeInUp 0.5s ease backwards;
}

.panel:nth-child(2) { animation-delay: 0.2s; }

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(77, 166, 255, 0.3), transparent);
}

.panel:hover {
    border-color: rgba(77, 166, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(77, 166, 255, 0.1);
}

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

.panel-header h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
}

.panel-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.panel-body {
    padding: 20px 24px;
}

.btn-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.btn-link:hover {
    background: rgba(77, 166, 255, 0.1);
    color: var(--primary-light);
}

/* Category List */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.category-item:hover {
    border-left-color: var(--primary);
    transform: translateX(4px);
    background: rgba(100, 160, 255, 0.05);
}

.cat-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.cat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cat-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

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

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

/* Distribution */
.distribution-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dist-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dist-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dist-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dist-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: 2px 10px;
    border-radius: 100px;
}

.dist-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}

.dist-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 1.2s ease;
    position: relative;
    overflow: hidden;
}

.dist-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Activity Chart */
.activity-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    height: 160px;
    padding: 16px 8px 8px;
}

.activity-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
}

.activity-bar {
    width: 100%;
    max-width: 36px;
    background: linear-gradient(180deg, #4da6ff 0%, #3b82f6 100%);
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: all 0.5s ease;
    min-height: 4px;
    cursor: pointer;
}

.activity-bar:hover {
    background: linear-gradient(180deg, #64b5ff 0%, #4da6ff 100%);
    filter: brightness(1.2);
}

.activity-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.15), transparent);
    border-radius: inherit;
}

.activity-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    color: var(--text-primary);
    transition: transform 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.activity-bar:hover .activity-tooltip {
    transform: translateX(-50%) scale(1);
}

.activity-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.empty-state.small { padding: 32px 24px; }

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state .btn-primary { margin-top: 8px; }

/* ============================================
   CATEGORIAS PAGE
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

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

.stats-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.stat-pill.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.stat-pill.inactive {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.stat-number {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
}

.stat-pill.active .stat-number { color: var(--success); }
.stat-pill.inactive .stat-number { color: var(--error); }

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

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.category-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    animation: fadeInUp 0.5s ease backwards;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(77, 166, 255, 0.1);
    border-color: rgba(77, 166, 255, 0.25);
}

.category-card.inactive { opacity: 0.6; }

.cat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.cat-emoji {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.cat-card-actions {
    display: flex;
    gap: 6px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.15s ease;
    cursor: pointer;
}

.action-btn:hover {
    background: rgba(100, 160, 255, 0.05);
    color: var(--text-primary);
}

.action-btn.edit:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.action-btn.delete:hover {
    border-color: var(--error);
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.cat-card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.cat-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.cat-type-badge {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cat-type-badge.despesa {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.cat-type-badge.receita {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.cat-status {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.status-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.cat-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.cat-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

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

.color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.search-input {
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 240px;
    outline: none;
    transition: all 0.15s ease;
}

.search-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.1);
}

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

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

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

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 1.4rem;
    line-height: 1;
    transition: all 0.15s ease;
    border: none;
    cursor: pointer;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.modal-form {
    padding: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.modal-form .form-group {
    margin-bottom: 16px;
}

.modal-form .form-group:last-child { margin-bottom: 0; }

.modal-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.modal-form input[type="text"],
.modal-form input[type="email"],
.modal-form input[type="password"],
.modal-form select,
.modal-form textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.15s ease;
}

.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.1);
}

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

.color-picker {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker input[type="color"] {
    width: 48px;
    height: 40px;
    padding: 2px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.color-preset {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.color-preset:hover {
    transform: scale(1.2);
    border-color: white;
}

.icon-select { font-size: 1rem; }

/* Impede que a lista nativa use fundo claro com texto do tema escuro. */
.modal-form select {
    color-scheme: dark;
}

.modal-form select option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1rem;
    padding: 4px;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.modal-form .toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    cursor: pointer;
}

.toggle-switch input { display: none; }

.toggle-slider {
    display: block;
    width: 44px;
    height: 24px;
    flex: 0 0 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    position: relative;
    transition: all 0.15s ease;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.15s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
}

.toggle-switch input:checked + .toggle-slider::after {
    left: 22px;
    background: var(--success);
}

.modal-form .toggle-label {
    display: block;
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

/* ============================================
   BOTÕES
   ============================================ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(77, 166, 255, 0.3);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background: rgba(100, 160, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .right-column {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .right-column .panel {
        flex: 1;
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: flex; }
    .topbar { padding: 12px 16px; }
    .search-box { display: none; }
    .user-info { display: none; }
    .content-area { padding: 20px 16px; }
    .welcome-banner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .right-column { flex-direction: column; }
    .page-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    .form-row { grid-template-columns: 1fr; }
    .login-card {
        width: 100%;
        max-width: 380px;
        padding: 28px;
    }
    .category-grid { grid-template-columns: 1fr; }
    .activity-chart { height: 140px; }
}

@media (max-width: 480px) {
    .login-card { padding: 24px 20px; }
    .brand-name { font-size: 1.3rem; }
    .kpi-grid { grid-template-columns: 1fr; }
    .stats-bar { flex-wrap: wrap; }
    .activity-chart { gap: 6px; }
    .activity-bar { max-width: 28px; }
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 100px;
}

::selection {
    background: rgba(77, 166, 255, 0.3);
    color: var(--text-primary);
}


/* ============================================
   WELCOME ACTIONS
   ============================================ */

.welcome-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-welcome {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(77, 166, 255, 0.3);
}

.btn-welcome:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(77, 166, 255, 0.4);
    color: white;
}

.btn-welcome svg {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .welcome-actions {
        flex-direction: column;
        gap: 12px;
    }

    .btn-welcome {
        width: 100%;
        justify-content: center;
    }
}


/* ============================================
   MELHORIAS VISUAIS EXTRAS
   ============================================ */

/* Glassmorphism nos cards */
.kpi-card,
.panel,
.category-card,
.welcome-banner {
    backdrop-filter: blur(10px);
}

/* Glow sutil nos cards */
.kpi-card::after,
.panel::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 0%, rgba(77, 166, 255, 0.08), transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kpi-card:hover::after,
.panel:hover::after {
    opacity: 1;
}

/* Efeito de borda brilhante */
.kpi-card,
.panel,
.category-card {
    position: relative;
}

/* Animação de entrada suave */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.panel {
    animation: fadeInScale 0.4s ease backwards;
}

.panel:nth-child(1) { animation-delay: 0.1s; }
.panel:nth-child(2) { animation-delay: 0.2s; }

/* Efeito de hover nos itens da lista */
.category-item {
    position: relative;
    overflow: hidden;
}

.category-item::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(77, 166, 255, 0.05));
    transition: width 0.3s ease;
}

.category-item:hover::after {
    width: 100%;
}

/* Efeito de brilho no avatar */
.cat-avatar,
.cat-emoji {
    position: relative;
    overflow: hidden;
}

.cat-avatar::after,
.cat-emoji::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
}

.cat-avatar:hover::after,
.cat-emoji:hover::after {
    opacity: 1;
    transform: rotate(45deg) translate(20%, 20%);
}

/* Efeito de digitação no título (opcional, via JS) */
.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary);
    animation: typing 3s steps(40) 1s forwards, blink 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Efeito de onda no botão */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:active::after {
    width: 300px;
    height: 300px;
}

/* Melhoria no modal */
.modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.modal {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(77, 166, 255, 0.1);
}

/* Efeito de foco nos inputs */
.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
    background: rgba(100, 160, 255, 0.03);
}

/* Scrollbar personalizada mais bonita */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 100px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(77, 166, 255, 0.5), rgba(59, 130, 246, 0.5));
    border-radius: 100px;
    border: 2px solid var(--bg-primary);
}

/* ============================================
   TABELAS E FILTROS PADRONIZADOS
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.header-content h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Filtros */
.filter-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.15s ease;
}

.filter-group input::placeholder,
.filter-group select::placeholder {
    color: var(--text-muted);
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.1);
    background: rgba(100, 160, 255, 0.03);
}

.filter-group select {
    color-scheme: dark;
}

.filter-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.filter-actions {
    display: flex;
    gap: 8px;
}

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

.btn-secondary-outline:hover {
    background: rgba(100, 160, 255, 0.05);
}

/* Tabela de Dados */
.table-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: linear-gradient(90deg, rgba(77, 166, 255, 0.1), rgba(100, 160, 255, 0.05));
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table thead th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.15s ease;
    position: relative;
}

.data-table tbody tr:hover {
    background: rgba(77, 166, 255, 0.05);
}

.data-table tbody tr.row-highlight {
    background: rgba(245, 158, 11, 0.08);
}

.data-table tbody tr.row-highlight:hover {
    background: rgba(245, 158, 11, 0.12);
}

.data-table td {
    padding: 14px 16px;
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table td strong {
    color: var(--text-primary);
}

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

/* Badges de Status */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    text-transform: capitalize;
}

.badge-pago,
.badge-recebido {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pendente {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-ativo {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-inativo {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Ações em Tabela */
.actions-cell {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(77, 166, 255, 0.1);
    border: 1px solid rgba(77, 166, 255, 0.2);
    color: var(--primary);
    transition: all 0.15s ease;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: rgba(77, 166, 255, 0.2);
    border-color: rgba(77, 166, 255, 0.4);
    transform: translateY(-1px);
}

.btn-icon.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.btn-icon.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Modal Melhorado (específico do modal de Despesas, que usa uma estrutura
   de DOM diferente: #modalDespesa > .modal-overlay + .modal-content).
   Escopado por ID para não conflitar com o modal de Categorias/Receitas,
   que usa .modal-overlay > .modal como card. */
#modalDespesa.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 20px;
}

#modalDespesa.modal[style*="display: none"],
#modalDespesa.modal.hidden {
    display: none !important;
}

#modalDespesa .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
}

#modalDespesa .modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1001;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(77, 166, 255, 0.1);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.4rem;
    line-height: 1;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.form-modal {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row.full {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all 0.15s ease;
}

.form-group input::placeholder,
.form-group select::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.1);
    background: rgba(100, 160, 255, 0.03);
}

.form-group select {
    color-scheme: dark;
}

.form-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 250px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* Responsividade */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

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

    .filter-actions {
        flex-direction: column;
    }

    .filter-actions .btn-secondary {
        width: 100%;
    }

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

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    .actions-cell {
        flex-wrap: wrap;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 100%;
        border-radius: var(--radius-lg);
    }

    .modal-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .modal-close {
        align-self: flex-end;
    }
}

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

/* Efeito de parallax sutil no banner */
.welcome-banner {
    transform-style: preserve-3d;
}

/* Efeito de glass nos stats */
.stat-pill {
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.stat-pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), transparent);
    opacity: 0.5;
}

/* Animação de contador */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-number {
    animation: countUp 0.5s ease backwards;
}

/* Efeito de hover nos action buttons */
.action-btn {
    position: relative;
    overflow: hidden;
}

.action-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-btn:hover::after {
    opacity: 1;
}

/* Melhoria no empty state */
.empty-state .btn-primary {
    animation: fadeInUp 0.5s ease 0.3s backwards;
}

/* Efeito de brilho no logo */
.sidebar-brand .brand-icon svg {
    filter: drop-shadow(0 0 8px rgba(77, 166, 255, 0.3));
    transition: filter 0.3s ease;
}

.sidebar-brand:hover .brand-icon svg {
    filter: drop-shadow(0 0 12px rgba(77, 166, 255, 0.5));
}

/* Efeito de gradiente no menu ativo */
.nav-item.active {
    background: linear-gradient(90deg, rgba(77, 166, 255, 0.15) 0%, rgba(77, 166, 255, 0.05) 100%);
    box-shadow: inset 0 0 20px rgba(77, 166, 255, 0.05);
}

/* Efeito de transição suave no logout */
.logout-btn-sidebar {
    position: relative;
    overflow: hidden;
}

.logout-btn-sidebar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), transparent);
    transition: width 0.3s ease;
}

.logout-btn-sidebar:hover::before {
    width: 100%;
}

/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */
body.light-mode {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-focus: rgba(77, 166, 255, 0.6);
}

body.light-mode .sidebar {
    background: #ffffff;
    border-right: 1px solid var(--border-color);
}

body.light-mode .topbar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border-color);
}

body.light-mode .panel {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

body.light-mode .settings-sidebar {
    background: #ffffff;
}

body.light-mode .kpi-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

body.light-mode .nav-item:hover,
body.light-mode .nav-item.active {
    background: rgba(77, 166, 255, 0.1);
    color: var(--primary-dark);
}

