:root {
    --app-primary: #006233;
    --app-primary-dark: #003820;
    --app-primary-light: #0a5c38;
    --app-accent-gold: #c4a035;
    --app-sidebar: #002818;
    --app-sidebar-hover: #0a4a2e;
    --app-bg: #f4f6f3;
    --app-surface: #ffffff;
    --app-border: #d8e0da;
    --app-text-muted: #5a6b60;
    --app-shadow-sm: 0 1px 3px rgba(0, 50, 30, 0.06);
    --app-shadow-md: 0 2px 8px rgba(0, 50, 30, 0.08);
    --app-radius: 8px;
    --app-radius-lg: 10px;
    --app-focus-ring: 0 0 0 0.2rem rgba(0, 98, 51, 0.25);
    --app-focus-outline: 2px solid var(--app-primary-dark);
}

/* Make Bootstrap's .text-muted use the AA-compliant token instead of its lighter default */
.text-muted {
    color: var(--app-text-muted) !important;
}

/* ----- Accessible keyboard focus (visible only for keyboard users) ----- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
[tabindex]:focus-visible {
    outline: var(--app-focus-outline);
    outline-offset: 2px;
    box-shadow: var(--app-focus-ring);
}

/* On dark/blue surfaces a light ring is more visible than the blue one */
.main-header a:focus-visible,
.main-header .btn:focus-visible,
.navbar-toggler:focus-visible,
.sidebar .nav-link:focus-visible,
.mobile-sidebar .nav-link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.35);
}

/* Mirror directional icons under RTL so arrows point the correct way */
[dir="rtl"] .fa-arrow-right,
[dir="rtl"] .fa-arrow-left,
[dir="rtl"] .fa-long-arrow-alt-right,
[dir="rtl"] .fa-long-arrow-alt-left,
[dir="rtl"] .fa-chevron-right,
[dir="rtl"] .fa-chevron-left,
[dir="rtl"] .fa-angle-right,
[dir="rtl"] .fa-angle-left,
[dir="rtl"] .fa-sign-out-alt,
[dir="rtl"] .fa-sign-in-alt,
[dir="rtl"] .fa-arrow-circle-right,
[dir="rtl"] .fa-arrow-circle-left {
    transform: scaleX(-1);
}

/* Base */
body {
    font-family: 'Tajawal', Arial, sans-serif;
    background: var(--app-bg);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #1a2e22;
    font-size: 0.95rem;
    line-height: 1.5;
}

[dir="ltr"] body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.text-primary {
    color: var(--app-primary) !important;
}

.bg-primary {
    background-color: var(--app-primary) !important;
}

.border-primary {
    border-color: var(--app-primary) !important;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

/* Header */
.main-header {
    background: var(--app-primary-dark);
    box-shadow: var(--app-shadow-md);
    border-bottom: 3px solid var(--app-accent-gold);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar {
    padding: 0.45rem 0;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff !important;
    padding: 0.15rem 0;
    max-width: min(100%, 28rem);
}

.navbar-brand span {
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-brand img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    object-fit: contain;
    flex-shrink: 0;
}

.navbar-brand:hover {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-text {
    font-weight: 400;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-text i {
    margin-inline-end: 0.35rem;
    color: rgba(255, 255, 255, 0.75);
}

.main-header .btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-weight: 500;
    font-size: 0.875rem;
}

.main-header .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.375rem 0.625rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.2);
}

/* Layout */
.main-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 52px);
}

.content-wrapper {
    display: flex;
    flex: 1;
    align-items: stretch;
    width: 100%;
}

.content {
    flex: 1;
    min-width: 0;
    padding: 1.25rem 1.5rem 1.5rem;
    background: var(--app-bg);
    min-height: calc(100vh - 52px);
}

