/**
 * Ported from Anjali Trans E2S (`anjalitrans-e2s/assets/css/custom-sheet.css`) for RIOS / Steex.
 * Excel-style filters, sheet tables, tabs, sidebar scroll, and component helpers.
 * Removed: global Bootstrap modal overrides; global equal-height row/card flex; unscoped .search-box (see below).
 */

/* Map Velzon-style vars used in this sheet to Steex (--tb-*) */
:root {
    --vz-text-muted: var(--tb-secondary-color, #878a99);
    --vz-primary: var(--tb-primary, #8b3477);
    --vz-primary-rgb: var(--tb-primary-rgb, 139, 52, 119);
    /* Steex app.min uses invalid rgba(#000,.075); breaks Bootstrap .shadow-sm (box-shadow !important) */
    --tb-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* ============================================
   SCHOOL CONTEXT (tabs + dropdown, no card – same as vendors)
   ============================================ */
.school-context-wrap {
    background: transparent;
}

.school-context-dropdown-wrap {
    margin-left: auto;
}

.school-context-tabs.nav-tabs {
    border-bottom: none;
    gap: 0;
}

.school-context-wrap .school-context-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    line-height: 1.2;
    border: 1px solid transparent;
    border-radius: 0.25rem 0.25rem 0 0;
    color: var(--vz-text-muted);
}

.school-context-wrap .school-context-tabs .nav-link:hover {
    border-color: #e9ecef;
    color: var(--vz-primary);
    background-color: rgba(var(--vz-primary-rgb), 0.05);
}

.school-context-wrap .school-context-tabs .nav-link.active {
    color: var(--tb-primary, #8b3477) !important;
    font-weight: 600;
    background-color: transparent;
    border-color: #dee2e6 #dee2e6 transparent;
    border-bottom-color: transparent;
    margin-bottom: -1px;
}

.school-context-wrap .school-context-tabs .nav-link i {
    flex-shrink: 0;
    line-height: 1;
}

/* ============================================
   SPREADSHEET TABLE STYLES
   ============================================ */
.sheet-wrap {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    border: 1px solid #e0e0e0;
    background: #fff;
    position: relative;
    width: 100%;
    max-width: 100%;
}

.sheet-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
    margin: 0;
    table-layout: auto;
}

/* Companies master: header + body use same font size */
.sheet-table.companies-master-table thead th {
    font-size: 13px;
}

.sheet-table.companies-master-table tbody td,
.sheet-table.companies-master-table tbody td .badge {
    font-size: 13px;
}

.sheet-table thead {
    background: #f8f9fa;
}

.sheet-table thead th {
    background: #f8f9fa;
    border: 1px solid #d0d0d0;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #495057;
    white-space: nowrap;
    position: relative;
    width: auto;
}

.sheet-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.sheet-table thead th.sortable:hover {
    background: #e9ecef;
}

.sheet-table thead th.sort-asc::after {
    content: " ▲";
    font-size: 10px;
    color: #6c757d;
}

.sheet-table thead th.sort-desc::after {
    content: " ▼";
    font-size: 10px;
    color: #6c757d;
}

.sheet-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.sheet-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.sheet-table tbody tr:hover {
    background: #e3f2fd;
    cursor: pointer;
}

/* KM slab entry popup: clean, borderless grid */
.km-slab-entry-table {
    border: none !important;
    border-collapse: separate !important;
}

.km-slab-entry-table thead th,
.km-slab-entry-table tbody tr td {
    border: none !important;
    box-shadow: none !important;
}

.km-slab-entry-table thead tr,
.km-slab-entry-table tbody tr {
    border: none !important;
}

/* Shift entry popup: borderless grid */
.shift-entry-table {
    border: none !important;
    border-collapse: separate !important;
}

.shift-entry-table thead th,
.shift-entry-table tbody tr td {
    border: none !important;
    box-shadow: none !important;
}

.shift-entry-table thead tr,
.shift-entry-table tbody tr {
    border: none !important;
}

/* Standards entry popup: borderless grid */
.standards-entry-table {
    border: none !important;
    border-collapse: separate !important;
}

.standards-entry-table thead th,
.standards-entry-table tbody tr td {
    border: none !important;
    box-shadow: none !important;
}

.standards-entry-table thead tr,
.standards-entry-table tbody tr {
    border: none !important;
}

/* (student slider styles removed – no longer used) */

/* Pagination UI below tables (25 per page display) */
.sheet-pagination-wrap {
    padding: 0.5rem 0;
    border: 1px solid #e0e0e0;
    border-top: none;
    background: #fff;
    padding-left: 12px;
    padding-right: 12px;
}

.sheet-pagination-info {
    font-size: 13px;
}

.sheet-pagination-wrap .pagination {
    gap: 2px;
}

.sheet-pagination-wrap .page-link {
    padding: 0.35rem 0.65rem;
    font-size: 13px;
}

/* Hide pagination UI inside Route Sheet popup */
#routeSheetModal .sheet-pagination-wrap {
    display: none !important;
}

.sheet-table tbody tr.clickable {
    cursor: pointer;
}

.sheet-table tbody td {
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    vertical-align: middle;
    color: #212529;
    white-space: nowrap;
    width: auto;
}

.sheet-table tbody td.clickable {
    cursor: pointer;
    color: #1976d2;
}

.sheet-table tbody td.clickable:hover {
    text-decoration: underline;
}

.sheet-table tbody td input[type="text"],
.sheet-table tbody td input[type="number"],
.sheet-table tbody td select {
    width: 100%;
    border: none;
    background: transparent;
    padding: 4px;
    font-size: 13px;
}

.sheet-table tbody td input[type="text"]:focus,
.sheet-table tbody td input[type="number"]:focus,
.sheet-table tbody td select:focus {
    background: #fff3cd;
    outline: 2px solid #ffc107;
}

/* ============================================
   GOOGLE SHEETS-LIKE INPUT STYLES
   ============================================ */
.gs-input {
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fff;
}

.gs-input:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.gs-input-group {
    position: relative;
    
}

.gs-input-group label {
    position: absolute;
    top: -8px;
    left: 12px;
    background: #fff;
    padding: 0 4px;
    font-size: 12px;
    color: #5f6368;
    font-weight: 500;
}

.gs-input-group input,
.gs-input-group select,
.gs-input-group textarea {
    width: 100%;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
}

.gs-input-group input:focus,
.gs-input-group select:focus,
.gs-input-group textarea:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

/* Inline label style */
.gs-input-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.gs-input-inline label {
    min-width: 120px;
    font-size: 13px;
    color: #5f6368;
    font-weight: 500;
}

.gs-input-inline input,
.gs-input-inline select {
    flex: 1;
}

/* ============================================
   FILTER BAR (Excel-like)
   ============================================ */
.filter-bar {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
    padding: 6px 10px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 13px;
}

/* Scoped: avoid breaking Steex .search-box inside data-table cards */
.filter-bar .search-box {
    flex: 1;
    min-width: 200px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* ============================================
   QUICK ACTIONS BAR
   ============================================ */
.quick-actions {
    display: flex;
    gap: 8px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.quick-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* ============================================
   KPI CARDS
   ============================================ */
.kpi-card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.kpi-card .card-body {
    padding: 20px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 8px;
}

.kpi-card.success .kpi-value {
    color: #28a745;
}

.kpi-card.warning .kpi-value {
    color: #ffc107;
}

.kpi-card.info .kpi-value {
    color: #17a2b8;
}

.kpi-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    opacity: 0.1;
    color: #1976d2;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.maintenance {
    background: #fff3cd;
    color: #856404;
}

/* ============================================
   TABLE ACTIONS
   ============================================ */
.table-actions {
    white-space: nowrap;
}

.table-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
    margin: 0 2px;
}

/* ============================================
   MODAL SHEET STYLE (scoped — global .modal/.modal-dialog rules omitted for BS5 / Steex compatibility)
   ============================================ */
.modal-sheet .modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Wider route create modal */
#addRouteModal .modal-dialog {
    max-width: 95vw;
    width: 1200px;
}

