:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #fca311;
    --dark: #212529;
    --light: #f8f9fa;
    --gray: #adb5bd;
    --bg-color: #f0f2f5;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-color: #2b2d42;
    --sidebar-bg: #1a1b26;
    --sidebar-text: #a9b1d6;
    --sidebar-active: #4361ee;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar.closed {
    width: 60px;
}

.sidebar .logo {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    background: rgba(0,0,0,0.2);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar .nav-list {
    list-style: none;
    padding: 20px 0;
    overflow-y: auto;
    flex: 1;
}

.sidebar .nav-item {
    margin-bottom: 5px;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background-color: var(--sidebar-active);
    color: #fff;
    border-radius: 0 25px 25px 0;
    margin-right: 15px;
}

.sidebar .nav-link i {
    min-width: 30px;
    font-size: 18px;
}

.sidebar-title {
    font-size: 12px;
    text-transform: uppercase;
    color: #FFD700;
    padding: 10px 20px;
    margin-top: 10px;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    min-width: 0;
}

/* Topbar */
.topbar {
    height: 70px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 999;
}

.toggle-btn {
    font-size: 24px;
    cursor: pointer;
    color: var(--dark);
    background: none;
    border: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

/* Content Area */
.content-area {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.1);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 10px;
}

/* Widgets */
.widget-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.widget {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3);
    position: relative;
    overflow: hidden;
}

.widget::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    transform: rotate(45deg);
}

.widget.success { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); box-shadow: 0 10px 20px rgba(56, 239, 125, 0.3); }
.widget.warning { background: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%); box-shadow: 0 10px 20px rgba(242, 201, 76, 0.3); }
.widget.danger { background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%); box-shadow: 0 10px 20px rgba(255, 75, 43, 0.3); }

.widget-info h3 { font-size: 32px; margin-bottom: 5px; z-index: 1; position: relative;}
.widget-info p { font-size: 14px; opacity: 0.9; z-index: 1; position: relative;}
.widget-icon { font-size: 48px; opacity: 0.5; z-index: 1; position: relative;}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 14px;
}

.btn-primary { background-color: var(--primary); color: #fff; }
.btn-primary:hover { background-color: var(--secondary); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4); }

.btn-success { background-color: var(--success); color: #fff; }
.btn-success:hover { background-color: #31b3db; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(76, 201, 240, 0.4); }

.btn-danger { background-color: var(--danger); color: #fff; }
.btn-danger:hover { background-color: #d11a6d; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(247, 37, 133, 0.4); }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 5px; }
.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #ffca2c;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

/* Table styling override for DataTables */
table.dataTable {
    border-collapse: collapse !important;
    width: 100% !important;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}

table.dataTable thead th {
    background-color: var(--primary) !important;
    color: #fff !important;
    border: none !important;
    padding: 15px !important;
    font-weight: 500;
}

table.dataTable tbody td {
    padding: 12px 15px !important;
    border-bottom: 1px solid #eee !important;
    vertical-align: middle;
}

table.dataTable tbody tr:hover {
    background-color: #f8f9fa !important;
}

.dt-buttons .btn {
    margin-right: 5px;
    margin-bottom: 15px;
    padding: 6px 12px;
    border-radius: 4px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 80%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.9);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 60px; position: absolute; height: 100%; }
    .sidebar:not(.closed) { width: 260px; }
    .main-content { margin-left: 60px; }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.active { display: flex; animation: fadeIn 0.3s ease; }

.modal {
    background: #fff;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
    opacity: 1;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { color: var(--primary); margin: 0; }
.close-btn { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--gray); }
.modal-body { padding: 25px; }
.modal-footer { padding: 20px 25px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 10px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Login Page specific */
.login-body {
    background: linear-gradient(135deg, #f0f2f5 0%, #dcdff1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}
.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    text-align: center;
}
.login-card h2 { margin-bottom: 30px; color: var(--primary); font-weight: 700; }
.login-logo i { font-size: 60px; color: var(--primary); margin-bottom: 20px; }