/* Sidebar */
.sidebar {
    width: 220px;
    min-width: 220px;
    flex-shrink: 0;
    background: var(--app-sidebar);
    color: #fff;
    font-size: 0.875rem;
    position: sticky;
    top: 52px;
    align-self: flex-start;
    max-height: calc(100vh - 52px);
    overflow-y: auto;
    overflow-x: hidden;
    border-inline-end: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar .nav {
    padding: 0.75rem 0.5rem 1rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    border-radius: var(--app-radius);
    margin-bottom: 2px;
    padding: 0.625rem 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.sidebar .nav-link i {
    width: 1.125rem;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.85;
}

.sidebar .nav-link:hover {
    background: var(--app-sidebar-hover);
    color: #fff;
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-inline-start: 3px solid var(--app-accent-gold);
    padding-inline-start: calc(0.875rem - 3px);
}

.sidebar .nav-section,
.mobile-sidebar .nav-section {
    padding: 0.85rem 0.875rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    list-style: none;
}

.sidebar .nav-divider,
.mobile-sidebar .nav-divider {
    height: 1px;
    margin: 0.35rem 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    list-style: none;
}

/* Mobile sidebar */
.mobile-sidebar {
    background: var(--app-sidebar);
    color: #fff;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 70vh;
    overflow-y: auto;
}

.mobile-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    border-radius: var(--app-radius);
    margin-bottom: 2px;
    padding: 0.625rem 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: background 0.15s ease;
}

.mobile-sidebar .nav-link i {
    width: 1.125rem;
    text-align: center;
}

.mobile-sidebar .nav-link:hover,
.mobile-sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-inline-start: 3px solid var(--app-accent-gold);
    padding-inline-start: calc(0.875rem - 3px);
}

/* Page header */
.page-header {
    margin-bottom: 1.25rem;
    padding: 1rem 1.15rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-inline-start: 4px solid var(--app-primary);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-sm);
}

.page-header h1,
.page-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--app-primary-dark);
    margin-bottom: 0.25rem;
}

.page-header .page-desc {
    color: var(--app-text-muted);
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Section heading: a mid-page group title (e.g. analytics sections). Lighter
   than .page-header, no border like .section-title (which is form-scoped). */
.section-heading {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--app-primary-dark);
    margin-bottom: 1rem;
}

.section-heading i {
    opacity: 0.7;
}

/* Cards */
.card {
    box-shadow: var(--app-shadow-sm);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    overflow: hidden;
    background: var(--app-surface);
}

.card-header {
    background: #f8faf8;
    border-bottom: 1px solid var(--app-border);
    padding: 0.75rem 1.15rem;
    font-weight: 600;
    color: var(--app-primary-dark);
}

.card-header.bg-primary {
    background: var(--app-primary-dark) !important;
    border-bottom: 2px solid var(--app-accent-gold);
    color: #fff;
}

/* Headings used as card-header titles should match the header's compact scale
   instead of Bootstrap's large default h2/h3 sizes. */
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.card-body {
    padding: 1.25rem;
}

/* Stat cards */
.stat-card {
    border: 1px solid var(--app-border);
    border-inline-start: 3px solid var(--app-primary);
    box-shadow: var(--app-shadow-sm);
    border-radius: var(--app-radius);
    background: var(--app-surface);
    height: 100%;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--app-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    line-height: 1.2;
}

.stat-card .stat-icon {
    color: var(--app-primary);
    opacity: 0.35;
    font-size: 1.75rem;
}

.stat-card.stat-success { border-inline-start-color: #198754; }
.stat-card.stat-success .stat-icon { color: #198754; }
.stat-card.stat-warning { border-inline-start-color: #fd7e14; }
.stat-card.stat-warning .stat-icon { color: #fd7e14; }
.stat-card.stat-info { border-inline-start-color: #0dcaf0; }
.stat-card.stat-info .stat-icon { color: #0dcaf0; }

/* Forms */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    border-radius: var(--app-radius);
    border-color: var(--app-border);
    font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 98, 51, 0.15);
}

/* Larger, easier-to-hit checkboxes/radios + comfortable label spacing */
.form-check-input {
    width: 1.1em;
    height: 1.1em;
    margin-top: 0.2em;
}

.form-check-label {
    line-height: 1.5;
    cursor: pointer;
}

.form-check {
    min-height: 1.6rem;
}

.form-text {
    font-size: 0.8rem;
}

.form-section {
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
}

.form-section:last-of-type {
    margin-bottom: 0;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--app-primary-dark);
    border-bottom: 1px solid var(--app-border);
    padding-bottom: 0.625rem;
    margin-bottom: 1rem;
}

.section-title i {
    opacity: 0.7;
}

.is-loading {
    background-color: #f8f9fa;
    border-color: var(--app-primary);
}

/* Buttons */
.btn {
    border-radius: var(--app-radius);
    font-weight: 500;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--app-primary);
    border-color: var(--app-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--app-primary-light);
    border-color: var(--app-primary-light);
}

.btn-outline-primary {
    color: var(--app-primary);
    border-color: var(--app-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--app-primary);
    border-color: var(--app-primary);
}

.btn-lg {
    font-size: 0.95rem;
    padding: 0.625rem 1.25rem;
}

/* Ensure interactive controls meet a comfortable minimum touch target */
.btn,
.form-select:not(.form-select-sm),
.form-control:not(textarea):not(.form-control-sm) {
    min-height: 2.5rem;
}

.btn-sm,
.form-control-sm,
.form-select-sm {
    min-height: 2rem;
}

/* ----- Badges: consistent sizing + AA contrast ----- */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.01em;
    padding: 0.4em 0.6em;
}

/* The default Bootstrap .bg-warning / .bg-info badges use white text on light
   backgrounds (fails AA). Force dark text for adequate contrast. */
.badge.bg-warning,
.badge.bg-info,
.badge.bg-light {
    color: #212529 !important;
}

/* Role badge sitting on the blue header: give it a solid, readable surface */
.main-header .badge.bg-light {
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--app-primary-dark) !important;
}