.modal-sheet .modal-header {
    border-bottom: 1px solid #e0e0e0;
    padding: 16px 20px;
}

.modal-sheet .modal-body {
    padding: 20px;
}

.modal-sheet .modal-footer {
    border-top: 1px solid #e0e0e0;
    padding: 16px 20px;
}

/* ============================================
   MODAL FORM STYLING - PROPER ARRANGEMENT
   ============================================ */
.modal-sheet .modal-body {
    padding: 24px;
}

.modal-sheet .modal-body .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 14px;
    display: block;
}

.modal-sheet .modal-body .row {
    margin-bottom: 0;
}

.modal-sheet .modal-body .row.g-3 {
    margin-bottom: 0;
}

.modal-sheet .modal-body .row.g-3 > * {
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    margin-top: var(--bs-gutter-y);
}

.modal-sheet .modal-body .form-control,
.modal-sheet .modal-body .form-select {
    font-size: 14px;
    padding: 0.625rem 0.875rem;
    height: auto;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modal-sheet .modal-body .form-control:focus,
.modal-sheet .modal-body .form-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

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

.modal-sheet .modal-body .form-check {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.modal-sheet .modal-body .form-check-label {
    font-weight: 500;
    font-size: 14px;
}

/* Form field grouping */
.modal-sheet .modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-sheet .modal-body .form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-sheet .modal-body .form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.modal-sheet .modal-body .form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

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

.custom-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.custom-toast.success {
    border-left: 4px solid #28a745;
}

.custom-toast.error {
    border-left: 4px solid #dc3545;
}

.custom-toast.warning {
    border-left: 4px solid #ffc107;
}

.custom-toast.info {
    border-left: 4px solid #17a2b8;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   VALIDATION ERRORS
   ============================================ */
.validation-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
}

.input-error {
    border-color: #dc3545 !important;
}

.input-success {
    border-color: #28a745 !important;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .no-print {
        display: none !important;
    }
    
    .sheet-wrap {
        max-height: none;
        overflow: visible;
    }
    
    .sheet-table {
        page-break-inside: auto;
    }
    
    .sheet-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .sheet-table {
        font-size: 12px;
    }
    
    .sheet-table thead th,
    .sheet-table tbody td {
        padding: 6px 8px;
    }
}

/* ============================================
 * Tab Styles - Line below headers with colored underline for active
 * ============================================ */
.nav-tabs {
    border-bottom: 2px solid #dee2e6 !important;
    margin-bottom: 20px;
    padding-bottom: 0;
    position: relative;
    width: 100%;
}

.nav-tabs .nav-item {
    margin-bottom: -2px;
}

.nav-tabs .nav-link {
    color: var(--vz-text-muted);
    border: none !important;
    border-bottom: 3px solid transparent !important;
    background-color: transparent;
    padding: 12px 20px;
    font-weight: 500;
    transition: color 0.2s ease, background-color 0.2s ease !important;
    position: relative;
    margin-right: 4px;
}

.nav-tabs .nav-link:hover {
    color: var(--vz-primary);
    border-bottom-color: transparent !important;
    background-color: rgba(var(--vz-primary-rgb), 0.05);
}

.nav-tabs .nav-link.active {
    color: var(--tb-primary, #8b3477) !important;
    background-color: transparent !important;
    border-bottom: 3px solid var(--tb-primary, #8b3477) !important;
    font-weight: 600;
    margin-bottom: -2px;
    position: relative;
    z-index: 1000;
}

.nav-tabs .nav-link:not(.active) {
    border-bottom-color: transparent !important;
}

/* Ensure tab content is properly styled */
.tab-content {
    padding-top: 0;
}

.tab-pane {
    padding-top: 20px;
}

/* ============================================
   MODAL FORM INPUT SPACING FIXES
   ============================================ */
.modal-sheet .modal-body {
    padding: 1.5rem;
}

.modal-sheet .modal-body .form-label {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 14px;
    color: #495057;
    display: block;
}

/* Bootstrap row gap spacing - ensure proper margins and gutters */
.modal-sheet .modal-body .row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
    margin-left: calc(-0.5 * var(--bs-gutter-x));
    margin-right: calc(-0.5 * var(--bs-gutter-x));
    margin-top: calc(-1 * var(--bs-gutter-y));
}

.modal-sheet .modal-body .row > * {
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    margin-top: var(--bs-gutter-y);
}

.modal-sheet .modal-body .row.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

.modal-sheet .modal-body .row.g-2 {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
}

.modal-sheet .modal-body .form-control,
.modal-sheet .modal-body .form-select {
    margin-bottom: 0;
}

/* GS Input Group spacing */
.modal-sheet .modal-body .gs-input-group {
    margin-top: 1rem;
    margin-bottom: 0;
}

.modal-sheet .modal-body .gs-input-group:first-child {
    margin-top: 0;
}

.modal-sheet .modal-body .gs-input-group {
    position: relative;
}

.modal-sheet .modal-body .gs-input-group label {
    margin-top: 0;
    margin-bottom: 0.5rem;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    background: transparent;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.modal-sheet .modal-body .gs-input-group input,
.modal-sheet .modal-body .gs-input-group select {
    margin-top: 0;
}

/* Horizontal rule spacing */
.modal-sheet .modal-body hr {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

/* Ensure proper spacing for dynamically added rows */
.modal-sheet .modal-body .bus-distribution-row {
    margin-bottom: 0.5rem;
}

.modal-sheet .modal-body .bus-distribution-row:last-child {
    margin-bottom: 0;
}

/* Fix for form fields in rows - ensure labels have space above when not first */
.modal-sheet .modal-body .row .col-md-6:not(:first-child) .form-label,
.modal-sheet .modal-body .row .col-md-4:not(:first-child) .form-label,
.modal-sheet .modal-body .row .col-md-12:not(:first-child) .form-label {
    margin-top: 0;
}

/* Ensure consistent spacing for all form elements */
.modal-sheet .modal-body form .row:first-child .col-md-6:first-child .form-label,
.modal-sheet .modal-body form .row:first-child .col-md-4:first-child .form-label,
.modal-sheet .modal-body form .row:first-child .col-md-12:first-child .form-label {
    margin-top: 0;
}

/* ============================================
   SUMMARY TOTALS CARD STYLES
   ============================================ */
.summary-totals {
    padding: 0;
}

.summary-item {
    background: #e8f0ff;
    border: 1px solid #c5d4f5;
    border-radius: 6px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.summary-item:hover {
    border-color: #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.summary-item-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.summary-item-value {
    font-size: 18px;
    color: #212529;
    font-weight: 700;
}

.summary-item-deduction .summary-item-value {
    color: #dc3545;
}

.summary-item-addition .summary-item-value {
    color: #28a745;
}

.summary-divider {
    height: 2px;
    background: linear-gradient(to right, transparent, #dee2e6, transparent);
    margin: 20px 0 16px 0;
}

.summary-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #8b3477 0%, #00784a 100%);
    color: #fff;
    padding: 16px 20px;
    border-radius: 6px;
    margin: 0 -16px -16px -16px;
}

.summary-total-label {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-total-value {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .summary-item {
        padding: 10px 12px;
    }
    
    .summary-item-value {
        font-size: 16px;
    }
    
    .summary-total-value {
        font-size: 20px;
    }
}

/* ============================================
   FUEL STORAGE CARD STYLES
   ============================================ */
.fuel-storage-card {
    background: #f5f1e8;
    border: 1px solid #e8e0d3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.fuel-storage-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    background: #f0ebe0;
}

.fuel-storage-available,
.fuel-storage-purchased,
.fuel-storage-allocated {
    background: #f5f1e8;
    color: #333;
}

.fuel-storage-available h6,
.fuel-storage-purchased h6,
.fuel-storage-allocated h6 {
    color: #6c757d;
}

.fuel-storage-available h3,
.fuel-storage-purchased h3,
.fuel-storage-allocated h3 {
    color: #212529;
}

/* ============================================
   LEFT MENU SCROLLBAR - Vertical scroll when height exceeds screen
   ============================================ */
.app-menu.navbar-menu {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.app-menu.navbar-menu .navbar-brand-box {
    flex-shrink: 0;
}

.app-menu.navbar-menu #scrollbar {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Important for flexbox scrolling */
}

/* Smooth scrolling */
.app-menu.navbar-menu #scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

/* Webkit browsers (Chrome, Safari, Edge) */
.app-menu.navbar-menu #scrollbar::-webkit-scrollbar {
    width: 8px;
}

.app-menu.navbar-menu #scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.app-menu.navbar-menu #scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.app-menu.navbar-menu #scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Equal-height cards: omitted globally — breaks many Steex grids. Add a utility class on a row if needed. */

/* ============================================
   AUTOSUGGEST DROPDOWN COMPONENT
   ============================================ */
.autosuggest-wrapper {
    position: relative;
    width: 100%;
}

.autosuggest-input-wrapper {
    position: relative;
}

.autosuggest-input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 0.875rem;
    font-size: 13px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background-color: #fff;
    cursor: text;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.autosuggest-input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.autosuggest-input::placeholder {
    color: #6c757d;
}

.autosuggest-dropdown-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6c757d;
    font-size: 16px;
}

.autosuggest-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
}

.autosuggest-dropdown.show {
    display: block;
}

.autosuggest-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}

.autosuggest-option:last-child {
    border-bottom: none;
}

.autosuggest-option:hover,
.autosuggest-option.highlighted {
    background-color: #e7f1ff;
}

.autosuggest-option.selected {
    background-color: #cfe2ff;
    font-weight: 600;
}

.autosuggest-no-results {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.autosuggest-loading {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
}

/* Ensure autosuggest works in modals */
.modal .autosuggest-dropdown {
    z-index: 1055;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .autosuggest-dropdown {
        max-height: 200px;
    }
}

/* ============================================
   SIDEBAR & TOPBAR - School switcher
   ============================================ */
#sidebar-nav-container #sidebarSchoolSelect {
    font-size: 12px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: #fff;
}
#sidebar-nav-container #sidebarSchoolSelect option {
    background: #2a3042;
    color: #fff;
}
[data-sidebar="dark"] .menu-title.mt-2 {
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 8px;
}
.topbar-school-select {
    min-width: 180px;
    font-size: 13px;
}
@media (max-width: 991px) {
    .topbar-school-select { min-width: 140px; }
}

/* Sidebar accordion arrow: scroll with menu (theme uses position:absolute on :after) */
#scrollbar .navbar-nav .nav-item > .nav-link.menu-link[data-bs-toggle="collapse"],
#scrollbar .navbar-nav .nav-link.menu-link[data-bs-toggle="collapse"] {
    position: relative;
}

