/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
    --ink: #13232B;
    --ink-2: #1C3139;
    --ink-text: #A9BAC0;
    --surface: #F2F4F3;
    --card: #FFFFFF;
    --line: #E1E6E4;
    --line-2: #EDF0EF;
    --text: #1B2A31;
    --muted: #66757B;
    --brand: #0B7A75;
    --brand-dark: #08615D;
    --brand-soft: #E3F1EF;
    --signal: #C9731E;
    --signal-soft: #FBF0E4;
    --ok: #2E7D4F;
    --ok-soft: #E6F2EA;
    --danger: #B83A28;
    --danger-soft: #F9E7E3;
    --radius-lg: 14px;
    --radius: 10px;
    --radius-sm: 7px;
    --sidebar-w: 248px;
    --topbar-h: 64px;
    --font-ui: 'Figtree', 'Segoe UI', system-ui, sans-serif;
    --font-display: 'Bricolage Grotesque', 'Figtree', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
body {
    background-color: var(--surface);
    font-family: var(--font-ui);
    color: var(--text);
    font-size: 0.95rem;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* =========================================================
   APP SHELL
   ========================================================= */
.sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--ink);
    color: var(--ink-text);
    display: flex; flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
    /* Closed by default on every screen size - opens only via the topbar toggle button,
       and closes again either by clicking the backdrop or navigating to another page. */
    transform: translateX(-100%);
}
body.sb-open .sidebar { transform: none; }
body.sb-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(19,35,43,.4); z-index: 1035; }
.sb-brand { display: flex; align-items: center; gap: 12px; height: var(--topbar-h); padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sb-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: #fff; font-size: .95rem; }
.sb-name { color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; line-height: 1.1; }
.sb-sub { font-size: .75rem; color: var(--ink-text); }

.sb-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.sb-group { font-size: .78rem; color: #7E949B; padding: 16px 10px 6px; }
.sb-group:first-child { padding-top: 4px; }
.sb-link {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 10px; margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--ink-text); text-decoration: none;
    font-size: .9rem; font-weight: 500;
    cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
}
.sb-link i { width: 18px; text-align: center; font-size: .92rem; }
.sb-link:hover { background: var(--ink-2); color: #fff; }
.sb-link.active { background: var(--brand); color: #fff; }
.sb-link .sb-count { margin-left: auto; font-size: .72rem; font-weight: 600; background: rgba(255,255,255,.1); color: #fff; padding: 1px 8px; border-radius: 20px; }
.sb-link.active .sb-count { background: rgba(255,255,255,.22); }
.sb-link .sb-soon { margin-left: auto; font-size: .7rem; color: #7E949B; }

.sb-foot { padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.06); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #E8B04A; color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: .82rem; flex-shrink: 0; }
.sb-user .n { color: #fff; font-size: .88rem; font-weight: 600; line-height: 1.2; }
.sb-user .r { font-size: .75rem; }

.main { margin-left: 0; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 1030;
    height: var(--topbar-h);
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 16px;
    padding: 0 28px;
}
.tb-toggle { display: block; border: 0; background: none; font-size: 1.15rem; color: var(--text); padding: 6px; }
.tb-crumb { font-size: .8rem; color: var(--muted); line-height: 1.2; }
.tb-title { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; line-height: 1.2; }
.tb-search { position: relative; width: 300px; max-width: 32vw; }
.topbar .dropdown { margin-left: auto; }
.tb-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; }
.tb-search input { width: 100%; height: 38px; padding: 0 12px 0 34px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: .88rem; }
.tb-search input:focus { outline: none; border-color: var(--brand); background: #fff; }
.tb-icon { width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; color: var(--text); display: grid; place-items: center; position: relative; }
.tb-icon .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); border: 2px solid #fff; }

.content { padding: 28px; flex: 1; }

.btn-brand { background: var(--brand); color: #fff; border: 0; border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; padding: 9px 16px; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); color: #fff; }
.btn-quiet { background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 600; font-size: .85rem; padding: 7px 13px; }
.btn-quiet:hover { border-color: #C5CFCC; background: #FAFBFB; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.panel-hd { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.panel-hd h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.panel-hd .sub { font-size: .8rem; color: var(--muted); }
.panel-hd .actions { margin-left: auto; }
.panel-bd { padding: 20px; }

/* =========================================================
   DASHBOARD
   NOTE: "Today's car pickups" runway/timeline widget and its
   CSS have been intentionally removed from this file per request.
   ========================================================= */
.dash-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-head h1 { font-size: 1.7rem; font-weight: 700; margin: 0 0 4px; }
.dash-head p { margin: 0; color: var(--muted); }
.dash-head .actions { margin-left: auto; display: flex; gap: 8px; }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; }
.kpi .k-label { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi .k-label i { color: var(--brand); }
.kpi .k-value { font-family: var(--font-display); font-size: 1.85rem; font-weight: 700; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .k-note { font-size: .8rem; color: var(--muted); }
.kpi .k-note.up { color: var(--ok); }
.kpi .k-note.warn { color: var(--signal); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }

.start-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.start-tile { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-align: left; cursor: pointer; width: 100%; }
.start-tile:hover { border-color: var(--brand); }
.start-tile .ico { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.start-tile .t { font-weight: 600; font-size: .92rem; }
.start-tile .s { font-size: .78rem; color: var(--muted); }
.start-tile.is-soon .ico { background: var(--line-2); color: var(--muted); }

.table-crm { width: 100%; margin: 0; font-size: .88rem; }
.table-crm th { font-weight: 600; color: var(--muted); font-size: .8rem; padding: 10px 16px; border-bottom: 1px solid var(--line-2); white-space: nowrap; background: #FAFBFB; }
.table-crm td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap; }
.table-crm tr:last-child td { border-bottom: 0; }
.table-crm tbody tr:hover td { background: #FAFBFB; }
.ref { font-weight: 600; font-variant-numeric: tabular-nums; }
.prod { display: inline-flex; align-items: center; gap: 7px; }
.prod i { color: var(--muted); width: 16px; text-align: center; }
.status { display: inline-block; font-size: .76rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.st-confirmed { background: var(--ok-soft); color: var(--ok); }
.st-pending { background: var(--signal-soft); color: var(--signal); }
.st-cancelled { background: var(--danger-soft); color: var(--danger); }
.st-declined { background: var(--danger-soft); color: var(--danger); }
.st-refunded { background: var(--danger-soft); color: var(--danger); }
.st-voided { background: var(--danger-soft); color: var(--danger); }
.st-expired { background: #ECEFF0; color: #5B676C; }
.st-partial { background: var(--signal-soft); color: var(--signal); }

/* My Bookings grid: is this booking still being live-checked? Green blinking = yes, nothing = not (or no longer) in the live check. */
.pool-dot { display: none; width: 7px; height: 7px; border-radius: 50%; margin-left: 8px; vertical-align: middle; }
.pool-dot.on { display: inline-block; background: var(--ok); animation: poolPulse 1.6s ease-in-out infinite; }
@keyframes poolPulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.st-modified { background: var(--brand-soft); color: var(--brand); }
.st-ticketed { background: var(--brand-soft); color: var(--brand); }

.link-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.link-item:last-child { border-bottom: 0; }
.link-item .who { font-weight: 600; font-size: .9rem; }
.link-item .meta { font-size: .78rem; color: var(--muted); }
.link-item .amt { margin-left: auto; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.link-item .age { font-size: .75rem; color: var(--signal); font-weight: 500; }

.table-wrap { overflow-x: auto; }
/* My bookings: the list scrolls up and down inside its box and the header row stays in view. */
.table-wrap-scroll { max-height: calc(100vh - 260px); min-height: 260px; overflow-y: auto; }
.table-wrap-scroll .table-crm th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--line-2); }
/* Dashboard "Payment links waiting": about five rows show, the rest scroll. */
.link-list-scroll { max-height: 320px; overflow-y: auto; }

/* =========================================================
   BOOKING PAGE LAYOUT
   ========================================================= */
.bk-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.bk-head h1 { font-size: 1.55rem; font-weight: 700; margin: 0 0 4px; }
.bk-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.bk-head .draft { margin-left: auto; font-size: .8rem; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 5px 12px; }

.product-tabs { display: flex; gap: 6px; margin-bottom: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.product-tabs button { border: 0; background: none; padding: 10px 14px; margin-bottom: -1px; font-weight: 600; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.product-tabs button i { margin-right: 7px; }
.product-tabs button:hover { color: var(--text); }
.product-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

.bk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }

.booking-container { max-width: none; margin: 0; }
.custom-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: none;
    margin-bottom: 20px;
    overflow: visible;
    scroll-margin-top: calc(var(--topbar-h) + 20px);
}
.card-header-custom {
    background-color: transparent;
    border-bottom: 1px solid var(--line-2);
    padding: 16px 22px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--text);
    display: flex;
    align-items: center;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card-header-custom .step-no { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-family: var(--font-ui); font-size: .8rem; font-weight: 700; display: grid; place-items: center; margin-right: 12px; flex-shrink: 0; }
.custom-card.is-complete .step-no { background: var(--brand); color: #fff; }
.card-header-custom i { color: var(--muted); margin-right: 10px; font-size: 1rem; }
.card-body-custom { padding: 22px; }

.form-label { font-weight: 600; font-size: .84rem; color: #3E4E55; margin-bottom: 7px; }
.form-control, .form-select { border-radius: var(--radius-sm); border: 1px solid #D5DCDA; padding: 9px 13px; font-size: .92rem; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.form-control::placeholder { color: #9AA6AA; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,122,117,.14); }
.form-control[readonly] { background-color: #fff; cursor: pointer; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(11,122,117,.14); border-color: var(--brand); }
.text-danger { color: var(--danger) !important; }

/* Provider & Car dropdown (rendered from the database, not S3 directly) */
.dropdown-search-box { position: relative; }
.dropdown-search-box > .form-control[readonly] {
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2366757B' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 13px center; background-size: 12px;
}
.dropdown-menu-custom { width: 100%; max-height: 350px; overflow-y: auto; padding: 0; border-radius: var(--radius); box-shadow: 0 14px 34px rgba(19,35,43,.14); border: 1px solid var(--line); z-index: 1050; }
.dropdown-item-custom { display: flex; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .15s; }
.dropdown-item-custom:hover { background-color: #F6F8F7; }
.dropdown-item-custom.active { background-color: var(--brand-soft); }
.provider-logo { width: 65px; height: 42px; object-fit: contain; margin-right: 14px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background-color: #fff; }
.provider-info h6 { margin: 0; font-size: .92rem; font-weight: 600; color: var(--text); word-break: break-all; }
.provider-info p { margin: 0; font-size: .78rem; color: var(--muted); }
.check-icon { margin-left: auto; color: var(--brand); display: none; }
.dropdown-item-custom.active .check-icon { display: block; }

.s3-diag-error { color: var(--danger); font-size: .78rem; margin-top: 6px; line-height: 1.4; }
.s3-diag-error:empty { display: none; }

/* =========================================================
   SUPER ADMIN - MEDIA MANAGER (Car Model / Rental Provider images)
   ========================================================= */
.upload-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.upload-form .field { flex: 1; min-width: 200px; }
.upload-msg { display: inline-block; font-size: .84rem; margin-left: 10px; font-weight: 600; }
.upload-msg.success { color: var(--ok); }
.upload-msg.error { color: var(--danger); }

.media-search { position: relative; max-width: 320px; margin-bottom: 16px; }
.media-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; pointer-events: none; }
.media-search input { padding-left: 34px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.media-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; position: relative; }
.media-card .thumb { width: 100%; height: 100px; object-fit: contain; background: #F7F9F8; padding: 8px; display: block; }
.media-card .name { padding: 8px 10px; font-size: .82rem; font-weight: 600; word-break: break-word; }
.media-card .delete-btn {
    position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%;
    background: rgba(255,255,255,.92); border: 1px solid var(--line); color: var(--danger);
    display: grid; place-items: center; cursor: pointer; font-size: .8rem;
}
.media-card .delete-btn:hover { background: var(--danger-soft); }
.media-empty { color: var(--muted); font-size: .88rem; padding: 12px 0; }

/* =========================================================
   EMAIL TEMPLATE EDITOR - Code / Preview tabs
   ========================================================= */
.editor-tabs { display: inline-flex; background: var(--surface); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.editor-tab { border: 0; background: none; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 5px 14px; border-radius: 6px; }
.editor-tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.preview-toolbar { margin-bottom: 8px; }
.device-toggle { display: inline-flex; background: var(--surface); border-radius: var(--radius-sm); padding: 3px; gap: 2px; flex-shrink: 0; }
.device-toggle .editor-tab { padding: 5px 10px; }

/* Template list item (light panel, NOT the dark sidebar) */
.tpl-list-item {
    display: block; width: 100%; text-align: left;
    padding: 10px 16px; border: 0; background: none;
    font-size: .88rem; font-weight: 500; color: var(--text);
    border-bottom: 1px solid var(--line-2); text-decoration: none;
}
.tpl-list-item:hover { background: var(--surface); color: var(--text); }
.tpl-list-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }

.btn-quiet.disabled, .btn-quiet:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-brand:disabled { opacity: .5; cursor: not-allowed; background: var(--muted); border-color: var(--muted); }
.editor-tab:disabled { opacity: .45; cursor: not-allowed; }

.car-preview-box { display: flex; align-items: center; border: 1px dashed #9CCBC7; background-color: #F4FAF9; border-radius: var(--radius-sm); padding: 8px 14px; min-height: 62px; }
.car-preview-box img { width: 75px; height: 46px; object-fit: contain; border-radius: 4px; margin-right: 14px; background: #fff; border: 1px solid var(--line); padding: 2px; }
.car-preview-title { font-size: .92rem; font-weight: 600; color: var(--brand); margin: 0; word-break: break-all; }
.car-preview-subtitle { font-size: .78rem; color: var(--muted); margin: 0; }

.pay-choice .form-check-inline { margin-right: 10px; margin-bottom: 8px; padding: 11px 16px 11px 40px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.pay-choice .form-check-inline:has(.form-check-input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pay-choice .form-check-label { font-weight: 600 !important; font-size: .9rem; cursor: pointer; }
.pay-choice .form-check-input { cursor: pointer; }

#manualSection h6, #linkSection h6 { font-size: .88rem; font-weight: 700; color: var(--text) !important; }
#manualSection, #linkSection { border-color: var(--line-2) !important; }

.charge-details-section { background: #F7F9F8; border-radius: var(--radius); padding: 20px; border: 1px solid var(--line-2); }
.charge-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.charge-row:last-child { margin-bottom: 0; }
.summary-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .88rem; color: #45555B; font-variant-numeric: tabular-nums; }
.summary-row.total { font-weight: 700; font-size: 1.02rem; color: var(--text); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.btn-add-charge { border: 1px dashed #B9C5C2; background: #fff; color: var(--brand); font-size: .86rem; padding: 7px 14px; border-radius: var(--radius-sm); font-weight: 600; transition: border-color .15s, background .15s; }
.btn-add-charge:hover { background: var(--brand-soft); border-color: var(--brand); }
.btn-remove { color: var(--danger); background: none; border: none; font-size: 1rem; margin-top: 34px; cursor: pointer; padding: 0 4px; }
.btn-remove:hover { color: #8E2B1D; }

.form-actions { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 18px; margin-bottom: 30px; }
.form-actions .hint { font-size: .84rem; color: var(--muted); margin-right: auto; }
.form-actions .btn-primary { background: var(--brand); border-color: var(--brand); font-size: 1rem !important; padding: 10px 26px !important; }
.form-actions .btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

/* =========================================================
   BOOKING SUMMARY RAIL
   ========================================================= */
.rail { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 16px; }
.steps { list-style: none; margin: 0; padding: 8px; }
.steps li button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: var(--radius-sm); font-size: .88rem; font-weight: 500; color: var(--muted); }
.steps li button:hover { background: #F6F8F7; color: var(--text); }
.steps li button.current { color: var(--text); font-weight: 600; background: #F6F8F7; }
.steps .s-ico { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #C5CFCC; display: grid; place-items: center; font-size: .68rem; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.steps li.done .s-ico { background: var(--brand); border-color: var(--brand); color: #fff; }
.steps .s-opt { margin-left: auto; font-size: .74rem; color: #9AA6AA; }

.sum-block { padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.sum-block:last-child { border-bottom: 0; }
.sum-k { font-size: .76rem; color: var(--muted); margin-bottom: 3px; }
.sum-v { font-size: .9rem; font-weight: 600; word-break: break-word; }
.sum-v.empty { color: #A4AFB2; font-weight: 500; }
.sum-car { display: flex; align-items: center; gap: 12px; }
.sum-car img { width: 64px; height: 40px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.sum-route { position: relative; padding-left: 18px; }
.sum-route::before { content: ''; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.sum-route .leg { position: relative; margin-bottom: 10px; }
.sum-route .leg:last-child { margin-bottom: 0; }
.sum-route .leg::before { content: ''; position: absolute; left: -18px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); }
.sum-route .leg.drop::before { background: var(--brand); }
.sum-money .row-m { display: flex; justify-content: space-between; font-size: .86rem; color: #45555B; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.sum-money .row-m.counter span:last-child { color: var(--signal); }
.sum-money .row-m.tot { font-size: 1.05rem; font-weight: 700; color: var(--text); border-top: 1px solid var(--line-2); padding-top: 10px; margin: 10px 0 0; }
.sum-method { display: inline-block; font-size: .75rem; font-weight: 600; background: var(--brand-soft); color: var(--brand); padding: 2px 9px; border-radius: 20px; }

.empty-state { text-align: center; padding: 60px 20px; max-width: 460px; margin: 0 auto; }
.empty-state .ico { width: 64px; height: 64px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 1.5rem; margin: 0 auto 16px; }
.empty-state h2 { font-size: 1.2rem; font-weight: 700; }
.empty-state p { color: var(--muted); }

.crm-toast {
    position: fixed; right: 24px; bottom: 24px; z-index: 2000;
    background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--radius);
    font-size: .88rem; display: flex; align-items: center; gap: 10px;
    transform: translateY(20px); opacity: 0; pointer-events: none;
    transition: all .2s ease;
}
.crm-toast.show { transform: none; opacity: 1; }
.crm-toast i { color: #7FD1C8; }

.sb-backdrop { display: none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1199px) {
    .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .dash-grid { grid-template-columns: 1fr; }
    .bk-layout { grid-template-columns: 1fr; }
    .rail { position: static; }
    .rail .steps-panel { display: none; }
}
@media (max-width: 991px) {
    .tb-search { display: none; }
    .topbar .dropdown { margin-left: auto; }
    .topbar { padding: 0 16px; }
    .content { padding: 20px 16px; }
}
@media (max-width: 767px) {
    .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
    .kpi .k-value { font-size: 1.5rem; }
    .start-grid { grid-template-columns: 1fr; }
    .charge-row { flex-wrap: wrap; }
    .charge-row > .flex-grow-1 { flex-basis: 100%; }
    .card-body-custom { padding: 18px; }
    .form-actions { flex-direction: column; align-items: stretch; }
    .form-actions .hint { margin: 0; }
    .nb-text { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

/* =========================================================
   BOOKING DETAILS PAGE + LIVE STATUS PANEL
   ========================================================= */
.table-crm td.ref a { color: var(--brand); text-decoration: none; }
.table-crm td.ref a:hover { text-decoration: underline; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.detail-rail { position: sticky; top: calc(var(--topbar-h) + 20px); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.detail-grid dt { font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.detail-grid dd { margin: 0; font-weight: 600; word-break: break-word; }
.remark-item { padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: .9rem; }
.remark-item:last-child { border-bottom: 0; }
.remark-meta { font-size: .76rem; color: var(--muted); margin-top: 3px; }
/* Previous notes: the list scrolls inside its own box, so a booking with many notes does not make the page longer and longer */
.remarks-scroll { max-height: 320px; overflow-y: auto; padding-right: 8px; }
.bk-head h1 .status { font-size: .8rem; vertical-align: middle; margin-left: 8px; }

.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); display: inline-block; margin-right: 8px; animation: livePulse 1.6s infinite; }
@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(46,125,79,.5); }
    70% { box-shadow: 0 0 0 7px rgba(46,125,79,0); }
    100% { box-shadow: 0 0 0 0 rgba(46,125,79,0); }
}
.live-stamp { margin-left: auto; font-family: var(--font-ui); font-size: .74rem; font-weight: 500; color: var(--muted); }
.live-stamp.live-error { color: var(--danger); }

.status-block { padding: 14px 22px; border-bottom: 1px solid var(--line-2); }
.status-block .k { font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.status-block .note { font-size: .82rem; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.status-block .meta { font-size: .8rem; color: #45555B; margin-top: 6px; word-break: break-word; }

.timeline { list-style: none; margin: 0; padding: 16px 22px 6px; }
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.tl-item::before { content: ''; position: absolute; left: 6px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #C5CFCC; background: #fff; flex-shrink: 0; margin-top: 3px; position: relative; z-index: 1; }
.tl-item.done .tl-dot { background: var(--brand); border-color: var(--brand); }
.tl-title { font-weight: 600; font-size: .87rem; }
.tl-time { font-size: .77rem; color: var(--muted); }

@media (max-width: 1199px) {
    .detail-layout { grid-template-columns: 1fr; }
    .detail-rail { position: static; }
}
@media (max-width: 575px) {
    .detail-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   DNIS BOX (car booking form)
   ========================================================= */
.dnis-status { font-size: .8rem; margin-top: 6px; line-height: 1.4; color: var(--muted); }
.dnis-status:empty { display: none; }
.dnis-status.ok { color: var(--ok); }
.dnis-status.bad { color: var(--danger); }
#btnDnisRefresh.spinning i { animation: dnisSpin .8s linear infinite; }
@keyframes dnisSpin { to { transform: rotate(360deg); } }

/* Chargeback alert at the very top of Booking Details: red, calm, with a soft pulse and a blinking dot */
.chargeback-alert { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 14px 18px; border: 1px solid #fecaca; border-left: 5px solid #dc2626; border-radius: 12px; background: #fef2f2; color: #7f1d1d; animation: cbPulse 1.8s ease-in-out infinite; }
.chargeback-alert .cb-dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; background: #dc2626; animation: cbBlink 1.1s ease-in-out infinite; }
.chargeback-alert .cb-body { flex: 1 1 auto; min-width: 0; }
.chargeback-alert .cb-title { font-weight: 800; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; color: #991b1b; }
.chargeback-alert .cb-text { margin-top: 2px; font-size: 0.95rem; }
.chargeback-alert .cb-text strong { font-size: 1.05rem; }
.chargeback-alert .cb-meta { margin-top: 3px; font-size: 0.78rem; color: #b91c1c; overflow-wrap: anywhere; }
.chargeback-alert .cb-link { flex: 0 0 auto; font-size: 0.8rem; font-weight: 700; color: #991b1b; text-decoration: underline; }
@keyframes cbPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); background: #fef2f2; } 50% { box-shadow: 0 0 0 7px rgba(220, 38, 38, 0); background: #fee2e2; } }
@keyframes cbBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
@media (max-width: 576px) { .chargeback-alert { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { .chargeback-alert, .chargeback-alert .cb-dot { animation: none; } }

/* Regular customer note under the email / phone fields of a new booking: green and calm */
.regular-customer { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 12px 18px; border: 1px solid #bbf7d0; border-left: 5px solid #16a34a; border-radius: 12px; background: #f0fdf4; color: #14532d; }
.regular-customer .rc-icon { flex: 0 0 auto; color: #16a34a; font-size: 1.1rem; }
.regular-customer .rc-title { font-weight: 800; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; color: #166534; }
.regular-customer .rc-text { margin-top: 2px; font-size: 0.92rem; }

/* Flight Booking page: one box for each flight of the itinerary and for each passenger */
.flt-row { padding: 14px 16px 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.flt-row:last-child { margin-bottom: 0; }
.flt-row-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.flt-row-hd .flt-title { font-weight: 700; font-size: 0.9rem; color: var(--brand-dark); }
.flt-row-hd .btn-remove { margin-top: 0; font-size: 0.82rem; }
.flt-note { margin-top: 10px; font-size: 0.82rem; color: var(--muted); }
.flt-group { margin-bottom: 18px; }
.flt-group:last-child { margin-bottom: 0; }
.flt-group-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.flt-group-title { font-weight: 700; font-size: 0.95rem; color: var(--ink, inherit); }
.ap-cap { margin-top: 3px; font-size: 0.76rem; color: var(--muted); min-height: 1em; }
.ap-cap.bad { color: #c0392b; }
.ap-list { position: absolute; z-index: 2000; display: none; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(15, 30, 60, .16); max-height: 300px; overflow-y: auto; }
.ap-item { display: flex; gap: 10px; align-items: baseline; padding: 7px 12px; cursor: pointer; font-size: 0.86rem; }
.ap-item:hover, .ap-item.active { background: rgba(42, 82, 152, .10); }
.ap-code { font-weight: 700; min-width: 38px; color: var(--brand-dark); }
.ap-desc { color: var(--muted); }
.al-trigger { width: 100%; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-trigger.empty { color: var(--muted); }
.al-panel { position: absolute; z-index: 2000; display: none; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(15, 30, 60, .16); }
.al-search-wrap { padding: 8px; border-bottom: 1px solid var(--line-2); }
.al-items { max-height: 216px; overflow-y: auto; }
.al-item { padding: 7px 12px; cursor: pointer; font-size: 0.88rem; }
.al-item:hover, .al-item.active { background: rgba(42, 82, 152, .10); }
.al-code { color: var(--muted); }
.al-logo { width: 26px; height: 18px; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.al-logo-none { display: inline-block; }
.al-item .al-logo { background: #fff; }
.app-version { display: inline-block; font-size: .72rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; background: var(--card); }
.al-none { padding: 10px 12px; font-size: 0.86rem; color: var(--muted); }
/* Flight Booking: Cabin class / Booking For / Supplier Name - the same button + search box look as the Airline dropdown */
.pk-trigger { width: 100%; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-trigger.empty { color: var(--muted); }
.pk-panel { position: absolute; z-index: 2000; display: none; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(15, 30, 60, .16); }
.pk-search-wrap { padding: 8px; border-bottom: 1px solid var(--line-2); }
.pk-items { max-height: 216px; overflow-y: auto; }
.pk-item { padding: 7px 12px; cursor: pointer; font-size: 0.88rem; }
.pk-item:hover, .pk-item.active { background: rgba(42, 82, 152, .10); }
.pk-item .al-logo { background: #fff; }
.pk-code { color: var(--muted); }
.pk-none { padding: 10px 12px; font-size: 0.86rem; color: var(--muted); }
/* Flight Edit / Booking Details: ticket details of each passenger (ticket no, baggage, special service, seat per flight) */
.tk-pax { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; background: var(--card); }
.tk-pax-name { font-weight: 700; margin-bottom: 12px; }
.tk-pax-name .tk-type { font-weight: 500; font-size: .8rem; color: var(--muted); margin-left: 6px; }
.tk-seats { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 4px; }
.tk-seat { display: flex; align-items: center; gap: 8px; }
.tk-seat .tk-route { font-weight: 600; font-size: .85rem; white-space: nowrap; }
.tk-seat .form-control { width: 90px; }
.tk-flight { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: .9rem; }
.tk-flight:last-child { border-bottom: 0; }
.tk-flight .tk-route { font-weight: 700; min-width: 90px; }
.tk-flight .tk-meta { color: var(--muted); }
.tk-seat-badge { display: inline-block; font-size: .78rem; font-weight: 600; background: var(--line-2); border-radius: 6px; padding: 1px 8px; margin: 0 6px 4px 0; }

/* =========================================================
   PROFESSIONAL POLISH LAYER
   Look only: depth, spacing, type and the Booking Details header.
   No markup, field, id or logic is changed by this block; it is placed last so it refines the rules above.
   ========================================================= */
:root {
    --shadow-1: 0 1px 2px rgba(19, 35, 43, .05), 0 10px 26px -14px rgba(19, 35, 43, .16);
    --shadow-2: 0 2px 4px rgba(19, 35, 43, .06), 0 18px 36px -16px rgba(19, 35, 43, .22);
    --ring: rgba(11, 122, 117, .16);
}
body { line-height: 1.5; }

/* Top bar and side menu */
.topbar { box-shadow: 0 1px 0 var(--line), 0 8px 20px -18px rgba(19, 35, 43, .35); }
.tb-title { font-size: 1.18rem; letter-spacing: -.015em; }
.sb-brand { background: linear-gradient(180deg, rgba(255, 255, 255, .04), transparent); }
.sb-mark { background: linear-gradient(135deg, #12998F, var(--brand-dark)); box-shadow: 0 6px 14px -6px rgba(11, 122, 117, .8); }
.sb-group { font-size: .72rem; font-weight: 600; letter-spacing: .02em; }
.sb-link { transition: background .15s, color .15s; }
.sb-link.active { background: linear-gradient(90deg, rgba(11, 122, 117, .98), rgba(11, 122, 117, .78)); box-shadow: inset 3px 0 0 #7FE0D8, 0 8px 18px -12px rgba(11, 122, 117, .9); }
.sb-user { background: rgba(255, 255, 255, .04); }

/* Buttons */
.btn-brand { background: linear-gradient(180deg, #0E8A84, var(--brand)); box-shadow: 0 1px 2px rgba(8, 97, 93, .35), inset 0 1px 0 rgba(255, 255, 255, .16); transition: background .15s, box-shadow .15s, transform .15s; }
.btn-brand:hover, .btn-brand:focus { background: linear-gradient(180deg, var(--brand), var(--brand-dark)); box-shadow: 0 6px 14px -6px rgba(8, 97, 93, .6), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-brand:active { transform: translateY(1px); }
.btn-quiet { box-shadow: 0 1px 2px rgba(19, 35, 43, .05); transition: border-color .15s, background .15s, box-shadow .15s; }
.btn-quiet:hover { box-shadow: 0 4px 10px -6px rgba(19, 35, 43, .3); }

/* Cards and panels */
.custom-card, .panel, .kpi { box-shadow: var(--shadow-1); border-color: #DEE5E3; }
.card-header-custom { background: linear-gradient(180deg, #FFFFFF, #FAFBFB); padding: 15px 22px; }
.card-header-custom > i:first-child,
.card-header-custom > span:first-child > i:first-child { width: 30px; height: 30px; margin-right: 12px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-size: .88rem; vertical-align: middle; }
.panel-hd { background: linear-gradient(180deg, #FFFFFF, #FAFBFB); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

/* Dashboard tiles */
.kpi { position: relative; overflow: hidden; padding: 20px 22px; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, #17B1A6, var(--brand-dark)); }
.kpi .k-label { font-weight: 500; }
.kpi .k-label i { width: 28px; height: 28px; border-radius: 8px; background: var(--brand-soft); display: inline-grid; place-items: center; font-size: .82rem; }
.kpi .k-value { font-size: 2rem; letter-spacing: -.02em; }
.start-tile { box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s, transform .15s; }
.start-tile:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }

/* Tables */
.table-wrap { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.table-crm th { background: #F5F8F7; color: #55666C; font-weight: 600; font-size: .78rem; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.table-crm td { padding: 13px 16px; }
.table-crm tbody tr { transition: background .12s; }
.table-crm tbody tr:hover td { background: #F3F9F8; }
.table-crm td.ref a, .ref { color: var(--brand-dark); }

/* Status pills get a small dot so state reads at a glance */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 9px; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }

/* Forms */
.form-label { color: #34454C; }
.form-control, .form-select { border-color: #D3DBD9; background-color: #fff; box-shadow: inset 0 1px 1px rgba(19, 35, 43, .03); }
.form-control:hover, .form-select:hover { border-color: #B9C5C2; }
.form-control:focus, .form-select:focus { box-shadow: 0 0 0 3px var(--ring); }
.empty-state .ico { box-shadow: var(--shadow-1); }

/* Detail pages: each fact sits in its own tile */
.detail-grid { gap: 12px; }
.detail-grid > div { background: #F8FAF9; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 11px 14px; }
.detail-grid dt { font-size: .74rem; font-weight: 600; color: #6B7C82; margin-bottom: 3px; }
.detail-grid dd { font-size: .95rem; color: var(--text); }
.remark-item { padding: 12px 14px; margin-bottom: 8px; background: #F8FAF9; border: 1px solid var(--line-2); border-radius: var(--radius); }
.remark-item:last-child { border-bottom: 1px solid var(--line-2); margin-bottom: 0; }
.detail-rail .custom-card { overflow: hidden; }

/* Booking Details header: a ticket with a tear-off strip for the amounts */
.bk-hero { position: relative; overflow: hidden; margin-bottom: 24px; padding: 26px 28px 0; color: #fff; border-radius: var(--radius-lg); background: radial-gradient(120% 140% at 100% 0, rgba(23, 177, 166, .28) 0, rgba(23, 177, 166, 0) 55%), linear-gradient(135deg, #13232B 0%, #1C3139 100%); box-shadow: var(--shadow-2); }
.bk-hero-top { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; position: relative; }
.bk-hero h1 { font-size: 1.75rem; font-weight: 700; margin: 0 0 6px; color: #fff; letter-spacing: -.02em; }
.bk-hero h1 .status { font-size: .78rem; vertical-align: middle; margin-left: 10px; letter-spacing: 0; }
.bk-hero p { margin: 0; color: var(--ink-text); font-size: .92rem; }
.bk-hero .btn-quiet { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .22); box-shadow: none; }
.bk-hero .btn-quiet:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); }
.bk-hero-stats { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 24px -28px 0; padding: 18px 28px 20px; border-top: 1px dashed rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .045); }
.bk-hero-stats::before, .bk-hero-stats::after { content: ''; position: absolute; top: -10px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); }
.bk-hero-stats::before { left: -10px; }
.bk-hero-stats::after { right: -10px; }
.bk-stat .k { font-size: .76rem; color: var(--ink-text); font-weight: 500; margin-bottom: 4px; }
.bk-stat .v { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.01em; word-break: break-word; }
.bk-stat.total .v { color: #8FE6DD; }
.bk-stat .v.text { font-family: var(--font-ui); font-size: 1rem; font-weight: 600; }

@media (max-width: 991px) {
    .bk-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
    .bk-hero { padding: 20px 18px 0; }
    .bk-hero-stats { margin: 20px -18px 0; padding: 16px 18px; grid-template-columns: 1fr 1fr; }
    .bk-hero h1 { font-size: 1.4rem; }
}

/* =========================================================
   PROFESSIONAL POLISH LAYER 2 (all pages)
   Look only. Same fields, ids, markup and logic; this block just unifies how every page looks.
   ========================================================= */

/* Links and tiles never underlined */
a, a:hover, .start-tile, .start-tile:hover, a.btn-quiet, a.btn-brand, .link-item, .link-item a, .sb-link { text-decoration: none; }

/* Page headers: same look on every page */
.bk-head, .dash-head { align-items: center; padding-bottom: 16px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.bk-head h1, .dash-head h1 { font-size: 1.5rem; letter-spacing: -.02em; color: var(--ink); }
.bk-head p, .dash-head p { max-width: 80ch; font-size: .9rem; line-height: 1.5; }
.bk-head .draft { background: var(--brand-soft); color: var(--brand); border-color: transparent; font-weight: 600; }
.bk-hero ~ * .bk-head { border-bottom: 0; }

/* Step cards: number and icon sit on one line next to the title */
.card-header-custom > div:first-child { display: flex; align-items: center; min-width: 0; }
.card-header-custom .step-no { display: inline-grid; place-items: center; vertical-align: middle; width: 28px; height: 28px; margin-right: 12px; box-shadow: 0 0 0 4px var(--brand-soft); background: var(--brand); color: #fff; }
.card-header-custom > div > i,
.card-header-custom > div > span > i { width: 28px; height: 28px; margin-right: 10px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-size: .85rem; flex-shrink: 0; }
.card-header-custom > div > i:first-child { margin-right: 12px; }
.card-header-custom .btn-add-charge { white-space: nowrap; }

/* Buttons: one family */
.btn { border-radius: var(--radius-sm); font-weight: 600; letter-spacing: .005em; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #12918B, var(--brand)); border-color: var(--brand-dark); box-shadow: 0 1px 2px rgba(11, 122, 117, .3), 0 8px 16px -10px rgba(11, 122, 117, .8); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: linear-gradient(180deg, var(--brand), var(--brand-dark)); border-color: var(--brand-dark); }
.btn-primary:focus { box-shadow: 0 0 0 3px var(--ring); }
.btn-outline-secondary { background: #fff; color: var(--text); border-color: var(--line); box-shadow: 0 1px 2px rgba(19, 35, 43, .05); }
.btn-outline-secondary:hover, .btn-outline-secondary:focus, .btn-outline-secondary:active { background: var(--surface); color: var(--ink); border-color: #C5CFCC; }
.btn-outline-secondary:focus { box-shadow: 0 0 0 3px var(--ring); }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-outline-danger { border-radius: var(--radius-sm); }
.btn-lg { padding: 11px 28px; font-size: 1rem; }
.btn-sm { font-size: .84rem; }

/* Search boxes and input groups */
.search-box-wrap .input-group { border: 1px solid #D5DCDA; border-radius: var(--radius-sm); background: #fff; overflow: hidden; box-shadow: 0 1px 2px rgba(19, 35, 43, .04); transition: border-color .15s, box-shadow .15s; }
.search-box-wrap .input-group:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.search-box-wrap .input-group .input-group-text,
.search-box-wrap .input-group .form-control { border: 0; box-shadow: none; background: transparent !important; border-radius: 0; }
.search-box-wrap .input-group .input-group-text { color: var(--muted) !important; padding-left: 14px; }
.input-group > .form-control:focus { z-index: 3; }
.input-group-text { background: var(--surface); border-color: #D5DCDA; color: var(--muted); font-size: .9rem; }

/* Alerts */
.alert { border-radius: var(--radius); border-width: 1px; border-left-width: 4px; font-size: .9rem; box-shadow: var(--shadow-1); }
.alert-success { background: #ECF8F4; border-color: #BFE6DB; border-left-color: #1E9E6A; color: #165C41; }
.alert-danger { background: #FDF0EF; border-color: #F3C6C2; border-left-color: #D0443C; color: #8C2A24; }
.alert-warning { background: #FFF8E8; border-color: #F1DDA6; border-left-color: #D99A1C; color: #7A5410; }
.alert-info { background: #EEF6FA; border-color: #C5DDEA; border-left-color: #2F86B5; color: #1E5877; }

/* Popup windows: same dark ink header as the rest of the site instead of blue */
.modal-content { border: 0; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 24px 60px -20px rgba(19, 35, 43, .55); }
.modal-header { background: linear-gradient(135deg, var(--ink), var(--ink-2)) !important; border-bottom: 0 !important; padding: 14px 20px !important; }
.modal-header .modal-title, .modal-header span, .modal-header h5 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.005em; }
.modal-header .btn-close { filter: invert(1) grayscale(1) brightness(2); opacity: .75; }
.modal-header .btn-close:hover { opacity: 1; }
.modal-body { padding: 20px; font-size: .92rem; }
.modal-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 12px 20px; gap: 8px; }
.modal-footer .btn { border-radius: var(--radius-sm) !important; min-width: 88px; }
.modal-backdrop.show { opacity: .5; }

/* Tabs, choices and action bars */
.product-tabs button, .product-tabs a { transition: background .15s, color .15s, box-shadow .15s; }
.pay-choice .form-check-inline { box-shadow: 0 1px 2px rgba(19, 35, 43, .04); transition: border-color .15s, background .15s, box-shadow .15s; }
.pay-choice .form-check-inline:hover { border-color: #BFD3D1; }
.pay-choice .form-check-inline:has(.form-check-input:checked) { box-shadow: 0 0 0 3px var(--ring); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.form-actions { box-shadow: var(--shadow-2); }
.charge-details-section { background: linear-gradient(180deg, #F7F9F8, #F2F5F4); }
.btn-add-charge { border-radius: var(--radius-sm); }

/* Summary rail */
.rail .custom-card { overflow: hidden; }
.rail .card-header-custom { padding: 13px 18px; font-size: .95rem; }
.sum-money .row-m.tot { color: var(--brand-dark); }

/* Tables: calmer rows, clear header */
.table-crm thead th { background: #F6F8F7; color: #55666C; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; border-bottom: 1px solid var(--line); }
.table-crm tbody td { vertical-align: middle; border-color: var(--line-2); }
.table-crm tbody tr { transition: background .12s; }
.table-crm tbody tr:hover { background: #F7FAF9; }
.table-crm td a:not(.btn) { color: var(--brand-dark); font-weight: 600; }
.table-crm td a:not(.btn):hover { color: var(--brand); }
.panel, .custom-card { border-radius: var(--radius-lg); }

/* Empty states and small details */
.empty-state { border: 1px dashed var(--line); border-radius: var(--radius-lg); background: linear-gradient(180deg, #FFFFFF, #FAFBFB); }
.badge { font-weight: 600; letter-spacing: .01em; }
hr { border-color: var(--line); opacity: 1; }
::selection { background: rgba(11, 122, 117, .22); }

/* Thin scrollbars */
* { scrollbar-width: thin; scrollbar-color: #C3CDCB transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #C3CDCB; border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #A9B7B4; background-clip: content-box; border: 2px solid transparent; }
.sidebar *, .sidebar { scrollbar-color: #2C4350 transparent; }

@media (max-width: 575px) {
    .bk-head, .dash-head { padding-bottom: 12px; }
    .bk-head h1, .dash-head h1 { font-size: 1.3rem; }
    .modal-body, .modal-footer { padding-left: 16px; padding-right: 16px; }
}

/* =========================================================
   PROFESSIONAL POLISH LAYER 3 (all pages)
   Look only. Page banners, flight segments, car picture, dashboard lists that scroll instead of growing the page.
   ========================================================= */

/* One dark banner on top of every page, same family as the Booking Details ticket */
.bk-head, .dash-head {
    position: relative; overflow: hidden; align-items: center; gap: 16px;
    margin-bottom: 24px; padding: 22px 26px; border: 0; border-radius: var(--radius-lg); color: #fff;
    background: radial-gradient(110% 160% at 100% 0, rgba(23, 177, 166, .26) 0, rgba(23, 177, 166, 0) 55%), linear-gradient(135deg, #13232B 0%, #1C3139 100%);
    box-shadow: var(--shadow-2);
}
.bk-head > *, .dash-head > * { position: relative; }
.bk-head h1, .dash-head h1 { margin: 0 0 4px; color: #fff; font-size: 1.55rem; letter-spacing: -.02em; }
.bk-head p, .dash-head p { max-width: 80ch; color: var(--ink-text); font-size: .9rem; }
.bk-head .draft { background: rgba(255, 255, 255, .1); color: #CFE9E6; border: 1px solid rgba(255, 255, 255, .16); font-weight: 600; }
.bk-head .btn-outline-secondary, .bk-head .btn-quiet, .dash-head .btn-outline-secondary, .dash-head .btn-quiet {
    background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .22); box-shadow: none;
}
.bk-head .btn-outline-secondary:hover, .bk-head .btn-quiet:hover, .dash-head .btn-outline-secondary:hover, .dash-head .btn-quiet:hover {
    background: rgba(255, 255, 255, .2); color: #fff; border-color: rgba(255, 255, 255, .4);
}
.bk-head .search-box-wrap .input-group { border-color: transparent; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .5); }
.bk-head .app-version, .dash-head .app-version { background: rgba(255, 255, 255, .1); color: #CFE9E6; border: 1px solid rgba(255, 255, 255, .16); }
.bk-head .status, .dash-head .status { box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); }

/* Flight lines on Booking Details */
.seg-list { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.seg { display: grid; grid-template-columns: 230px minmax(0, 1fr) auto; align-items: center; gap: 10px 24px; padding: 14px 18px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); background: linear-gradient(90deg, #F5FAF9, #fff 55%); }
.seg-route { display: flex; align-items: center; gap: 12px; }
.seg-code { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: .02em; color: var(--ink); }
.seg-path { position: relative; flex: 1 1 36px; min-width: 36px; height: 18px; display: grid; place-items: center; }
.seg-path::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed #A9C9C6; }
.seg-path i { position: relative; z-index: 1; padding: 0 6px; background: #F8FBFA; color: var(--brand); font-size: .8rem; transform: rotate(0deg); }
.seg-airline, .seg-when { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text); min-width: 0; }
.seg-airline span { font-weight: 600; overflow-wrap: anywhere; }
.seg-airline i, .seg-when i { color: var(--brand); font-size: .85rem; }
.seg-when { justify-self: end; padding: 5px 12px; border-radius: 20px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 767px) {
    .seg { grid-template-columns: 1fr; gap: 8px; }
    .seg-when { justify-self: start; }
}

/* Car picture on Booking Details */
.veh-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, #F5FAF9, #FFFFFF 70%); }
.veh-img { flex: 0 0 auto; width: 210px; max-width: 42%; height: 112px; display: grid; place-items: center; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line-2); padding: 6px; }
.veh-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.veh-info { min-width: 0; }
.veh-model { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--ink); letter-spacing: -.01em; }
.veh-prov { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.veh-prov img { width: 54px; height: 32px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: #fff; }
@media (max-width: 575px) { .veh-hero { flex-direction: column; align-items: flex-start; } .veh-img { width: 100%; max-width: 100%; } }

/* Dashboard: both lists keep a fixed size and scroll inside when there are more rows */
.dash-grid { align-items: stretch; }
.dash-grid > .panel:first-child { position: relative; min-height: 540px; overflow: hidden; }
.dash-grid > .panel:first-child .panel-hd { height: 64px; box-sizing: border-box; }
.dash-grid > .panel:first-child .table-wrap { position: absolute; top: 64px; right: 0; bottom: 0; left: 0; overflow: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.dash-grid .table-wrap .table-crm th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--line); }
.dash-grid .link-list-scroll { max-height: 264px; overflow-y: auto; }
.dash-grid .link-item:hover { background: #F7FAF9; }
@media (max-width: 1100px) { .dash-grid > .panel:first-child { min-height: 460px; } }

/* A little more finish on shared parts */
.panel-hd h2, .card-header-custom { color: var(--ink); }
.kpi .k-value { color: var(--ink); }
.kpi .k-label i { width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 8px; background: var(--brand-soft); font-size: .8rem; }
.start-tile .t { color: var(--ink); }
.table-wrap-scroll { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.detail-grid dt { text-transform: none; }
.tk-seat-badge { background: var(--brand-soft); color: var(--brand-dark); }
@media (max-width: 575px) {
    .bk-head, .dash-head { padding: 18px 18px; }
    .bk-head h1, .dash-head h1 { font-size: 1.3rem; }
}
.bk-head > div:first-child, .dash-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.bk-head > div:not(:first-child), .dash-head > div:not(:first-child) { margin-left: auto; }

/* =========================================================
   Sidebar groups that open and close (New booking, Super Admin)
   ========================================================= */
.sb-fold { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; border-radius: var(--radius-sm); transition: color .15s, background .15s; }
.sb-fold:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.sb-fold:focus-visible { outline: 2px solid #7FE0D8; outline-offset: -2px; }
.sb-fold .sb-chev { font-size: .66rem; transition: transform .2s; }
.sb-fold.open .sb-chev { transform: rotate(180deg); }
.sb-fold-items { display: none; }
.sb-fold.open + .sb-fold-items { display: block; }

/* =========================================================
   ANALYTICS PAGE
   ========================================================= */
.an-head { align-items: flex-end; }
.an-range { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.an-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.an-chip { padding: 5px 12px; border-radius: 20px; font-size: .8rem; font-weight: 600; color: #CFE9E6; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); transition: background .15s, color .15s; }
.an-chip:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.an-chip.on { background: #fff; color: var(--brand-dark); border-color: #fff; }
.an-dates { display: flex; align-items: center; gap: 8px; color: var(--ink-text); font-size: .85rem; }
.an-dates input[type=date] { height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: .85rem; color: var(--text); background: #fff; }
.an-dates input[type=date]:focus { outline: 0; box-shadow: 0 0 0 3px rgba(127, 224, 216, .45); }

.an-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.an-kpi { position: relative; overflow: hidden; padding: 16px 18px 14px; background: var(--card); border: 1px solid #DEE5E3; border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
.an-kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, #17B1A6, var(--brand-dark)); }
.an-k-label { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.an-k-label i { width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 7px; background: var(--brand-soft); color: var(--brand); font-size: .75rem; }
.an-k-value { margin: 8px 0 6px; font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-k-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .76rem; }
.an-k-note { color: var(--muted); }
.an-d { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 20px; font-weight: 700; font-size: .72rem; }
.an-d i { font-size: .62rem; }
.an-d.up { background: var(--ok-soft); color: var(--ok); }
.an-d.down { background: var(--danger-soft); color: var(--danger); }
.an-d.flat { background: var(--line-2); color: var(--muted); }

.an-health { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.an-h { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.an-h-ico { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--line-2); color: var(--muted); }
.an-h.ok .an-h-ico { background: var(--ok-soft); color: var(--ok); }
.an-h.warn .an-h-ico { background: var(--signal-soft); color: var(--signal); }
.an-h.bad .an-h-ico { background: var(--danger-soft); color: var(--danger); }
.an-h-v { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.an-h-l { font-size: .78rem; font-weight: 600; color: var(--text); }
.an-h-n { font-size: .72rem; color: var(--muted); }

.an-grid-2 { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.an-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.an-agents { margin-bottom: 20px; }
.an-agents .table-wrap-scroll { max-height: 460px; min-height: 0; }
.an-empty { padding: 24px 0; text-align: center; color: var(--muted); font-size: .9rem; }



.an-stack { display: flex; height: 14px; border-radius: 10px; overflow: hidden; background: var(--line-2); margin-bottom: 16px; }
.an-stack span { display: block; height: 100%; }
.an-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.an-legend li { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.an-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.an-lg-name { flex: 1 1 auto; font-weight: 600; color: var(--text); }
.an-lg-n { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.an-lg-p { width: 52px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.an-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.an-b-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: .86rem; }
.an-b-name { font-weight: 600; color: var(--text); }
.an-b-val { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-b-track { height: 8px; border-radius: 8px; background: var(--line-2); overflow: hidden; }
.an-b-track span { display: block; height: 100%; border-radius: 8px; background: var(--brand); }

.an-rank { color: var(--muted); font-weight: 700; }
.an-agent { display: flex; align-items: center; gap: 10px; }
.an-av { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-size: .74rem; font-weight: 700; }
.an-ag-name { font-weight: 600; color: var(--ink); }
.an-ag-id { font-size: .74rem; color: var(--muted); }
.an-top { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 8px; border-radius: 20px; background: #FFF3D6; color: #8A5A00; font-size: .68rem; font-weight: 700; }
.an-sales .an-s-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.an-sales .an-s-top span { color: var(--muted); font-size: .78rem; }
.an-agents .table-crm td.num { font-variant-numeric: tabular-nums; }
.an-total td { font-weight: 700; background: #F6F8F7; border-top: 2px solid var(--line); }

@media (max-width: 1399px) { .an-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .an-health { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .an-grid-2, .an-grid-3 { grid-template-columns: 1fr; } .an-range, .an-chips { align-items: flex-start; justify-content: flex-start; } }
@media (max-width: 767px) { .an-kpis, .an-health { grid-template-columns: repeat(2, minmax(0, 1fr)); } .an-k-value { font-size: 1.3rem; } .an-dates { flex-wrap: wrap; } }
@media (max-width: 480px) { .an-health { grid-template-columns: 1fr; } }
.an-minus { color: var(--danger); }

/* Where the money went (Analytics) */
.an-wf { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.an-wf li { display: grid; grid-template-columns: 110px minmax(0, 1fr) 110px; align-items: center; gap: 12px; font-size: .88rem; }
.an-wf-name { font-weight: 600; color: var(--text); }
.an-wf-track { position: relative; height: 18px; border-radius: 6px; background: var(--line-2); }
.an-wf-track span { position: absolute; top: 0; bottom: 0; border-radius: 6px; min-width: 2px; }
.an-wf-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.an-wf-net { padding-top: 12px; border-top: 1px dashed var(--line); }
.an-wf-net .an-wf-name, .an-wf-net .an-wf-val { color: #166B49; font-weight: 700; }
.an-due { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #F1DDA6; border-radius: var(--radius); background: #FFF8E8; }
.an-due-ico { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #FBEBC4; color: #8A5A00; }
.an-due-v { font-weight: 700; color: #6E4A08; }
.an-due-n { font-size: .78rem; color: #8A6A2A; }
@media (max-width: 575px) { .an-wf li { grid-template-columns: 90px minmax(0, 1fr) 90px; gap: 8px; } }

/* Dashboard, Recent bookings: the whole table (down to Booking Status) fits in the box */
.dash-grid > .panel:first-child .table-crm th { padding-left: 6px; padding-right: 6px; letter-spacing: .01em; font-size: .64rem; }
.dash-grid > .panel:first-child .table-crm td { padding-left: 6px; padding-right: 6px; font-size: .84rem; }
.dash-grid > .panel:first-child .table-crm th:first-child, .dash-grid > .panel:first-child .table-crm td:first-child { padding-left: 16px; }
.dash-grid > .panel:first-child .table-crm th:last-child, .dash-grid > .panel:first-child .table-crm td:last-child { padding-right: 12px; }
@media (max-width: 1500px) {
  .dash-grid > .panel:first-child .table-crm td { font-size: .78rem; padding-left: 5px; padding-right: 5px; }
  .dash-grid > .panel:first-child .table-crm th { font-size: .6rem; padding-left: 5px; padding-right: 5px; }
  .dash-grid > .panel:first-child .table-crm td:first-child, .dash-grid > .panel:first-child .table-crm th:first-child { padding-left: 14px; }
  .dash-grid > .panel:first-child .table-crm td:nth-child(2) { max-width: 78px; overflow: hidden; text-overflow: ellipsis; }
  .dash-grid > .panel:first-child .table-crm td, .dash-grid > .panel:first-child .table-crm th { padding-left: 4px; padding-right: 4px; }
  .dash-grid > .panel:first-child .table-crm td:first-child, .dash-grid > .panel:first-child .table-crm th:first-child { padding-left: 14px; }
  .dash-grid > .panel:first-child .table-crm td:last-child, .dash-grid > .panel:first-child .table-crm th:last-child { padding-right: 10px; }
}
@media (min-width: 1101px) and (max-width: 1380px) { .dash-grid { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); } }
.dash-grid > .panel:first-child .table-crm td:nth-child(7) { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }

/* Quality (QC) and Customer Service (CS): the second line under a status pill, the tabs, the number chips, the facts grid, the blinking bell. */
.qc-sub { font-size: .72rem; color: var(--muted); margin-top: 3px; line-height: 1.3; white-space: nowrap; }
.qc-sub.qc-req { color: var(--signal); font-weight: 600; }
.qc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.qc-tabs a { padding: 9px 16px; font-size: .88rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.qc-tabs a:hover { color: var(--text); }
.qc-tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.qc-tabs a.alert-tab .qc-tab-count { background: var(--danger-soft); color: var(--danger); }
.qc-tab-count { display: inline-block; min-width: 22px; text-align: center; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 20px; background: #ECEFF0; color: #5B676C; margin-left: 4px; }
.qc-chips { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.qc-chip { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 16px; min-width: 150px; }
.qc-chip .n { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.qc-facts .k { font-size: .76rem; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.qc-reasons label { display: inline; font-size: .88rem; margin-left: 4px; }
.qc-reasons input { margin-right: 6px; }
.tb-icon .bell-count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--signal); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.tb-icon.bell-blink .bell-count { background: var(--danger); animation: bellBlink 1s ease-in-out infinite; }
.tb-icon.bell-blink i { color: var(--danger); animation: bellShake 1s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes bellBlink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes bellShake { 0%, 60%, 100% { transform: rotate(0); } 10% { transform: rotate(14deg); } 20% { transform: rotate(-12deg); } 30% { transform: rotate(8deg); } 40% { transform: rotate(-6deg); } }

/* The bell's small list: opens under the bell when it is clicked. */
.bell-wrap { position: relative; }
.bell-panel { display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 10px 30px rgba(19, 35, 43, .16); z-index: 1060; overflow: hidden; }
.bell-panel.open { display: block; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; font-size: .88rem; border-bottom: 1px solid var(--line-2); }
.bell-head span { background: var(--surface); border-radius: 9px; padding: 0 8px; font-size: .75rem; font-weight: 700; color: var(--muted); }
.bell-list { max-height: 340px; overflow-y: auto; }
.bell-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line-2); color: var(--text); text-decoration: none; }
.bell-item:hover { background: var(--surface); color: var(--text); }
.bell-text { font-size: .85rem; font-weight: 600; white-space: normal; }
.bell-sub { font-size: .76rem; color: var(--muted); white-space: normal; }
.bell-empty, .bell-more { padding: 14px; font-size: .84rem; color: var(--muted); }
.bell-all { display: block; text-align: center; padding: 10px 14px; border-top: 1px solid var(--line-2); font-size: .84rem; font-weight: 600; text-decoration: none; }

/* On a phone (under 768px) the wide Quality / CS tables (class qc-cards) show each row as a small card: the column name above its value. The bell's list gets the width of the screen. */
@media (max-width: 767.98px) {
    .table-crm.qc-cards thead { display: none; }
    .table-crm.qc-cards, .table-crm.qc-cards tbody { display: block; width: 100%; }
    .table-crm.qc-cards tr { display: block; width: auto; margin: 10px 12px; padding: 6px 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
    .table-crm.qc-cards td { display: block; padding: 6px 14px; border: 0; white-space: normal; min-width: 0 !important; max-width: none !important; text-align: left !important; }
    .table-crm.qc-cards td:empty { display: none; }
    .table-wrap.qc-cards-wrap { max-height: none; min-height: 0; overflow: visible; }
    .table-crm.qc-cards td::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 600; color: var(--muted); margin-bottom: 1px; }
}
@media (max-width: 575.98px) {
    .bell-wrap { position: static; }
    .bell-panel { left: 12px; right: 12px; width: auto; max-width: none; top: calc(100% + 6px); }
}
