/* ============================================
   EdmonHub — Design System v2.0
   Ultra-Premium Dark Theme with 
   Glassmorphism, Aurora Effects & Micro-Animations
   ============================================ */

/* === CSS Variables === */
:root {
    /* Colors — Rich Dark Palette */
    --bg-primary: #030308;
    --bg-secondary: #0a0a14;
    --bg-card: rgba(12, 12, 24, 0.75);
    --bg-card-hover: rgba(18, 18, 36, 0.85);
    --bg-card-solid: #0e0e1c;
    --bg-glass: rgba(255, 255, 255, 0.025);
    --bg-glass-hover: rgba(255, 255, 255, 0.055);
    --bg-input: rgba(255, 255, 255, 0.04);
    --bg-input-focus: rgba(99, 102, 241, 0.06);
    --bg-sidebar: rgba(6, 6, 14, 0.97);

    --border-color: rgba(255, 255, 255, 0.055);
    --border-color-hover: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(99, 102, 241, 0.3);
    --border-glow: rgba(99, 102, 241, 0.2);

    --text-primary: #ececf4;
    --text-secondary: #8e8ea8;
    --text-muted: #50506a;
    --text-inverse: #030308;

    /* Accent Gradients — Refined Indigo-Violet */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #a78bfa;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --accent-gradient-hover: linear-gradient(135deg, #7577f5 0%, #9d75f8 50%, #b69df8 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));

    /* Status Colors — Refined */
    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.08);
    --color-success-border: rgba(16, 185, 129, 0.2);
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.08);
    --color-warning-border: rgba(245, 158, 11, 0.2);
    --color-danger: #ef4444;
    --color-danger-bg: rgba(239, 68, 68, 0.08);
    --color-danger-border: rgba(239, 68, 68, 0.2);
    --color-info: #3b82f6;
    --color-info-bg: rgba(59, 130, 246, 0.08);
    --color-info-border: rgba(59, 130, 246, 0.2);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

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

    /* Shadows — Layered Depth */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.2), 0 0 6px rgba(99, 102, 241, 0.1);
    --shadow-glow-lg: 0 0 40px rgba(99, 102, 241, 0.25), 0 0 12px rgba(139, 92, 246, 0.15);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: 1.125rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 2.5rem;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Sidebar Width */
    --sidebar-width: 270px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

/* === Custom Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* === Selection === */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform var(--transition-normal);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent, 
        rgba(99, 102, 241, 0.15) 30%, 
        rgba(139, 92, 246, 0.1) 70%, 
        transparent
    );
    pointer-events: none;
}

.sidebar-header {
    padding: var(--space-lg) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    min-height: 72px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.sidebar-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

/* BCV Rate Widget in Sidebar */
.sidebar-bcv {
    padding: var(--space-md);
    background: var(--accent-gradient-subtle);
    margin: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.12);
    position: relative;
    overflow: hidden;
}

.sidebar-bcv::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.bcv-rate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
    position: relative;
}

.bcv-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bcv-value {
    font-weight: 800;
    color: var(--color-success);
    font-size: var(--font-size-sm);
}

.bcv-date {
    font-size: 10px;
    color: var(--text-muted);
    display: block;
    margin-top: 3px;
    position: relative;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: var(--accent-gradient);
    border-radius: 0 3px 3px 0;
    transition: transform var(--transition-fast);
}

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

.nav-item:hover::before {
    transform: translateY(-50%) scaleY(1);
}

.nav-item svg {
    opacity: 0.6;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
}

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

.nav-item.active {
    color: #fff;
    background: var(--accent-gradient);
    box-shadow: var(--shadow-glow);
    font-weight: 600;
}

.nav-item.active::before {
    display: none;
}

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

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-action {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 9px 14px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    width: 100%;
    transition: all var(--transition-fast);
    font-family: inherit;
}

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

.sidebar-action.logout:hover {
    color: var(--color-danger);
    background: var(--color-danger-bg);
}

