:root {
    color-scheme: light;
    /* Backgrounds */
    --color-bg: #f3f4f6;
    --color-surface: #ffffff;
    --color-surface-alt: #f9fafb;
    --color-surface-elevated: rgba(255, 255, 255, 0.7);
    --color-sidebar: rgba(255, 255, 255, 0.85);

    /* Borders */
    --color-border: #e5e7eb;
    --color-border-light: rgba(229, 231, 235, 0.5);

    /* Text */
    --color-text: #111827;
    --color-text-muted: #6b7280;
    --color-text-light: #9ca3af;

    /* Primary Colors - Vibrant Purple/Blue */
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #818cf8;
    --color-primary-weak: rgba(99, 102, 241, 0.1);
    --color-primary-glow: rgba(99, 102, 241, 0.5);

    /* Semantic Colors */
    --color-green: #10b981;
    --color-green-dark: #059669;
    --color-red: #ef4444;
    --color-red-dark: #dc2626;
    --color-orange: #f59e0b;
    --color-orange-dark: #d97706;
    --color-purple: #8b5cf6;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-surface: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%);
    --gradient-sidebar: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.4) 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    --shadow-glow-hover: 0 0 30px rgba(99, 102, 241, 0.5);

    /* Effects */
    --blur-glass: blur(16px);
    --blur-backdrop: blur(8px);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

[data-theme="dark"] {
    color-scheme: dark;
    /* Backgrounds */
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-surface-alt: #172033;
    --color-surface-elevated: rgba(30, 41, 59, 0.7);
    --color-sidebar: rgba(15, 23, 42, 0.85);

    /* Borders */
    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-light: rgba(255, 255, 255, 0.05);

    /* Text */
    --color-text: #f3f4f6;
    --color-text-muted: #9ca3af;
    --color-text-light: #6b7280;

    /* Primary Colors */
    --color-primary: #818cf8;
    --color-primary-dark: #6366f1;
    --color-primary-light: #a5b4fc;
    --color-primary-weak: rgba(129, 140, 248, 0.15);
    --color-primary-glow: rgba(129, 140, 248, 0.4);

    /* Semantic Colors */
    --color-green: #34d399;
    --color-green-dark: #10b981;
    --color-red: #f87171;
    --color-red-dark: #ef4444;
    --color-orange: #fbbf24;
    --color-orange-dark: #f59e0b;
    --color-purple: #a78bfa;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    --gradient-success: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    --gradient-danger: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    --gradient-warning: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --gradient-surface: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(30, 41, 59, 0.6) 100%);
    --gradient-sidebar: linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.4) 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(129, 140, 248, 0.3);
    --shadow-glow-hover: 0 0 30px rgba(129, 140, 248, 0.5);
}

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

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-light);
}

.material-symbols-outlined {
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
    vertical-align: middle;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    background: radial-gradient(circle at top right, var(--color-primary-weak), transparent 40%),
        radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.05), transparent 40%);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--color-sidebar);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 20;
    /* transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); */
    overflow: hidden;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .brand {
    justify-content: center;
    padding-bottom: 1rem;
}

.sidebar.collapsed .brand__title,
.sidebar.collapsed .brand__subtitle {
    display: none;
    opacity: 0;
}

.sidebar.collapsed .nav__item {
    justify-content: center;
    padding: 0.85rem 0;
}

.sidebar.collapsed .nav__item span:last-child {
    display: none;
}

.sidebar.collapsed .nav__item .material-symbols-outlined {
    margin: 0;
}

.sidebar.collapsed .logout {
    justify-content: center;
    padding: 0.85rem 0;
}

.sidebar.collapsed .logout span:last-child {
    display: none;
}

.sidebar.collapsed .sidebar__footer {
    padding: 1.5rem 0.5rem;
}

.sidebar__top {
    padding: 2rem 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.sidebar__footer {
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
    background: rgba(0, 0, 0, 0.02);
}

.sidebar__user {
    margin-bottom: 1rem;
}

.sidebar__user-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
}

.sidebar__user-email {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    word-break: break-all;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 2rem;
    margin-bottom: 1rem;
}

.brand__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-glow);
    font-size: 28px;
}

