/*
 * Site theme on top of the compiled Tailwind css (app.css). Plain css, so it needs no
 * build step and works for both sites; brand colours still come from the Tailwind classes.
 */

:root {
    --theme-ink: #1f2937;
    --theme-ink-2: #4b5563;
    --theme-muted: #6b7280;
    --theme-line: #e5e7eb;
    --theme-line-soft: #f3f4f6;
    --theme-soft: #f9fafb;
}

/* ---------- Cards ---------- */

.card {
    background: #fff;
    border: 1px solid var(--theme-line);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* page panels touch the screen edges on phones, like before */
@media (max-width: 639px) {
    .card-flush {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
}

.card-header {
    background: #fff;
    color: var(--theme-ink);
    border-bottom: 1px solid var(--theme-line-soft);
    border-radius: 0.75rem 0.75rem 0 0;
}

@media (max-width: 639px) {
    .card-flush > .card-header {
        border-radius: 0;
    }
}

.card-header h1 {
    font-size: 1.75rem;
    line-height: 1.25;
    color: var(--theme-ink);
}

@media (max-width: 639px) {
    .card-header h1 {
        font-size: 1.5rem;
    }
}

.card-title {
    font-family: 'Raleway-Bold';
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--theme-muted);
}

.card-stat {
    font-family: 'Raleway-Black';
    font-size: 2rem;
    line-height: 1.1;
    color: var(--theme-ink);
}

.row-hover:hover {
    background: var(--theme-soft);
}

/* readable line height inside the restyled pages (the body uses leading-none) */
.page,
.card {
    line-height: 1.5;
}

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

.styled-table {
    border: 1px solid #9ca3af;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 0.9375rem;
    margin: 1rem 0;
}

.styled-table thead tr {
    background-color: #d1d5db;
    color: #1f2937;
}

.styled-table th {
    font-family: 'Raleway-Bold';
    font-weight: normal;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid #9ca3af;
}

.styled-table td {
    color: var(--theme-ink);
}

.styled-table tbody tr {
    border-bottom: 1px solid #d1d5db;
}

.styled-table:not(.variant) tbody tr.even-visible,
.styled-table.variant tbody td:nth-of-type(even) {
    background-color: #f3f4f6;
}

.styled-table tbody tr:hover {
    background-color: #e5e7eb;
}

.styled-table.styled-table-large {
    font-size: 1rem;
}

/* ---------- Tabs (tour pages) ---------- */

.tabs-wrapper {
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tabs-wrapper .tab {
    background: #fff !important;
    border: 1px solid var(--theme-line);
    border-radius: 9999px !important;
    box-shadow: none !important;
    padding: 0.5rem 1.25rem !important;
    color: var(--theme-ink-2);
    font-family: 'Raleway-Bold';
    line-height: 1.5;
}

.tabs-wrapper a.tab:hover {
    background: var(--theme-soft) !important;
}

/* the current tab is not a link */
.tabs-wrapper div.tab {
    background: var(--theme-ink) !important;
    border-color: var(--theme-ink);
    color: #fff;
}

@media (max-width: 639px) {
    .tabs-wrapper {
        padding: 0 1rem;
    }
}

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

.card .form-input {
    border-color: #d1d5db;
    border-radius: 0.5rem;
}

/* ---------- Allocation legend (tours pages) ---------- */

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    margin-right: 0.375rem;
    flex-shrink: 0;
}

/* ---------- Allocation bars (tours pages) ---------- */

.progress {
    height: 20px;
    border-radius: 9999px;
    background-color: var(--theme-line-soft);
}

.progress-segment {
    line-height: 20px;
    font-size: 0.75rem;
}

/* ---------- Compact tables (tour bookings) ---------- */

.styled-table.table-compact th,
.styled-table.table-compact td {
    padding: 10px 12px;
}

/* text that may wrap inside a nowrap table */
.styled-table td.cell-wrap {
    white-space: normal;
    word-break: break-word;
}

/* ---------- Booking detail ---------- */

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border: 1px solid;
    border-radius: 9999px;
    font-family: 'Raleway-Bold';
    font-size: 0.8125rem;
    line-height: 1.5;
    white-space: nowrap;
}

