/* ==========================================================================
   Wafid operations console
   --------------------------------------------------------------------------
   A back-office for booking GCC-mandated medical screening appointments.
   Operators work dense tables for whole shifts, so the system is tuned for
   scanning: cool paper ground, navy document ink, one authoritative blue.
   Document numbers (passport, GCC slip) are set in mono because operators
   read them character by character and 0/O and 1/l must not collide.
   ========================================================================== */

:root {
    /* Ink — genuinely navy, the colour of a stamped document, not tinted black */
    --ink:        #10203a;
    --ink-2:      #3e4c63;
    --ink-3:      #6b7a91;

    /* Ground */
    --canvas:     #edf1f7;
    --surface:    #ffffff;
    --surface-2:  #f6f8fc;
    --line:       #d6deea;
    --line-soft:  #e6ecf4;

    /* The one authoritative blue */
    --stamp:      #0b5fa5;
    --stamp-ink:  #084a80;
    --stamp-wash: #e8f1f9;

    /* Status */
    --ok:         #0c7a52;
    --ok-wash:    #e6f4ee;
    --wait:       #a96500;
    --wait-wash:  #fdf1de;
    --stop:       #b3261e;
    --stop-wash:  #fceceb;

    --radius:     6px;
    --radius-lg:  10px;
    --rail:       244px;
    --topbar:     60px;

    --shadow-rail: 1px 0 0 var(--line);
    --shadow-pop:  0 6px 24px -8px rgba(16, 32, 58, .28);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "tnum" 1; /* tabular figures: columns of numbers line up */
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ink);
    font-weight: 600;
    letter-spacing: -.011em;
    margin: 0;
}

h1 { font-size: 20px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

a { color: var(--stamp); text-decoration: none; }
a:hover { color: var(--stamp-ink); text-decoration: underline; }

/* Document numbers: passport, GCC slip, reference codes. */
.mono,
.doc-no {
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .92em;
    letter-spacing: .01em;
}

:focus-visible {
    outline: 2px solid var(--stamp);
    outline-offset: 2px;
    border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}

/* --------------------------------------------------------------------------
   Shell — persistent rail, topbar, content well
   -------------------------------------------------------------------------- */

.shell {
    min-height: 100vh;
    padding-left: var(--rail);
}

.rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail);
    background: var(--surface);
    box-shadow: var(--shadow-rail);
    display: flex;
    flex-direction: column;
    z-index: 40;
    overflow-y: auto;
}

.rail-mark {
    display: flex;
    align-items: baseline;
    gap: 7px;
    height: var(--topbar);
    padding: 0 18px;
    border-bottom: 1px solid var(--line-soft);
    flex: 0 0 auto;
    text-decoration: none;
}

.rail-mark:hover { text-decoration: none; }

.rail-mark b {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--ink);
}

.rail-mark span {
    font-size: 11px;
    color: var(--ink-3);
    letter-spacing: .02em;
}

.rail-groups { padding: 14px 0 24px; }

.rail-group + .rail-group { margin-top: 18px; }

.rail-group > p {
    margin: 0 0 4px;
    padding: 0 18px;
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-3);
}

.rail-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 18px;
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 450;
    border-left: 2px solid transparent;
    transition: background .12s ease, color .12s ease;
}

.rail-link:hover {
    background: var(--surface-2);
    color: var(--ink);
    text-decoration: none;
}

.rail-link.is-current {
    background: var(--stamp-wash);
    border-left-color: var(--stamp);
    color: var(--stamp-ink);
    font-weight: 550;
}

.rail-link svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6;
    opacity: .85;
}

/* Topbar ------------------------------------------------------------------ */

.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    z-index: 30;
}

.topbar-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -.01em;
}

.topbar-title.is-hidden { opacity: 0; pointer-events: none; }

.topbar-title { transition: opacity .15s ease; }

.topbar-spacer { flex: 1; }

