/* ══════════════════════════════════════════════════════════════════════
   PHAZA PORTAL ADAPTER — UI Core 2.6.0
   Laravel + Filament. Vendor SELECTORS only; every value comes from a
   token. If you find a raw hex below, it is a bug — fix it in tokens.py
   and rebuild, never here.

   SELECTOR VERIFICATION STATUS. All 57 selectors were swept against a 20-route
   rendered corpus, Filament vendor source and the live DOM (Portal, 2026-08-25).
   Five categories, because "verified / unverified" was too coarse to be useful:

     VERIFIED-CORPUS     matched in rendered markup
     VERIFIED-VENDOR     absent from the corpus but present in vendor source;
                         state-gated, renders only when the state occurs
                         (modal open, stats widget present, field in error)
     STRUCTURAL          element or attribute selector; no class to verify
     PRODUCT-SUPPRESSED  never renders in THIS product by configuration, kept
                         because other consumers need it
     DEAD                wrong key. Five were found and re-keyed in 2.5.2.

   A dead selector fails silently and looks like coverage. NOT-IN-CORPUS on its
   own proves nothing — it splits three ways, and only one of them is a bug.

   Pinned to: Filament v5.x (.fi-* class contract), verified against rendered
   markup 2026-08-24 by the Portal parity matrix. Two selectors in the first cut
   were DEAD and silently did nothing — .fi-fo-field-wrp (v5 renders
   .fi-fo-field) and .fi-btn-primary (v3-era). Note the exception below: the
   ERROR MESSAGE class kept the -wrp- infix that the wrapper lost. A dead selector is worse than a
   missing rule: it looks like coverage.
   On a Filament major upgrade, re-run the visual regression set in
   ../rules/accessibility.md §7 before shipping.
   ══════════════════════════════════════════════════════════════════════ */
/* REQUIRES core/phaza-ui-core.css to be loaded FIRST by the host application
   (contracts.md §1). This file deliberately does NOT @import it: in 2.0.0 it
   did, which bound the adapter to one directory layout and double-loaded the
   core stylesheet. Load order is the app's job, not the adapter's. */

/* ---- ground: no vendor white ever reaches the screen ---- */
.fi-body, .fi-main, .fi-layout { background: var(--phz-surface-canvas) !important; color: var(--phz-text-primary); }
/* PRODUCT-SUPPRESSED: .fi-sidebar never renders in the Portal (navigation(false));
   kept because other Filament consumers do render it. */
.fi-sidebar, .fi-topbar { background: var(--phz-surface-raised) !important; border-color: var(--phz-border-subtle) !important; }
/* the active class sits on the ITEM, and the control is -btn not -button */
.fi-sidebar-item.fi-active .fi-sidebar-item-btn { background: var(--phz-surface-hover) !important;
  box-shadow: inset 2px 0 0 var(--phz-brand-action); }
[dir="rtl"] .fi-sidebar-item.fi-active .fi-sidebar-item-btn { box-shadow: inset -2px 0 0 var(--phz-brand-action); }

/* ---- containers wear the one edge ---- */
/* THE CANONICAL SURFACE GROUP. Every main container in the product belongs
   here — surface gradient, inset ring, stage cut, signature trace at the cut.

   A vendor hook that merely consumes surface TOKENS is not yet a canonical
   surface. The cut and the trace are what make it one. .fi-ta-ctn — the table
   card, the largest and most-seen surface in the product — sat outside this
   group for nine cuts while rendering the gradient, so it read as styled and
   was not. If you add a Filament container to the adapter, add it HERE or state
   why it is exempt.

   VERIFIED-CORPUS: .fi-section, .fi-ta-ctn (8+ of 20 corpus routes).
   VERIFIED-VENDOR: .fi-wi-stats-overview-stat (stats-overview blade) and
   .fi-modal-window (support JS) are state-gated and absent from a static
   corpus. */
.fi-section, .fi-ta-ctn, .fi-wi-stats-overview-stat, .fi-modal-window {
  background: linear-gradient(180deg, var(--phz-surface-hover), var(--phz-surface-raised) 24%) !important;
  box-shadow: inset 0 0 0 1px var(--phz-border-default) !important;
  border: 0 !important; border-radius: 0 !important;
  clip-path: var(--phz-cut-stage); position: relative; }
[dir="rtl"] .fi-section, [dir="rtl"] .fi-ta-ctn,
[dir="rtl"] .fi-wi-stats-overview-stat, [dir="rtl"] .fi-modal-window {
  clip-path: var(--phz-cut-stage-rtl); }
.fi-section::after, .fi-ta-ctn::after,
.fi-wi-stats-overview-stat::after, .fi-modal-window::after {
  content: ""; position: absolute; top: 0; left: 0; z-index: 2;
  width: var(--phz-cut-len); height: var(--phz-trace-w); background: var(--phz-gradient-signature);
  transform-origin: 0 0;
  /* translateY(-100%) puts the thickness on the INWARD normal of the cut.
     Without it the strip grows outward and the clip erases it — which is why
     this trace rendered nowhere from 2.0.0 to 2.5.4. */
  transform: translateX(var(--phz-cut-x)) rotate(var(--phz-cut-ang)) translateY(-100%);
  pointer-events: none; }
[dir="rtl"] .fi-section::after, [dir="rtl"] .fi-ta-ctn::after,
[dir="rtl"] .fi-wi-stats-overview-stat::after,
[dir="rtl"] .fi-modal-window::after { left: auto; right: 0; transform-origin: 100% 0;
  transform: translateX(calc(var(--phz-cut-x) * -1)) rotate(calc(var(--phz-cut-ang) * -1)) translateY(-100%); }

