/* ============================================
   APP.CSS - Main Application Stylesheet
   Modern Material Design Inspired Theme
   ============================================ */

:root {
    /* Primary palette */
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;

    /* Accent */
    --accent: #f59e0b;
    --accent-light: #fbbf24;

    /* Neutral */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Semantic */
    --success: #059669;
    --success-light: #d1fae5;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --info: #2563eb;
    --info-light: #dbeafe;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition: all 0.2s ease;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family:
        'Inter',
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   LAYOUT
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed);
}

.page-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
}

.page-body {
    padding: 24px 32px;
    flex: 1;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(195deg, #1e3a5f 0%, #1a237e 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 40;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-brand {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 72px;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .sidebar-section-title {
    display: none;
}

.sidebar-nav {
    padding: 12px;
    flex: 1;
}

.sidebar-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    padding: 12px 12px 6px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.navbar-breadcrumb {
    font-size: 13px;
    color: var(--gray-400);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.navbar-user:hover {
    background: var(--gray-100);
}

.navbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.navbar-user-info {
    display: flex;
    flex-direction: column;
}

.navbar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}

.navbar-user-role {
    font-size: 11px;
    color: var(--gray-400);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
}

/* Stat cards */
.stat-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: linear-gradient(195deg, #49a3f1, #1a73e8);
}
.stat-icon.green {
    background: linear-gradient(195deg, #66bb6a, #388e3c);
}
.stat-icon.orange {
    background: linear-gradient(195deg, #ffa726, #fb8c00);
}
.stat-icon.red {
    background: linear-gradient(195deg, #ef5350, #e53935);
}
.stat-icon.purple {
    background: linear-gradient(195deg, #ab47bc, #7b1fa2);
}

.stat-info h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-info p {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover:not(:disabled) {
    background: #047857;
}

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-outline:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    padding: 6px 12px;
}
.btn-ghost:hover:not(:disabled) {
    background: var(--gray-100);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 16px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
}

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    color: var(--gray-800);
    background: white;
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-200);
}

.form-control.error {
    border-color: var(--danger);
}

.form-control.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Toggle switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--gray-300);
    border-radius: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ============================================
   TABLE
   ============================================ */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: var(--gray-50);
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

tbody tr:hover {
    background: var(--gray-50);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.95);
    transition: var(--transition);
}

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

.modal-lg {
    max-width: 720px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============================================
   TOAST / NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 480px;
    animation: toastIn 0.3s ease;
    border-left: 4px solid var(--gray-300);
}

.toast.success {
    border-left-color: var(--success);
}
.toast.error {
    border-left-color: var(--danger);
}
.toast.warning {
    border-left-color: var(--warning);
}
.toast.info {
    border-left-color: var(--info);
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}
.toast.success .toast-icon {
    color: var(--success);
}
.toast.error .toast-icon {
    color: var(--danger);
}
.toast.warning .toast-icon {
    color: var(--warning);
}
.toast.info .toast-icon {
    color: var(--info);
}

.toast-message {
    font-size: 14px;
    color: var(--gray-700);
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #1a237e 50%, #0d1b3e 100%);
    padding: 24px;
}

.auth-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.auth-header {
    padding: 32px 32px 0;
    text-align: center;
}

.auth-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(195deg, #1e3a5f, #1a237e);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 24px;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--gray-500);
}

.auth-body {
    padding: 32px;
}

.auth-footer {
    padding: 0 32px 32px;
    text-align: center;
    font-size: 14px;
    color: var(--gray-500);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--gray-400);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

/* ============================================
   LOADING
   ============================================ */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-dark {
    border-color: var(--gray-200);
    border-top-color: var(--primary);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}
.text-right {
    text-align: right;
}
.text-sm {
    font-size: 13px;
}
.text-xs {
    font-size: 12px;
}
.text-muted {
    color: var(--gray-500);
}
.text-success {
    color: var(--success);
}
.text-danger {
    color: var(--danger);
}
.text-warning {
    color: var(--warning);
}
.text-primary {
    color: var(--primary);
}
.font-bold {
    font-weight: 700;
}
.font-semibold {
    font-weight: 600;
}
.mt-1 {
    margin-top: 4px;
}
.mt-2 {
    margin-top: 8px;
}
.mt-3 {
    margin-top: 12px;
}
.mt-4 {
    margin-top: 16px;
}
.mt-6 {
    margin-top: 24px;
}
.mb-2 {
    margin-bottom: 8px;
}
.mb-4 {
    margin-bottom: 16px;
}
.mb-6 {
    margin-bottom: 24px;
}
.mr-2 {
    margin-right: 8px;
}
.ml-auto {
    margin-left: auto;
}
.gap-2 {
    gap: 8px;
}
.gap-3 {
    gap: 12px;
}
.gap-4 {
    gap: 16px;
}
.flex {
    display: flex;
}
.flex-col {
    flex-direction: column;
}
.items-center {
    align-items: center;
}
.justify-between {
    justify-content: space-between;
}
.justify-center {
    justify-content: center;
}
.flex-wrap {
    flex-wrap: wrap;
}
.flex-1 {
    flex: 1;
}
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
.w-full {
    width: 100%;
}
.hidden {
    display: none !important;
}
.relative {
    position: relative;
}
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    gap: 0;
}

.tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tab:hover {
    color: var(--gray-700);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ============================================
   SEARCH & FILTER BAR
   ============================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

.search-box input {
    width: 100%;
    padding: 8px 14px 8px 38px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-200);
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 14px;
}

/* ============================================
   CONFIRM DIALOG
   ============================================ */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.confirm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-box {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
}

.confirm-icon.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.confirm-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.confirm-message {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
    }
    .page-body {
        padding: 16px;
    }
    .page-header {
        padding: 12px 16px;
    }
    .grid-2,
    .grid-3,
    .grid-4,
    .grid-5 {
        grid-template-columns: 1fr;
    }
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-box {
        max-width: none;
    }
}