.pill-gray { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
.pill-green { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pill-red { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.pill-purple { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.pill-magenta { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }
.pill-amber { background: #fffbeb; color: #b45309; border-color: #fde68a; }
a.pill-amber:hover { text-decoration: underline; }
.card.border-amber { border-left: 4px solid #f59e0b; }

/* label left, value right */
.detail-list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--theme-line-soft);
}

.detail-list > div:first-child {
    padding-top: 0;
}

.detail-list > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.detail-list dt {
    color: var(--theme-muted);
    flex-shrink: 0;
}

.detail-list dd {
    color: var(--theme-ink);
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
}

.detail-list > div.detail-total {
    border-top: 1px solid #9ca3af;
    border-bottom: 0;
    margin-top: 0.25rem;
    padding-top: 0.75rem;
    font-family: 'Raleway-Bold';
    font-size: 1.125rem;
}

.detail-list > div.detail-total dt {
    color: var(--theme-ink);
}

/* progress steps */
.step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--theme-line);
    border-radius: 0.5rem;
    background: var(--theme-soft);
    color: var(--theme-ink-2);
    font-size: 0.75rem;
    line-height: 1.3;
}

.step .step-note {
    font-size: 0.6875rem;
    opacity: 0.75;
}

.step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    border: 2px solid #d1d5db;
    border-radius: 9999px;
    background: #fff;
    color: var(--theme-muted);
    font-family: 'Raleway-Bold';
    font-size: 0.625rem;
}

.step.is-done {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.step.is-done .step-icon {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.guest-card {
    border: 1px solid var(--theme-line);
    border-radius: 0.5rem;
    padding: 1rem;
}

.note {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--theme-line);
    border-radius: 0.375rem;
    background: #fff;
}

.icon-btn:hover {
    background: var(--theme-line-soft);
}

.doc-list > li {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--theme-line-soft);
}

.doc-list > li:first-child {
    padding-top: 0;
}

.doc-list > li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

/* booking history */
.timeline > li {
    position: relative;
    padding: 0 0 0.875rem 1.25rem;
    border-left: 2px solid var(--theme-line);
    margin-left: 0.25rem;
}

.timeline > li:last-child {
    padding-bottom: 0;
}

.timeline > li::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0.3rem;
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background: #9ca3af;
}

.styled-table.my-0 {
    margin-top: 0;
    margin-bottom: 0;
}

/* ---------- Booking type colours (same as the allocation bars) ---------- */

