:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --background-color: #f4f5f9;
    --card-bg: #ffffff;
    --text-primary: #2b2d42;
    --text-secondary: #8d99ae;
    --border-color: #edf2f4;
    --sidebar-width: 240px;
}

* { box-sizing: border-box; }

body {
    background-color: var(--background-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    margin: 0;
}

/* =================== AUTH =================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8eaf6 0%, #f5f5f5 100%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.auth-card h2 {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 1.8rem;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

/* =================== LAYOUT =================== */
.wrapper { display: flex; width: 100%; }

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: #fff;
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    transition: transform 0.3s;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    text-align: center;
}
.sidebar-header img {
    max-width: 100%;
    height: 28px;
    width: auto;
}

.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0 2rem 0;
    margin: 0;
}

.sidebar-nav li { padding: 0 0.75rem 0.1rem 0.75rem; }

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    padding: 1rem 1rem 0.3rem 1rem !important;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.sidebar-nav a i { font-size: 1rem; width: 18px; text-align: center; }

.sidebar-nav a:hover { background: rgba(67, 97, 238, 0.08); color: var(--primary-color); }
.sidebar-nav a.active { background: rgba(67, 97, 238, 0.12); color: var(--primary-color); font-weight: 700; box-shadow: inset 3px 0 0 var(--primary-color); }

/* =================== MAIN CONTENT =================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.content-area { padding: 1.75rem; flex: 1; }

.min-w-0 { min-width: 0; }

/* =================== CARDS =================== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.kpi-card {
    padding: 1.4rem 1.5rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border-left: 4px solid var(--primary-color);
}

.kpi-card h5 {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.kpi-card h2 {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
}

/* =================== BUTTONS =================== */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    transition: all 0.25s;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.35);
}

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

/* =================== PAGE HEADER =================== */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h4 {
    font-weight: 700;
    font-size: 1.35rem;
    margin: 0;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0.2rem 0 0 0;
}

/* =================== TABLES =================== */
.table th {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    background: #f8f9fa;
}

.table td { font-size: 0.9rem; vertical-align: middle; }
.table tbody tr:hover { background: rgba(67, 97, 238, 0.03); }

/* =================== BADGES =================== */
.badge-status {
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* =================== MOBILE =================== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}


body {
    background-color: var(--background-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

/* Authentication Pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.auth-card h2 {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s;
}

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

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
}

/* Dashboard Layout */
.wrapper {
    display: flex;
    width: 100%;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    position: fixed;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-align: center;
    letter-spacing: 1px;
}
.sidebar-header img {
    max-width: 100%;
    height: 28px;
    width: auto;
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.sidebar-nav li {
    padding: 0.2rem 1.5rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.content-area {
    padding: 2rem;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

/* Dashboard Cards */
.kpi-card {
    padding: 1.5rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border-left: 4px solid var(--primary-color);
}
.kpi-card h5 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}
.kpi-card h2 {
    color: var(--text-primary);
    font-weight: 700;
    margin: 0;
}
