.sidebar {
    width: 240px;
    min-height: 100vh;
    transition: all 0.3s;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 0;
    overflow: hidden;
}

.sidebar .nav-link {
    padding: 8px 16px;
    border-radius: 6px;
    margin: 2px 0;
    font-size: 14px;
    transition: background-color 0.2s;
}

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

.sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.15);
    font-weight: 600;
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 8px;
}

.nav-section {
    text-transform: uppercase;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.42) !important;
    padding-top: 12px;
    padding-bottom: 3px;
    margin-bottom: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-card {
    border: none;
    border-radius: 10px;
    transition: transform 0.2s;
}

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

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

.table th {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: #6c757d;
    border-bottom: 2px solid #dee2e6;
}

.badge-status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
}

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

.login-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
    padding: 30px;
    text-align: center;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4192 100%);
}

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

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

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 575.98px) {
    .sidebar {
        position: fixed;
        z-index: 1050;
        width: 240px;
        top: 0;
        left: -240px;
        transition: left 0.3s;
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar.collapsed {
        left: -240px;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }

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

    #wrapper > .flex-grow-1 {
        width: 100% !important;
    }

    main.p-4 {
        padding: 0.75rem !important;
    }

    .page-header h2 {
        font-size: 18px;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .stat-card .card-body {
        padding: 0.75rem;
    }

    .stat-card h3 {
        font-size: 1.2rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .table th, .table td {
        padding: 0.4rem;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .login-card {
        margin: 1rem;
    }

    .login-card .card-header {
        padding: 20px;
    }

    .navbar .navbar-text {
        font-size: 0.85rem;
    }

    .form-label {
        font-size: 0.85rem;
    }

    .form-control, .form-select {
        font-size: 0.85rem;
    }

    h1 { font-size: 1.4rem; }
    h2 { font-size: 1.2rem; }
    h3 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        z-index: 1050;
        width: 240px;
        top: 0;
        left: -240px;
        transition: left 0.3s;
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar.collapsed {
        left: -240px;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }

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

    #wrapper > .flex-grow-1 {
        width: 100% !important;
    }

    main.p-4 {
        padding: 1rem !important;
    }

    .page-header h2 {
        font-size: 20px;
    }

    .table {
        font-size: 0.85rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar {
        width: 200px;
    }

    .sidebar .nav-link {
        font-size: 13px;
        padding: 6px 12px;
    }

    main.p-4 {
        padding: 1.5rem !important;
    }

    .stat-card .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* ===== SearchPicker Component ===== */
.sp-wrapper { position: relative; }

/* Combo input container */
.sp-combo { position: relative; display: flex; align-items: center; }
.sp-combo-icon {
    position: absolute; left: 10px;
    color: #9ca3af; font-size: 0.8rem;
    pointer-events: none; z-index: 1;
}
.sp-combo.sm .sp-combo-icon { left: 8px; font-size: 0.72rem; }

/* The text input – styled to match Bootstrap form-control */
.sp-combo-input {
    display: block;
    width: 100%;
    padding: 0.375rem 2rem 0.375rem 1.9rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    outline: none;
    cursor: text;
}
.sp-combo-input::placeholder { color: #9ca3af; font-style: normal; }
.sp-combo-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
}
.sp-combo.sm .sp-combo-input {
    font-size: 0.875rem;
    padding: 0.25rem 1.75rem 0.25rem 1.6rem;
}

/* Clear (×) button */
.sp-combo-clear {
    position: absolute; right: 6px;
    background: none; border: none; padding: 2px 3px;
    color: #9ca3af; cursor: pointer; font-size: 0.85rem;
    line-height: 1; display: none;
    align-items: center; justify-content: center;
    border-radius: 50%;
}
.sp-combo-clear:hover { color: #495057; background: #f1f3f5; }

/* Dropdown panel – appended to body, position:fixed */
.sp-panel2 {
    position: fixed;
    z-index: 99999;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.13);
    overflow-y: auto;
}
.sp-dd-header {
    padding: 5px 12px 4px;
    font-size: 0.68rem;
    text-transform: uppercase;
    color: #9ca3af;
    font-weight: 700;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #f3f4f6;
}
.sp-dd-item {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f9fafb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sp-dd-item:last-child { border-bottom: none; }
.sp-dd-item:hover, .sp-dd-item.active { background: #eff6ff; color: #1d4ed8; }
.sp-dd-item .sp-match, .sp-dd-item mark.sp-match {
    background: none; color: #2563eb; font-weight: 700; padding: 0;
}
.sp-dd-clock { color: #9ca3af; font-size: 0.72rem; flex-shrink: 0; }
.sp-dd-empty { padding: 14px 16px; color: #9ca3af; font-size: 0.85rem; text-align: center; }

/* Hidden native select – moved completely off-screen */
.sp-hidden-select {
    position: fixed !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    visibility: hidden !important;
}