/* ============================================
   SIDEBAR OVERLAY (Mobile)
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Ambient Background Glow */
.main-content::before {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.main-content::after {
    content: '';
    position: fixed;
    bottom: -200px;
    left: 100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Main Header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    background: rgba(3, 3, 8, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    min-height: 68px;
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, 
        transparent, 
        rgba(99, 102, 241, 0.12) 30%, 
        rgba(139, 92, 246, 0.08) 70%, 
        transparent
    );
    pointer-events: none;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--bg-glass);
}

.header-title h1 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.header-subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

.header-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* Module Content */
.module-content {
    flex: 1;
    padding: var(--space-lg) var(--space-xl);
    position: relative;
    z-index: 1;
    animation: moduleEnter 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================
   DOLAR/EURO WIDGET (Header)
   ============================================ */
.dolar-aldia-widget {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-lg) !important;
    padding: 12px 16px !important;
    max-width: 340px !important;
    box-shadow: var(--shadow-md) !important;
    border: 1px solid var(--border-color) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    transition: all var(--transition-normal);
}

.dolar-aldia-widget:hover {
    border-color: var(--border-color-hover) !important;
    box-shadow: var(--shadow-lg) !important;
}

.rate-select-btn {
    transition: all var(--transition-fast) !important;
}

.rate-select-btn:hover {
    transform: translateY(-1px);
}

/* ============================================
   UI CARDS & GLASS COMPONENTS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-inset);
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, transparent 60%);
    pointer-events: none;
}

.card:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-sm), var(--shadow-inset);
}

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

.card-title {
    font-size: var(--font-size-md);
    font-weight: 700;
    letter-spacing: -0.2px;
}

/* ============================================
   GRIDS
   ============================================ */
.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

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

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

/* ============================================
   STAT CARDS (Dashboard)
   ============================================ */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-inset);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 0 3px 3px 0;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -30%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.04);
    pointer-events: none;
    transition: all var(--transition-smooth);
}

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

.stat-card:hover::after {
    transform: scale(1.3);
    background: rgba(99, 102, 241, 0.06);
}

.stat-card.success::before { background: var(--color-success); }
.stat-card.success::after { background: rgba(16, 185, 129, 0.04); }
.stat-card.warning::before { background: var(--color-warning); }
.stat-card.warning::after { background: rgba(245, 158, 11, 0.04); }
.stat-card.danger::before { background: var(--color-danger); }
.stat-card.danger::after { background: rgba(239, 68, 68, 0.04); }
.stat-card.info::before { background: var(--color-info); }
.stat-card.info::after { background: rgba(59, 130, 246, 0.04); }

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    margin-top: 6px;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.stat-sub {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    line-height: 1.3;
    position: relative;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-lg);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-glow);
}

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

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-color-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger), #dc2626);
    color: #fff;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 24px rgba(239, 68, 68, 0.3);
}

.btn-ghost {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 6px 10px;
}

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

.btn-sm { padding: 7px 14px; font-size: var(--font-size-xs); }
.btn-xs { padding: 5px 10px; font-size: 11px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* ============================================
   FORM INPUTS
   ============================================ */
.input-group {
    margin-bottom: var(--space-md);
}

.input-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

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

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="month"],
select,
textarea {
    width: 100%;
    padding: 11px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12), var(--shadow-glow);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    min-height: 90px;
    resize: vertical;
    line-height: 1.6;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238e8ea8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.input-icon-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

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

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid var(--border-color-hover);
    background: var(--bg-glass);
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
}

