/**
 * HECO Admin - Professional Dashboard Styles
 * ============================================
 * Custom admin panel design using the design system
 */

/* ============================================
   CSS Variables (Admin-specific)
   ============================================ */
:root {
    /* Sidebar */
    --hct-sidebar-width: 260px;
    --hct-sidebar-bg: #0f172a;
    --hct-sidebar-hover: #1e293b;
    --hct-sidebar-active: rgba(121, 160, 159, 0.1);
    --hct-sidebar-text: #94a3b8;
    --hct-sidebar-heading: #475569;
    --hct-topbar-height: 64px;

    /* Admin colors (inheriting from design system) */
    --admin-primary: var(--heco-primary-600, #7aa1a0);
    --admin-primary-light: var(--heco-primary-400, #97bbb9);
    --admin-primary-dark: var(--heco-primary-700, #79a09f);
    --admin-bg: #f1f5f9;
    --admin-card-bg: #ffffff;
    --admin-border: #e2e8f0;
    --admin-text: #1e293b;
    --admin-text-muted: #64748b;

    /* Shared danger/red token — use this var instead of hardcoding reds */
    --heco-danger: #b54a4a;
}

/* ============================================
   Base Styles
   ============================================ */
.hct-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--admin-bg);
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Sidebar
   ============================================ */
.hct-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--hct-sidebar-width);
    height: 100vh;
    background: var(--hct-sidebar-bg);
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.hct-sidebar::-webkit-scrollbar {
    width: 6px;
}

.hct-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.hct-sidebar::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

.hct-sidebar::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.hct-sidebar.collapsed {
    transform: translateX(-100%);
}

/* Sidebar Brand */
.hct-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.025em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
}

.hct-sidebar-brand i {
    font-size: 1.25rem;
    color: var(--admin-primary-light);
}

/* Sized by height so the wordmark keeps its proportions whatever the file is. */
.hct-brand-logo {
    height: 26px;
    width: auto;
}

/* Sidebar Navigation */
.hct-sidebar-nav {
    padding: 16px 0;
}

.hct-nav-section {
    padding: 20px 24px 8px;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--hct-sidebar-heading);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hct-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    margin: 2px 12px;
    color: var(--hct-sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    border-radius: 8px;
    transition: all 0.15s ease;
    position: relative;
}

.hct-nav-link i {
    width: 20px;
    font-size: 1rem;
    text-align: center;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

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

.hct-nav-link:hover i {
    opacity: 1;
}

.hct-nav-link.active {
    background: var(--hct-sidebar-active);
    color: var(--admin-primary-light);
    font-weight: 500;
}

.hct-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--admin-primary-light);
    border-radius: 0 4px 4px 0;
}

.hct-nav-link.active i {
    opacity: 1;
    color: var(--admin-primary-light);
}

/* ============================================
   Main Wrapper
   ============================================ */
.hct-main-wrapper {
    margin-left: var(--hct-sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.hct-main-wrapper.sidebar-collapsed {
    margin-left: 0;
}

/* ============================================
   Top Bar
   ============================================ */
.hct-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: var(--hct-topbar-height);
    background: var(--admin-card-bg);
    border-bottom: 1px solid var(--admin-border);
    backdrop-filter: blur(8px);
}

.hct-topbar h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--admin-text);
    margin: 0;
}

/* Topbar toggle button */
#sidebarToggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--admin-text-muted);
    transition: all 0.15s ease;
}

#sidebarToggle:hover {
    background: var(--admin-bg);
    color: var(--admin-text);
}

/* User dropdown in topbar */
.hct-topbar .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--admin-text);
    text-decoration: none;
    transition: all 0.15s ease;
}

.hct-topbar .dropdown-toggle:hover {
    background: var(--admin-bg);
    border-color: #cbd5e1;
}

.hct-topbar .dropdown-toggle::after {
    margin-left: 4px;
    opacity: 0.5;
}

.hct-topbar .dropdown-menu {
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 8px;
    margin-top: 8px;
}

.hct-topbar .dropdown-item {
    padding: 10px 14px;
    font-size: 0.875rem;
    border-radius: 6px;
    color: var(--admin-text);
}

.hct-topbar .dropdown-item:hover {
    background: var(--admin-bg);
}

.hct-topbar .dropdown-item-text {
    padding: 10px 14px;
}

.hct-topbar .dropdown-divider {
    margin: 6px 0;
    border-color: var(--admin-border);
}

