/*
 * Partner panel (/partner) additions to the shared back-office stylesheet (docs/design/backoffice/SPEC.md §7.4 item 13,
 * §11; owner bo-partner). Plain CSS published by `php artisan filament:assets` (no build step); colours come from the
 * shared `.rym-chip--*` classes of rymotel-backoffice.css and Filament's colour variables, logical properties only
 * (right to left in Arabic). The selectors are listed in docs/design/CHANGES.md (Partner).
 */

/* Calendar board: one night of one unit, a shared chip (state colour ≥ 4.5:1, 12 px, 13 px in Arabic). */
.rym-cal-cell {
    display: block;
    position: relative;
    min-inline-size: 4.25rem;
    padding: .125rem .25rem;
    text-align: center;
}

.rym-cal-cell__label {
    font-weight: 600;
}

.rym-cal-cell__marks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .125rem;
    min-block-size: 1rem;
}

/* A stop-sell on a night that is not free: the dashed outline of `.rym-chip--stop-sell` over the state's colour. */
.rym-cal-cell--stop-sell {
    outline: 2px dashed #b45309;
    outline-offset: -2px;
}

/* Restrictions in words ("≥ 3", "Arrivée fermée", "Départ fermé"), never arrows alone (1.4.1). */
.rym-cal-mark {
    font-size: .75rem;
    line-height: 1.25;
    white-space: nowrap;
}

.rym-cal-mark--closed {
    padding-inline: .25rem;
    border: 1px solid currentColor;
    border-radius: var(--radius-sm, .25rem);
    white-space: normal;
}

:root:lang(ar) .rym-cal-mark {
    font-size: .8125rem;
}

/* The legend: its title, the state chips, and the symbols in words. */
.rym-cal-legend {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.rym-cal-legend__title {
    font-size: .875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.rym-cal-legend__symbols {
    margin: 0;
    font-size: .75rem;
    color: var(--gray-700);
}

:root:lang(ar) .rym-cal-legend__symbols {
    font-size: .8125rem;
}

/* Previous / next month: the chevrons point the reading direction in Arabic (directional icons only). */
[dir="rtl"] .rym-cal-nav .fi-icon {
    transform: scaleX(-1);
}

/*
 * The board (SPEC-polish §4.1, PT-09; `.rym-cal-board` on the `.fi-ta` root, GroupedCalendar::table()).
 * From 40 rem, the unit column stays in view while the nights scroll (`.fi-ta-content-ctn` is the scroll container).
 * Below 40 rem it scrolls with the nights as before (review R-P1): a held unit column of about 17 rem would leave less
 * than one night readable on a 360-390 px phone. The board is grouped by property: a group row is
 * `tr.fi-ta-row.fi-ta-group-header-row > td[colspan]`, painted gray-50 by Filament, so only the header cell and the unit
 * cell of a record row are sticky; the gray property band stays gray, without a hairline. The hairline is an inset
 * shadow on the inner edge (a border scrolls away from a sticky cell of a collapsed table); it is decorative (the column
 * is also named by its header). The unit header keeps the header row's gray-50 (Filament `.fi-ta-table > thead > tr`),
 * opaque so the scrolled night headers pass under it: no white block in the gray header row (review R-P2; the ops
 * planning board does the same).
 */
@media (min-width: 40rem) {
    .rym-cal-board .fi-ta-table :is(.fi-ta-header-cell:first-child, .fi-ta-row:not(.fi-ta-group-header-row) > .fi-ta-cell:first-child) {
        position: sticky;
        inset-inline-start: 0;
        z-index: 1;
        background-color: #fff;
        box-shadow: inset -1px 0 0 var(--rym-bo-hairline);
    }

    [dir="rtl"] .rym-cal-board .fi-ta-table :is(.fi-ta-header-cell:first-child, .fi-ta-row:not(.fi-ta-group-header-row) > .fi-ta-cell:first-child) {
        box-shadow: inset 1px 0 0 var(--rym-bo-hairline);
    }

    .rym-cal-board .fi-ta-table :is(.fi-ta-header-cell:first-child, .fi-ta-row:not(.fi-ta-group-header-row) > .fi-ta-cell:first-child):is(th) {
        background-color: var(--gray-50);
    }
}

/* Today's night: the "current" sign of the tabs (primary-50 fill, 2 px primary-600 bar, primary-800 text 8.16:1); the
   header also says « Aujourd'hui » in words. */
.rym-cal-board .fi-ta-header-cell.rym-cal-today {
    background-color: var(--primary-50);
    color: var(--primary-800);
    box-shadow: inset 0 -2px 0 var(--primary-600);
}

/*
 * Quiet chips (product-owner decision 3): « libre » is the resting state, white with a hairline ring and gray-700 text
 * (10.72:1; was green #dcfce7 / #14532d); « vendue » is slate gray-200 with gray-900 text (14.46:1; was a second blue
 * next to the brand). Background colour only, so a past night keeps its hatching (`.rym-chip--past`). Blocked, held,
 * stop-sell, group-claimed and unknown keep the shared chips; the ops boards keep theirs (this sheet is partner-only).
 */
.rym-cal-cell.rym-chip--free,
.rym-cal-legend .rym-chip--free {
    background-color: #fff;
    color: var(--gray-700);
    box-shadow: inset 0 0 0 1px var(--rym-bo-hairline);
}

.rym-cal-cell.rym-chip--sold,
.rym-cal-legend .rym-chip--sold {
    background-color: var(--gray-200);
    color: var(--gray-900);
}

/* Listing wizard (PT-15): the checklist of the last step uses the shared `.rym-checklist` rules; the taxes of step 9 are
   a plain bulleted list (no inline style left in either). */
.rym-wizard-checklist {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
}

.rym-wizard-taxes {
    margin: 0;
    padding-inline-start: 1.25rem;
    list-style: disc;
}

.rym-wizard-taxes > li + li {
    margin-block-start: .25rem;
}
