:root {
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 0px;
    --topbar-height: 56px;
    --primary-color: #0d6efd;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --sidebar-hover-bg: #334155;
    --sidebar-header-bg: #0f172a;
}

/* Reset */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f1f5f9;
    margin: 0;
    overflow-x: hidden;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar.collapsed {
    transform: translateX(calc(-1 * var(--sidebar-width)));
}

.sidebar-header {
    padding: 15px 20px;
    background-color: var(--sidebar-header-bg);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand:hover {
    color: #fff;
}

.sidebar-nav {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-nav .nav-header {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 20px 5px;
}

.sidebar-nav .nav-item {
    margin: 1px 0;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: var(--sidebar-active);
    background-color: var(--sidebar-hover-bg);
}

.sidebar-nav .nav-link.active {
    color: var(--sidebar-active);
    background-color: var(--sidebar-hover-bg);
    border-left-color: var(--primary-color);
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed + .main-content {
    margin-left: 0;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.sidebar-toggle {
    color: #475569;
    padding: 0;
}

.sidebar-toggle:hover {
    color: #1e293b;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 20px;
}

/* Cards */
.stat-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

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

.stat-card .card-body {
    padding: 20px;
}

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

/* Tables */
.table thead th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

/* Forms */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #475569;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

/* Badge overrides */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

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

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: none;
}

.login-card .card-body {
    padding: 40px;
}

.login-brand {
    text-align: center;
    margin-bottom: 30px;
}

.login-brand i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.login-brand h2 {
    font-weight: 700;
    margin-top: 10px;
}

/* DataTables overrides */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    padding: 5px 10px;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