.pill-type { border-color: transparent; color: #fff; background: #4b5563; }

/* the source of a booking ("How did you hear about us?"), a colour per source */
.pill-source { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
.pill-source-returning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.pill-source-friends { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pill-source-search, .pill-source-internet { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.pill-source-ads { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.pill-source-social { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }
.pill-source-article { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
.pill-source-newsletter { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.pill-source-reviews { background: #f7fee7; color: #4d7c0f; border-color: #d9f99d; }
.pill-source-agent { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.pill-source-tripsite { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.pill-type-invited { background: rgba(0, 123, 255, 0.75); }
.pill-type-on_hold { background: rgba(0, 123, 255, 0.5); }
.pill-type-pending { background: #007bff; }
.pill-type-booked { background: #10b981; }
.pill-type-tripsite_reserved { background: rgba(254, 101, 61, 0.5); }
.pill-type-tripsite_on_hold { background: rgba(254, 101, 61, 0.75); }
.pill-type-tripsite_booked { background: #fe653d; }
.pill-type-charter { background: #9061f9; }

.dot-type-invited { background: rgba(0, 123, 255, 0.75); }
.dot-type-on_hold { background: rgba(0, 123, 255, 0.5); }
.dot-type-pending { background: #007bff; }
.dot-type-booked { background: #10b981; }
.dot-type-tripsite_reserved { background: rgba(254, 101, 61, 0.5); }
.dot-type-tripsite_on_hold { background: rgba(254, 101, 61, 0.75); }
.dot-type-tripsite_booked { background: #fe653d; }
.dot-type-charter { background: #9061f9; }
.dot-type-free { background: #fff; border: 1px solid #9ca3af; }

/* ---------- Dropdown menus (tour page) ---------- */

.menu {
    position: relative;
}

.menu > summary {
    list-style: none;
}

.menu > summary::-webkit-details-marker {
    display: none;
}

.menu-panel {
    position: absolute;
    right: 0;
    z-index: 30;
    min-width: 15rem;
    margin-top: 0.375rem;
    padding: 0.375rem;
    background: #fff;
    border: 1px solid var(--theme-line);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.menu-item {
    display: block;
    width: 100%;
    /* buttons get the bold font site-wide, links don't: same font for both here */
    font-family: 'Raleway-Regular';
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    color: var(--theme-ink);
    text-align: left;
    font-size: 0.9375rem;
    line-height: 1.4;
    white-space: nowrap;
}

/* on phones the menu spans the screen, so it can't stick out of it */
@media (max-width: 639px) {
    .menu-panel {
        position: fixed;
        left: 1rem;
        right: 1rem;
        min-width: 0;
        max-height: 70vh;
        overflow-y: auto;
    }
}

.menu-item:hover {
    background: var(--theme-line-soft);
}

.menu-label {
    display: block;
    padding: 0.5rem 0.75rem 0.25rem;
    color: var(--theme-muted);
    font-family: 'Raleway-Bold';
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* a disabled summary button */
.btn-primary.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------- Booking form link (tour page) ---------- */

.share-strip {
    background: #fff;
    border: 1px dashed #9ca3af;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
}

.share-url {
    display: block;
    color: var(--theme-ink-2);
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: all;
}

/* quieter button for secondary actions */
.btn-outline {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border: 1px solid #9ca3af;
    border-radius: 0.5rem;
    background: #fff;
    color: var(--theme-ink);
    font-family: 'Raleway-Bold';
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-outline:hover {
    background: var(--theme-line-soft);
}

/* ---------- Dashboard leaderboard ---------- */

.leader-rank {
    width: 1.75rem;
    text-align: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.leader-bar {
    height: 6px;
    margin: 0.375rem 0 0 2.25rem;
    border-radius: 9999px;
    background: var(--theme-line-soft);
    overflow: hidden;
}

.leader-bar > span {
    display: block;
    height: 100%;
    border-radius: 9999px;
    background: #9ca3af;
}

.leader-row.is-leader .leader-bar > span {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* ---------- Payment progress (booking page) ---------- */

.pay-bar {
    height: 10px;
    border-radius: 9999px;
    background: var(--theme-line);
    overflow: hidden;
}

.pay-bar > span {
    display: block;
    height: 100%;
    border-radius: 9999px;
    background: #3b82f6;
}

.pay-bar > span.is-full {
    background: #10b981;
}

/* fewer pixels between rows, for small tiles */
.detail-list.detail-list-tight > div {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    line-height: 1.35;
}

.detail-list.detail-list-tight > div:first-child {
    padding-top: 0;
}

.detail-list.detail-list-tight > div:last-child {
    padding-bottom: 0;
}

/* ---------- Selectable cards (bulk invoice payment types) ---------- */

.pick-card {
    position: relative;
    display: block;
    padding: 0.875rem 1rem 0.875rem 2.5rem;
    border: 2px solid var(--theme-line);
    border-radius: 0.75rem;
    background: #fff;
    cursor: pointer;
    line-height: 1.3;
}

.pick-card:hover {
    border-color: #9ca3af;
}

.pick-card .pick-input {
    position: absolute;
    top: 1rem;
    left: 0.875rem;
}

.pick-card:has(.pick-input:checked) {
    border-color: #10b981;
    background: #ecfdf5;
}

.pick-card.is-empty {
    opacity: 0.55;
    cursor: not-allowed;
}

/* narrow select: the arrow hugs the right edge so a short value (a year) still fits */
.select-wrapper.select-compact::after {
    right: -4px;
}

/* booking alerts marked as known (with a reason) */
.text-c-known {
    color: #6b7280;
}

/* finance dashboard button, only shown to the finance role (body: wins over the site button colours) */
body .btn-primary.btn-finance {
    background-color: #db2777;
    border-color: #db2777;
}
body .btn-primary.btn-finance:hover,
body .btn-primary.btn-finance:focus {
    background-color: #be185d;
    border-color: #be185d;
}

/* dashboard activity timeline: a colour per kind */
.tl-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: #9ca3af;
}
.timeline > li.tl-booking::before, .tl-dot.tl-booking { background: #3b82f6; }
.timeline > li.tl-message::before, .tl-dot.tl-message { background: #8b5cf6; }
.timeline > li.tl-cabin::before, .tl-dot.tl-cabin { background: #fe653d; }
.timeline > li.tl-tour::before, .tl-dot.tl-tour { background: #10b981; }

/* ---------- Guest booking form ---------- */

.bf-steps ol {
    display: flex;
    align-items: flex-start;
    list-style: none;
    margin: 0;
    padding: 0;
}
.bf-steps li {
    flex: 1 1 0;
    position: relative;
    text-align: center;
    min-width: 0;
}
/* the line between two steps */
.bf-steps li:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 1rem;
    left: calc(50% + 1.25rem);
    right: calc(-50% + 1.25rem);
    height: 2px;
    background: var(--theme-line);
}
.bf-steps li.is-done:not(:last-child)::after {
    background: #9ca3af;
}
.bf-step {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    color: var(--theme-muted);
    font-size: 0.8125rem;
    text-decoration: none;
}
.bf-step-nr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: #fff;
    border: 2px solid var(--theme-line);
    font-family: 'Raleway-Bold';
    color: var(--theme-muted);
}
.bf-steps li.is-done .bf-step-nr {
    border-color: #9ca3af;
    color: var(--theme-ink-2);
}
.bf-steps li.is-current .bf-step {
    color: var(--theme-ink);
    font-family: 'Raleway-Bold';
}
.bf-steps li.is-current .bf-step-nr {
    border-color: var(--theme-ink);
    background: var(--theme-ink);
    color: #fff;
}
.bf-steps a.bf-step:hover .bf-step-label {
    text-decoration: underline;
}
.bf-step-label {
    line-height: 1.2;
}
@media (max-width: 480px) {
    .bf-step-label { font-size: 0.6875rem; }
}

.bf-section-title {
    font-family: 'Raleway-Bold';
    font-size: 1.125rem;
    color: var(--theme-ink);
    margin-bottom: 1rem;
}
.bf-subtitle {
    font-family: 'Raleway-Bold';
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--theme-muted);
    margin-bottom: 0.75rem;
}
.bf-label {
    display: block;
    color: var(--theme-ink-2);
    font-size: 0.875rem;
    font-family: 'Raleway-Bold';
    margin-bottom: 0.375rem;
}
.bf-hint {
    font-size: 0.75rem;
    color: var(--theme-muted);
    margin-top: 0.25rem;
}
/* a choice (radio/checkbox) as a bordered pill */
.bf-choice {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--theme-line);
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #fff;
    cursor: pointer;
}
.bf-choice:hover {
    background: var(--theme-soft);
}
/* labels are bold site-wide; a list of choices reads calmer in the regular font */
.bf-choice,
.bf-choice span {
    font-family: 'Raleway-Regular';
    font-size: 0.9375rem;
    color: var(--theme-ink-2);
}
.bf-choice:has(input:checked) {
    border-color: var(--theme-ink-2);
}
.bf-choice:has(input:checked) span {
    color: var(--theme-ink);
}
/* the "I want to book for [2] people" sentence */
.bf-sentence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Raleway-Bold';
    font-size: 1.125rem;
    color: var(--theme-ink);
}
/* the select reads as part of the sentence: same font, centred on the line */
.bf-sentence .select-wrapper {
    display: inline-flex;
    align-items: center;
}
.bf-sentence select {
    font-family: 'Raleway-Bold';
    font-size: 1.125rem;
    color: var(--theme-ink);
    height: 2.75rem;
    line-height: 1.2;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
}
.bf-sentence .select-wrapper::after {
    top: 50%;
    transform: translateY(-50%);
}

/* site header: logo | Booking site */
.site-header-divider {
    display: inline-block;
    width: 1px;
    height: 2.25rem;
    background: var(--theme-line);
}

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

/*
 * Button colours with readable white text (contrast 4.5:1 or more): a darker green than the
 * Premium brand green, the navy of the Bikeplanet invoices and emails.
 */
.site-pbtb .btn-primary {
    background-color: #2a8165;
    border-color: #2a8165;
}
.site-pbtb .btn-primary:hover,
.site-pbtb .btn-primary:focus {
    background-color: #1f6f55;
    border-color: #1f6f55;
}
.site-bpb .btn-primary {
    background-color: #1d3557;
    border-color: #1d3557;
}
.site-bpb .btn-primary:hover,
.site-bpb .btn-primary:focus {
    background-color: #142640;
    border-color: #142640;
}

/* the dashboard keeps the full brand colours: Premium green, Bikeplanet orange */
.site-pbtb .btn-primary.btn-brand {
    background-color: #3ea986;
    border-color: #3ea986;
}
.site-pbtb .btn-primary.btn-brand:hover,
.site-pbtb .btn-primary.btn-brand:focus {
    background-color: #2a8165;
    border-color: #2a8165;
}
.site-bpb .btn-primary.btn-brand {
    background-color: #f19c26;
    border-color: #f19c26;
}
.site-bpb .btn-primary.btn-brand:hover,
.site-bpb .btn-primary.btn-brand:focus {
    background-color: #d9861a;
    border-color: #d9861a;
}

/* the admin pages: compacter buttons; the guest pages (booking form, payment) keep the large ones */
.admin-area .btn-primary {
    font-size: 0.875rem;
    padding: 0.375rem 1rem;
}
.admin-area .btn-primary.small {
    padding: 0.25rem 0.75rem;
}

/* secondary actions: same size as a compact primary button */
.btn-outline {
    color: var(--theme-ink);
    text-decoration: none;
    cursor: pointer;
}
.btn-outline.small {
    padding: 0.25rem 0.75rem;
}

/* ---------- Dark mode (backend only: html.theme-dark + body.admin-area) ---------- */

/* the switch shows the moon in light mode, the sun in dark mode */
.theme-icon-sun { display: none; }
html.theme-dark .theme-icon-sun { display: inline; }
html.theme-dark .theme-icon-moon { display: none; }

html.theme-dark body.admin-area {
    --theme-ink: #e5e7eb;
    --theme-ink-2: #cbd5e1;
    --theme-muted: #9ca3af;
    --theme-line: #2f3a48;
    --theme-line-soft: #1f2732;
    --theme-soft: #1a222c;
    background-color: #0f141b;
    color: #d1d5db;
    color-scheme: dark;
}

/* surfaces */
html.theme-dark body.admin-area .card,
html.theme-dark body.admin-area .card-header,
html.theme-dark body.admin-area .bg-white,
html.theme-dark body.admin-area .site-header,
html.theme-dark body.admin-area .share-strip,
html.theme-dark body.admin-area .menu-panel,
html.theme-dark body.admin-area .tabs-wrapper .tab,
html.theme-dark body.admin-area .btn-outline,
html.theme-dark body.admin-area .icon-btn,
html.theme-dark body.admin-area .pick-card,
html.theme-dark body.admin-area .step-icon {
    background-color: #161d26 !important;
    border-color: #2f3a48;
}
html.theme-dark body.admin-area .bg-gray-50,
html.theme-dark body.admin-area .bg-gray-100,
html.theme-dark body.admin-area .row-hover:hover,
html.theme-dark body.admin-area .menu-item:hover,
html.theme-dark body.admin-area .btn-outline:hover,
html.theme-dark body.admin-area .icon-btn:hover,
html.theme-dark body.admin-area .tabs-wrapper a.tab:hover {
    background-color: #1f2833 !important;
}
html.theme-dark body.admin-area .bg-gray-200 {
    background-color: #2a3340;
}
/* the logos are made for a white background */
html.theme-dark body.admin-area .site-logo {
    background: #fff;
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
}

/* the current tab: light on dark */
html.theme-dark body.admin-area .tabs-wrapper div.tab {
    background: #e5e7eb !important;
    border-color: #e5e7eb;
    color: #111827;
}

/* text */
html.theme-dark body.admin-area .text-gray-900,
html.theme-dark body.admin-area .text-gray-800,
html.theme-dark body.admin-area .text-black,
html.theme-dark body.admin-area strong,
html.theme-dark body.admin-area h1,
html.theme-dark body.admin-area h2,
html.theme-dark body.admin-area h3 {
    color: #e5e7eb;
}
html.theme-dark body.admin-area .text-gray-700 { color: #d1d5db; }
html.theme-dark body.admin-area .text-gray-600 { color: #b6c0cc; }
html.theme-dark body.admin-area .text-gray-500 { color: #9ca3af; }
html.theme-dark body.admin-area .text-gray-400 { color: #7b8592; }

/* lines */
html.theme-dark body.admin-area .border-gray-100,
html.theme-dark body.admin-area .border-gray-200,
html.theme-dark body.admin-area .border-gray-300,
html.theme-dark body.admin-area .divide-gray-100 > * + *,
html.theme-dark body.admin-area .divide-gray-200 > * + * {
    border-color: #2f3a48;
}

/* form fields */
html.theme-dark body.admin-area .form-input,
html.theme-dark body.admin-area input[type="text"],
html.theme-dark body.admin-area input[type="email"],
html.theme-dark body.admin-area input[type="number"],
html.theme-dark body.admin-area input[type="date"],
html.theme-dark body.admin-area input[type="tel"],
html.theme-dark body.admin-area input[type="password"],
html.theme-dark body.admin-area input[type="search"],
html.theme-dark body.admin-area select,
html.theme-dark body.admin-area textarea,
html.theme-dark body.admin-area trix-editor {
    background-color: #0f141b;
    border-color: #3a4656;
    color: #e5e7eb;
}
html.theme-dark body.admin-area ::placeholder {
    color: #6b7584;
}
/* the select arrow is a dark svg */
html.theme-dark body.admin-area .select-wrapper::after {
    filter: invert(1) brightness(0.85);
}
html.theme-dark body.admin-area trix-toolbar .trix-button-group {
    background: #e5e7eb;
}

/* tables */
html.theme-dark body.admin-area .styled-table {
    border-color: #2f3a48;
}
html.theme-dark body.admin-area .styled-table thead tr {
    background-color: #222b36;
    color: #e5e7eb;
}
html.theme-dark body.admin-area .styled-table th {
    border-bottom-color: #2f3a48;
}
html.theme-dark body.admin-area .styled-table tbody tr {
    background-color: #161d26;
    border-bottom-color: #2f3a48;
}
html.theme-dark body.admin-area .styled-table:not(.variant) tbody tr.even-visible,
html.theme-dark body.admin-area .styled-table.variant tbody td:nth-of-type(even) {
    background-color: #1a222c;
}
html.theme-dark body.admin-area .styled-table tbody tr:hover {
    background-color: #222b36;
}

/* tinted labels and boxes: same colours, see-through */
html.theme-dark body.admin-area .bg-red-50,
html.theme-dark body.admin-area .bg-red-100 { background-color: rgba(239, 68, 68, 0.16); }
html.theme-dark body.admin-area .bg-green-50,
html.theme-dark body.admin-area .bg-green-100 { background-color: rgba(16, 185, 129, 0.16); }
html.theme-dark body.admin-area .bg-yellow-50,
html.theme-dark body.admin-area .bg-yellow-100 { background-color: rgba(245, 158, 11, 0.18); }
html.theme-dark body.admin-area .bg-blue-50,
html.theme-dark body.admin-area .bg-blue-100 { background-color: rgba(59, 130, 246, 0.18); }
html.theme-dark body.admin-area .text-red-600,
html.theme-dark body.admin-area .text-red-700 { color: #fca5a5; }
html.theme-dark body.admin-area .text-green-600,
html.theme-dark body.admin-area .text-green-700 { color: #6ee7b7; }
html.theme-dark body.admin-area .text-yellow-800 { color: #fcd34d; }
html.theme-dark body.admin-area .border-red-300 { border-color: rgba(239, 68, 68, 0.45); }
html.theme-dark body.admin-area .border-green-300 { border-color: rgba(16, 185, 129, 0.45); }

html.theme-dark body.admin-area .pill-gray { background: #2a3340; color: #d1d5db; border-color: #3a4656; }
html.theme-dark body.admin-area .pill-green { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.4); }
html.theme-dark body.admin-area .pill-red { background: rgba(239, 68, 68, 0.16); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
html.theme-dark body.admin-area .pill-amber { background: rgba(245, 158, 11, 0.16); color: #fcd34d; border-color: rgba(245, 158, 11, 0.4); }
html.theme-dark body.admin-area .pill-purple { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.4); }
html.theme-dark body.admin-area .pill-source { background: #2a3340; color: #d1d5db; border-color: #3a4656; }
html.theme-dark body.admin-area .pill-source-returning { background: rgba(245, 158, 11, 0.16); color: #fcd34d; border-color: rgba(245, 158, 11, 0.4); }
html.theme-dark body.admin-area .pill-source-friends { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.4); }
html.theme-dark body.admin-area .pill-source-search, html.theme-dark body.admin-area .pill-source-internet { background: rgba(59, 130, 246, 0.16); color: #93c5fd; border-color: rgba(59, 130, 246, 0.4); }
html.theme-dark body.admin-area .pill-source-ads { background: rgba(249, 115, 22, 0.16); color: #fdba74; border-color: rgba(249, 115, 22, 0.4); }
html.theme-dark body.admin-area .pill-source-social { background: rgba(236, 72, 153, 0.16); color: #f9a8d4; border-color: rgba(236, 72, 153, 0.4); }
html.theme-dark body.admin-area .pill-source-article { background: rgba(20, 184, 166, 0.16); color: #5eead4; border-color: rgba(20, 184, 166, 0.4); }
html.theme-dark body.admin-area .pill-source-newsletter { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.4); }
html.theme-dark body.admin-area .pill-source-reviews { background: rgba(132, 204, 22, 0.16); color: #bef264; border-color: rgba(132, 204, 22, 0.4); }
html.theme-dark body.admin-area .pill-source-agent { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.4); }
html.theme-dark body.admin-area .pill-source-tripsite { background: rgba(6, 182, 212, 0.16); color: #67e8f9; border-color: rgba(6, 182, 212, 0.4); }
html.theme-dark body.admin-area .pill-magenta { background: rgba(236, 72, 153, 0.16); color: #f9a8d4; border-color: rgba(236, 72, 153, 0.4); }

html.theme-dark body.admin-area .step.is-done {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}
html.theme-dark body.admin-area .step.is-done .step-icon {
    background: #10b981 !important;
    color: #fff;
}
html.theme-dark body.admin-area .note {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #e5e7eb;
}
html.theme-dark body.admin-area .pick-card:has(.pick-input:checked) {
    background: rgba(16, 185, 129, 0.16) !important;
}
html.theme-dark body.admin-area .text-c-known { color: #9ca3af; }

/* ---------- Document thumbnails and preview (booking page) ---------- */

.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.doc-card {
    min-width: 0;
}
.doc-card .icon-btn {
    width: 1.75rem;
    height: 1.75rem;
}
/* break the names at the dashes: agreement- / dana.pdf */
.doc-card-name {
    hyphens: manual;
}
.doc-card-name {
    display: block;
    max-width: 100%;
    font-size: 0.75rem !important;
    line-height: 1.35;
    overflow-wrap: anywhere;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.doc-thumb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 210 / 297;
    padding: 0;
    border: 1px solid var(--theme-line);
    border-radius: 0.375rem;
    background: #fff;
    overflow: hidden;
    cursor: zoom-in;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.doc-thumb:hover,
.doc-thumb:focus {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}
.doc-thumb canvas {
    display: none;
}
.doc-thumb.is-loaded canvas {
    display: block;
}
.doc-thumb.is-loaded .doc-thumb-icon {
    display: none;
}

.doc-preview {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(17, 24, 39, 0.6);
}
.doc-preview.hidden {
    display: none;
}
.doc-preview-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 56rem;
    height: 90vh;
    overflow: hidden;
}
.doc-preview-frame {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    background: #f3f4f6;
}

/* booking: "Send again…" opens a small panel with the explanation */
.send-again > summary::-webkit-details-marker { display: none; }
.send-again { position: relative; }
.send-again-panel { position: absolute; left: 0; top: 100%; z-index: 30; width: 22rem; max-width: calc(100vw - 3rem); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); }

/* booking: a payment is a light box, the left edge says paid / overdue / open */
.payment-row {
    background: var(--theme-soft);
    border: 1px solid var(--theme-line);
    border-left-width: 4px;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}
.payment-row.is-paid { border-left-color: #10b981; }
.payment-row.is-overdue { border-left-color: #ef4444; }
.payment-row.is-processing { border-left-color: #f59e0b; }
.payment-row.is-open { border-left-color: #9ca3af; }
html.theme-dark body.admin-area .payment-row { background: #1a222c; border-color: #2f3a48; }
html.theme-dark body.admin-area .payment-row.is-paid { border-left-color: #10b981; }
html.theme-dark body.admin-area .payment-row.is-overdue { border-left-color: #ef4444; }
html.theme-dark body.admin-area .payment-row.is-processing { border-left-color: #f59e0b; }
html.theme-dark body.admin-area .payment-row.is-open { border-left-color: #6b7280; }

/* booking: "Price & options" folds out */
.price-tile > summary::-webkit-details-marker { display: none; }
.price-tile:not([open]) > summary { border-bottom: 0; border-radius: 0.75rem; }
.price-tile-arrow { display: inline-block; color: var(--theme-muted); transition: transform 0.15s ease; }
.price-tile[open] .price-tile-arrow { transform: rotate(90deg); }

/* booking: "made out to someone else" folds in and out under its checkbox */
.bill-to-fold > summary { cursor: pointer; list-style: none; }
.bill-to-fold > summary::-webkit-details-marker { display: none; }
.bill-to-fold[open] > summary .tile-arrow { transform: rotate(90deg); }

/* ---------- Foldable tiles (x-booking-tile) ---------- */

.tile-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3rem;
    cursor: pointer;
    list-style: none;
}
.tile-summary::-webkit-details-marker { display: none; }
/* room for the actions on the right */
.tile-summary.has-actions { padding-right: 45%; }
.tile-arrow,
.price-tile-arrow {
    display: inline-block;
    color: var(--theme-muted);
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}
.booking-tile[open] > summary .tile-arrow { transform: rotate(90deg); }
.booking-tile:not([open]) > summary,
.price-tile:not([open]) > summary { border-bottom: 0; border-radius: 0.75rem; }
.tile-actions {
    position: absolute;
    top: 0;
    right: 1.5rem;
    height: 3rem;
    max-width: 55%;
}

/* tour table: a guest in a cabin of their own, under their booking */
.styled-table tbody tr.own-cabin-row td { background: #faf5ff; }
html.theme-dark body.admin-area .styled-table tbody tr.own-cabin-row td { background: rgba(139, 92, 246, 0.1); }

/* ---------- Tour page: the bookings list ---------- */
/* name with the details, the booking type (the pills line up), then status and alerts */
.booking-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0.25rem;
}
.booking-line-alerts { width: 100%; }
.booking-line-alerts:not(:has(*)) { display: none; }
.booking-actions:not(:has(*)) { display: none; }
@media (min-width: 768px) {
    .booking-line {
        display: grid;
        /* name column only as wide as a name with its details needs, the alerts take the rest */
        grid-template-columns: minmax(0, 21rem) 8.5rem minmax(0, 1fr);
        column-gap: 1rem;
    }
    .booking-line-type { white-space: nowrap; }
    .booking-line-alerts { width: auto; }
    .booking-line-alerts:not(:has(*)) { display: flex; }
    .booking-actions, .booking-actions:not(:has(*)) { display: flex; flex: none; width: 11rem; justify-content: flex-end; }
}
/* the rows: a stripe in the colour of the booking type, every other booking shaded, a highlight on hover */
.booking-row { border-left: 4px solid transparent; transition: background-color 0.15s ease; }
.booking-row.is-alt { background: var(--theme-soft); }
.booking-row:hover { background: var(--theme-line-soft); }
.tour-bookings > li.booking-row-booked { border-left-color: #10b981; }
.tour-bookings > li.booking-row-pending { border-left-color: #007bff; }
.tour-bookings > li.booking-row-invited { border-left-color: rgba(0, 123, 255, 0.75); }
.tour-bookings > li.booking-row-on_hold { border-left-color: rgba(0, 123, 255, 0.5); }
.tour-bookings > li.booking-row-tripsite_booked { border-left-color: #fe653d; }
.tour-bookings > li.booking-row-tripsite_reserved { border-left-color: rgba(254, 101, 61, 0.5); }
.tour-bookings > li.booking-row-tripsite_on_hold { border-left-color: rgba(254, 101, 61, 0.75); }
.tour-bookings > li.booking-row-charter { border-left-color: #9061f9; }
/* a guest in the single cabin: under their booking, a little indented and purple */
.own-cabin-row.booking-row { background: #faf5ff; padding-left: 2.25rem; }
html.theme-dark body.admin-area .own-cabin-row.booking-row { background: rgba(139, 92, 246, 0.1); }
.tour-bookings > li:not(.booking-row) { border-left: 4px solid transparent; }
