/* Dashboard Container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--color-background);
}

/* Fixed Right Sidebar */
.dashboard-sidebar {
    width: 280px;
    background: var(--color-card);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    /* box-shadow: -2px 0 10px rgba(0,0,0,0.1); */
    transition: all 0.3s ease;
    border-left: 1px solid var(--color-border);
    transform: translateX(0);
}

/* Off-canvas behavior for tablet and mobile */
@media (max-width: 1024px) {
    .dashboard-sidebar {
        transform: translateX(100%);
        width: 280px;
    }
    
    .dashboard-sidebar.open {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-right: 0;
    }
    
    .dashboard-sidebar.collapsed + .dashboard-main {
        margin-right: 0;
    }
    
    /* Overlay for mobile */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* Collapsed sidebar state */
.dashboard-sidebar.collapsed {
    width: 70px;
}

.dashboard-sidebar.collapsed .nav-text,
.dashboard-sidebar.collapsed .user-info,
.dashboard-sidebar.collapsed .logo-image,
.dashboard-sidebar.collapsed .settings-dropdown,
.dashboard-sidebar.collapsed .settings-toggle {
    display: none;
}

.dashboard-sidebar.collapsed .logo-icon {
    display: block;
}

/* Logo Section */
.dashboard-sidebar .sidebar-logo {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-sidebar .logo-image {
    display: block;
    transition: all 0.3s ease;
    opacity: 1;
    transform: scale(1);
    width: 100%;
    height: 56px;
    object-fit: contain;
    object-position: center;
}

.logo-icon {
    max-width: 32px;
    height: auto;
    display: none;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
}

.dashboard-sidebar.collapsed .logo-image {
    opacity: 0;
    transform: scale(0.8);
}

.dashboard-sidebar.collapsed .logo-icon {
    display: block;
    opacity: 1;
    transform: scale(1);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    margin-bottom: auto;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0.25rem 1rem;
}

.dashboard-sidebar.collapsed .nav-item {
    margin: 0.25rem 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    justify-content: center;
}

.dashboard-sidebar:not(.collapsed) .nav-link {
    justify-content: flex-start;
}

.nav-link:hover {
    background: var(--color-background);
    color: var(--color-heading);
}

.nav-link.active {
    background: var(--color-accent);
    color: white;
}

.nav-link i {
    margin-left: 0.75rem;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    transform: scale(1);
}

.dashboard-sidebar.collapsed .nav-link i {
    margin-left: 0;
    transform: scale(1.1);
}

.nav-text {
    transition: opacity 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
}

.dashboard-sidebar.collapsed .nav-text {
    opacity: 0;
    transform: translateX(10px);
    width: 0;
}

/* User Account Section (Fixed at bottom) */
.sidebar-account {
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-card);
}

.user-profile {
    display: flex;
    align-items: center;
    position: relative;
    justify-content: center;
}

.dashboard-sidebar:not(.collapsed) .user-profile {
    justify-content: flex-start;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.75rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
    transform: scale(1);
}

.dashboard-sidebar.collapsed .user-avatar {
    margin-left: 0;
    transform: scale(1.1);
}

.user-avatar i {
    font-size: 1.2rem;
    color: #6c757d;
}

.user-info {
    flex: 1;
    min-width: 0;
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateX(0);
}

.dashboard-sidebar.collapsed .user-info {
    opacity: 0;
    transform: translateX(10px);
    width: 0;
}

.user-name {
    font-weight: 600;
    color: var(--color-heading);
    font-size: 0.9rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

.user-type {
    font-size: 0.8rem;
    color: var(--color-text);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

.user-settings {
    position: relative;
    flex-shrink: 0;
}

.settings-toggle {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--color-background);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-toggle:hover {
    background: var(--color-accent);
    color: white;
}

.settings-toggle i {
    font-size: 0.9rem;
}

.settings-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1001;
    display: none;
    margin-bottom: 0.5rem;
}

.settings-dropdown.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--color-border);
}

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

.dropdown-item:hover {
    background: var(--color-background);
    color: var(--color-heading);
}

.dropdown-item.logout {
    color: var(--color-red);
    text-align: center;
    justify-content: center;
}