/* ============================================
   Content Area
   ============================================ */
.hct-content {
    flex: 1;
    padding: 28px;
}

/* ============================================
   Card Styles (Override Bootstrap)
   ============================================ */
.hct-content .card {
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    background: var(--admin-card-bg);
    overflow: hidden;
}

.hct-content .card-header {
    background: linear-gradient(180deg, #fafbfc 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--admin-border);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--admin-text);
}

.hct-content .card-header h6 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hct-content .card-header h6 i {
    color: var(--admin-text-muted);
}

.hct-content .card-body {
    padding: 20px;
}

/* ============================================
   Stat Cards
   ============================================ */
.stat-card {
    background: var(--admin-card-bg);
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--admin-primary) 0%, var(--admin-primary-light) 100%);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-text);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(121, 160, 159, 0.1) 0%, rgba(121, 160, 159, 0.05) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--admin-primary);
    font-size: 1.25rem;
}

/* ============================================
   Table Styles
   ============================================ */
.hct-content .table {
    font-size: 0.875rem;
    margin: 0;
}

.hct-content .table thead th {
    font-weight: 600;
    color: var(--admin-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 16px;
    border-bottom: 2px solid var(--admin-border);
    background: transparent;
}

.hct-content .table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: var(--admin-text);
}

.hct-content .table tbody tr:last-child td {
    border-bottom: none;
}

.hct-content .table-hover tbody tr:hover {
    background-color: rgba(121, 160, 159, 0.04);
}

/* ============================================
   Badge Styles
   ============================================ */
.hct-content .badge {
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
    padding: 5px 10px;
    border-radius: 6px;
}

.badge.bg-success {
    background: rgba(121, 160, 159, 0.12) !important;
    color: #79a09f !important;
}

.badge.bg-warning {
    background: rgba(245, 158, 11, 0.12) !important;
    color: #b45309 !important;
}

.badge.bg-danger {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #b91c1c !important;
}

.badge.bg-info {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #1d4ed8 !important;
}

.badge.bg-secondary {
    background: rgba(100, 116, 139, 0.12) !important;
    color: #475569 !important;
}

/* ============================================
   Form Styles
   ============================================ */
.hct-content .form-control,
.hct-content .form-select {
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.875rem;
    color: var(--admin-text);
    transition: all 0.15s ease;
}

.hct-content .form-control:focus,
.hct-content .form-select:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(121, 160, 159, 0.1);
    outline: none;
}

.hct-content .form-control::placeholder {
    color: #94a3b8;
}

.hct-content .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--admin-text);
    margin-bottom: 6px;
}

.hct-content .form-text {
    font-size: 0.8125rem;
    color: var(--admin-text-muted);
}

/* Form Switch */
.form-check-input:checked {
    background-color: var(--admin-primary);
    border-color: var(--admin-primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(121, 160, 159, 0.1);
}

/* ============================================
   Button Styles
   ============================================ */
.btn {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 10px 18px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.8125rem;
}

.btn-success {
    background: linear-gradient(180deg, var(--admin-primary) 0%, var(--admin-primary-dark) 100%);
    border: none;
    box-shadow: 0 1px 2px rgba(121, 160, 159, 0.2);
}

.btn-success:hover {
    background: linear-gradient(180deg, var(--admin-primary-dark) 0%, #496767 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(121, 160, 159, 0.25);
}

.btn-outline-success {
    color: var(--admin-primary);
    border-color: var(--admin-primary);
    background: transparent;
}

.btn-outline-success:hover {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
    color: white;
}

.btn-outline-secondary {
    color: var(--admin-text-muted);
    border-color: var(--admin-border);
}

.btn-outline-secondary:hover {
    background: var(--admin-bg);
    border-color: #cbd5e1;
    color: var(--admin-text);
}

/* ============================================
   Accordion Styles
   ============================================ */
.hct-content .accordion-item {
    border: 1px solid var(--admin-border);
    border-radius: 10px !important;
    margin-bottom: 8px;
    overflow: hidden;
}

.hct-content .accordion-button {
    padding: 16px 20px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--admin-text);
    background: transparent;
}

.hct-content .accordion-button:not(.collapsed) {
    background: rgba(121, 160, 159, 0.04);
    color: var(--admin-primary-dark);
    box-shadow: none;
}

.hct-content .accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(121, 160, 159, 0.1);
}

.hct-content .accordion-body {
    padding: 20px;
}

