body {
    background-color: #f6f8fb;
    color: #1f2937;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

:root {
    --app-primary: #1f6feb;
    --app-surface: #ffffff;
    --app-muted: #6b7280;
    --app-border: #e5e7eb;
    --app-sidebar: #0f172a;
    --app-accent: #14b8a6;
}

.container-fluid {
    max-width: 1400px;
}

.sidebar {
    width: 240px;
    min-height: 100vh;
    position: sticky;
    top: 0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}

.app-sidebar {
    background: var(--app-sidebar);
}

.sidebar .nav-link {
    border-radius: 6px;
    margin: 2px 6px;
    padding: 8px 12px;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.card {
    border: 1px solid var(--app-border);
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
}

.card-header {
    border-bottom: 1px solid var(--app-border);
}

.table thead th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--app-muted);
    background: #f8fafc;
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

.form-label {
    font-weight: 600;
    color: #111827;
}

.form-control,
.form-select {
    border-radius: 10px;
    border-color: var(--app-border);
}

.btn {
    border-radius: 10px;
}

.btn-primary {
    background: var(--app-primary);
    border-color: var(--app-primary);
}

.badge {
    border-radius: 999px;
}

.badge.bg-success {
    background-color: var(--app-accent) !important;
}

.print-only {
    display: none;
}

.print-header {
    padding: 12px 24px 0;
}

.print-logo {
    max-height: 70px;
}

.rtl {
    direction: rtl;
}

.rtl .sidebar .nav-link i {
    margin-left: 0.5rem;
    margin-right: 0;
}

.rtl .dropdown-menu-end {
    left: 0;
    right: auto;
}

.auth-page {
    background: radial-gradient(circle at top, #e0e7ff, #f6f8fb 55%);
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
    background: #ffffff;
}

.auth-brand {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1f6feb, #3b82f6);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(31, 111, 235, 0.35);
}

.auth-card .input-group-text {
    background: #f8fafc;
    border-color: var(--app-border);
}

.auth-footer {
    font-size: 0.9rem;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(31, 111, 235, 0.12);
    font-size: 1.4rem;
}

.icon-circle.text-success {
    background: rgba(16, 185, 129, 0.12);
}

.icon-circle.text-warning {
    background: rgba(245, 158, 11, 0.16);
}

.icon-circle.text-danger {
    background: rgba(239, 68, 68, 0.16);
}

@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        z-index: 20;
        transform: translateX(-100%);
        transition: transform 0.2s ease-in-out;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .topbar .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }

    .card {
        border-radius: 14px;
    }

    .table-responsive {
        border-radius: 12px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }

    .card-header .btn,
    .card-body .btn {
        width: 100%;
    }

    .card-body .d-flex.gap-2 {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 575px) {
    .container-fluid,
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    h4 {
        font-size: 1.2rem;
    }

    .btn {
        font-size: 0.95rem;
        padding: 0.55rem 0.9rem;
    }

    .form-control,
    .form-select {
        font-size: 0.95rem;
    }

    .table {
        font-size: 0.9rem;
    }

    .card-body {
        padding: 1rem;
    }
}

@media print {
    .sidebar,
    .topbar,
    .card-body form,
    .btn,
    .nav,
    .dropdown,
    .alert,
    .card-header,
    .card-body {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    .table-responsive {
        display: block !important;
    }

    .card,
    .table {
        box-shadow: none !important;
    }

    body {
        background: #ffffff !important;
    }
}
