/* ─────────────────────────────────────────────────────────────────────
   HOMEi «الطلبات» (the customer reservation-requests module) on the house
   design system — RR-DS-1, Kamal 2-10-2026: «عدل التصميم للديزاين سيستم
   بتاعنا واضغط الداتا ميبقاش فيه اسكرول كتير… زي الجروث الذكي».
     الطلبات · تجميع الطلبات · طلبات الأراضي · الطلبات المكررة ·
     مجموعة الطلبات · برامج كلاود فور · تقارير الطلبات (+ ريكوست 360,
     إعدادات الترشيح والتجميع, تعديل الطلب).
   As «الجروث الذكي» v2: tight rows, filters as chips (no pills, no tabs
   inside a page), one ruled card per list.

   Prefix `rr`. Every Filament page of the module carries `rr-page`
   (getPageClasses); the custom pages keep their own scopes (.dw .cf .dup
   .gs .rjp .sjp) whose local tokens now read the house ones.

   Colours: the house tokens (--lm-d-* in tokens.css, with their dark
   mirror) — no colour literal here, the ratchet holds this sheet at zero.
   Text never under 12px. Logical properties only (RTL/LTR).

   Registered as a Filament asset: a change here ships nothing until
   `php artisan filament:assets` is run and public/css/app/ is committed.
   ──────────────────────────────────────────────────────────────────── */

/* ── 1. the page head ── */
body .rr-page .fi-page-header-main-ctn { padding-block: 20px 16px; row-gap: 14px; }
body .rr-page .fi-header { gap: 8px; align-items: center; }
body .rr-page .fi-header-heading { font-size: 26px; font-weight: 700; line-height: 1.25; color: var(--lm-d-ink); }
body .rr-page .fi-header-subheading { margin-block-start: 2px; font-size: 13.5px; color: var(--lm-d-muted); }
body .rr-page .fi-header-actions-ctn .fi-btn {
    min-block-size: 40px;
    border-radius: 12px;
    padding-inline: 14px;
    background: var(--lm-d-surface);
    color: var(--lm-d-ink);
    box-shadow: inset 0 0 0 1px var(--lm-d-control-edge);
    font-weight: 700;
    font-size: 14px;
}
body .rr-page .fi-header-actions-ctn .fi-btn .fi-icon { color: currentColor; }
body .rr-page .fi-header-actions-ctn .fi-btn:is(.fi-color-primary, .fi-color-success) { background: var(--lm-d-accent); color: var(--lm-d-on-accent); box-shadow: 0 4px 12px var(--lm-d-accent-soft); }
body .rr-page .fi-header-actions-ctn .fi-btn.fi-color-danger { color: var(--lm-d-danger); box-shadow: inset 0 0 0 1px var(--lm-d-gap-edge); }
body .rr-page .fi-page-content { row-gap: 12px; }