/* Tables */
.table {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.table thead th {
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--app-text-muted);
    background: #eef3ef;
    border-bottom-width: 1px;
    padding: 0.7rem 0.875rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 0.875rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 98, 51, 0.04);
}

.table-responsive {
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--app-text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    opacity: 0.25;
    margin-bottom: 0.75rem;
    display: block;
}

.empty-state p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Footer */
.app-footer {
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--app-border);
    background: var(--app-surface);
    border-radius: var(--app-radius);
    text-align: center;
    font-size: 0.8rem;
    color: var(--app-text-muted);
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--app-bg);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-card .card-header {
    text-align: center;
    background: var(--app-primary);
    color: #fff;
    border-bottom: none;
    padding: 1.25rem;
}

.login-card .card-header h3 {
    font-size: 1.125rem;
    margin: 0;
    font-weight: 600;
}

.login-card .card {
    box-shadow: var(--app-shadow-md);
}

.login-brand {
    text-align: center;
    margin-bottom: 1.25rem;
}

.login-brand img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--app-border);
    padding: 4px;
}

.login-brand .login-app-name {
    display: block;
    margin-top: 0.6rem;
    font-weight: 700;
    color: var(--app-primary-dark);
    font-size: 1.05rem;
}

/* Citizen portal */
.portal-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--app-bg);
    padding: 1rem;
}

.portal-card {
    width: 100%;
    max-width: 720px;
}

.portal-card .card-header {
    background: var(--app-primary);
    color: #fff;
    border-bottom: none;
    padding: 1rem 1.25rem;
}

.portal-card .card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Make the tracking number / PIN in the citizen success screen stand out and
   stay legible (monospace, generous size, selectable). Scoped to .portal-token
   so it does NOT restyle technical <code> elsewhere (settings, audit, hashes…). */
.portal-token {
    font-size: 0.95em;
    color: var(--app-primary-dark);
    background: rgba(0, 98, 51, 0.08);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    user-select: all;
}

/* Welcome card */
.welcome-card .card-header {
    text-align: center;
    background: var(--app-primary);
    color: #fff;
    border-bottom: none;
}

.welcome-card .card-header h2 {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 600;
}

/* DataTables */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 0.75rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.dataTables_wrapper .dt-buttons {
    margin-bottom: 0.75rem;
}

.dataTables_wrapper .dt-buttons .btn {
    margin-inline-end: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Utility */
button, .btn, input[type="button"], input[type="submit"] {
    pointer-events: auto !important;
}

.modal { z-index: 1050; }
.modal-backdrop { z-index: 1040; }

.page-item.active .page-link,
.active > .page-link {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--app-primary);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--app-primary);
}

.nav-tabs .nav-link.active {
    color: var(--app-primary-dark);
    font-weight: 600;
}

.list-group-item.active {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

/* Responsive */
@media (max-width: 767.98px) {
    .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        display: none !important;
    }

    .content {
        padding: 1rem;
        min-height: auto;
    }

    .page-header h1,
    .page-header h2 {
        font-size: 1.2rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
    }

    .dataTables_wrapper .dt-buttons,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
    }
}

@media (min-width: 768px) {
    .mobile-sidebar,
    #mobileSidebar {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-brand img {
        width: 32px;
        height: 32px;
    }
}