.brand__title {
    margin: 0;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand__subtitle {
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

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

.nav__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.nav__item:hover {
    background: var(--color-surface-alt);
    color: var(--color-primary);
    transform: translateX(4px);
}

.nav__item.is-active {
    background: var(--color-primary-weak);
    color: var(--color-primary);
    font-weight: 600;
}

.nav__item.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
    border-radius: 0 4px 4px 0;
}

.logout {
    width: 100%;
    background: transparent;
    color: var(--color-red);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout:hover {
    background: var(--color-red);
    color: white;
    border-color: var(--color-red);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

/* Layout */
.layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    max-width: 100%;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2.5rem;
    background: var(--color-surface-elevated);
    backdrop-filter: var(--blur-backdrop);
    -webkit-backdrop-filter: var(--blur-backdrop);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.app-header__breadcrumb {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.app-header__title {
    margin: 0.25rem 0 0;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-text);
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
    background: var(--color-surface);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.search:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-weak);
    width: 320px;
}

.search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text);
    font-size: 0.95rem;
    min-width: 240px;
    width: 100%;
}

.ghost-button {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-muted);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.ghost-button:hover {
    background: var(--color-surface);
    color: var(--color-primary);
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-red);
    box-shadow: 0 0 0 2px var(--color-surface);
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--color-surface);
    background: url("https://ui-avatars.com/api/?name=Admin+User&background=6366f1&color=fff") center/cover no-repeat;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.avatar:hover {
    transform: scale(1.05);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-weak);
}

/* Main Content */
.views {
    flex: 1;
    padding: 2.5rem;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

.view {
    display: none;
}

.view.is-visible {
    display: block;
    animation: fade-slide-up 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animations */
@keyframes fade-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Components */
.section-heading {
    margin: 0 0 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grid {
    display: grid;
    gap: 2rem;
}

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

.grid.two {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.grid.four {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-primary-weak);
}

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

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

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0.5rem 0;
    letter-spacing: -0.03em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: auto;
}

.trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

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

.trend--down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-red-dark);
}

/* Lists & Tables */
.list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--color-border-light);
    padding: 1rem 0;
    transition: background-color 0.2s ease;
}

.list-item:hover {
    background-color: var(--color-surface-alt);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: var(--radius-sm);
    margin: 0 -0.5rem;
}

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

.pill {
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.pill--danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-red-dark);
}

.pill--warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-orange-dark);
}

.pill--success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-green-dark);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
}

.table th,
.table td {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.95rem;
}

.table thead {
    background: var(--color-surface-alt);
    border-bottom: 1px solid var(--color-border);
}

.table th {
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody tr {
    border-bottom: 1px solid var(--color-border-light);
    transition: all 0.2s ease;
}

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

.table tbody tr:hover {
    background: var(--color-surface-alt);
}

.table td:last-child,
.table th:last-child {
    text-align: right;
}

/* Charts & Visuals */
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    height: 160px;
    padding-top: 1rem;
}

.chart-bars__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
    justify-content: flex-end;
}

.chart-bars__stack {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    align-items: flex-end;
    height: 100%;
}

.chart-bars__stack span {
    width: 12px;
    border-radius: 4px;
    display: inline-block;
    min-height: 4px;
}

.chart-bars__stack span.incoming {
    background: var(--gradient-primary);
    box-shadow: 0 0 10px var(--color-primary-glow);
    animation: grow-up 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chart-bars__stack span.outgoing {
    background: var(--color-border);
    animation: grow-up 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
}

@keyframes grow-up {
    from {
        transform: scaleY(0);
    }

    to {
        transform: scaleY(1);
    }
}

.heatmap {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.heatmap__cell {
    aspect-ratio: 1;
    border-radius: 6px;
    background: var(--color-surface-alt);
    position: relative;
    transition: all 0.2s ease;
}

.heatmap__cell:hover {
    transform: scale(1.1);
    z-index: 2;
    box-shadow: var(--shadow-md);
}

.heatmap__cell[data-level="1"] {
    background: var(--color-primary-weak);
}

.heatmap__cell[data-level="2"] {
    background: var(--color-primary-light);
}

.heatmap__cell[data-level="3"] {
    background: var(--color-primary);
}

.heatmap__cell[data-level="4"] {
    background: var(--color-primary-dark);
}

/* Forms */
.form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    pointer-events: auto;
    animation: slide-in-right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 4px solid var(--color-primary);
}

.toast--success {
    border-left-color: var(--color-green);
}

.toast--error {
    border-left-color: var(--color-red);
}

.toast--warning {
    border-left-color: var(--color-orange);
}

.toast__icon {
    font-size: 1.5rem;
}

.toast--success .toast__icon {
    color: var(--color-green);
}

.toast--error .toast__icon {
    color: var(--color-red);
}

.toast--warning .toast__icon {
    color: var(--color-orange);
}

.toast__content {
    flex: 1;
}

.toast__title {
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
}

.toast__message {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fade-out {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1.5rem;
}

.page-header__title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-text);
}

