/* Glass Dashboard Theme */
:root {
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --text-main: #2d3748;
    --text-muted: #718096;
    --accent-color: #667eea;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --sidebar-width: 280px;
    --danger-color: #ef4444;
    --success-color: #10b981;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);
    background-attachment: fixed;
    /* Parallax-like fix */
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* Layout Grid */
.dashboard-layout {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    backdrop-filter: blur(10px);
    /* Subtle blur on bg */
}

/* Glass Sidebar */
.glass-sidebar {
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    z-index: 10;
    transition: transform 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: #1a202c;
    letter-spacing: -0.5px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 14px rgba(118, 75, 162, 0.4);
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.4);
    color: var(--accent-color);
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.65);
    color: #5a67d8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.nav-icon {
    width: 20px;
    text-align: center;
}

.user-profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.user-info {
    flex: 1;
    font-size: 0.85rem;
}

.user-name {
    display: block;
    font-weight: 600;
    color: #333;
}

.logout-btn {
    color: var(--danger-color);
    text-decoration: none;
    font-size: 1.2rem;
    margin-left: auto;
    transition: transform 0.2s;
}

.logout-btn:hover {
    transform: scale(1.1);
}


/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    /* Internal scrolling */
    padding: 2rem 3rem;
    position: relative;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.page-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    color: #1a202c;
    letter-spacing: -1px;
}

.page-header p {
    margin: 4px 0 0;
    color: var(--text-muted);
}

/* Glass Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    /* Soft shadow */
    padding: 24px;
    margin-bottom: 24px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: fadeIn 0.5s ease-out;
}

.glass-card:hover {
    /* transform: translateY(-4px); disabled for forms to avoid jitter */
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.12);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2d3748;
}

/* Tabs Animation logic */
.tab-content {
    display: none;
    animation: slideUp 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

/* Form Elements with Glass Style */
input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
    font-size: 1rem;
    color: #4a5568;
    transition: all 0.2s;
    box-sizing: border-box;
    margin-bottom: 1rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #4a5568;
}

/* Buttons */
.btn-glass-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.3);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-glass-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(118, 75, 162, 0.4);
}

.btn-glass-secondary {
    background: rgba(255, 255, 255, 0.6);
    color: #4a5568;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-glass-secondary:hover {
    background: white;
    color: var(--accent-color);
}

/* Grid for Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.stat-box {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(102, 126, 234, 0.1);
    color: #5a67d8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-val {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}


@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard-layout {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }

    .glass-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        padding: 1rem;
    }

    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .nav-item {
        white-space: nowrap;
    }

    .brand {
        margin-bottom: 1rem;
    }

    .main-content {
        padding: 1.5rem;
        overflow: visible;
    }

    .user-profile {
        display: none;
    }

    /* Hide profile on mobile for now */
}