/* ---- actions ---- */
.fi-btn { border-radius: 0 !important; }
/* the canonical primary button carries the control-scale blade cut. The first
   cut of this adapter set border-radius:0 and stopped there, so Filament
   primaries were square but uncut — right colour, wrong shape. */
.fi-btn.fi-color-primary { background: var(--phz-gradient-action) !important;
  border: 0 !important; color: #fff !important; clip-path: var(--phz-cut-button); }
[dir="rtl"] .fi-btn.fi-color-primary { clip-path: var(--phz-cut-button-rtl); }
.fi-btn.fi-color-danger { background: linear-gradient(140deg,#E25555,#C03434) !important; color:#fff !important; }
.fi-btn:disabled, .fi-btn[aria-disabled="true"] { opacity: .45; filter: none; }

/* ---- fields: shadow-elevated, sharp, bloom+sweep focus. Never a system border ---- */
.fi-input, .fi-select-input, .fi-fo-textarea, .fi-fo-field input, .fi-fo-field textarea {
  background-color: var(--phz-surface-sunken) !important; color: var(--phz-text-primary) !important;
  border-color: transparent !important; border-radius: 0 !important;
  box-shadow: var(--phz-shadow-field) !important; }
.fi-input:focus, .fi-select-input:focus, .fi-fo-textarea:focus,
.fi-fo-field input:focus, .fi-fo-field textarea:focus {
  outline: none !important; box-shadow: var(--phz-shadow-field-focus) !important; }
/* Filament's naming is INCONSISTENT here and it is a trap. The wrapper div was
   renamed .fi-fo-field-wrp -> .fi-fo-field in v5, but its error message KEPT
   the -wrp- infix: field-wrapper.blade.php still renders
   .fi-fo-field-wrp-error-message (verified in vendor source, v5.7.6).
   Do NOT "normalise" this selector to match the wrapper rename — that kills it. */
.fi-fo-field-wrp-error-message { color: var(--phz-status-danger); }

/* ---- dropdowns: one surface language, sharp, attached tier ---- */
/* combobox options: .fi-select-input-option inside .fi-select-input-options-ctn,
   selected carried by the CLASS .fi-selected — not aria-selected. Live-verified
   on an open combobox. The NATIVE variant (.fi-select-input, a real <select>)
   has no styleable options at all: the popup is drawn by the OS. */
.fi-dropdown-panel, .fi-select-input-options-ctn {
  background: var(--phz-surface-overlay) !important; border: 1px solid var(--phz-border-default) !important;
  border-radius: 0 !important; box-shadow: var(--phz-shadow-dropdown) !important; }
.fi-dropdown-list-item, .fi-select-input-option { border-radius: 0 !important; position: relative; }
.fi-dropdown-list-item:hover, .fi-select-input-option:hover { background: var(--phz-surface-hover) !important; }
.fi-select-input-option.fi-selected { color: var(--phz-link) !important; }

/* ---- identity: the blade window, never a circle ---- */
.fi-avatar, .fi-user-avatar { border-radius: 0 !important;
  transform: skewX(var(--phz-window-skew)); overflow: hidden; }
.fi-avatar img, .fi-user-avatar img { transform: skewX(var(--phz-window-counter)); }

/* ---- status stays colour + icon + word, never colour alone ---- */
.fi-badge { border-radius: var(--phz-radius-pill) !important; }

/* ---- tables ----
   VERIFIED against rendered Filament v5.7.6 markup by the Portal coverage
   ledger, 2026-08-24/25: .fi-ta-table, thead, .fi-ta-row, .fi-ta-header-cell,
   .fi-ta-header-cell-sort-btn (+ its svg). ---- */
.fi-ta-table thead { background: var(--phz-surface-raised); }
.fi-ta-row:hover { background: var(--phz-surface-hover); }

/* the tbl-data header ruling, implemented. Filament v5.7.6 renders NO
   .fi-ta-header-cell-label element — the header text lives directly in
   .fi-ta-header-cell and in .fi-ta-header-cell-sort-btn when the column sorts.
   Style both or sortable columns silently keep vendor type. */
.fi-ta-header-cell, .fi-ta-header-cell-sort-btn {
  font-family: var(--phz-font-mono) !important;
  font-size: var(--phz-text-xs) !important;
  text-transform: uppercase; letter-spacing: .88px;
  color: var(--phz-text-muted) !important; }
/* uppercase is a LATIN-ONLY instruction — Arabic has no case, so an RTL header
   keeps the sans face at the same size, weight and tracking. */
[dir="rtl"] .fi-ta-header-cell, [dir="rtl"] .fi-ta-header-cell-sort-btn {
  font-family: var(--phz-font-ui) !important; text-transform: none; }
/* the hairline goes on the SECTION, not the cell. Per-cell is the same line
   only while cells fill the row — a trailing spacer cell or scroll-padding
   leaves a gap in it. One run cannot develop gaps. (Portal, 2026-08-24.) */
.fi-ta-table thead { box-shadow: inset 0 -1px 0 var(--phz-brand-accent); }
/* the sort icon is an svg INSIDE the sort button; v5.7.6 renders no
   .fi-ta-header-cell-sort-icon element. This selector shipped dead in 2.5.0,
   two lines under the paragraph documenting the last dead selector — fixing an
   instance is not fixing the neighbourhood. */
.fi-ta-header-cell-sort-btn svg { color: var(--phz-brand-action); }

/* ---- links ---- */
a, .fi-link { color: var(--phz-link); }
