/* Native Bookings admin UI (PitBox) — plain HTML/CSS/JS.
 * Theme: true black, #FF0000 accent, #fff text, #888 muted.
 */

.ba-page-header .page-title {
    margin-bottom: 6px;
}

.ba-toolbar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin: 14px 0 16px;
}

.ba-glass-card {
    background: linear-gradient(145deg, rgba(26,26,26,0.95) 0%, rgba(17,17,17,0.98) 100%);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.ba-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.ba-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.ba-input, .ba-select {
    background: var(--bg-dark);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    color: var(--text-white);
    padding: 8px 12px;
    font-size: 0.9rem;
}

.ba-input:focus, .ba-select:focus {
    outline: none;
    border-color: var(--color-red-primary);
}

.ba-btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.ba-inline-error {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255,0,0,0.08);
    border: 1px solid rgba(255,0,0,0.35);
    color: #fff;
    display: none;
}
.ba-inline-error.show { display: block; }

.ba-loading {
    padding: 18px;
    color: var(--text-muted);
}

/* Table */
.ba-table-wrap {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.ba-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ba-table thead th {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-align: left;
    padding: 12px 14px;
}

.ba-table tbody td {
    padding: 12px 14px;
    vertical-align: middle;
}

.ba-table tbody tr:nth-child(odd) { background: #0a0a0a; }
.ba-table tbody tr:nth-child(even) { background: #000000; }
.ba-table tbody tr:hover { background: rgba(255,255,255,0.04); }
.ba-table tbody tr.ba-row-click { cursor: pointer; }

/* Badges */
.ba-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid var(--border-gray);
    color: var(--text-white);
}

.ba-badge--red { background: rgba(255,0,0,0.12); border-color: rgba(255,0,0,0.4); color: #fff; }
.ba-badge--green { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.35); color: #fff; }
.ba-badge--gray { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); color: #888; }

.ba-sim-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ba-sim-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Modal */
.ba-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.65);
    display: none;
}
.ba-modal-overlay.show { display: block; }

.ba-modal-panel {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 520px;
    max-width: 100%;
    background: #0a0a0a;
    border-left: 1px solid var(--border-gray);
    transform: translateX(24px);
    opacity: 0;
    transition: transform 0.18s ease, opacity 0.18s ease;
    overflow-y: auto;
}
.ba-modal-overlay.show .ba-modal-panel {
    transform: translateX(0);
    opacity: 1;
}

.ba-modal-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.ba-modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ba-modal-close {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.14);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}
.ba-modal-close:hover { border-color: var(--color-red-primary); }

.ba-modal-body {
    padding: 18px;
}

.ba-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 14px;
}

.ba-detail-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 12px;
}

.ba-detail-item .ba-k { color: #888; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.ba-detail-item .ba-v { color: #fff; font-weight: 700; margin-top: 6px; word-break: break-word; }

.ba-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.ba-section-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-white);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

/* Assign sims */
.ba-sim-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.ba-sim-btn {
    padding: 10px 0;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.03);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
}
.ba-sim-btn.active {
    background: rgba(255,0,0,0.15);
    border-color: rgba(255,0,0,0.5);
}

/* Check-in cards */
.ba-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 900px) {
    .ba-card-grid { grid-template-columns: 1fr 1fr; }
}
.ba-checkin-card {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ba-checkin-card-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}
.ba-checkin-name {
    font-size: 1.05rem;
    font-weight: 900;
}
.ba-checkin-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

.ba-checkin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* Schedule */
.ba-schedule-scroll {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.08);
    background: #000;
}
.ba-schedule-header {
    display: grid;
    align-items: center;
    gap: 0;
    background: #0a0a0a;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ba-schedule-head-cell {
    padding: 10px 8px;
    text-align: center;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    border-right: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
}
.ba-schedule-head-cell:last-child { border-right: none; }