.checkbox-wrapper input[type="checkbox"]:checked {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

input[type="checkbox"]:not(.checkbox-wrapper input) {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid var(--border-color-hover);
    background: var(--bg-glass);
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
}

input[type="checkbox"]:not(.checkbox-wrapper input):checked {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
}

input[type="checkbox"]:not(.checkbox-wrapper input):checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

/* Form Grid Layout for Modals */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 var(--space-md);
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

/* ============================================
   BADGES & TAGS
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.badge-success { 
    background: var(--color-success-bg); 
    color: var(--color-success); 
    border: 1px solid var(--color-success-border);
}
.badge-warning { 
    background: var(--color-warning-bg); 
    color: var(--color-warning); 
    border: 1px solid var(--color-warning-border);
}
.badge-danger { 
    background: var(--color-danger-bg); 
    color: var(--color-danger); 
    border: 1px solid var(--color-danger-border);
}
.badge-info { 
    background: var(--color-info-bg); 
    color: var(--color-info); 
    border: 1px solid var(--color-info-border);
}
.badge-neutral { 
    background: var(--bg-glass); 
    color: var(--text-secondary); 
    border: 1px solid var(--border-color);
}
.badge-accent {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-md);
    animation: modalOverlayIn 0.25s ease;
}

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

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

.modal-lg { max-width: 750px; }

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

.modal-title { 
    font-size: var(--font-size-md); 
    font-weight: 700; 
    letter-spacing: -0.2px;
}

.modal-close { 
    background: none; 
    border: none; 
    color: var(--text-muted); 
    cursor: pointer; 
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
}

.modal-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    background: rgba(0, 0, 0, 0.15);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: var(--font-size-sm);
    min-width: 280px;
    max-width: 400px;
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

@keyframes toastSlideIn {
    from { 
        transform: translateX(120%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

.toast.removing {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    to { 
        transform: translateX(120%); 
        opacity: 0; 
    }
}

.toast.success { border-left: 3px solid var(--color-success); }
.toast.error { border-left: 3px solid var(--color-danger); }
.toast.warning { border-left: 3px solid var(--color-warning); }
.toast.info { border-left: 3px solid var(--accent-primary); }

.toast-icon {
    flex-shrink: 0;
    opacity: 0.8;
}

.toast-message {
    font-weight: 500;
}

/* ============================================
   LOGIN OVERLAY
   ============================================ */
.login-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--space-md);
    overflow: hidden;
}

/* Animated Aurora Background */
.login-overlay::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    top: -200px;
    left: -100px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.12) 0%, transparent 60%);
    animation: auroraFloat1 12s ease-in-out infinite;
    pointer-events: none;
}

.login-overlay::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    bottom: -150px;
    right: -100px;
    background: radial-gradient(ellipse, rgba(139, 92, 246, 0.1) 0%, transparent 60%);
    animation: auroraFloat2 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes auroraFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(80px, 60px) scale(1.1); }
    66% { transform: translate(-40px, 80px) scale(0.95); }
}

@keyframes auroraFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-60px, -40px) scale(1.05); }
    66% { transform: translate(50px, -60px) scale(1.1); }
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: var(--space-2xl) var(--space-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow-xl);
    text-align: center;
    position: relative;
    z-index: 1;
    animation: loginAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.login-container::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-xl);
    padding: 1px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), transparent 50%, rgba(139, 92, 246, 0.15));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.login-logo { margin-bottom: var(--space-xl); }

.login-logo .logo-icon {
    display: inline-flex;
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.3)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5)); }
}

.login-title { 
    font-size: 1.6rem; 
    font-weight: 800; 
    margin-top: var(--space-sm);
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle { 
    font-size: var(--font-size-xs); 
    color: var(--text-secondary); 
    margin-top: 4px;
}

.login-form {
    margin-top: var(--space-lg);
    text-align: left;
}

.login-error { 
    color: var(--color-danger); 
    font-size: var(--font-size-xs); 
    margin-bottom: var(--space-md); 
    padding: var(--space-sm) var(--space-md);
    background: var(--color-danger-bg);
    border: 1px solid var(--color-danger-border);
    border-radius: var(--radius-sm);
}

.login-setup-msg {
    padding: var(--space-sm) var(--space-md);
    background: var(--color-info-bg);
    border: 1px solid var(--color-info-border);
    border-radius: var(--radius-sm);
    color: var(--color-info);
    font-size: var(--font-size-xs);
    margin-bottom: var(--space-md);
}

.login-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* ============================================
   DATA TABLES
   ============================================ */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--font-size-sm);
}