/* ── 2. a Filament table as the page's ruled card ── */
body .rr-page .fi-ta-ctn {
    background: var(--lm-d-surface);
    border: 1px solid var(--lm-d-border);
    border-block-start: 3px solid var(--lm-d-info);
    border-radius: 16px;
    box-shadow: 0 1px 2px var(--lm-d-shadow);
    overflow: clip;
}
body .rr-page .fi-ta-header-ctn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-inline: 16px; border-block-end: 1px solid var(--lm-d-divider); }
body .rr-page .fi-ta-header-ctn > * { border: 0; }
body .rr-page .fi-ta-header { padding-block: 8px; flex: 1 1 auto; min-inline-size: 0; }
body .rr-page .fi-ta-header-toolbar { padding-block: 6px; padding-inline: 0; flex: 0 1 auto; margin-inline-start: auto; gap: 8px; }
body .rr-page .fi-ta-search-field { inline-size: min(260px, 100%); }
body .rr-page .fi-ta-search-field .fi-input-wrp { border-radius: 10px; box-shadow: inset 0 0 0 1px var(--lm-d-control-edge); background: var(--lm-d-surface); }
body .rr-page .fi-ta-header-cell { background: var(--lm-d-surface); padding-block: 9px; padding-inline: 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
body .rr-page .fi-ta-header-cell,
body .rr-page .fi-ta-header-cell .fi-ta-header-cell-label { color: var(--lm-d-ink); }
body .rr-page .fi-ta-row > td { border-block-end: 1px solid var(--lm-d-divider); }
body .rr-page .fi-ta-row:hover > td { background: var(--lm-d-hover); }
body .rr-page .fi-ta-cell { padding-block: 0; color: var(--lm-d-ink); }
/* tight rows: the cell's own content block loses Filament's tall padding */
body .rr-page .fi-ta-cell > :is(.fi-ta-col, .fi-ta-col-wrp) { padding-block: 6px; }
body .rr-page .fi-ta-cell .fi-ta-col :is(.fi-ta-text, .fi-ta-text-item, .fi-ta-icon) { padding-block: 0; }
body .rr-page .fi-ta-cell .fi-ta-text-has-descriptions { gap: 0; line-height: 1.35; }
body .rr-page .fi-ta-cell .fi-ta-text-item { font-size: 13.5px; color: var(--lm-d-ink); }
body .rr-page .fi-ta-cell .fi-ta-text-description { font-size: 12px; color: var(--lm-d-muted); }
body .rr-page .fi-ta-cell .fi-badge { font-size: 12px; font-weight: 700; border-radius: 999px; padding-inline: 8px; min-block-size: 22px; }
body .rr-page .fi-ta-actions .fi-link { font-size: 13px; font-weight: 700; }
body .rr-page .fi-ta-selection-cell, body .rr-page .fi-ta-actions-cell { padding-block: 6px; }
body .rr-page .fi-pagination { padding: 8px 16px; }
body .rr-page .fi-pagination-item.fi-active .fi-pagination-item-btn { color: var(--lm-d-accent-ink); box-shadow: inset 0 0 0 1px var(--lm-d-accent); }
body .rr-page .fi-ta-filter-indicators { padding-inline: 16px; border-block-end: 1px solid var(--lm-d-divider); }
body .rr-page .fi-ta-filter-indicators .fi-badge { border-radius: 10px; background: var(--lm-d-info-soft); color: var(--lm-d-info); font-weight: 600; box-shadow: none; }
body .rr-page .fi-ta-empty-state { padding-block: 32px; }

/* ── 3. view filters: Filament's tabs (and the module's own quick filters) as chips ── */
body .rr-page .fi-tabs { gap: 6px; padding: 0; margin: 0; border: 0; background: transparent; box-shadow: none; overflow-x: auto; scrollbar-width: none; max-inline-size: 100%; }
body .rr-page .fi-sc-tabs, body .rr-page .fi-resource-tabs { margin: 0; }
body .rr-page .fi-tabs-item, .rr-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-block-size: 34px;
    padding-inline: 12px;
    border: 1px solid var(--lm-d-border);
    border-radius: 10px;
    background: var(--lm-d-page);
    color: var(--lm-d-muted);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
}
body .rr-page .fi-tabs-item .fi-tabs-item-label { color: inherit; }
body .rr-page .fi-tabs-item .fi-badge, .rr-chip b { color: var(--lm-d-ink); font-weight: 700; font-variant-numeric: tabular-nums; background: transparent; box-shadow: none; padding: 0; min-block-size: 0; font-size: 13px; }
body .rr-page .fi-tabs-item:hover, .rr-chip:hover { background: var(--lm-d-chip-bg); }
body .rr-page .fi-tabs-item.fi-active, .rr-chip.is-on { background: var(--lm-d-info-soft); border-color: var(--lm-d-info-soft); color: var(--lm-d-info); }
body .rr-page .fi-tabs-item.fi-active .fi-badge, .rr-chip.is-on b { color: var(--lm-d-info); }
.rr-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rr-head { display: flex; flex-direction: column; gap: 8px; }
.rr-dim { color: var(--lm-d-muted); }
.rr-arrival {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 8px 12px;
    border: 1px solid var(--lm-d-accent);
    border-radius: 10px;
    background: var(--lm-d-accent-soft);
    color: var(--lm-d-ink);
    font-size: 13.5px;
}
.rr-arrival a { margin-inline-start: auto; color: var(--lm-d-accent-ink); font-weight: 700; text-decoration: none; white-space: nowrap; }

