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

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --dark: #0f172a;
    --light: #f8fafc;
    --sidebar-bg: #1e293b;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #f1f5f9;
    color: var(--dark);
    margin: 0;
    overflow-x: hidden;
}

/* Glassmorphism utils */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* Sidebar Styling */
.wrapper {
    display: flex;
    width: 100%;
}

.sidebar {
    min-width: 280px;
    max-width: 280px;
    background: var(--sidebar-bg);
    color: #fff;
    min-height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    background: rgba(0,0,0,0.1);
    text-align: center;
}

.sidebar-header i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.5));
}

.sidebar ul.components {
    padding: 1rem 0;
}

.sidebar ul li {
    padding: 0.2rem 1rem;
}

.sidebar ul li a {
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 12px;
    transition: 0.3s;
    font-weight: 500;
}

.sidebar ul li a i {
    width: 25px;
    margin-right: 12px;
    font-size: 1.1rem;
}

.sidebar ul li a:hover, .sidebar ul li.active > a {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar ul li.active > a {
    background: var(--primary);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

/* Content Area */
.content {
    flex: 1;
    padding: 2rem;
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
}

.top-navbar {
    background: var(--glass);
    backdrop-filter: blur(8px);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--glass-border);
}

/* Dashboard Stat Cards */
.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Table Styling */
.table-container {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.table thead th {
    background: #f8fafc;
    color: var(--secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
}

.table th:last-child, .table td:last-child {
    width: 120px;
    min-width: 120px;
    text-align: center !important;
}

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

/* Badge Styles */
.badge {
    padding: 0.5em 0.8em;
    border-radius: 8px;
    font-weight: 600;
}

/* Form Styling */
.form-control, .form-select {
    border: 1px solid #e2e8f0;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    transition: 0.2s;
}

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

/* Search Bar */
.search-container {
    position: relative;
    max-width: 300px;
}

.search-container input {
    padding-left: 2.5rem;
    background: #f1f5f9;
    border: none;
}

.search-container::before {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    transition: 0.3s;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

#mainContent > * {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Pagination Styling */
.pagination .page-link {
    background: var(--glass);
    color: var(--secondary);
    border: 1px solid var(--glass-border);
    transition: all 0.2s ease;
    min-width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.pagination .page-link:hover {
    background: #fff;
    transform: translateY(-1px);
    color: var(--primary);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    background: transparent;
}

/* Mobile Toggle */
#sidebarToggle {
    display: none;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    top: 0;
    left: 0;
}

/* RESPONSIVE QUERIES */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -280px;
        transition: 0.4s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-header {
        padding: 1.5rem 1rem;
    }

    #sidebarToggle {
        display: block;
        margin-right: 1rem;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .content {
        padding: 1rem;
        width: 100%;
    }

    .top-navbar {
        padding: 0.8rem 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .search-container {
        max-width: 100%;
        width: 100%;
        order: 3;
    }
}

@media (max-width: 575.98px) {
    .stat-card {
        padding: 1rem;
    }
    
    .top-navbar h5 {
        font-size: 1rem;
    }

    .btn-sm {
        padding: 0.4rem 0.8rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .table thead th, .table tbody td {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }

    /* Stacked Tables for Mobile */
    .stack-on-mobile thead {
        display: none;
    }

    .stack-on-mobile, .stack-on-mobile tbody, .stack-on-mobile tr, .stack-on-mobile td {
        display: block;
        width: 100%;
    }

    .stack-on-mobile tr {
        margin-bottom: 1.5rem;
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        background: #fff;
        padding: 10px;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    }

    .stack-on-mobile td {
        text-align: right;
        padding: 8px 10px !important;
        position: relative;
        border: none !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .stack-on-mobile td::before {
        content: attr(data-label);
        font-weight: 700;
        text-align: left;
        color: var(--secondary);
        font-size: 0.75rem;
        text-transform: uppercase;
        flex: 1;
    }

    .stack-on-mobile td:last-child {
        border-top: 1px solid #f1f5f9 !important;
        margin-top: 5px;
        padding-top: 12px !important;
        justify-content: center;
    }
    
    .stack-on-mobile td:last-child::before {
        display: none;
    }
}