/* ============================================
   Alert Styles
   ============================================ */
.hct-content .alert {
    border-radius: 10px;
    border: none;
    padding: 14px 18px;
    font-size: 0.875rem;
}

.alert-success {
    background: rgba(121, 160, 159, 0.1);
    color: #79a09f;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

/* ============================================
   Trip Manager Specific
   ============================================ */
.trip-manager-col {
    height: calc(100vh - 120px);
    overflow-y: auto;
}

.day-block {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    border-left: 4px solid var(--admin-primary);
    padding: 16px;
    margin-bottom: 12px;
}

.day-block.border-warning {
    border-left-color: #f59e0b;
}

.timeline-connector {
    width: 2px;
    background: linear-gradient(180deg, var(--admin-primary-light) 0%, transparent 100%);
    min-height: 20px;
    margin-left: 20px;
}

/* ============================================
   Chat Styles
   ============================================ */
.chat-container {
    height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
}

.chat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.chat-message.user {
    margin-left: auto;
    background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-primary-dark) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant {
    background: white;
    border: 1px solid var(--admin-border);
    border-bottom-left-radius: 4px;
    color: var(--admin-text);
}

/* ============================================
   Map Container
   ============================================ */
.map-container {
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--admin-border);
}

/* ============================================
   Text Utilities
   ============================================ */
.text-success {
    color: var(--admin-primary) !important;
}

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

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 991.98px) {
    .hct-sidebar {
        transform: translateX(-100%);
    }

    .hct-sidebar:not(.collapsed) {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.2);
    }

    .hct-main-wrapper {
        margin-left: 0 !important;
    }

    .hct-content {
        padding: 20px;
    }

    .trip-manager-col {
        height: auto;
    }

    .map-container {
        height: 280px;
    }

    .chat-container {
        height: 320px;
    }
}

@media (max-width: 767.98px) {
    .hct-topbar {
        padding: 0 16px;
    }

    .hct-content {
        padding: 16px;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* ============================================
   travel-preferences-edit page (admin/travel-preferences-edit.blade.php)
   ============================================ */
.tp-edit-page .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 16px;
    font-size: 0.85rem;
}
.tp-edit-page .breadcrumb a {
    color: #79a09f;
    text-decoration: none;
}
.tp-edit-page .breadcrumb a:hover { text-decoration: underline; }
.tp-edit-page .form-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    max-width: 720px;
}
.tp-edit-page .form-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #496767;
    margin: 0 0 4px;
}
.tp-edit-page .form-section-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0 0 20px;
}
.tp-edit-page .read-only-pill {
    display: inline-block;
    padding: 4px 12px;
    background: #f1f7f7;
    color: #79a09f;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
}
.tp-edit-page .form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}
.tp-edit-page .form-check-input:checked {
    background-color: #7aa1a0;
    border-color: #7aa1a0;
}
.tp-edit-page .tp-back-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #4b5563;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}
.tp-edit-page .tp-back-btn:hover {
    background: #f1f7f7;
    color: #79a09f;
}

/* ============================================
   travel-preferences page (admin/travel-preferences.blade.php)
   ============================================ */
.tp-accordion .accordion-button {
    background: #fff;
    color: #79a09f;
    font-weight: 600;
    box-shadow: none;
    padding: 14px 18px;
}
.tp-accordion .accordion-button:not(.collapsed) {
    background: #f1f7f7;
    color: #496767;
}
.tp-accordion .accordion-button:focus {
    border-color: #7ca4a3;
    box-shadow: 0 0 0 0.2rem rgba(121, 160, 159, 0.15);
}
.tp-accordion .accordion-item {
    border: 1px solid #e5e7eb;
    margin-bottom: 10px;
    border-radius: 8px !important;
    overflow: hidden;
}
.tp-accordion .accordion-body {
    padding: 0;
}
.tp-accordion .pref-add-row {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 12px 16px;
}

/* ============================================
   trip-manager layout (admin/trip-manager/layout.blade.php)
   ============================================ */
