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

:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-main: #f1f5f9;
    --white: #ffffff;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100vh;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(79, 70, 229, 0.4);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    padding: 0 0.5rem;
}

.logo-box {
    width: 45px;
    height: 45px;
    background: var(--white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.logo-box img {
    width: 32px;
    height: auto;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.nav-menu {
    list-style: none;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-link:hover {
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary);
    transform: translateX(4px);
}

.nav-link.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2.5rem;
    width: calc(100% - 280px);
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.page-info h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-dark);
}

.user-pill {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.user-meta {
    text-align: right;
}

.user-meta .name {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-meta .role {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--white);
    object-fit: cover;
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.card-stat {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 1.75rem;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.card-stat:hover {
    transform: translateY(-5px);
}

.icon-box {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.icon-box.blue { background: rgba(79, 70, 229, 0.1); color: var(--primary); }
.icon-box.red { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.icon-box.green { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.icon-box.amber { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.stat-info .value {
    font-size: 1.75rem;
    font-weight: 800;
    display: block;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-info .label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Data Sections */
.data-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1.5rem;
}

.section-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Custom Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr {
    background: var(--white);
    transition: transform 0.2s ease;
}

tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

td {
    padding: 1.25rem 1rem;
    font-size: 0.9rem;
}

td:first-child { border-radius: 12px 0 0 12px; }
td:last-child { border-radius: 0 12px 12px 0; }

.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.bg-danger-soft { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.bg-success-soft { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.bg-warning-soft { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.bg-primary-soft { background: rgba(79, 70, 229, 0.1); color: var(--primary); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 8px 20px -5px rgba(79, 70, 229, 0.4);
}

/* DataTables Overrides */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--glass-border);
    background: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    outline: none;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.25rem;
}

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

.section-card, .card-stat {
    animation: fadeIn 0.5s ease forwards;
}
