/* Admin Dashboard Theme - Professional & Responsive */

/* --- Layout Structure --- */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
}

body {
    min-height: 100vh;
    background-color: var(--bg-body);
    overflow-x: hidden;
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transition: transform 0.3s ease-in-out, width 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand img {
    height: 32px;
    width: 32px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

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

/* Sidebar Navigation */
.nav-pills .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.nav-pills .nav-link i {
    width: 24px;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 1.1rem;
}

.nav-pills .nav-link:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.nav-pills .nav-link.active {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

/* --- Main Content Area --- */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.top-navbar {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.content-wrapper {
    flex: 1;
    padding: 2rem;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }
    
    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }
}

/* --- Dashboard Components --- */

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    background-color: var(--bg-card);
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.stats-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

/* Background utilities for icons */
.bg-light-primary { background-color: rgba(185, 199, 248, 0.2); color: var(--primary-color); }
.bg-light-success { background-color: rgba(76, 175, 80, 0.15); color: var(--success-color); }
.bg-light-info { background-color: rgba(23, 162, 184, 0.15); color: #17a2b8; }
.bg-light-warning { background-color: rgba(255, 193, 7, 0.15); color: #ffc107; }
.bg-light-danger { background-color: rgba(220, 53, 69, 0.15); color: var(--danger-color); }

/* Tables */
.table-responsive {
    border-radius: 0.75rem;
    overflow: hidden;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.table-hover tbody tr:hover {
    background-color: var(--bg-secondary);
}

/* Avatar */
.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-md {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

/* Buttons */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 0.5rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(185, 199, 248, 0.25);
}

/* Login Page Specifics */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-body) 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    border-radius: 1rem;
}

/* Utilities */
.text-gray-800 { color: var(--text-heading) !important; }
.shadow-custom { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }

/* Dark Mode Overrides (if needed beyond theme.css) */
[data-theme="dark"] .table th {
    background-color: #252525;
    color: #b0b0b0;
}

[data-theme="dark"] .sidebar {
    border-right-color: #333;
}