.data-table th {
    text-align: left;
    padding: 14px 18px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.data-table tr {
    transition: background var(--transition-fast);
}

.data-table tr:hover td {
    background: var(--bg-glass-hover);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Paid row styling */
.expense-paid td {
    opacity: 0.5;
}

.expense-paid:hover td {
    opacity: 0.7;
}

/* ============================================
   SERIES COMPONENTS
   ============================================ */
.series-poster {
    width: 90px;
    height: 130px;
    object-fit: cover;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.series-card:hover .series-poster {
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.episode-chip {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}

.episode-chip:hover {
    border-color: var(--border-color-hover);
    background: var(--bg-glass-hover);
    transform: scale(1.08);
}

.episode-chip.watched {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-color: var(--color-success-border);
}

.episode-chip.aired {
    border-color: var(--color-warning);
}

/* Season Tabs */
.season-tabs {
    scrollbar-width: none;
}
.season-tabs::-webkit-scrollbar {
    display: none;
}

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: progressShimmer 2s ease-in-out infinite;
}

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

.progress-fill.success { 
    background: linear-gradient(135deg, #10b981, #059669); 
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.tab {
    padding: 8px 18px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    white-space: nowrap;
}

.tab:hover { 
    color: var(--text-primary); 
    background: var(--bg-glass-hover);
}

.tab.active {
    color: #fff;
    background: var(--accent-gradient);
    box-shadow: var(--shadow-glow);
    font-weight: 600;
}

/* ============================================
   VAULT ENTRIES
   ============================================ */
.vault-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    transition: all var(--transition-fast);
    gap: var(--space-md);
}

.vault-entry:hover {
    border-color: var(--border-color-hover);
    background: var(--bg-card-hover);
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.empty-state::before {
    content: '📋';
    display: block;
    font-size: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.4;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }

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

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet breakpoint */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dolar-aldia-widget {
        max-width: 100% !important;
        width: 100% !important;
    }

    .main-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }

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

    .module-content {
        padding: var(--space-md);
    }

    .main-header {
        padding: var(--space-md);
        gap: var(--space-sm);
    }

    .mobile-menu-btn { 
        display: flex; 
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

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

    .dolar-aldia-widget {
        max-width: 100% !important;
        width: 100% !important;
    }

    .header-title h1 {
        font-size: 1.2rem;
    }

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

    .stat-card {
        padding: var(--space-md);
    }

    .stat-value {
        font-size: var(--font-size-lg);
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        padding: 7px 14px;
        font-size: var(--font-size-xs);
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: var(--font-size-xs);
    }

    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
        bottom: var(--space-md);
    }

    .toast {
        min-width: unset;
        width: 100%;
    }

    .modal {
        max-height: 95vh;
        border-radius: var(--radius-lg);
        margin: var(--space-sm);
    }

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

    .vault-entry {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    /* Series cards on mobile */
    .series-poster {
        width: 70px;
        height: 100px;
    }

    .episode-grid {
        grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    }

    .login-container {
        padding: var(--space-xl);
    }
}

/* Small mobile */
@media (max-width: 400px) {
    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .btn-sm {
        padding: 7px 10px;
        font-size: 11px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Staggered card entrance */
.grid-auto > .card:nth-child(1) { animation-delay: 0s; }
.grid-auto > .card:nth-child(2) { animation-delay: 0.05s; }
.grid-auto > .card:nth-child(3) { animation-delay: 0.1s; }
.grid-auto > .card:nth-child(4) { animation-delay: 0.15s; }
.grid-auto > .card:nth-child(5) { animation-delay: 0.2s; }
.grid-auto > .card:nth-child(6) { animation-delay: 0.25s; }

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .sidebar-overlay,
    .mobile-menu-btn,
    .header-actions,
    .toast-container,
    .dolar-aldia-widget {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }

    .card {
        break-inside: avoid;
        border: 1px solid #ddd;
        background: #fff;
        color: #000;
    }
}