.ba-schedule-row {
    display: grid;
    align-items: stretch;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ba-schedule-row:last-child { border-bottom: none; }
.ba-schedule-row-label {
    padding: 12px 10px;
    border-right: 1px solid rgba(255,255,255,0.06);
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #fff;
}

.ba-sim-timeline {
    position: relative;
    background: #000;
}

.ba-slot-cell {
    border-right: 1px solid rgba(255,255,255,0.06);
}

.ba-schedule-block {
    position: absolute;
    top: 8px;
    height: calc(100% - 16px);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,0,0,0.12);
    cursor: pointer;
    padding: 10px 10px;
    overflow: hidden;
}

.ba-schedule-block:hover {
    border-color: rgba(255,0,0,0.55);
}

.ba-schedule-block--green { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.35); }
.ba-schedule-block--gray { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12); color: #888; }

.ba-block-name {
    font-weight: 900;
    font-size: 0.85rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ba-block-sub {
    margin-top: 6px;
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Analytics */
.ba-analytics-kpis {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 900px) {
    .ba-analytics-kpis { grid-template-columns: repeat(4, 1fr); }
}
.ba-kpi-tile {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}
.ba-kpi-label {
    color: #888;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 800;
}
.ba-kpi-value {
    color: #fff;
    font-size: 1.6rem;
    margin-top: 6px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.ba-analytics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 14px;
}
@media (min-width: 1100px) {
    .ba-analytics-grid { grid-template-columns: 1.4fr 0.9fr; }
}

.ba-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 160px;
    padding: 10px 10px 0;
}
.ba-bar {
    width: 16px;
    border-radius: 10px;
    background: rgba(255,0,0,0.35);
    border: 1px solid rgba(255,0,0,0.55);
}
.ba-bar-labels {
    display: flex;
    gap: 10px;
    padding: 8px 10px 0;
    color: #888;
    font-size: 0.75rem;
    overflow: hidden;
}
.ba-status-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ba-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
}


/* ========== Booking sub-tab navigation ========== */
.ba-sub-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 0;
}
.ba-sub-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #888;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 16px 10px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.ba-sub-tab:hover {
    color: #fff;
}
.ba-sub-tab.active {
    color: #fff;
    border-bottom-color: #FF0000;
}
.ba-sub-panel {
    /* shown by default; .hidden hides it */
}
.ba-sub-panel.hidden {
    display: none !important;
}


/* ========== Panel containers ========== */
.ba-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    padding: 0 16px 16px;
}
.ba-panel .ba-table-wrap {
    overflow-y: auto;
    flex: 1;
}
.ba-schedule-wrap {
    overflow-y: auto;
    flex: 1;
}
.ba-checkin-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 0;
}

/* ========== Sub-nav fix for full-height layout ========== */
#page-bookings {
    overflow: hidden;
}
.ba-sub-nav {
    flex-shrink: 0;
    padding: 0 16px;
    margin-bottom: 0;
}

/* ========== Error bar ========== */
.ba-error {
    display: none;
    margin: 6px 0 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255,0,0,0.08);
    border: 1px solid rgba(255,0,0,0.35);
    color: #fff;
    font-size: 0.9rem;
}
.ba-error.show { display: block; }
.ba-detail-error-bar {
    margin: 0 18px 12px;
}

/* ========== Overlay modal ========== */
.ba-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
}
.ba-overlay.show {
    display: flex;
}
.ba-modal {
    background: #0d0d0d;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.ba-modal--wide { max-width: 680px; }

/* ========== Form rows ========== */
.ba-form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.ba-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.ba-panel-title {
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
}

/* ========== Small action buttons ========== */
.ba-btn-sm {
    font-size: 0.78rem !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
}

/* ========== Analytics ID selectors ========== */
#ba-analytics-kpis {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 14px;
}
@media (min-width: 900px) {
    #ba-analytics-kpis { grid-template-columns: repeat(4, 1fr); }
}
#ba-analytics-bars {
    margin-top: 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 8px;
}
#ba-analytics-status {
    margin-top: 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 8px;
}
.ba-period-btn.active {
    background: rgba(255,0,0,0.12) !important;
    border-color: rgba(255,0,0,0.45) !important;
    color: #fff !important;
}

/* Iframe booking panel fills all available height */
.ba-panel--iframe {
    padding: 0;
    flex: 1;
    min-height: 0;
}
.ba-panel--iframe iframe {
    display: block;
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
}