.page-header__subtitle {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

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

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-primary-weak);
}

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

.btn-outline:hover {
    background: var(--color-primary-weak);
    border-color: var(--color-primary);
}

/* Grid Spacing */
.grid.spacing {
    margin-bottom: 2.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.is-active {
    display: flex;
}

.modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fade-in 0.3s ease;
}

.modal__container {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scale-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.modal__close {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.modal__close:hover {
    background: var(--color-surface-alt);
    color: var(--color-text);
}

.modal__body {
    padding: 2rem;
}

.modal__footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters select {
    padding: 0.65rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filters select:hover {
    border-color: var(--color-primary-light);
}

.filters select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-weak);
}

/* Modern Filters Bar */
.filters-bar {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--color-surface-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.filters-group {
    display: flex;
    gap: 1.25rem;
    flex: 1;
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 180px;
    flex: 1;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-label .material-symbols-outlined {
    font-size: 18px;
    color: var(--color-primary);
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:hover {
    border-color: var(--color-primary-light);
    background: var(--color-surface);
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-weak);
}

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

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

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-weak);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.form-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.checkbox-label span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* Category Badge */
.category-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

/* Icon Buttons */
.icon-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--color-surface-alt);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

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

.icon-btn .material-symbols-outlined {
    font-size: 18px;
}

/* Folders Grid - Google Drive Style */
.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.folder-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.folder-card:hover {
    background: var(--color-surface-alt);
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.folder-card__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-weak);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.folder-card__icon .material-symbols-outlined {
    font-size: 24px;
    color: var(--color-primary);
}

.folder-card__content {
    flex: 1;
    min-width: 0;
}

.folder-card__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-card__meta {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.folder-card__menu {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    opacity: 0;
}

.folder-card:hover .folder-card__menu {
    opacity: 1;
}

.folder-card__menu:hover {
    background: var(--color-surface-alt);
    color: var(--color-text);
}

.dropdown__item--danger {
    color: #ef4444;
}

.dropdown__item--danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.dropdown__divider {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid var(--color-border);
}

/* View Switcher */
.view-switcher {
    display: flex;
    gap: 0.25rem;
    background: var(--color-surface-alt);
    padding: 0.25rem;
    border-radius: var(--radius-md);
}

.view-switcher__btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-switcher__btn:hover {
    background: var(--color-surface);
    color: var(--color-text);
}

.view-switcher__btn.is-active {
    background: var(--color-primary);
    color: white;
}

/* Files View Container */
.files-view {
    display: none;
}

.files-view.is-active {
    display: grid;
}

/* Grid View */
.files-view--grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.file-item--grid {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.file-item--grid:hover {
    background: var(--color-surface-alt);
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.file-item__preview {
    width: 100%;
    aspect-ratio: 1;
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.file-item__preview .material-symbols-outlined {
    font-size: 48px;
    color: var(--color-primary);
}

.file-item__info {
    margin-bottom: 0.5rem;
}

.file-item__name {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item__meta {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.file-item__menu {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--color-surface);
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    opacity: 0;
}

.file-item:hover .file-item__menu {
    opacity: 1;
}

.file-item__menu:hover {
    background: var(--color-surface-alt);
    color: var(--color-text);
}

/* List View */
.files-view--list {
    grid-template-columns: 1fr;
    gap: 0;
}

.file-item--list {
    display: grid;
    grid-template-columns: 40px 1fr auto auto 40px;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-item--list:hover {
    background: var(--color-surface-alt);
}

.file-item__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-item__icon .material-symbols-outlined {
    font-size: 24px;
    color: var(--color-primary);
}

.file-item__size {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    min-width: 80px;
    text-align: right;
}

/* Detail View */
.files-view--detail {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.file-item--detail {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.file-item--detail:hover {
    background: var(--color-surface-alt);
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-md);
}

.file-item__preview-large {
    width: 80px;
    height: 80px;
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-item__preview-large .material-symbols-outlined {
    font-size: 48px;
    color: var(--color-primary);
}

.file-item__content {
    flex: 1;
}

.file-item__details {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    align-items: center;
}

.file-item__tag {
    background: var(--color-primary-weak);
    color: var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--color-surface-alt);
    color: var(--color-text);
}

.btn-icon .material-symbols-outlined {
    font-size: 20px;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown__menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    padding: 0.5rem 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}

.dropdown__menu.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown__item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    text-align: left;
}

.dropdown__item:hover {
    background: var(--color-surface-alt);
}

.dropdown__item .material-symbols-outlined {
    font-size: 20px;
    color: var(--color-text-muted);
}

.dropdown__item--danger {
    color: var(--color-red);
}

.dropdown__item--danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.dropdown__item--danger .material-symbols-outlined {
    color: var(--color-red);
}

@keyframes dropdown-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner--large {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.skeleton {
    background: linear-gradient(90deg,
            var(--color-surface-alt) 0%,
            var(--color-border) 50%,
            var(--color-surface-alt) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.btn.is-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
        gap: 0.5rem;
    }

    .app-header__title {
        font-size: 1.25rem;
    }

    .app-header__breadcrumb {
        display: none;
    }

    .app-header__actions {
        gap: 0.5rem;
    }

    .search {
        background: transparent;
        border: none;
        padding: 0;
        box-shadow: none;
    }

    .search:focus-within {
        box-shadow: none;
        width: auto;
    }

    .search input {
        display: none;
    }

    .search input {
        display: none;
    }

    /* Transactions Page Responsiveness */
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }

    .filters-group {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-item {
        min-width: 100%;
    }

    .card__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

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

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header__title {
        font-size: 1.5rem;
    }

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

    .files-view--grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .file-item--list {
        grid-template-columns: 40px 1fr 40px;
        gap: 0.75rem;
    }

    .file-item__size,
    .file-item--list .file-item__meta {
        display: none;
    }



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

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

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

    .view-switcher {
        width: 100%;
        justify-content: center;
    }
}

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

    .folder-card__icon {
        width: 32px;
        height: 32px;
    }

    .folder-card__icon .material-symbols-outlined {
        font-size: 20px;
    }

    .file-item--grid {
        padding: 0.75rem;
    }

    .file-item__preview {
        aspect-ratio: 1.2;
    }

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

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

.form input,
.form select,
.form textarea {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-weak);
}

/* Form Row - 2 Column Grid Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row label input,
.form-row label select {
    width: 100%;
}

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

/* Single column form row */
.form-row.single {
    grid-template-columns: 1fr;
}

.form-row > *:only-child {
    grid-column: 1 / -1;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 0.95rem;
}

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

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

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

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-surface-alt);
}

/* Utilities */
.text-center {
    text-align: center;
}

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

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

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

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

.font-bold {
    font-weight: 700;
}

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

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

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

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -280px;
        height: 100%;
        box-shadow: var(--shadow-xl);
        /* transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); */
    }

    .sidebar.is-open {
        transform: translateX(280px);
    }

    .app-header {
        padding: 1rem 1.5rem;
    }

    .views {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {

    .grid.two,
    .grid.three,
    .grid.four {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 2rem;
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.is-active {
    opacity: 1;
    visibility: visible;
}

.modal__content {
    background: var(--color-surface);
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal.is-active .modal__content {
    transform: translateY(0);
}

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

.modal__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.modal__body {
    padding: 1.5rem;
}

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