/* ── 3b. the custom pages' own lists: one ruled card, a head row with chips, a pager ── */
.rr-card {
    background: var(--lm-d-surface);
    border: 1px solid var(--lm-d-border);
    border-block-start: 3px solid var(--lm-d-info);
    border-radius: 16px;
    box-shadow: 0 1px 2px var(--lm-d-shadow);
    overflow: clip;
    color: var(--lm-d-ink);
}
.rr-card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 16px; border-block-end: 1px solid var(--lm-d-divider); }
.rr-card-t { font-size: 15px; font-weight: 700; color: var(--lm-d-ink); }
.rr-card table thead tr { background: var(--lm-d-surface); }
.rr-card table thead th { color: var(--lm-d-ink); font-size: 13px; font-weight: 700; border-block-end: 1px solid var(--lm-d-divider); white-space: nowrap; }
.rr-card table tbody tr:hover { background: var(--lm-d-hover); }
.rr-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; border-block-start: 1px solid var(--lm-d-divider); font-size: 13px; }
.rr-pages { display: inline-flex; gap: 4px; }
.rr-page-btn { min-inline-size: 32px; block-size: 32px; padding-inline: 8px; border: 1px solid var(--lm-d-border); border-radius: 8px; background: var(--lm-d-surface); color: var(--lm-d-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.rr-page-btn:hover { background: var(--lm-d-hover); }
.rr-page-btn.is-on { border-color: var(--lm-d-accent); color: var(--lm-d-accent-ink); }
.rr-page-btn:disabled { opacity: .45; cursor: default; }

/* two operator boxes side by side on a desktop (برامج كلاود فور) */
.rr-duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 12px; align-items: start; }
.rr-duo:empty { display: none; }

/* «إعدادات الترشيح والتجميع»: the form and its live preview side by side; the preview scrolls inside itself */
.rr-gs-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.rr-gs-form { display: flex; flex-direction: column; gap: 12px; min-inline-size: 0; }
@media (min-width: 1200px) {
    .rr-gs-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
    .rr-gs-preview { position: sticky; inset-block-start: 12px; max-block-size: calc(100dvh - 210px); overflow-y: auto; overscroll-behavior: contain; }
}

/* «ريكوست 360»: the records with nothing in them, folded into one line */
.rr-empties { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-block-end: 12px; padding: 8px 12px; border: 1px dashed var(--lm-d-border); border-radius: 12px; background: var(--lm-d-surface); font-size: 13px; color: var(--lm-d-muted); }
.rr-empties-t { font-weight: 700; color: var(--lm-d-ink); }
.rr-empty { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--lm-d-quiet-bg); }
.rr-empty b { font-weight: 600; color: var(--lm-d-ink); }

/* ── 4. forms (create / edit): sections as plain house cards, tight ── */
body .rr-page .fi-section { border-radius: 16px; border: 1px solid var(--lm-d-border); box-shadow: 0 1px 2px var(--lm-d-shadow); outline: 0; background: var(--lm-d-surface); }
body .rr-page .fi-section-header { padding: 10px 16px; gap: 2px 10px; }
body .rr-page .fi-section-header-heading { font-size: 15px; font-weight: 700; color: var(--lm-d-ink); }
body .rr-page .fi-section-header-description { font-size: 12.5px; color: var(--lm-d-muted); }
body .rr-page .fi-section-content { padding: 12px 16px; }
body .rr-page .fi-section-content-ctn { border-color: var(--lm-d-divider); }
body .rr-page .fi-fo-field-label-content { font-size: 13.5px; font-weight: 700; color: var(--lm-d-ink); }
body .rr-page .fi-input-wrp { border-radius: 10px; box-shadow: inset 0 0 0 1px var(--lm-d-control-edge); }
body .rr-page .fi-fo-field-wrp-helper-text { font-size: 12.5px; color: var(--lm-d-muted); }
body .rr-page .fi-sc { gap: 12px 16px; }
body .rr-page .fi-fo-field { gap: 4px; }
body .rr-page .fi-form-actions { gap: 8px; }
body .rr-page .fi-form-actions .fi-btn { min-block-size: 40px; border-radius: 10px; font-weight: 700; }
body .rr-page .fi-form-actions .fi-btn.fi-color-primary { background: var(--lm-d-accent); color: var(--lm-d-on-accent); }
body .rr-page .fi-form-actions .fi-btn:not(.fi-color-primary) { background: var(--lm-d-surface); color: var(--lm-d-ink); box-shadow: inset 0 0 0 1px var(--lm-d-control-edge); }