.trip-manager-col { height: calc(100vh - 140px); overflow-y: auto; padding: 10px; }
.tm-sidebar { background: #f8f9fa; }
.day-block { border: 1px solid #dee2e6; border-radius: 8px; padding: 12px; margin-bottom: 10px; background: #fff; cursor: pointer; transition: border-color 0.15s; }
.day-block:hover { border-color: #0d6efd; }
.day-block.locked { background: #f1f7f7; border-color: #79a09f; }
.day-block.selected { border-color: #0d6efd; border-width: 2px; }
.service-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid #f0f0f0; }

/* ============================================
   admin login page (admin/auth/login.blade.php)
   ============================================ */
body.admin-login-page {
    background: linear-gradient(135deg, #1a1e2e 0%, #2d3748 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}
.admin-login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.admin-login-brand {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: #5f8484;
    margin-bottom: 8px;
}
.admin-login-subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 24px;
}
.admin-login-error {
    background: #f8d7da;
    color: #842029;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.875rem;
}

/* ============================================
   Multi-select checkbox dropdown
   (used on admin/providers/edit + portal/sp/edit-profile)
   ============================================ */
.ms-dropdown { position: relative; }
.ms-dropdown .ms-trigger {
    width: 100%;
    cursor: pointer;
    background-color: #fff;
}
.ms-dropdown .ms-trigger .ms-label {
    display: inline-block;
    max-width: calc(100% - 20px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.ms-dropdown .ms-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 1050;
    padding: 4px 0;
}
.ms-dropdown .ms-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.875rem;
    margin: 0;
}
.ms-dropdown .ms-option:hover { background: #f8f9fa; }
.ms-dropdown .ms-option input[type=checkbox] { margin: 0; flex-shrink: 0; }
.ms-dropdown .ms-empty {
    padding: 12px;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Card containing multi-select dropdowns must let the panel escape */
.hct-content .card:has(.ms-dropdown),
.hct-content .card:has(.ms-dropdown) .card-body { overflow: visible; }

/* Filter-card forms (Travelers-style server-side filter pattern) host
   searchable .custom-select dropdowns. .hct-content .card has overflow:
   hidden, which would clip the dropdown panel below the card edge. Allow
   filter forms (and only filter forms — narrow scope so we don't break
   table cards with .table-responsive inside) to render their dropdown
   panels outside their own bounds. */
.hct-content form.card,
.hct-content form.card > .card-body { overflow: visible; }

/* ============================================
   CUSTOM CHECKBOX — Font Awesome check icon (mirrors portal.css).
   Used in row-select, bulk-delete patterns, terms checkboxes etc.
   ============================================ */
.check-control {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 0.92rem;
    color: var(--color-text-primary, #111827);
    margin: 0;
}

.check-control-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.check-control-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--color-border, #cbd5e1);
    border-radius: 4px;
    background: #fff;
    color: transparent;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.check-control:hover .check-control-icon {
    border-color: var(--heco-primary-500, #7ca4a3);
}

.check-control-input:focus-visible ~ .check-control-icon {
    box-shadow: 0 0 0 3px rgba(121, 160, 159, 0.22);
}

.check-control-input:checked ~ .check-control-icon {
    background: var(--heco-primary-50, #f1f7f7);
    border-color: var(--heco-primary-700, #79a09f);
    color: var(--heco-primary-700, #79a09f);
}

.check-control-icon i {
    font-size: 11px;
    line-height: 1;
}

.check-control-label { flex: 1; }
.check-control-label a {
    color: var(--heco-primary-700, #79a09f);
    text-decoration: none;
    font-weight: 500;
}
.check-control-label a:hover { text-decoration: underline; }

.check-control-input:disabled ~ .check-control-icon {
    background: var(--heco-neutral-100, #f1f5f9);
    cursor: not-allowed;
}
.check-control:has(.check-control-input:disabled) {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ============================================
   ADMIN-WIDE STYLE BUS — scoped under .heco-admin (set on <body>).
   Mirror of the portal scope; never overrides Bootstrap classes globally.
   ============================================ */
.heco-admin .form-control,
.heco-admin .form-select,
.heco-admin .input-group-text,
.heco-admin .btn,
.heco-admin .card,
.heco-admin .modal-content,
.heco-admin .dropdown-menu,
.heco-admin .alert,
.heco-admin .badge,
.heco-admin .list-group,
.heco-admin .list-group-item:first-child,
.heco-admin .list-group-item:last-child,
.heco-admin .pagination .page-link,
.heco-admin .nav-pills .nav-link,
.heco-admin .progress {
    border-radius: 4px;
}

/* Pagination — use the brand colour (not Bootstrap blue) for links + active page */
.heco-admin .pagination {
    --bs-pagination-color: var(--admin-primary);
    --bs-pagination-hover-color: var(--admin-primary-dark);
    --bs-pagination-focus-color: var(--admin-primary-dark);
    --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(122, 161, 160, 0.25);
    --bs-pagination-active-color: #fff;
    --bs-pagination-active-bg: var(--admin-primary);
    --bs-pagination-active-border-color: var(--admin-primary);
    gap: 0.375rem;
}
/* Space the page boxes apart instead of Bootstrap's flush, connected look. */
.heco-admin .pagination .page-item:not(:first-child) .page-link {
    margin-left: 0;
}

.heco-admin .rounded-pill { border-radius: 50rem; }
.heco-admin .rounded-circle { border-radius: 50%; }

.heco-admin .input-group > :first-child:not(:only-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.heco-admin .input-group > :not(:first-child):not(:last-child) {
    border-radius: 0;
}
.heco-admin .input-group > :last-child:not(:only-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.heco-admin .input-group > :only-child {
    border-radius: 4px;
}

/* ============================================
   CUSTOM SEARCHABLE SELECT (public/js/custom-select.js)
   Mirrors the portal component but scoped under .heco-admin and
   sized for the admin's small (form-select-sm) filter dropdowns.
   ============================================ */
.heco-admin .custom-select-wrap {
    position: relative;
}
.heco-admin .custom-select-wrap select {
    display: none;
}
.heco-admin .custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border: 1px solid var(--heco-neutral-300, #ced4da);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 31px;
}
.heco-admin .custom-select-trigger:hover {
    border-color: var(--heco-primary-700, #79a09f);
}
.heco-admin .custom-select-wrap.open .custom-select-trigger {
    border-color: var(--heco-primary-700, #79a09f);
}
.heco-admin .custom-select-trigger .caret {
    margin-left: 8px;
    font-size: 0.7rem;
    color: var(--heco-neutral-400, #999);
    flex-shrink: 0;
}
.heco-admin .custom-select-body {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1080;
    background: #fff;
    border: 1px solid var(--heco-neutral-300, #ced4da);
    border-radius: 4px;
    margin-top: 2px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.heco-admin .custom-select-wrap.open .custom-select-body {
    display: block;
}
.heco-admin .custom-select-search {
    padding: 6px;
    border-bottom: 1px solid var(--heco-neutral-200, #e5e7eb);
    background: var(--heco-neutral-50, #f8fafc);
}
.heco-admin .custom-select-search-input {
    width: 100%;
    padding: 5px 10px;
    font-size: 0.8125rem;
    border: 1px solid var(--heco-neutral-200, #e5e7eb);
    border-radius: 4px;
    background: #fff;
    outline: none;
    transition: border-color 0.15s ease;
}
.heco-admin .custom-select-search-input:focus {
    border-color: var(--heco-primary-700, #79a09f);
}
.heco-admin .custom-select-options {
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.heco-admin .custom-select-option {
    padding: 7px 12px;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.heco-admin .custom-select-option:hover {
    background: var(--heco-neutral-50, #f8f9fa);
    color: var(--heco-primary-700, #79a09f);
}
.heco-admin .custom-select-option.selected {
    background: var(--heco-primary-50, #f1f7f7);
    color: var(--heco-primary-700, #79a09f);
    font-weight: 600;
}
.heco-admin .custom-select-option.hidden {
    display: none;
}
.heco-admin .custom-select-empty {
    padding: 12px 14px;
    text-align: center;
    color: var(--heco-neutral-500, #6b7280);
    font-size: 0.8125rem;
}

/* Fixed-width helpers for inline filter controls (avoids inline styles). */
.heco-admin .heco-filter-xs { width: 100px; }
.heco-admin .heco-filter-sm { width: 140px; }
.heco-admin .heco-filter-md { width: 160px; }
.heco-admin .heco-filter-lg { width: 200px; }
.heco-admin .heco-filter-date { width: 150px; }
@media (max-width: 575.98px) {
    .heco-admin .heco-filter-xs,
    .heco-admin .heco-filter-sm,
    .heco-admin .heco-filter-md,
    .heco-admin .heco-filter-lg,
    .heco-admin .heco-filter-date { width: 100%; }
}

/* ---- Control Panel ---- */
.heco-admin .cp-scroll-box { max-height: 360px; overflow-y: auto; }
.heco-admin .cp-tabwrap { border-radius: 0 0 4px 4px; background: #fff; }
.heco-admin .cp-select-narrow { max-width: 320px; }
.heco-admin textarea.cp-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8125rem; }
.heco-admin .cp-list-check,
.heco-admin .cp-prompt-check { font-size: 1.05rem; color: var(--heco-primary-700, #79a09f); }
.heco-admin .cp-list-selall,
.heco-admin .cp-prompt-selall { font-size: 1.05rem; color: var(--heco-primary-700, #79a09f); cursor: pointer; }
.heco-admin .cp-checked { color: var(--heco-primary-700, #79a09f); }

/* ---- SP pricing section on provider edit ---- */
.heco-admin .sp-price-check,
.heco-admin .sp-price-selall { font-size: 1.05rem; color: var(--heco-primary-700, #79a09f); cursor: pointer; }
.heco-admin .sp-price-checked { color: var(--heco-primary-700, #79a09f); }

/* ---- Bulk-delete check icons (shared list pages) ---- */
.heco-admin .row-check,
.heco-admin .selall-check { font-size: 1.05rem; color: var(--heco-primary-700, #79a09f); cursor: pointer; }
.heco-admin .row-checked { color: var(--heco-primary-700, #79a09f); }

/* ---- Trips: inline per-row status dropdown width ---- */
.heco-admin .heco-trip-status { font-size: 0.75rem; }
.heco-admin td .custom-select-wrap { width: 150px; }

/* ---- Email test page ---- */
.heco-admin .email-test-card { max-width: 680px; }

/* ============================================================
   Utility classes (used to retire inline style= attributes
   per project coding rules — Rule 2: no inline CSS).
   ============================================================ */

/* Generic cursor + visibility helpers (Bootstrap's d-none covers display:none). */
.heco-admin .cursor-pointer { cursor: pointer; }

/* Table column widths used across admin list pages. */
.heco-admin .w-check     { width: 34px; }
.heco-admin .w-id        { width: 40px; }
.heco-admin .w-img-thumb { width: 60px; }
.heco-admin .w-sort      { width: 80px; }
.heco-admin .w-active    { width: 80px; }
.heco-admin .w-status    { width: 90px; }
.heco-admin .w-rate      { width: 150px; }
.heco-admin .w-paper     { width: 90px; }
.heco-admin .w-orient    { width: 110px; }
.heco-admin .w-actions   { width: 110px; }
.heco-admin .w-actions-md { width: 120px; }
.heco-admin .w-actions-lg { width: 140px; }
.heco-admin .w-cell-label { width: 140px; }
.heco-admin .w-cell-label-md { width: 160px; }
.heco-admin .w-when      { width: 150px; }
.heco-admin .w-user      { width: 160px; }
.heco-admin .w-key-col   { width: 35%; }
.heco-admin .w-day-col   { width: 14.28%; }

/* Calendar cell shell. */
.heco-admin .cal-cell { height: 100px; vertical-align: top; padding: 4px; }

/* Currency-flag image. */
.heco-admin .img-flag { width: 24px; height: 16px; object-fit: cover; border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.heco-admin .img-flag-plain { width: 24px; height: 16px; object-fit: cover; }

/* List-row gallery thumbnail (image:50x35, used on experiences index). */
.heco-admin .img-thumb-list { width: 50px; height: 35px; object-fit: cover; }

/* Edit-form gallery thumbnail (60x80, used on experience/regen edit forms). */
.heco-admin .img-thumb-gallery { width: 80px; height: 60px; object-fit: cover; }

/* Preview-image sizing on edit forms + JS-driven previews. */
.heco-admin .img-preview-md  { max-height: 120px; }
.heco-admin .img-preview-sm  { max-height: 100px; }
.heco-admin .img-preview-lg  { max-height: 180px; }

/* Scrollable inner panels used on dashboard / control panel / experience form. */
.heco-admin .scroll-panel-sm { max-height: 180px; overflow-y: auto; }
.heco-admin .scroll-panel-md { max-height: 300px; overflow-y: auto; }
.heco-admin .scroll-panel-lg { max-height: 400px; overflow-y: auto; }

/* Misc admin inline-style retirements. */
.heco-admin .month-label    { min-width: 140px; text-align: center; }
.heco-admin .input-pct      { width: 70px; }
.heco-admin .input-trip-search { width: 250px; }
.heco-admin .tp-leftcol     { min-width: 220px; }
.heco-admin .tp-rightcol    { width: 90px; }

/* Calendar trip badges inside cells. */
.heco-admin .cal-trip-badge {
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Day-card styling on the experience edit form (used by JS-built day rows). */
.heco-admin .day-card-shell      { border-left: 3px solid var(--admin-primary); background: #f0fdf4; }
.heco-admin .day-card-header     { background: rgba(255,255,255,0.6); border-bottom: 1px solid var(--admin-border); }
.heco-admin .day-card-badge      { background: var(--admin-primary); }
.heco-admin .day-card-textarea   { background: rgba(255,255,255,0.7); }

/* Extra-small badge font size (used for day-type chips in trip manager). */
.heco-admin .badge-xs { font-size: 10px; }

/* Admin SP calendar cell — selection/border + cursor states. */
.heco-admin .cursor-not-allowed { cursor: not-allowed; }
.heco-admin .admin-cal-day { border: 1px solid transparent; }
.heco-admin .admin-cal-day--selected { border: 2px solid #0d6efd; }

/* Experience inclusion chip row in the experiences list. */
.heco-admin .exp-inc-row  { display: flex; flex-wrap: wrap; gap: 2px; }
.heco-admin .exp-inc-chip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; margin: 1px; border-radius: 5px;
    font-size: 0.85rem; color: var(--heco-primary-700, #79a09f);
}

/* Service-type pill on the SP pricing table. */
.heco-admin .sp-type-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--heco-primary-50, #eef5f5);
    font-size: 0.78rem;
    font-weight: 600;
}

/* Admin SP calendar — per-room-category breakdown as a hover popover. */
.heco-admin .admin-cal-day { position: relative; }
/* Popover uses position: fixed so it escapes any ancestor with
   overflow: hidden; JS sets the actual top/left on hover. */
.heco-admin .admin-cal-day .admin-cal-rooms {
    display: none;
    position: fixed;
    z-index: 1080;
    min-width: 260px;
    max-width: 320px;
    max-height: 60vh;
    overflow-y: auto;
    background: #fff;
    color: #1f2937;
    border: 1px solid var(--heco-primary-200, #dceae9);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.3;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    text-align: left;
    pointer-events: auto;
    white-space: normal;
    scrollbar-width: thin;
}
.heco-admin .admin-cal-day:hover .admin-cal-rooms { display: block; }
.heco-admin .admin-cal-day .admin-cal-rooms-title {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.heco-admin .admin-cal-day .admin-cal-rooms-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--heco-primary-800, #496767);
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--heco-primary-100, #e8f0ef);
    padding-bottom: 4px;
    margin-bottom: 4px;
}
.heco-admin .admin-cal-day .admin-cal-room-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 2px 0;
}
.heco-admin .admin-cal-day .admin-cal-room-tier {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--heco-primary-100, #e8f0ef);
    color: var(--heco-primary-800, #496767);
    white-space: nowrap;
}
.heco-admin .admin-cal-day .admin-cal-room-name {
    flex: 1;
    color: #374151;
}
.heco-admin .admin-cal-day .admin-cal-room-avail {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Admin SP calendar cell states. The HECO brand override on .bg-success /
   .text-success forces solid turquoise, so Bootstrap's bg-opacity-25 utility
   results in same-colour text on background. Use dedicated state classes. */
.heco-admin .cal-cell-available {
    background-color: var(--heco-primary-100, #e8f0ef);
    color: var(--heco-primary-800, #496767);
}
.heco-admin .cal-cell-booked {
    background-color: #fdecea;
    color: #b91c1c;
}
.heco-admin .cal-cell-blocked {
    background-color: #e5e7eb;
    color: #4b5563;
}
.heco-admin .cal-room-row--ok      { color: var(--heco-primary-800, #496767); }
.heco-admin .cal-room-row--partial { color: #b45309; }
.heco-admin .cal-room-row--sold    { color: #b91c1c; }

/* SP pricing modal — keep paired columns the same visual height regardless
   of which one carries a data-desc help line. Each column is a flex-column
   and the trailing .form-help-text is pushed to the bottom with margin-top:
   auto. min-height reserves one line so empty slots don't collapse. */
.heco-admin .sp-field-row { align-items: stretch; }
.heco-admin .sp-field-row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}
.heco-admin .sp-field-row .form-help-text {
    margin-top: auto;
    min-height: 1.1em;
}

/* Comfort-tier auto-derived summary on provider edit. */
.heco-admin .auto-pill { font-weight: 400; font-size: 0.7rem; }
.heco-admin .comfort-tier-summary { min-height: 38px; }

/* Pending-pricing diff layout — left-aligned, compact, narrow label column. */
.heco-admin .pending-identity {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--heco-primary-100, #e8f0ef);
    margin-bottom: 8px;
    font-size: 0.875rem;
}
.heco-admin .diff-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.heco-admin .diff-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 4px 0;
    font-size: 0.875rem;
}
.heco-admin .diff-label {
    flex: 0 0 140px;
    /* Stated, like .diff-value below it. Alignment inherits, and a centred
       ancestor turned this column into centred text with a ragged left edge. */
    text-align: left;
    color: var(--color-text-muted, #6c757d);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}
.heco-admin .diff-value { flex: 1; text-align: left; }

/* One folded row per rate in the approvals queue. A transport rate carries
   fourteen fields, so a member who filed four left the reviewer scrolling a
   page of detail to reach the next one. The head stays readable closed. */
.heco-admin .pending-rate-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
}
.heco-admin .pending-rate-head:hover { background: var(--heco-primary-50, #f4f8f8); }
.heco-admin .pending-rate-head[aria-expanded="true"] {
    background: var(--heco-primary-50, #f4f8f8);
    border-bottom: 1px solid var(--heco-primary-100, #e8f0ef);
}
.heco-admin .pending-chevron { transition: transform 0.15s ease; font-size: 0.75rem; }
.heco-admin .pending-rate-head[aria-expanded="true"] .pending-chevron { transform: rotate(90deg); }
/* The identity can be long — let it shorten rather than push the price off. */
.heco-admin .pending-rate-identity {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.heco-admin .pending-rate-body { padding: 12px 16px 16px; }

/* A rate's add-ons and photos on the approvals card. Neither is a column, so
   the field diff above them cannot show either — they get their own block. */
.heco-admin .rate-extras { margin-bottom: 12px; }
.heco-admin .rate-extras-title {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    font-weight: 600;
    color: var(--color-text-muted, #6c757d);
    margin-bottom: 4px;
}
.heco-admin .addon-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    padding: 3px 0;
    font-size: 0.875rem;
}
.heco-admin .addon-name  { font-weight: 600; }
.heco-admin .addon-price { color: var(--color-text-muted, #6c757d); }
.heco-admin .addon-desc  {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #6c757d);
    padding-left: 2px;
    margin-bottom: 2px;
}
.heco-admin .addon-removed .addon-name { text-decoration: line-through; }
.heco-admin .addon-removed { opacity: 0.7; }

.heco-admin .rate-photo-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.heco-admin .rate-photo { display: inline-block; line-height: 0; }
.heco-admin .rate-photo-added img   { border-color: #198754 !important; border-width: 2px !important; }
.heco-admin .rate-photo-removed img { opacity: 0.4; filter: grayscale(1); border-color: #dc3545 !important; }

/* Room Types checklist — tier-first accommodation form. */
.heco-admin .room-type-checklist { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.heco-admin .room-type-chip      { margin: 0; cursor: pointer; }

/* Form-control-sm — provider/SP pricing forms use the small Bootstrap input
   variant. Bump padding slightly so inputs render at ~39px, matching the
   compact custom-select dropdown height beside them. */
.heco-admin .form-control-sm {
    min-height: calc(1.5em + .5rem + calc(var(--bs-border-width) * 2));
    padding: 0.50rem .5rem;
    font-size: .875rem;
    border-radius: var(--bs-border-radius-sm);
}
.heco-admin .custom-select-wrap:has(select.form-select-sm) .custom-select-trigger {
    padding: 0.50rem 1.75rem 0.50rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    min-height: calc(1.5em + .5rem + calc(var(--bs-border-width) * 2));
    border-radius: var(--bs-border-radius-sm);
}

/* Experience per-person price slabs (req 3.2) — narrow, tidy pricing table. */
.exp-slab-table { max-width: 520px; }
.exp-slab-table .exp-slab-col { width: 140px; }

/* Password fields with a show/hide eye — admin login and the Edit HCT User
   modal. Mirrors the portal's .password_toggle so both sides behave alike. */
.admin-password-field { position: relative; }
.admin-password-field .form-control { padding-right: 38px; }
.admin-password-field .password_toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: #6b7280;
    cursor: pointer;
    background: transparent;
}
.admin-password-field .password_toggle:hover,
.admin-password-field .password_toggle:focus-visible {
    color: #79a09f;
    outline: none;
}
.admin-password-field .password_toggle i { font-size: 1rem; line-height: 1; }
