@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --success: #10b981;
    --info: #3b82f6;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light: #f9fafb;
    --dark: #111827;
    --bg-body: #f3f4f6;
    --text-muted: #6b7280;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
    background-color: var(--bg-body);
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* --- Sidebar Styling --- */
#sidebar {
    background: #ffffff;
    box-shadow: 2px 0 20px rgba(0,0,0,0.05);
    border-right: 1px solid rgba(0,0,0,0.05);
    z-index: 1000;
}

.sidebar-sticky {
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

#sidebar .sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    color: #4361ee;
    color: var(--primary);
}

#sidebar .nav-link {
    color: #6b7280;
    color: var(--text-muted);
    border-radius: 0.5rem;
    margin: 0.25rem 1rem;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
}

#sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 12px;
    font-size: 1.1rem;
    transition: transform 0.2s;
}

#sidebar .nav-link:hover {
    color: #4361ee;
    color: var(--primary);
    background: rgba(67, 97, 238, 0.05);
}

#sidebar .nav-link:hover i {
    transform: scale(1.1);
}

#sidebar .nav-link.active {
    background: #4361ee;
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

#sidebar .nav-link.active i {
    color: white;
}

/* --- Main Content --- */
main {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #111827;
    color: var(--dark);
    letter-spacing: -0.025em;
}

/* --- Cards --- */
.card {
    background: white;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    box-shadow: var(--hover-shadow);
}

.card-header {
    background: white;
    border-bottom: 1px solid #f3f4f6;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-card {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    color: white;
}

.stats-card .card-body {
    position: relative;
    z-index: 2;
}

.stats-card .icon-bg {
    position: absolute;
    right: -10px;
    bottom: -20px;
    font-size: 8rem;
    opacity: 0.15;
    transform: rotate(-15deg);
    z-index: 1;
    pointer-events: none;
}

.bg-gradient-primary { background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%); }
.bg-gradient-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.bg-gradient-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.bg-gradient-danger { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); }

/* --- Tables --- */
.table-container {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    width: 100%;
}

.table thead th {
    background: #f9fafb;
    color: #6b7280;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.table tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #374151;
    font-weight: 500;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

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

/* --- Badges --- */
.badge {
    padding: 0.35em 0.8em;
    font-weight: 600;
    border-radius: 2rem;
}

.bg-success-soft { background-color: rgba(16, 185, 129, 0.1) !important; color: #10b981 !important; }
.bg-danger-soft { background-color: rgba(239, 68, 68, 0.1) !important; color: #ef4444 !important; }
.bg-warning-soft { background-color: rgba(245, 158, 11, 0.1) !important; color: #f59e0b !important; }
.bg-primary-soft { background-color: rgba(67, 97, 238, 0.1) !important; color: #4361ee !important; }
.bg-secondary-soft { background-color: rgba(107, 114, 128, 0.1) !important; color: #6b7280 !important; }

/* --- Forms --- */
.form-control {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    box-shadow: none;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: #4361ee;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #4361ee;
    background-color: var(--primary);
    border-color: #4361ee;
    border-color: var(--primary);
    box-shadow: 0 4px 6px rgba(67, 97, 238, 0.2);
}

.btn-primary:hover {
    background-color: #3f37c9;
    background-color: var(--secondary);
    border-color: #3f37c9;
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(67, 97, 238, 0.3);
}

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

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* --- Collapsible Sidebar Support --- */
#sidebar.collapsed {
    width: 80px;
}
#sidebar.collapsed .sidebar-text,
#sidebar.collapsed .sidebar-header h5 {
    display: none;
}
#sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 1rem 0;
}
#sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    #sidebar {
        margin-left: -250px;
        transition: margin 0.3s;
    }
    #sidebar.active {
        margin-left: 0;
    }
}
