/*
 * Dashboard Admin Bootstrap Theme
 * Modern admin dashboard theme with data visualization components
 * Built for Bootstrap 5.3
 * License: Free for personal and commercial use
 */

:root {
    --da-primary: #4f46e5;
    --da-secondary: #6b7280;
    --da-success: #10b981;
    --da-warning: #f59e0b;
    --da-danger: #ef4444;
    --da-info: #3b82f6;
    --da-light: #f9fafb;
    --da-dark: #111827;
    --da-sidebar-bg: #1f2937;
    --da-sidebar-hover: #374151;
    --da-card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --da-card-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--da-light);
    font-size: 0.875rem;
    line-height: 1.5;
}

.text-primary { color: var(--da-primary) !important; }
.text-secondary { color: var(--da-secondary) !important; }
.text-success { color: var(--da-success) !important; }
.text-warning { color: var(--da-warning) !important; }
.text-danger { color: var(--da-danger) !important; }
.text-info { color: var(--da-info) !important; }

.bg-primary { background-color: var(--da-primary) !important; }
.bg-secondary { background-color: var(--da-secondary) !important; }
.bg-success { background-color: var(--da-success) !important; }
.bg-warning { background-color: var(--da-warning) !important; }
.bg-danger { background-color: var(--da-danger) !important; }
.bg-info { background-color: var(--da-info) !important; }

/* Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--da-sidebar-bg);
    color: #d1d5db;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #374151;
}

.sidebar-brand {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.sidebar-brand i {
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
}

.sidebar.collapsed .sidebar-brand span {
    display: none;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.sidebar.collapsed .nav-section-title {
    display: none;
}

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

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #d1d5db;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0;
}

.nav-link:hover {
    background-color: var(--da-sidebar-hover);
    color: white;
}

.nav-link.active {
    background-color: var(--da-primary);
    color: white;
    position: relative;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: white;
}

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

.sidebar.collapsed .nav-link span {
    display: none;
}

.nav-link .badge {
    margin-left: auto;
    font-size: 0.65rem;
}

.sidebar.collapsed .nav-link .badge {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 70px;
}

/* Top Navigation */
.topbar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: var(--da-card-shadow);
}

.topbar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--da-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: none;
}

.sidebar-toggle:hover {
    background-color: var(--da-light);
    color: var(--da-dark);
}

.topbar-search {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-input {
    background-color: var(--da-light);
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    width: 100%;
    font-size: 0.875rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--da-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-btn {
    background: none;
    border: none;
    color: var(--da-secondary);
    font-size: 1.125rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.topbar-btn:hover {
    background-color: var(--da-light);
    color: var(--da-dark);
}

.topbar-btn .badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    font-size: 0.625rem;
}

.user-menu {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.user-menu:hover {
    background-color: var(--da-light);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--da-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Page Content */
.page-content {
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--da-dark);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--da-secondary);
    font-size: 0.875rem;
}

/* Cards */
.card-dashboard {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: var(--da-card-shadow);
    transition: all 0.2s ease;
}

.card-dashboard:hover {
    box-shadow: var(--da-card-shadow-lg);
}

.card-dashboard .card-header {
    background: transparent;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--da-dark);
}

.card-dashboard .card-body {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--da-card-shadow);
    border-left: 4px solid var(--da-primary);
    transition: all 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--da-card-shadow-lg);
}

.stats-card.success {
    border-left-color: var(--da-success);
}

.stats-card.warning {
    border-left-color: var(--da-warning);
}

.stats-card.danger {
    border-left-color: var(--da-danger);
}

.stats-card.info {
    border-left-color: var(--da-info);
}

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

.stats-icon.primary { background-color: var(--da-primary); }
.stats-icon.success { background-color: var(--da-success); }
.stats-icon.warning { background-color: var(--da-warning); }
.stats-icon.danger { background-color: var(--da-danger); }
.stats-icon.info { background-color: var(--da-info); }

.stats-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--da-dark);
    margin-bottom: 0.25rem;
}

.stats-label {
    color: var(--da-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.stats-change {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.stats-change.positive {
    color: var(--da-success);
}

.stats-change.negative {
    color: var(--da-danger);
}

/* Tables */
.table-dashboard {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--da-card-shadow);
}

.table-dashboard .table {
    margin-bottom: 0;
}

.table-dashboard .table th {
    border-top: none;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
    font-weight: 600;
    color: var(--da-dark);
    padding: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-dashboard .table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.table-dashboard .table tbody tr:hover {
    background-color: #f9fafb;
}

/* Buttons */
.btn-dashboard {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--da-primary);
    border-color: var(--da-primary);
}

.btn-primary:hover {
    background-color: #3730a3;
    border-color: #3730a3;
}

/* Forms */
.form-control-dashboard {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-control-dashboard:focus {
    border-color: var(--da-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label-dashboard {
    font-weight: 500;
    color: var(--da-dark);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Progress Bars */
.progress-dashboard {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.progress-bar-dashboard {
    height: 100%;
    border-radius: 0.5rem;
    transition: width 0.6s ease;
}

/* Badges */
.badge-dashboard {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Bootstrap Icons Support */
.sidebar-brand i,
.nav-link i,
.stats-icon i,
.topbar-btn i {
    font-size: inherit;
    line-height: inherit;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-content.expanded {
        margin-left: 0;
    }
    
    .topbar {
        padding: 0.75rem 1rem;
    }
    
    .topbar-search {
        display: none;
    }
    
    .page-content {
        padding: 1rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .topbar-actions {
        gap: 0.5rem;
    }
    
    .user-menu span {
        display: none;
    }
    
    .stats-value {
        font-size: 1.5rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
}