/* ============================================
   ASSIGN VEHICLES MODAL - Card-style list
   ============================================ */
.assign-vehicles-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.assign-vehicle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.assign-vehicle-row:hover {
    background: #f1f5f9;
    border-color: #dee2e6;
}
.assign-vehicle-row .assign-row-bus {
    flex: 1;
    min-width: 0;
    max-width: 280px;
}
.assign-vehicle-row .assign-row-rental-wrap {
    flex: 0 0 140px;
}
.assign-vehicle-row .assign-row-rental-wrap .input-group-text {
    background: #fff;
    font-size: 13px;
    color: #64748b;
}
.assign-vehicle-row .assign-row-rental {
    max-width: 120px;
    text-align: right;
}
.assign-vehicle-row .btn-remove-assign-row {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    border-color: #e2e8f0;
}
.assign-vehicle-row .btn-remove-assign-row:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
    border-color: rgba(220, 53, 69, 0.3);
}
@media (max-width: 576px) {
    .assign-vehicle-row {
        flex-wrap: wrap;
    }
    .assign-vehicle-row .assign-row-bus { max-width: none; }
    .assign-vehicle-row .assign-row-rental-wrap { flex: 1 1 100%; }
    .assign-vehicle-row .assign-row-rental { max-width: none; }
}
.assign-vehicles-empty {
    display: none;
}
.assign-vehicles-list:empty + .assign-vehicles-empty {
    display: block;
}
.btn-soft-primary {
    color: var(--tb-primary, #8b3477);
    background: rgba(64, 81, 137, 0.1);
    border-color: transparent;
}
.btn-soft-primary:hover {
    color: #fff;
    background: var(--tb-primary, #8b3477);
    border-color: var(--tb-primary, #8b3477);
}

/* Raise Invoice modal - editable amount column */
#raiseInvoiceModal .invoice-row-amount {
    max-width: 140px;
    margin-left: auto;
    border: none;
    background: transparent;
    box-shadow: none;
}
#raiseInvoiceModal .invoice-row-amount:focus {
    border: none;
    box-shadow: none;
    outline: none;
}
#raiseInvoiceModal .invoice-amounts-table tbody td,
#raiseInvoiceModal .invoice-amounts-table tfoot td {
    vertical-align: middle;
}
#raiseInvoiceModal tfoot td {
    padding: 0.5rem 0.75rem;
}