/* The balance gates whether an operator can book at all, so it is a figure,
   not a nav link. */
.balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
    padding-right: 16px;
    border-right: 1px solid var(--line);
}

.balance small {
    font-size: 11px;
    color: var(--ink-3);
}

.balance b {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
}

.balance.is-empty b { color: var(--stop); }

.who {
    display: flex;
    align-items: center;
    gap: 9px;
    background: none;
    border: 0;
    padding: 4px 6px;
    border-radius: var(--radius);
    color: var(--ink);
    font: inherit;
    cursor: pointer;
}

.who:hover { background: var(--surface-2); }

.who-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--stamp);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
}

.who-name { font-size: 13px; font-weight: 500; }

.rail-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    width: 34px;
    height: 34px;
    color: var(--ink-2);
    cursor: pointer;
}

/* Content well ------------------------------------------------------------ */

.well { padding: 22px 24px 48px; }

.page-head {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.page-head h1 { font-size: 21px; letter-spacing: -.018em; }

.page-head p {
    margin: 3px 0 0;
    color: var(--ink-3);
    font-size: 13px;
    max-width: 62ch;
}

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

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.card + .card { margin-top: 16px; }

.card-body { padding: 18px; }

.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line-soft);
    padding: 13px 18px;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* A filter bar reads as a control strip, not another card. */
.filters {
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

label,
.form-label,
.field > label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-2);
    margin-bottom: 5px;
}

.form-control,
.form-select,
select.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 7px 10px;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--ink);
    line-height: 1.45;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.form-control::placeholder { color: #9aa7ba; }

.form-control:focus,
.form-select:focus,
select:focus,
textarea:focus,
input:focus {
    border-color: var(--stamp);
    box-shadow: 0 0 0 3px rgba(11, 95, 165, .13);
    outline: none;
}

/* Native selects lose their affordance once the border is restyled, so the
   chevron is drawn back on explicitly. */
select.form-control,
.form-select,
select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236b7a91' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 13px;
}

.form-control:disabled,
select:disabled { background-color: var(--surface-2); color: var(--ink-3); }

.form-control.is-invalid,
input.is-invalid,
select.is-invalid { border-color: var(--stop); }

.invalid-feedback {
    display: block;
    color: var(--stop);
    font-size: 12px;
    margin-top: 4px;
}

.invalid-feedback strong { font-weight: 500; }

.field { margin-bottom: 12px; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    --btn-bg: var(--surface);
    --btn-fg: var(--ink);
    --btn-bd: var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 1px solid var(--btn-bd);
    border-radius: var(--radius);
    padding: 7px 14px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    transition: filter .12s ease, background .12s ease;
}

.btn:hover { filter: brightness(.97); color: var(--btn-fg); text-decoration: none; }
.btn:active { filter: brightness(.94); }

.btn-primary {
    --btn-bg: var(--stamp);
    --btn-fg: #fff;
    --btn-bd: var(--stamp);
}

.btn-secondary,
.btn-light,
.btn-default {
    --btn-bg: var(--surface);
    --btn-fg: var(--ink);
    --btn-bd: var(--line);
}

