/**
 * LOKA - Custom Styles
 */

:root {
    --sidebar-width: 250px;
    --navbar-height: 56px;
    --primary-color: #0d6efd;
    --sidebar-bg: #212529;
    --sidebar-text: #adb5bd;
    --sidebar-hover: #495057;
    --sidebar-active: #0d6efd;
}

/* ===== LAYOUT ===== */
body {
    background-color: #f8f9fa;
    overflow-x: hidden;
}

.wrapper {
    display: flex;
    width: 100%;
    padding-top: var(--navbar-height);
}

/* ===== NAVBAR ===== */
.navbar {
    z-index: 1030;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.avatar-circle {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.notification-dropdown {
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

@media (max-width: 575.98px) {
    .notification-dropdown {
        width: calc(100vw - 1.5rem);
        max-width: calc(100vw - 1.5rem);
    }
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: var(--sidebar-bg);
    position: fixed;
    left: 0;
    top: var(--navbar-height);
    transition: all 0.3s ease;
    z-index: 1040; /* Increased to be above navbar (1030) */
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0;
    min-height: 200px;
    max-height: calc(100vh - var(--navbar-height) - 50px);
    scrollbar-width: auto;
    scrollbar-color: rgba(255, 255, 255, 0.5) rgba(255, 255, 255, 0.1);
}

.sidebar-content::-webkit-scrollbar {
    width: 12px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.08);
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar .nav-link.active {
    background: rgba(13, 110, 253, 0.15);
    color: var(--sidebar-active);
    border-left-color: var(--sidebar-active);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar .nav-link .badge {
    font-size: 0.7rem;
}

.sidebar .nav-header {
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1.5rem 1.25rem 0.5rem;
    list-style: none;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #343a40;
    text-align: center;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - var(--navbar-height));
    transition: all 0.3s ease;
    padding: 0;
}

.main-content.expanded {
    margin-left: 0;
}

/* ===== PAGE HEADER ===== */
.page-header {
    background: #fff;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.page-header .breadcrumb {
    margin-bottom: 0;
    font-size: 0.875rem;
}

/* ===== CARDS ===== */
.stat-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Clickable stat cards */
a.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

a.stat-card-link:hover .stat-label {
    color: #495057;
}

.stat-card .stat-hint {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #adb5bd;
    opacity: 0;
    transition: opacity 0.2s ease;
}

a.stat-card-link:hover .stat-hint,
a.stat-card-link:focus .stat-hint {
    opacity: 1;
}

/* ===== TABLES ===== */
.table-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
}

.table-card .card-header {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.25rem;
}

.table-card .card-header h5 {
    margin: 0;
    font-weight: 600;
}

.table th {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
}

/* ===== FORMS ===== */
.form-label {
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ===== BUTTONS ===== */
.btn {
    font-weight: 500;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===== BADGES ===== */
.badge {
    font-weight: 500;
    padding: 0.4em 0.65em;
}

/* ===== ACTIVITY FEED ===== */
.activity-feed {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-feed li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.activity-feed li:last-child {
    border-bottom: none;
}

.activity-feed .activity-time {
    font-size: 0.75rem;
    color: #6c757d;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
}

.login-card .card-body {
    padding: 2.5rem;
}

.login-card .logo {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

.chart-container-sm {
    position: relative;
    height: 220px;
    width: 100%;
}

.dash-chart-empty {
    min-height: 180px;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        margin-left: 0; /* Override the default collapsed behavior */
    }

    .sidebar.show {
        transform: translateX(0);
    }

    /* Overlay for mobile sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1035; /* Between navbar (1030) and sidebar (1040) */
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }

    /* Main content - let container-fluid.py-4 handle vertical spacing */
    .main-content {
        padding: 0;
    }

    /* ===== MOBILE SIDEBAR FIXES ===== */
    /* Ensure sidebar is visible when shown on mobile */
    .sidebar.show {
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: var(--sidebar-width);
        max-width: 85vw;
    }

    /* Ensure sidebar content is visible */
    .sidebar.show .sidebar-content {
        opacity: 1;
        visibility: visible;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Sidebar nav items - ensure they're visible on mobile */
    .sidebar .nav-item,
    .sidebar .nav-link {
        display: flex;
        width: 100%;
    }

    /* Sidebar text - ensure visibility */
    .sidebar .nav-link span {
        opacity: 1;
        display: inline;
    }
}

/* ===== MOBILE TOUCH TARGETS (768px and below) ===== */
@media (max-width: 768px) {
    /* Larger touch targets for buttons */
    .btn {
        min-height: 44px;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .btn-sm {
        min-height: 36px;
        padding: 0.35rem 0.75rem;
        font-size: 0.8rem;
    }

    .btn-xs {
        min-height: 32px;
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Form controls - larger touch targets */
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 1rem;
    }

    .form-control::placeholder {
        font-size: 0.95rem;
    }

    /* Input groups */
    .input-group .form-control {
        min-height: 44px;
    }

    .input-group-text {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Dropdown toggles */
    .dropdown-toggle {
        min-height: 44px;
    }

    /* Checkboxes and radio buttons */
    .form-check-input {
        width: 1.3rem;
        height: 1.3rem;
    }

    /* Cards - full width on mobile */
    .card {
        margin-bottom: 1rem;
    }

    .dashboard-card {
        margin-bottom: 0.75rem;
    }

    /* Stats cards - stack vertically */
    .row.g-3 > .col-md-4,
    .row.g-3 > .col-md-3,
    .row.g-3 > .col-md-6 {
        width: 100%;
        max-width: 100%;
    }

    /* KPI/stat rows built with bare .col - wrap into a compact grid
       instead of squeezing every card onto one line */
    .row.g-3 > .col {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .row.g-3 > .col .card-body {
        padding: 0.5rem 0.25rem;
    }

    .row.g-3 > .col h4,
    .row.g-3 > .col h3 {
        font-size: 1.1rem;
    }

    /* Button groups wrap instead of overflowing the viewport */
    .btn-group,
    .btn-group-vertical {
        flex-wrap: wrap;
    }

    /* Page title rows (title + export buttons) stack cleanly */
    .d-flex.justify-content-between.align-items-center {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .stats-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Table responsive wrapper with touch scrolling */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 0;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    /* Table font size */
    .table {
        font-size: 0.85rem;
    }

    .table thead th {
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Table cells padding */
    .table td,
    .table th {
        padding: 0.5rem;
    }

    /* Nav tabs - scrollable on mobile */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-content {
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    /* Badge adjustments */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }

    /* Page header adjustments */
    h1 {
        font-size: 1.75rem;
    }

    h4 {
        font-size: 1.25rem;
    }

    /* Alert padding */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Form labels */
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }

    /* Pagination adjustments */
    .pagination {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .pagination .page-link {
        padding: 0.375rem 0.6rem;
        font-size: 0.85rem;
    }

    /* ===== MOBILE-FIRST CHART STYLES ===== */
    /* Chart containers - proper height control */
    .chart-container {
        position: relative;
        height: 250px;
        width: 100%;
    }

    .chart-container-sm {
        position: relative;
        height: 200px;
        width: 100%;
    }

    /* Charts full width on mobile; keep Chart.js container height */
    .card-body canvas {
        max-width: 100% !important;
    }

    /* Chart cards stack vertically on mobile */
    .charts-row .col-lg-8,
    .charts-row .col-lg-6,
    .charts-row .col-lg-4,
    .charts-row .col-lg-3 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    /* Stats cards - stack vertically on mobile */
    .stats-row .col-xl-3,
    .stats-row .col-md-6 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    /* Reduce chart legend size on mobile */
    .chartjs-legend {
        font-size: 0.75rem !important;
    }

    /* Chart title adjustments */
    .card-header h5 {
        font-size: 1rem;
    }

    /* Activity feed mobile adjustments */
    .activity-feed {
        font-size: 0.85rem;
    }

    .activity-feed li {
        padding: 0.5rem 0;
    }

    /* Stats cards - stack vertically with full width */
    .stats-row .col-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ===== SMALL MOBILE (575px and below) ===== */
@media (max-width: 575.98px) {
    /* Even smaller charts on very small screens */
    .chart-container {
        height: 200px;
    }

    .chart-container-sm {
        height: 180px;
    }

    /* Stats value larger for readability */
    .stat-value {
        font-size: 1.75rem !important;
    }

    /* Card header adjustments */
    .card-header {
        padding: 0.75rem 1rem;
    }

    .card-body {
        padding: 0.75rem 1rem;
    }

    /* Keep all columns visible - rely on horizontal scroll for tables */
}

/* ===== TABLET STYLES (768px - 991px) ===== */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Chart containers - medium height */
    .chart-container {
        height: 280px;
    }

    .chart-container-sm {
        height: 220px;
    }

    /* Stats cards - 2 per row on tablet */
    .stats-row .col-xl-3 {
        width: 50%;
        max-width: 50%;
        flex: 0 0 50%;
    }

    /* Charts - 2 per row on tablet */
    .charts-row .col-lg-4 {
        width: 50%;
        max-width: 50%;
        flex: 0 0 50%;
    }
}

/* ===== TOM SELECT CUSTOMIZATION ===== */
.ts-wrapper {
    width: 100%;
}

.ts-wrapper.multi .ts-control {
    padding: 0.375rem 0.75rem;
    min-height: 42px;
}

.ts-wrapper.multi .ts-control > .item {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    font-size: 0.875rem;
}

.ts-wrapper.multi .ts-control > .item .remove {
    border-left: 1px solid rgba(255,255,255,0.3);
    margin-left: 0.375rem;
    padding-left: 0.375rem;
}

.ts-dropdown {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    margin-top: 4px;
}

.ts-dropdown .option {
    padding: 0.5rem 0.75rem;
}

.ts-dropdown .option.active {
    background: rgba(13, 110, 253, 0.1);
    color: inherit;
}

.ts-dropdown .option:hover {
    background: rgba(13, 110, 253, 0.1);
}

.ts-wrapper.focus .ts-control {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ===== DATATABLE CUSTOMIZATION ===== */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-top: 1rem;
}

/* ===== UTILITIES ===== */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== PRINT ===== */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .dataTables_length,
    .dataTables_filter,
    .dataTables_paginate {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}

/* ===== Availability planning calendar (ported from prod-loka) ===== */
/* ===== Availability planning calendar ===== */
.avail-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 991.98px) {
    .avail-layout { grid-template-columns: 1fr; }
}
.avail-mini { padding: 1rem; }
.avail-mini-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.avail-mini-title { font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
.avail-mini-sub { font-size: 0.75rem; opacity: 0.65; }
.avail-mini-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.avail-range-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
}
.avail-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    border: 1px solid #94a3b8;
    border-radius: 8px;
    overflow: hidden;
    background: #94a3b8;
}
[data-theme="loka"] .avail-cal-grid {
    border-color: #475569;
    background: #475569;
}
.avail-cal-dow {
    background: #1e3a5f;
    color: #f8fafc;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.45rem 0.15rem;
    border-right: 1px solid #334155;
}
.avail-cal-dow:last-child { border-right: none; }
.avail-cal-day {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 4.25rem;
    padding: 0.35rem 0.4rem;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
    border-right: 1px solid #94a3b8;
    border-bottom: 1px solid #94a3b8;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
[data-theme="loka"] .avail-cal-day {
    background: #0f172a;
    border-right-color: #475569;
    border-bottom-color: #475569;
    color: #e2e8f0;
}
.avail-cal-day:nth-child(7n) { border-right: none; }
.avail-cal-day:hover { background: #f1f5f9; }
[data-theme="loka"] .avail-cal-day:hover { background: #1e293b; }
.avail-cal-day.is-other {
    background: #f8fafc;
    color: #94a3b8;
    pointer-events: none;
}
[data-theme="loka"] .avail-cal-day.is-other {
    background: #0b1220;
    color: #475569;
}
.avail-cal-day.is-free { background: #ecfdf5; }
.avail-cal-day.is-partial { background: #fffbeb; }
.avail-cal-day.is-full { background: #fef2f2; }
[data-theme="loka"] .avail-cal-day.is-free { background: #052e1f; }
[data-theme="loka"] .avail-cal-day.is-partial { background: #3b2f0b; }
[data-theme="loka"] .avail-cal-day.is-full { background: #3f1212; }
.avail-cal-day.is-today .avail-day-num {
    background: #1e3a5f;
    color: #fff;
}
.avail-cal-day.is-selected {
    box-shadow: inset 0 0 0 2px #2563eb;
    z-index: 1;
    position: relative;
}
.avail-cal-day.is-sel-start,
.avail-cal-day.is-sel-end {
    box-shadow: inset 0 0 0 2px #1d4ed8;
}
.avail-day-num {
    display: inline-flex;
    width: 1.5rem;
    height: 1.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
}
.avail-day-free {
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0.75;
    margin-top: 0.15rem;
}
.avail-day-dots {
    display: flex;
    gap: 3px;
    margin-top: auto;
    padding-top: 0.2rem;
}
.avail-day-dots i {
    width: 5px;
    height: 5px;
    border-radius: 9999px;
    background: #2563eb;
    display: block;
}
.avail-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
}
.avail-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.avail-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}
.avail-dot.free { background: #10b981; }
.avail-dot.partial { background: #f59e0b; }
.avail-dot.full { background: #ef4444; }
.avail-hint {
    margin: 0.5rem 0 0;
    font-size: 0.7rem;
    opacity: 0.65;
    line-height: 1.35;
}
.avail-panel {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    padding: 1rem 1.15rem 1.25rem;
}
[data-theme="loka"] .avail-panel {
    background: #0f172a;
    border-color: #334155;
}
.avail-panel-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #e2e8f0;
}
[data-theme="loka"] .avail-panel-head { border-bottom-color: #334155; }
.avail-panel-title { font-size: 1.05rem; font-weight: 700; }
.avail-panel-sub { font-size: 0.8rem; opacity: 0.65; margin-top: 0.2rem; }
.avail-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.avail-filter-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 160px;
}
.avail-tabs {
    display: none;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}
.avail-tab {
    flex: 1;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 0.45rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.avail-tab.is-active {
    background: #1e3a5f;
    border-color: #1e3a5f;
    color: #fff;
}
[data-theme="loka"] .avail-tab {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}
[data-theme="loka"] .avail-tab.is-active {
    background: #2563eb;
    border-color: #2563eb;
}
@media (max-width: 767.98px) {
    .avail-tabs { display: flex; }
    .avail-sections .avail-section { display: none; }
    .avail-sections .avail-section.is-active { display: block; }
}
@media (min-width: 768px) {
    .avail-sections {
        display: grid;
        grid-template-columns: 1.2fr 1fr 1fr;
        gap: 1rem;
    }
    .avail-sections .avail-section { display: block !important; }
}
.avail-section {
    border: 1px solid #94a3b8;
    border-radius: 0.65rem;
    padding: 0.85rem 0.9rem 1rem;
    background: #f8fafc;
    min-height: 0;
}
[data-theme="loka"] .avail-section {
    border-color: #64748b;
    background: #1e293b;
}
.avail-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #cbd5e1;
}
[data-theme="loka"] .avail-section-title {
    border-bottom-color: #475569;
}
.avail-count {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.65;
}
.avail-empty {
    text-align: center;
    padding: 1.25rem 0.75rem;
    opacity: 0.7;
    font-size: 0.85rem;
}
.avail-empty i { font-size: 1.5rem; display: block; margin-bottom: 0.35rem; }
.avail-trip-list,
.avail-asset-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 28rem;
    overflow: auto;
}
.avail-trip-item,
.avail-asset-list li {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.55rem 0.65rem;
    background: #f8fafc;
}
[data-theme="loka"] .avail-trip-item,
[data-theme="loka"] .avail-asset-list li {
    border-color: #334155;
    background: #111827;
}
.avail-trip-time { font-size: 0.72rem; opacity: 0.7; margin-bottom: 0.2rem; }
.avail-trip-dest {
    font-weight: 600;
    font-size: 0.9rem;
    color: inherit;
    text-decoration: none;
}
.avail-trip-dest:hover { text-decoration: underline; }
.avail-trip-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin-top: 0.35rem;
}
.avail-asset-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.15rem 0.5rem;
    align-items: center;
}
.avail-asset-name { font-weight: 700; font-size: 0.85rem; }
.avail-asset-meta {
    grid-column: 1 / -1;
    font-size: 0.72rem;
    opacity: 0.7;
}
.avail-month-table { padding: 0; overflow: hidden; }
.avail-month-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.15rem;
    font-weight: 600;
}
.avail-month-summary::-webkit-details-marker { display: none; }


/* Gas voucher filter utility */
.min-w-140 { min-width: 140px; }
.min-w-80 { min-width: 80px; }
.min-w-45 { min-width: 45px; }
#navSearchDropdown { z-index: 1050; max-height: 380px; overflow: auto; }

/* ===== LAYOUT UTILITIES (Phase 1 - replace inline styles) ===== */
.mw-nav-search { max-width: 480px; }
.mw-palette { max-width: 560px; width: 90%; }
.max-h-300 { max-height: 300px; overflow-y: auto; }
.max-h-250 { max-height: 250px; overflow-y: auto; }
.mw-700 { max-width: 700px; }
.bg-bronze { background: #cd7f32 !important; color: #fff !important; }

/* Button touch target - consistent 44px */
.btn { min-height: 38px; }
@media (max-width: 991.98px) {
    .btn { min-height: 44px; }
}

/* Card header consistency */
.card-header { padding: 1rem 1.25rem; }
.card-header h5, .card-header h6 { margin-bottom: 0; }

/* Table card body - consistent padding around tables */
.table-card .card-body { padding: 1rem; }
.table-card .card-body.p-0 { padding: 0; }

/* Filter bar - unified 12-col pattern helper */
.filter-bar .form-control, .filter-bar .form-select { min-height: 38px; }

/* Settings help text - even height */
.form-help { min-height: 20px; display: block; }
.badge-keep { white-space: nowrap; display: inline-block; }