/* Statement / Ledger modal - wider table */
#statementModal .modal-dialog {
    max-width: 960px;
}
#statementModal .statement-table-wrap {
    width: 100%;
}
#statementModal #statementTable {
    width: 100%;
    min-width: 720px;
}

/* ============================================================
   RIOS / Steex — visible Anjali Trans theme parity
   (Targets existing Steex/RIOS markup; no new HTML classes.)
   ============================================================ */

/* App canvas — very light neutral grey */
.main-content > .page-content {
    background-color: #f0f0f1;
}

.page-content > .container-fluid {
    padding-top: 0.5rem;
    padding-bottom: 1.5rem;
}

/* Page title strip — spreadsheet app chrome */
.page-content .page-title-box {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

/* Cards — bordered + soft shadow like Anjali KPI / summary cards */
.page-content .card {
    border: 1px solid #e8eaed;
    box-shadow: 0 1px 2px rgba(56, 65, 74, 0.08), 0 2px 6px rgba(56, 65, 74, 0.06);
}

/* .shadow-sm uses !important; align with elevation above (dashboard KPI tiles, etc.) */
.page-content .card.shadow-sm {
    box-shadow: 0 1px 2px rgba(56, 65, 74, 0.08), 0 2px 6px rgba(56, 65, 74, 0.06) !important;
}

.page-content .card .card-header {
    background-color: #fff;
    border-bottom: 1px solid #e8eaed;
    font-weight: 600;
}

/* Table card toolbar (title + Add / Export row) — filter-bar tone */
.page-content .card .card-body.border-bottom {
    background-color: #f8f9fa;
    border-bottom-color: #e0e0e0 !important;
}

/* RIOS prototype data tables — very light blue sheet (no top rule: toolbar sits flush above thead) */
.page-content .rios-data-table.rios-table-scroll {
    border: 1px solid #c8d8e8;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    background: #f2f7fb;
}

.page-content .rios-data-table.rios-table-scroll > .rios-list-panel.border {
    border-top: none !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

.page-content .rios-data-table table.table {
    --bs-table-bg: transparent;
    border-collapse: collapse;
    font-size: 0.8125rem;
    margin-bottom: 0;
}

.page-content .rios-data-table table.table thead th {
    background-color: #e4eef7 !important;
    color: #3a5068;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border: 1px solid #b8cce0;
    border-bottom: 2px solid #a8bed6;
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    white-space: nowrap;
}

.page-content .rios-data-table table.table tbody td {
    border: 1px solid #d4e3f0;
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    color: #212529;
    background-color: #f2f7fb;
}

.page-content .rios-data-table table.table tbody tr:hover td {
    background-color: #e8f2fa !important;
}

.page-content .card .rios-data-table.rios-table-scroll table.table tbody tr:hover td:last-child {
    background-color: #e8f2fa !important;
}

.page-content .card .rios-data-table.rios-table-scroll table.table thead th:last-child {
    background-color: #e4eef7 !important;
}

/* Pagination row under table — sheet pagination strip */
.page-content .card .card-body .d-flex.flex-wrap.justify-content-between.align-items-center.gap-2.mt-3,
.page-content .card .card-body .d-flex.flex-nowrap.justify-content-between.align-items-center.gap-2.mt-3 {
    margin-top: 0 !important;
    padding: 0.5rem 0.75rem;
    border: 1px solid #c8d8e8;
    border-top: none;
    background: #f2f7fb;
    border-radius: 0 0 0.375rem 0.375rem;
}

/* Forms inside cards — Anjali / Google-style borders */
.page-content .card .form-control,
.page-content .card .form-select {
    border-color: #dadce0;
}

.page-content .card .form-control:focus,
.page-content .card .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.12);
}

/* KPI / metric rows — subtle lift on hover (dashboard & ops tiles) */
.page-content .row.g-3 > [class*="col-"] > .card {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.page-content .row.g-3 > [class*="col-"] > .card:hover {
    box-shadow: 0 4px 10px rgba(56, 65, 74, 0.12);
    transform: translateY(-1px);
}

/* Dashboard — KPI / chart cards as navigation */
.agri-dashboard-home .agri-dash-card-link {
    cursor: pointer;
}

.agri-dashboard-home .agri-dash-card-link:hover .card,
.agri-dashboard-home .agri-dash-card-link:focus-visible .card {
    box-shadow: 0 4px 12px rgba(56, 65, 74, 0.14) !important;
    transform: translateY(-1px);
}

.agri-dashboard-home .agri-dash-card-link .card {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