.btn-success { --btn-bg: var(--ok);   --btn-fg: #fff; --btn-bd: var(--ok); }
.btn-danger  { --btn-bg: var(--stop); --btn-fg: #fff; --btn-bd: var(--stop); }
.btn-warning { --btn-bg: var(--wait); --btn-fg: #fff; --btn-bd: var(--wait); }
.btn-info    { --btn-bg: var(--stamp-wash); --btn-fg: var(--stamp-ink); --btn-bd: #bcd8ee; }

.btn-sm { padding: 4px 9px; font-size: 12.5px; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-wrap {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
}

table.table,
table.dataTable {
    width: 100% !important;
    margin: 0;
    border-collapse: collapse;
    color: var(--ink);
    font-size: 13px;
}

table.table > thead th,
table.dataTable > thead th,
table.dataTable thead td,
.table-dark th,
thead.table-dark th {
    background: var(--surface-2) !important;
    color: var(--ink-2) !important;
    font-weight: 600;
    font-size: 12px;
    text-align: left;
    padding: 10px 12px;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    white-space: nowrap;
}

table.table > tbody td,
table.dataTable > tbody td {
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}

table.table > tbody tr:last-child td,
table.dataTable > tbody tr:last-child td { border-bottom: 0; }

table.table > tbody tr:hover td,
table.dataTable > tbody tr:hover td { background: var(--surface-2); }

/* Bootstrap's striping fights the hover row; the hairline is enough. */
.table-striped > tbody > tr:nth-of-type(odd) > * { background: transparent; }
.table-bordered > :not(caption) > * > * { border-width: 0; }

.table-responsive { border-radius: var(--radius-lg); }

/* --------------------------------------------------------------------------
   Status tags — a stamped document carries its state
   -------------------------------------------------------------------------- */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 550;
    line-height: 1.6;
    white-space: nowrap;
    background: var(--surface-2);
    color: var(--ink-2);
    box-shadow: inset 0 0 0 1px var(--line);
}

.tag::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.tag-ok      { background: var(--ok-wash);    color: var(--ok);        box-shadow: inset 0 0 0 1px #bfe3d3; }
.tag-wait    { background: var(--wait-wash);  color: var(--wait);      box-shadow: inset 0 0 0 1px #f0d9ae; }
.tag-stop    { background: var(--stop-wash);  color: var(--stop);      box-shadow: inset 0 0 0 1px #f0c4c1; }
.tag-info    { background: var(--stamp-wash); color: var(--stamp-ink); box-shadow: inset 0 0 0 1px #bcd8ee; }

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */

.alert {
    border: 1px solid var(--line);
    border-left: 3px solid var(--ink-3);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    padding: 11px 14px;
    font-size: 13.5px;
    margin-bottom: 14px;
}

.alert-success, .alert-primary {
    background: var(--ok-wash);
    border-color: #bfe3d3;
    border-left-color: var(--ok);
    color: #0a5d3f;
}

.alert-danger {
    background: var(--stop-wash);
    border-color: #f0c4c1;
    border-left-color: var(--stop);
    color: #8f1e17;
}

.alert-warning {
    background: var(--wait-wash);
    border-color: #f0d9ae;
    border-left-color: var(--wait);
    color: #8a5300;
}

/* Old inline overrides in the views shouted in 24px red; neutralise them. */
.alert[style] { font-size: 13.5px !important; text-align: left !important; }
.alert-danger[style], .alert-danger[style] * { color: #8f1e17 !important; }

/* --------------------------------------------------------------------------
   Empty state — an invitation to act, not a shrug
   -------------------------------------------------------------------------- */

.empty {
    text-align: center;
    padding: 44px 20px;
    color: var(--ink-3);
}

.empty b {
    display: block;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
}

.empty p { margin: 0 auto; max-width: 42ch; font-size: 13px; }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.pagination { gap: 4px; margin: 0; }

.page-link {
    border: 1px solid var(--line);
    border-radius: var(--radius) !important;
    color: var(--ink-2);
    font-size: 13px;
    padding: 5px 10px;
}

.page-link:hover { background: var(--surface-2); color: var(--ink); }

.page-item.active .page-link {
    background: var(--stamp);
    border-color: var(--stamp);
    color: #fff;
}

.page-item.disabled .page-link { color: #a9b4c4; background: var(--surface-2); }

/* --------------------------------------------------------------------------
   DataTables
   -------------------------------------------------------------------------- */

.dataTables_wrapper {
    padding: 0;
    font-size: 13px;
    color: var(--ink-2);
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { margin-bottom: 12px; }

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 5px 9px;
    font-size: 13px;
    width: auto;
    margin-left: 6px;
}

.dataTables_wrapper .dataTables_info { color: var(--ink-3); padding-top: 14px; font-size: 12.5px; }

.dataTables_wrapper .dataTables_paginate { padding-top: 10px; }

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid var(--line) !important;
    border-radius: var(--radius) !important;
    background: var(--surface) !important;
    color: var(--ink-2) !important;
    padding: 4px 10px;
    margin-left: 4px;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--stamp) !important;
    border-color: var(--stamp) !important;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: #a9b4c4 !important;
    background: var(--surface-2) !important;
}

table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc { position: relative; }

div.dt-buttons { margin-bottom: 12px; }

div.dt-buttons .dt-button {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius) !important;
    color: var(--ink) !important;
    font-size: 13px;
    padding: 6px 12px;
    margin-right: 6px;
}

div.dt-buttons .dt-button:hover { background: var(--surface-2) !important; }

/* --------------------------------------------------------------------------
   Sign-in — a credentialed system, not a marketing page
   -------------------------------------------------------------------------- */

.gate {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    padding: 32px 20px;
    background:
        radial-gradient(1200px 500px at 50% -10%, #f4f8fd 0%, var(--canvas) 60%);
}

.gate-card {
    width: 100%;
    max-width: 388px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-pop);
}

.gate-mark {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin-bottom: 22px;
}

.gate-mark b { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.gate-mark span { font-size: 11px; color: var(--ink-3); }

.gate-card h1 { font-size: 17px; margin-bottom: 3px; }

.gate-card > p {
    color: var(--ink-3);
    font-size: 13px;
    margin: 0 0 20px;
}

.gate-card .field { margin-bottom: 14px; }

.gate-card .btn { width: 100%; padding: 9px; margin-top: 4px; }

.gate-foot {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
    font-size: 12.5px;
    color: var(--ink-3);
    text-align: center;
}

/* --------------------------------------------------------------------------
   Responsive — the rail becomes a drawer
   -------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
    .shell { padding-left: 0; }

    .rail {
        transform: translateX(-100%);
        transition: transform .18s ease;
        box-shadow: var(--shadow-pop);
    }

    .rail.is-open { transform: none; }

    .rail-toggle { display: inline-grid; place-items: center; }

    .scrim {
        position: fixed;
        inset: 0;
        background: rgba(16, 32, 58, .4);
        z-index: 35;
    }

    .well { padding: 18px 16px 40px; }
    .topbar { padding: 0 16px; }
    .who-name { display: none; }
}

@media (max-width: 575.98px) {
    .balance { padding-right: 12px; }
    .page-head-actions { margin-left: 0; width: 100%; }
}

/* --------------------------------------------------------------------------
   Empty tables
   -------------------------------------------------------------------------- */

table.dataTable td.dataTables_empty,
table.table td.dataTables_empty {
    padding: 38px 16px;
    text-align: center;
    color: var(--ink-3);
    font-size: 13px;
}

/* DataTables draws a zero-height table before the first ajax draw; give the
   shell a floor so the card does not collapse to a sliver. */
.dataTables_wrapper table.dataTable { min-height: 0; }
.card > .table-responsive > table.dataTable tbody:empty::after { content: none; }

/* --------------------------------------------------------------------------
   Booking form
   --------------------------------------------------------------------------
   This page keeps its original Semantic UI markup and JS so the booking flow
   is untouched; these rules only settle it into the console frame and tighten
   Semantic's very loose default rhythm.
   -------------------------------------------------------------------------- */

.booking-shell .ui.container,
.booking-shell .content-container { width: auto !important; margin: 0 !important; padding: 0 !important; }

.booking-shell .ui.fluid.card,
.booking-shell .gcc-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: none;
    background: var(--surface);
    margin: 0;
}

.booking-shell .content.booking-form { padding: 22px 24px 26px; }

/* Semantic groups the inputs into fixed rows of two or three, which leaves most
   of a wide screen empty. The wrapper rows are flattened with display:contents
   so every leaf field becomes a cell in one auto-fitting grid instead. */
.booking-shell .form-fields-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 0 20px;
    align-items: start;
}

.booking-shell .form-fields-container > h3,
.booking-shell .form-fields-container > .ui.header { grid-column: 1 / -1; }

/* Semantic's own `.ui.form .fields` rule outranks a plain `.booking-shell
   .fields` selector, so the flatten is forced rather than out-specified. */
.booking-shell .ui.form .fields,
.booking-shell .ui.form .form-fields-container > .field,
.booking-shell .ui.form .field:has(.fields) { display: contents !important; }

/* Declared after the flatten rules above so hidden fields stay out of the grid
   rather than being turned back into contents boxes. */
.booking-shell .ui.form .field.d-none,
.booking-shell .ui.form .form-fields-container > .field.d-none { display: none !important; }

.booking-shell .form-buttons-container { grid-column: 1 / -1; margin-top: 8px; }

/* Semantic sizes each field as a fraction of its row (.three.fields > .field is
   33.3%). Once flattened, that fraction applies to the grid column instead and
   shrinks every input, so it is reset and the grid owns the sizing. */
.booking-shell .ui.form .form-fields-container .field {
    width: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    min-width: 0;
}

.booking-shell .ui.form .form-fields-container .field:not(:has(.fields)) {
    margin-bottom: 16px;
}

.booking-shell .ui.form .field > .ui.input,
.booking-shell .ui.form .field input[type="text"],
.booking-shell .ui.form .field input[type="email"],
.booking-shell .ui.form .field input[type="number"],
.booking-shell .ui.form .field input[type="date"],
.booking-shell .ui.form .field input:not([type="checkbox"]):not([type="radio"]),
.booking-shell .ui.form .field select,
.booking-shell .ui.form .field textarea { width: 100% !important; min-width: 0; }

/* Optional-marker sits with the label rather than wrapping onto its own line. */
.booking-shell .ui.form label .optional {
    font-weight: 400;
    color: var(--ink-3);
    margin-left: 5px;
}

/* Semantic's h3.ui.header carries its own size and weight; these are forced so
   the section rules read at the same level as the rest of the console. */
.booking-shell .ui.form .ui.header,
.booking-shell h3.ui.header {
    font-family: inherit !important;
    color: var(--ink) !important;
    margin: 24px 0 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.4;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line-soft);
}

/* main.css gives .md-header a 35px top margin, which is what was opening a gap
   between each section rule and the fields above it. */
.booking-shell .ui.form .ui.header .content,
.booking-shell .ui.form .ui.header .content.md-header {
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

.booking-shell .ui.form .ui.header:first-child { margin-top: 0 !important; }

.booking-shell .ui.form .field { margin-bottom: 14px; }

.booking-shell .ui.form .field > label {
    font-family: inherit;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--ink-2) !important;
    /* main.css pads these into 40px blocks; the label should be one line tall. */
    line-height: 1.35 !important;
    padding: 0 !important;
    margin: 0 0 5px !important;
    min-height: 0 !important;
    height: auto !important;
    display: block !important;
}

.booking-shell .ui.form input[type="text"],
.booking-shell .ui.form input[type="email"],
.booking-shell .ui.form input[type="number"],
.booking-shell .ui.form input[type="date"],
.booking-shell .ui.form select,
.booking-shell .ui.form textarea {
    font-family: inherit;
    font-size: 13.5px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
}

.booking-shell .ui.form input:focus,
.booking-shell .ui.form select:focus,
.booking-shell .ui.form textarea:focus {
    border-color: var(--stamp);
    box-shadow: 0 0 0 3px rgba(11, 95, 165, .13);
}

.booking-shell .ui.form .ui.button {
    font-family: inherit !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    border-radius: var(--radius) !important;
    padding: 10px 20px !important;
    background: var(--surface);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line);
    width: auto !important;
}

.booking-shell .ui.form .ui.primary.button,
.booking-shell .ui.form .ui.button.submit {
    background: var(--stamp) !important;
    color: #fff !important;
    box-shadow: none;
}

.booking-shell .ui.form .ui.primary.button:hover { background: var(--stamp-ink) !important; }

/* The Semantic grid used for the button row collapses to a simple right-aligned
   strip; the empty spacer columns it relies on are not needed here. */
.booking-shell .form-buttons-container .ui.grid {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 0;
}

.booking-shell .form-buttons-container .ui.grid > .column:empty { display: none; }

.booking-shell .form-buttons-container .ui.grid > .column {
    width: auto !important;
    padding: 0 !important;
}

/* Passport and national ID are read character by character. */
.booking-shell input[name="passport"],
.booking-shell input[name="confirm_passport"],
.booking-shell input[name="national_id"] {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    letter-spacing: .02em;
}

/* --------------------------------------------------------------------------
   Wide data tables
   --------------------------------------------------------------------------
   Only the table itself scrolls sideways. The length menu, search, info and
   pagination sit outside that scroller so they stay put on a 28-column table.
   -------------------------------------------------------------------------- */

.dt-top,
.dt-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
}

.dt-top { border-bottom: 1px solid var(--line-soft); }
.dt-bottom { border-top: 1px solid var(--line-soft); }

.dt-top > *:last-child,
.dt-bottom > *:last-child { margin-left: auto; }

.dt-scroll { overflow-x: auto; }

.dataTables_wrapper .dt-top .dataTables_length,
.dataTables_wrapper .dt-top .dataTables_filter,
.dataTables_wrapper .dt-bottom .dataTables_info,
.dataTables_wrapper .dt-bottom .dataTables_paginate { margin: 0; padding: 0; float: none; }

.dataTables_wrapper .dt-bottom .dataTables_paginate { margin-left: auto; }

/* One sort indicator, not the two that two stylesheets produce. */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
    background-image: none !important;
    position: relative;
    padding-right: 22px;
    cursor: pointer;
}

table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::before,
table.dataTable thead th.sorting_desc::after { content: none !important; }

table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc { color: var(--stamp) !important; }

table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after {
    content: "" !important;
    position: absolute;
    right: 8px;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    background: no-repeat center/8px 8px;
    opacity: .45;
}

table.dataTable thead th.sorting::after {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 0 7 3H1z' fill='%236b7a91'/%3E%3Cpath d='M4 8 1 5h6z' fill='%236b7a91'/%3E%3C/svg%3E");
}

table.dataTable thead th.sorting_asc::after {
    opacity: 1;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 1 7.5 6h-7z' fill='%230b5fa5'/%3E%3C/svg%3E");
}

table.dataTable thead th.sorting_desc::after {
    opacity: 1;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 7 .5 2h7z' fill='%230b5fa5'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Column picker
   -------------------------------------------------------------------------- */

.colvis { position: relative; }

.colvis-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
}

.colvis-btn:hover { background: var(--surface-2); }

.colvis-count {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-3);
    background: var(--surface-2);
    border-radius: 4px;
    padding: 0 5px;
}

.colvis-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
    width: 264px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    overflow: hidden;
}

.colvis-head {
    display: flex;
    gap: 6px;
    padding: 10px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--surface-2);
}

.colvis-head button {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 5px 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
}

.colvis-head button:hover { background: var(--stamp-wash); color: var(--stamp-ink); }

.colvis-list { max-height: 330px; overflow-y: auto; padding: 6px; }

.colvis-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border-radius: 5px;
    font-size: 13px;
    color: var(--ink);
    cursor: pointer;
    margin: 0;
}

.colvis-item:hover { background: var(--surface-2); }

.colvis-item input { width: 15px; height: 15px; accent-color: var(--stamp); flex: 0 0 auto; }

@media (max-width: 575.98px) {
    .colvis-menu { width: 240px; }
}
