/**
 * Dashboard, Admin & Portal Layout Styles
 * Made with heart ❤️ by Web Era Solutions
 */

:root {
    --sidebar-width: 260px;
    --topbar-height: 70px;
}

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: #F8FAFC;
}

/* Sidebar */
.dashboard-sidebar {
    width: var(--sidebar-width);
    background: #0F172A;
    color: #94A3B8;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: var(--transition-smooth);
    border-right: 1px solid #1E293B;
}
.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid #1E293B;
}
.sidebar-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: #FFFFFF;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.25rem 0.75rem;
    list-style: none;
    margin: 0;
}
.nav-category {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748B;
    padding: 0.75rem 0.75rem 0.35rem;
}
.sidebar-item {
    margin-bottom: 0.25rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    color: #94A3B8;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: 8px;
    transition: var(--transition-fast);
}
.sidebar-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}
.sidebar-link:hover {
    color: #FFFFFF;
    background: #1E293B;
}
.sidebar-link.active {
    color: #FFFFFF;
    background: var(--primary-gradient);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
.sidebar-link .badge {
    margin-left: auto;
}
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #1E293B;
    font-size: 0.8rem;
    text-align: center;
}

/* Main Content Area */
.dashboard-main {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: var(--transition-smooth);
}

/* Topbar */
.dashboard-topbar {
    height: var(--topbar-height);
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1010;
}
.topbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.35rem;
    color: var(--dark-surface);
    cursor: pointer;
}
.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-decoration: none;
}
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--border-color);
}
.user-info {
    line-height: 1.2;
}
.user-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark-surface);
}
.user-role-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* Page Body */
.dashboard-content {
    padding: 2rem;
    flex-grow: 1;
}
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}
.page-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* Metric Cards */
.stat-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-info {
    flex-grow: 1;
    min-width: 0;
}
.stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--dark-surface);
    line-height: 1.1;
    margin-bottom: 0.2rem;
}
.stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Custom Data Tables */
.custom-table-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.table-header-bar {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.custom-table {
    width: 100%;
    margin-bottom: 0;
    vertical-align: middle;
}
.custom-table th {
    background: #F8FAFC;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}
.custom-table td {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid #F1F5F9;
}
.custom-table tbody tr:hover {
    background: #F8FAFC;
}

/* Action Buttons */
.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    background: #FFFFFF;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}
.btn-action:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.btn-action.btn-delete:hover {
    border-color: var(--accent-rose);
    color: var(--accent-rose);
    background: #FFF1F2;
}

/* Empty State */
.empty-state {
    padding: 3.5rem 1.5rem;
    text-align: center;
}
.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-bottom: 1.25rem;
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
    }
    .dashboard-sidebar.show {
        transform: translateX(0);
    }
    .dashboard-main {
        margin-left: 0;
    }
    .topbar-toggle {
        display: block;
    }
    .dashboard-content {
        padding: 1.25rem;
    }
    .dashboard-topbar {
        padding: 0 1.25rem;
    }
}