/* Public homepage */
.public-home {
    background: #f4f6f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-home-header {
    background: #fff;
    border-bottom: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-sm);
}

.public-home-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--app-primary-dark);
    font-weight: 700;
    font-size: 1.1rem;
}

.public-home-brand img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--app-border);
}

.public-home-hero {
    background: linear-gradient(180deg, #fff 0%, #f4f6f9 100%);
    padding: 2.5rem 0 2rem;
}

.public-home-eyebrow {
    color: var(--app-primary);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.public-home-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: #1a2b3c;
    margin-bottom: 0.75rem;
}

.public-home-lead {
    color: var(--app-text-muted);
    font-size: 1.05rem;
    max-width: 36rem;
    margin-bottom: 0;
    line-height: 1.7;
}

.public-home-emergency {
    background: #fff;
    border: 1px solid #f0d8d8;
    border-inline-start: 4px solid #c62828;
    border-radius: var(--app-radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--app-shadow-sm);
}

.public-home-emergency-label {
    color: #b71c1c;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.public-home-emergency-label i {
    margin-inline-end: 0.35rem;
}

.public-home-emergency-number {
    display: inline-block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #c62828;
    text-decoration: none;
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.public-home-emergency-number:hover {
    color: #b71c1c;
}

.public-home-emergency-note {
    color: var(--app-text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.public-home-services {
    flex: 1;
    padding-top: 0.5rem;
}

.public-home-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.public-home-service {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    padding: 1.25rem 1.35rem;
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.public-home-service:hover {
    border-color: #b3cfe8;
    box-shadow: var(--app-shadow-md);
    color: inherit;
}

.public-home-service-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f0fa;
    color: var(--app-primary);
    border-radius: var(--app-radius);
    font-size: 1.15rem;
}

.public-home-service-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.public-home-service-body strong {
    font-size: 1rem;
    color: #1a2b3c;
}

.public-home-service-body small {
    color: var(--app-text-muted);
    line-height: 1.4;
}

.public-home-service-arrow {
    color: #adb5bd;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.public-home-info {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    padding: 1rem 1.15rem;
    color: var(--app-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.public-home-info i {
    color: var(--app-primary);
    margin-top: 0.15rem;
}

.public-home-footer {
    background: #fff;
    border-top: 1px solid var(--app-border);
    padding: 1.25rem 0;
    color: var(--app-text-muted);
}

@media (max-width: 991.98px) {
    .public-home-hero {
        padding-top: 1.75rem;
    }

    .public-home-emergency {
        margin-top: 0.5rem;
    }
}

/* Searchable case picker */
.case-picker {
    position: relative;
}

.case-picker-input-wrap {
    position: relative;
}

.case-picker-input-wrap .form-control {
    padding-inline-end: 2.25rem;
}

.case-picker-clear {
    position: absolute;
    top: 50%;
    inset-inline-end: 0.5rem;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--app-text-muted, #6c757d);
    padding: 0.15rem 0.35rem;
    line-height: 1;
    cursor: pointer;
}

.case-picker-clear:hover {
    color: var(--app-text, #212529);
}

.case-picker-list {
    position: absolute;
    z-index: 1050;
    inset-inline: 0;
    top: 100%;
    margin: 0.25rem 0 0;
    padding: 0.25rem 0;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--app-border, #dee2e6);
    border-radius: var(--app-radius, 0.375rem);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.case-picker-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f5;
}

.case-picker-item:last-child {
    border-bottom: 0;
}

.case-picker-item:hover,
.case-picker-item.active {
    background: #f8f9fa;
}

.case-picker-group {
    padding: 0.45rem 0.75rem 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--app-text-muted, #6c757d);
    background: #f8f9fa;
    border-bottom: 1px solid #eef1f4;
    cursor: default;
    list-style: none;
}

.case-picker-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.case-picker-item strong {
    font-size: 0.9rem;
}

.case-picker-item-badge {
    font-size: 0.68rem;
    color: var(--app-text-muted, #6c757d);
    white-space: nowrap;
}

.case-picker-item-sub {
    display: block;
    font-size: 0.8rem;
    color: var(--app-text-muted, #6c757d);
    margin-top: 0.1rem;
}

.case-picker-item-muted {
    color: var(--app-text-muted, #6c757d);
    cursor: default;
}

.case-picker-hint {
    font-size: 0.8rem;
}