.dropdown-item.logout:hover {
    background: var(--color-red);
    color: white;
}

.dropdown-item i {
    margin-left: 0.5rem;
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

/* Main Content Area */
.dashboard-main {
    flex: 1;
    margin-left: 0;
    margin-right: 280px;
    display: flex;
    flex-direction: column;
    transition: margin-right 0.3s ease;
}

.dashboard-sidebar.collapsed + .dashboard-main {
    margin-right: 70px;
}

/* Sticky Header */
.dashboard-header {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: 80px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    height: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.sidebar-toggle {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--color-text);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.sidebar-toggle i {
    font-size: 1.1rem;
}

/* Header Search Field */
.header-search {
    flex: 1;
    max-width: 400px;
}

.search-field {
    position: relative;
    display: flex;
    align-items: center;
}

.search-field i {
    position: absolute;
    right: 12px;
    color: var(--color-text);
    font-size: 1rem;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(4, 169, 245, 0.1);
}

.search-input::placeholder {
    color: var(--color-text);
    opacity: 0.7;
}

/* Section Title Bar */
.section-title-bar {
    padding: 0;
    margin-bottom: 2rem;
}

.section-title-bar h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-heading);
}

.section-title-bar p {
    margin: 0.5rem 0 0;
    color: var(--color-text);
    font-size: 0.9rem;
    opacity: 0.8;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-icon {
    position: relative;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.header-icon:hover {
    background: var(--color-accent);
    color: white;
    transform: scale(1.05);
}

.header-icon i {
    font-size: 1.1rem;
    color: var(--color-text);
    transition: color 0.3s ease;
}

.header-icon:hover i {
    color: white;
}

.header-icon .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--color-red);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide mobile search icon on desktop */
.mobile-search {
    display: none;
}

/* Dashboard Content */
.dashboard-content {
    padding: 2rem;
    flex: 1;
    position: relative;
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.content-section.active {
    display: block;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-card);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
    border: 1px solid var(--color-border);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
}

.stat-icon i {
    font-size: 1.5rem;
    color: white;
}

.stat-number {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-heading);
}

.stat-info p {
    margin: 0.25rem 0 0;
    color: var(--color-text);
    font-size: 0.9rem;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.content-card {
    background: var(--color-card);
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

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

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-background);
}

.card-title {
    margin: 0;
    font-weight: 600;
    color: var(--color-heading);
}

.card-body {
    padding: 1.5rem;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--color-background);
    border-radius: 10px;
    text-decoration: none;
    color: var(--color-heading);
    transition: all 0.3s ease;
    border: 1px solid var(--color-border);
}

.action-btn:hover {
    background: var(--color-accent);
    color: white;
    transform: translateX(5px);
    text-decoration: none;
}

.action-btn i {
    margin-left: 0.75rem;
    font-size: 1.2rem;
    color: var(--color-accent);
}

.action-btn:hover i {
    color: white;
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--color-background);
    border-radius: 10px;
    border: 1px solid var(--color-border);
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
}

.activity-icon i {
    color: white;
    font-size: 1rem;
}

.activity-content p {
    margin: 0;
    font-weight: 500;
    color: var(--color-heading);
}

.activity-content small {
    color: var(--color-text);
    font-size: 0.85rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-sidebar {
        width: 250px;
    }
    
    .dashboard-main {
        margin-right: 250px;
    }
    
    .dashboard-sidebar.collapsed {
        width: 60px;
    }
    
    .dashboard-sidebar.collapsed + .dashboard-main {
        margin-right: 60px;
    }
}

@media (max-width: 1024px) {
    .desktop-only {
        display: none;
    }
    
    .mobile-search {
        display: flex;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .dashboard-sidebar {
        width: 280px;
        transform: translateX(100%);
    }
    
    .dashboard-sidebar.open {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-right: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        padding: 1rem 1.5rem;
    }
    
    .sidebar-nav {
        max-height: 300px;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .header-icon {
        width: 36px;
        height: 36px;
    }
    
    .header-icon i {
        font-size: 1rem;
    }
    
    .section-title-bar {
        padding: 0.75rem 1.5rem;
    }
    
    .section-title-bar h1 {
        font-size: 1.25rem;
    }
}