/* Colors - Modern Enterprise Palette */
:root {
    /* Primary Colors */
    --primary-color: #0f172a; /* Slate 900 */
    --primary-light: #1e293b; /* Slate 800 */
    --primary-hover: #334155; /* Slate 700 */
    
    /* Accent Colors */
    --accent-color: #3b82f6; /* Blue 500 */
    --accent-hover: #2563eb; /* Blue 600 */
    --accent-light: #eff6ff; /* Blue 50 */
    
    /* Semantic Colors */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* Backgrounds & Text */
    --bg-color: #f8fafc; /* Slate 50 */
    --card-bg: #ffffff;
    --text-color: #334155; /* Slate 700 */
    --text-muted: #64748b; /* Slate 500 */
    
    /* Structural */
    --sidebar-width: 260px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-float: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* -------------------------------------
   SIDEBAR STYLING
------------------------------------- */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--primary-color);
    color: #FFFFFF;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0,0,0,0.1);
}

#sidebar .sidebar-header {
    padding: 24px 20px;
    background-color: rgba(0,0,0,0.2);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

#sidebar .sidebar-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#sidebar ul.components {
    padding: 24px 12px;
}

#sidebar ul li {
    margin-bottom: 4px;
}

#sidebar ul li a {
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#sidebar ul li a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

#sidebar ul li.active > a {
    color: #ffffff;
    background-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

#sidebar ul li a i {
    margin-right: 12px;
    width: 24px;
    font-size: 1.1rem;
    text-align: center;
    transition: transform 0.3s ease;
}

#sidebar ul li a:hover i {
    transform: scale(1.1);
}

/* -------------------------------------
   CONTENT & NAVBAR
------------------------------------- */
#content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-navbar {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    padding: 12px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.02);
    position: sticky;
    top: 0;
    z-index: 999;
}

.top-navbar .btn-primary {
    background-color: var(--accent-color);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: var(--shadow-sm);
}

/* -------------------------------------
   CARDS & WIDGETS
------------------------------------- */
.card {
    background: var(--card-bg);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-weight: 600;
    padding: 16px 24px;
    color: var(--primary-color);
}

.card-body {
    padding: 24px;
}

/* Dashboard Widget Styling */
.widget-card {
    border-left: 4px solid var(--accent-color);
    position: relative;
    overflow: hidden;
}

.widget-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(59,130,246,0.03) 100%);
    pointer-events: none;
}

.widget-card.accent {
    border-left-color: var(--primary-color);
}
.widget-card.accent::after {
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(15,23,42,0.03) 100%);
}

.widget-icon {
    font-size: 2.5rem;
    color: var(--accent-light);
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.widget-card:hover .widget-icon {
    transform: scale(1.1) rotate(5deg);
}

/* -------------------------------------
   TABLES
------------------------------------- */
.table-responsive {
    border-radius: 8px;
}

.table-custom {
    margin-bottom: 0;
    color: var(--text-color);
    border: 1px solid rgba(0,0,0,0.05);
}

.table-custom thead th {
    background-color: var(--primary-light);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(0,0,0,0.05);
    padding: 16px;
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: background-color 0.2s;
}

.table-custom thead th:hover {
    background-color: var(--primary-hover);
}

.table-custom thead th::after {
    content: '\f0dc'; /* fa-sort */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
}

.table-custom thead th.sort-asc::after {
    content: '\f0de'; /* fa-sort-up */
    opacity: 1;
}

.table-custom thead th.sort-desc::after {
    content: '\f0dd'; /* fa-sort-down */
    opacity: 1;
}

.table-custom tbody tr {
    transition: background-color 0.2s ease;
}

.table-custom tbody td {
    padding: 16px;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,0.05);
    font-size: 0.95rem;
}

.table-custom tbody tr:hover {
    background-color: var(--accent-light);
}

/* Specific highlight overrides for tables */
.table-custom thead th.bg-primary {
    background-color: var(--accent-color) !important;
    color: #fff;
}
.table-custom thead th.bg-success {
    background-color: var(--success-color) !important;
    color: #fff;
}

/* -------------------------------------
   BUTTONS
------------------------------------- */
.btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Action Buttons in Tables */
.table-custom .btn-sm {
    border-radius: 6px;
    margin: 0 2px;
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: #fff;
}
.btn-warning:hover {
    background-color: #d97706;
    color: #fff;
}

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

/* -------------------------------------
   FORMS & MODALS
------------------------------------- */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-float);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light)) !important;
    padding: 20px 24px;
    border-bottom: none;
}

.modal-title {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.modal-footer {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 16px 24px;
    background-color: var(--bg-color);
}

/* -------------------------------------
   BADGES & UTILITIES
------------------------------------- */
.badge {
    padding: 6px 10px;
    font-weight: 500;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

.text-primary {
    color: var(--primary-color) !important;
}

/* -------------------------------------
   RESPONSIVE DESIGN
------------------------------------- */
@media (min-width: 769px) {
    #sidebar.active {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    #content.active {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        box-shadow: none;
    }
    #sidebar.active {
        margin-left: 0;
        box-shadow: 4px 0 24px rgba(0,0,0,0.2);
    }
    #content {
        width: 100%;
        margin-left: 0;
    }
    #content.active {
        width: 100%;
        margin-left: 0;
    }
    #sidebar.active ~ #content {
        opacity: 0.4;
        pointer-events: none;
    }
}
