:root {
    --sidebar-width: 272px;
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --slate-950: #090d16;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --card-radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f3f6fb;
    color: var(--slate-800);
    font-size: 0.935rem;
    line-height: 1.55;
    overflow-x: hidden;
}

/* Sidebar Navigation */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #172554 100%);
    color: #f8fafc;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.14);
}

.sidebar-brand {
    padding: 1.35rem 1.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: #ffffff;
}

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

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
    flex-shrink: 0;
}

.brand-title {
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0;
}

.brand-subtitle {
    font-size: 0.72rem;
    color: #93c5fd;
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    padding: 1rem 0.9rem;
    flex: 1;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    font-weight: 700;
    padding: 0.85rem 0.85rem 0.4rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.72rem 0.95rem;
    border-radius: 11px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    transition: all 0.18s ease;
}

.sidebar-link i {
    font-size: 1.12rem;
    width: 22px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.18s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(2px);
}

.sidebar-link:hover i {
    color: #60a5fa;
}

.sidebar-link.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.sidebar-link.active i {
    color: #ffffff;
}

.sidebar-footer {
    padding: 1rem 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.45);
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    height: 70px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--slate-200);
    padding: 0 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

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

/* Cards & Containers */
.card-modern {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: var(--card-radius);
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-modern .card-header {
    background: transparent;
    border-bottom: 1px solid var(--slate-100);
    padding: 1.15rem 1.4rem;
    font-weight: 700;
}

.card-modern .card-body {
    padding: 1.4rem;
}

.kpi-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--card-radius);
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    padding: 1.35rem 1.4rem;
    box-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.09);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.kpi-icon.blue { background: #eff6ff; color: #2563eb; }
.kpi-icon.emerald { background: #ecfdf5; color: #059669; }
.kpi-icon.amber { background: #fffbeb; color: #d97706; }
.kpi-icon.rose { background: #fff1f2; color: #e11d48; }
.kpi-icon.indigo { background: #eef2ff; color: #4f46e5; }

.kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--slate-500);
    margin-bottom: 0.3rem;
}

.kpi-value {
    font-size: 1.42rem;
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.02em;
}

/* Soft Badges */
.badge-soft-success {
    background-color: #dcfce7;
    color: #15803d;
    font-weight: 600;
    padding: 0.42em 0.78em;
    border-radius: 8px;
}

.badge-soft-warning {
    background-color: #fef3c7;
    color: #b45309;
    font-weight: 600;
    padding: 0.42em 0.78em;
    border-radius: 8px;
}

.badge-soft-danger {
    background-color: #ffe4e6;
    color: #be123c;
    font-weight: 600;
    padding: 0.42em 0.78em;
    border-radius: 8px;
}

.badge-soft-info {
    background-color: #e0f2fe;
    color: #0369a1;
    font-weight: 600;
    padding: 0.42em 0.78em;
    border-radius: 8px;
}

.badge-soft-secondary {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    padding: 0.42em 0.78em;
    border-radius: 8px;
}

.badge-soft-dark {
    background-color: #e2e8f0;
    color: #1e293b;
    font-weight: 600;
    padding: 0.42em 0.78em;
    border-radius: 8px;
}

/* Modern Tables */
.table-modern {
    margin-bottom: 0;
}

.table-modern thead th {
    background-color: #f8fafc;
    color: var(--slate-600);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--slate-200);
    white-space: nowrap;
}

.table-modern tbody td {
    padding: 0.95rem 1.1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--slate-100);
    color: var(--slate-700);
}

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

/* Forms & Buttons */
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--slate-700);
    margin-bottom: 0.4rem;
}

.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    padding: 0.58rem 0.85rem;
    font-size: 0.92rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.55rem 1.05rem;
    font-size: 0.89rem;
    transition: all 0.18s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

/* Auth Split Screen */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 25px 60px rgba(9, 13, 22, 0.38);
    overflow: hidden;
    max-width: 980px;
    width: 100%;
}

.auth-aside {
    background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 100%);
    color: #ffffff;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Sidebar Overlay for Mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .sidebar-backdrop.show {
        display: block;
    }
    .app-main {
        margin-left: 0;
    }
    .app-content {
        padding: 1.15rem;
    }
    .app-topbar {
        padding: 0 1.15rem;
    }
}

