:root {
    --bg-color-main: #f0f2f5;
    --sidebar-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    
    --primary-color: #2563eb;
    --primary-light: #eff6ff;
    --secondary-color: #475569;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --accent: #3b82f6;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color-main);
    color: var(--text-main);
    /* Subtle background gradient to make glassmorphism pop */
    background-image: 
        radial-gradient(at 40% 20%, hsla(228,100%,74%,0.15) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(189,100%,56%,0.15) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(355,100%,93%,0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

.glass-panel {
    background: var(--sidebar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
}
.sidebar-header h2 {
    font-weight: 700;
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

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

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    gap: 12px;
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item:hover, .nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateX(4px);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

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

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

.user-info strong {
    font-size: 0.9rem;
}

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

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(255, 255, 255, 0.7);
}

.topbar .page-title {
    margin: 0;
    font-weight: 600;
    font-size: 1.25rem;
}

.topbar-actions {
    display: flex;
    gap: 12px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--secondary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.05);
    color: var(--primary-color);
}

.content-wrapper {
    padding: 32px;
    flex: 1;
}

/* Cards & Stats */
.stat-card {
    border-radius: 16px;
    padding: 24px;
    background: white;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.stat-card .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Color utility classes for icons */
.bg-light-primary { background: #eff6ff; color: #3b82f6; }
.bg-light-success { background: #ecfdf5; color: #10b981; }
.bg-light-warning { background: #fffbeb; color: #f59e0b; }
.bg-light-danger { background: #fef2f2; color: #ef4444; }

/* Table Enhancements */
.table-glass {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}
.table-glass th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    color: var(--secondary-color);
    font-weight: 600;
    padding: 16px;
}
.table-glass td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

/* ── Sidebar scrolls when items overflow ─────────────────── */
.sidebar-nav {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

/* ── Table search input ──────────────────────────────────── */
#tableSearch {
    border-radius: 50px;
    padding-left: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 0.9rem;
}

/* ── Success badge flash ─────────────────────────────────── */
.alert-success  { background: linear-gradient(135deg, #10b981, #059669); color: #fff; border-radius: 12px; padding: 14px 20px; }
.alert-danger   { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; border-radius: 12px; padding: 14px 20px; }

/* ── Progress bars ───────────────────────────────────────── */
.progress { background: #f1f5f9; }

/* ── Form controls consistent look ──────────────────────── */
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ── Responsive: collapse sidebar on small screens ────────── */
@media (max-width: 768px) {
    .sidebar { width: 70px; }
    .sidebar .nav-item span, .sidebar-header h2, .user-info { display: none; }
    .main-content { margin-left: 70px; }
}