/* ── 5. phones: rows wrap, chips scroll sideways ── */
@media (max-width: 1023.98px) {
    .rr-chips, body .rr-page .fi-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    body .rr-page .fi-header-heading { font-size: 22px; }
}
@media (max-width: 640px) {
    body .rr-page .fi-ta-search-field { inline-size: 100%; }
    /* a table row as a card (Filament's stackedOnMobile): every value with its
       name, two to a line; the checkbox in the corner, the actions on the last line */
    body .rr-page .fi-ta-table-stacked-on-mobile .fi-ta-row { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; padding: 10px 14px; border-block-end: 1px solid var(--lm-d-divider); }
    body .rr-page .fi-ta-table-stacked-on-mobile .fi-ta-row > td { display: block; padding: 0; border: 0; min-inline-size: 0; }
    body .rr-page .fi-ta-table-stacked-on-mobile .fi-ta-row > td:empty { display: none; }
    body .rr-page .fi-ta-table-stacked-on-mobile .fi-ta-row > td.fi-ta-selection-cell { position: absolute; inset-block-start: 10px; inset-inline-end: 12px; }
    body .rr-page .fi-ta-table-stacked-on-mobile .fi-ta-row > td.fi-ta-selection-cell ~ td:nth-child(3) { padding-inline-start: 28px; }
    body .rr-page .fi-ta-table-stacked-on-mobile .fi-ta-row > td:has(.fi-ta-actions) { grid-column: 1 / -1; }
    body .rr-page .fi-ta-table-stacked-on-mobile .fi-ta-cell-label { font-size: 12px; font-weight: 600; color: var(--lm-d-muted); line-height: 1.4; padding: 0; }
    body .rr-page .fi-ta-table-stacked-on-mobile .fi-ta-cell-content > :is(.fi-ta-col, .fi-ta-col-wrp),
    body .rr-page .fi-ta-table-stacked-on-mobile .fi-ta-cell-content :is(.fi-ta-text, .fi-ta-text-item, .fi-ta-icon) { padding: 0; }
    body .rr-page .fi-ta-table-stacked-on-mobile .fi-ta-cell-content .fi-ta-text-item { font-size: 13.5px; }
    body .rr-page .fi-ta-table-stacked-on-mobile .fi-ta-cell-content .fi-badge { min-block-size: 22px; }
    body .rr-page .fi-ta-table-stacked-on-mobile .fi-ta-cell-content .fi-badge { max-inline-size: 100%; overflow: hidden; }

    /* the custom pages' own lists (تجميع الطلبات · كلاود فور) as cards: the
       name across the top, the figures three to a line, each with its name */
    .rr-ptable thead { display: none; }
    .rr-ptable, .rr-ptable tbody { display: block; }
    .rr-ptable tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 8px; padding: 10px 14px; border-block-start: 1px solid var(--lm-d-divider); }
    .rr-ptable tr > td { display: block; padding: 0 !important; text-align: start !important; max-inline-size: none !important; min-inline-size: 0; white-space: normal !important; }
    .rr-ptable tr > td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--lm-d-muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .rr-ptable tr > td.is-main { grid-column: 1 / -1; }
    .rr-ptable tr > td.is-main::before { display: none; }
    .rr-ptable tr > td:last-child { grid-column: 1 / -1; }

    /* «الطلبات المكررة»: each request's line wraps, its decision on a line of its own */
    .rr-dup-rows, .rr-dup-rows tbody { display: block; }
    .rr-dup-rows tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding-block: 6px; }
    .rr-dup-rows tr > td { padding: 0 !important; }
    .rr-dup-rows tr > td:last-child { flex: 1 0 100%; text-align: start !important; }

    /* the custom pages' pickers never wider than the screen */
    :is(.cf, .dw, .gs, .dup) :is(select, input) { min-inline-size: 0 !important; max-inline-size: 100%; }
    .rr-chip, body .rr-page .fi-tabs-item { min-block-size: 40px; }
}
