/* ===================================================================
   Table treatment shared by both panels.

   Its own file because both the admin and the member panel load their
   own stylesheet and neither loads the other's: a copy in each is two
   copies to keep in step, and tables are exactly where that drift gets
   noticed.

   What it does:

     * pins the actions column to the right edge, so it is still there
       when a wide table is scrolled sideways;
     * quietens the header and the dividers, so the data reads before
       the furniture does.
   =================================================================== */

/* -------------------------------------------- the pinned action cell

   The abstracts list is 2,100px wide in a 1,400px window — scrolled all
   the way right to reach Edit, and all the way back to read who
   submitted it. Pinned, the actions stay put and the columns move
   under them.

   Only on tables that have an actions column: :has() guards that, so a
   table whose last column is real data is not frozen by accident.

   Filament gives rows no background of their own — the opaque colour
   comes from the container behind them — so a sticky cell has to carry
   its own, in every row state, or the columns scroll through it.
*/
:root {
    --iaam-ta-pinned: var(--color-white);
    --iaam-ta-pinned-hover: var(--gray-50);
    --iaam-ta-edge: var(--gray-200);
}

.dark {
    --iaam-ta-pinned: var(--color-gray-900);
    /* The same 5% white Filament composites for a hovered dark row,
       mixed over the container instead of laid on top of nothing. */
    --iaam-ta-pinned-hover: color-mix(in oklab, var(--color-white) 5%, var(--color-gray-900));
    --iaam-ta-edge: var(--gray-700);
}

.fi-ta-table:has(.fi-ta-actions-header-cell) > tbody > tr > td:last-child,
.fi-ta-table:has(.fi-ta-actions-header-cell) > thead > tr > th:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    background-color: var(--iaam-ta-pinned);
    /* A line rather than a shadow: a shadow that is always on reads as
       a rendering fault when the table is not scrolled at all. */
    border-inline-start: 1px solid var(--iaam-ta-edge);
}

/* The header sits above its own column and below nothing else. */
.fi-ta-table:has(.fi-ta-actions-header-cell) > thead > tr > th:last-child {
    z-index: 3;
    background-color: var(--iaam-ta-pinned-hover);
}

/* Hovered and striped rows, matching what Filament does to the rest of
   the row — a pinned cell that stays white while its row greys is worse
   than one that does not stick. */
.fi-ta-row.fi-clickable:hover > td:last-child,
.fi-ta-row.fi-striped > td:last-child {
    background-color: var(--iaam-ta-pinned-hover);
}

/* Narrow screens scroll the whole page instead, and a pinned column
   there costs width the data needs more. */
@media (max-width: 640px) {
    .fi-ta-table:has(.fi-ta-actions-header-cell) > tbody > tr > td:last-child,
    .fi-ta-table:has(.fi-ta-actions-header-cell) > thead > tr > th:last-child {
        position: static;
        border-inline-start: 0;
    }
}

/* ------------------------------------------------- quieter furniture

   Lighter, wider-tracked header text and a single-pixel divider, so a
   row of data is what the eye lands on first.
*/
.fi-ta-header-cell,
.fi-ta-actions-header-cell {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.fi-ta-header-cell .fi-ta-header-cell-label {
    font-weight: 600;
}

/* ------------------------------------------- the column chooser gear

   Pushed to the right-hand end of the toolbar, so it sits directly
   above the pinned actions column — which is where a table like
   Cloudflare's puts it, and where somebody looking for "what else can
   this table show me" looks for it.

   Not inside the header row itself, which is where that design has it:
   Filament renders this control in .fi-ta-header-toolbar, outside the
   element that scrolls horizontally, so moving it into a <th> is not a
   margin change. It would mean either owning a copy of Filament's
   2,000-line table view or moving the node with JavaScript, and
   Livewire's morphing would undo the second on every sort, filter and
   page change. The toolbar's right edge is the same place to the eye
   and costs neither.

   The toolbar's own wrapper carries no class, so it is reached through
   the child it holds.
*/
.fi-ta-header-toolbar > :has(> .fi-ta-col-manager-dropdown) {
    flex: 1 1 auto;
}

.fi-ta-header-toolbar .fi-ta-col-manager-dropdown {
    margin-inline-start: auto;
}

/* The search box keeps its own width rather than stretching to fill
   the room the line above just made. */
.fi-ta-header-toolbar .fi-ta-search-field {
    flex: 0 1 auto;
}

/* ===================================================================
   Typography and rhythm for data-dense screens.

   Grounded in IBM's Carbon design system rather than taste, because
   both panels already load IBM Plex Sans and Carbon is the system
   built around that typeface — so its published scale applies natively
   instead of being imported from somewhere it does not belong.

   Carbon's "productive" type set is the one meant for focused,
   task-driven product UI, as against "expressive" for pages people
   read. Its base is 14px, its data-table column headers are 14px
   SemiBold and its row text 14px Regular. That is what is set below.

   Three further rules, from Nielsen Norman Group's visual-design
   guidance: two to three type sizes rather than a ladder of them;
   one spacing unit within a group and double between groups, so
   spacing does the grouping; and a small palette, with colour on the
   few things that matter and everything else muted.
   =================================================================== */

/* ------------------------------------------------- tabular figures

   The single biggest legibility win on these screens, and the one
   thing proportional type gets wrong: in IAAM-W1001 / IAAM-W1002 the
   digits are different widths, so a column of register numbers does
   not line up and the eye cannot scan it. Tabular figures make every
   digit the same width. Applied to the columns that are numbers —
   references, dates, counts, money — and not to prose, where tabular
   spacing looks gappy.
*/
.fi-ta-cell-registernumber,
.fi-ta-cell-created-at,
.fi-ta-cell-updated-at,
.fi-ta-cell-total-price,
.fi-ta-cell-iaam-id,
.fi-ta-cell-nights,
.fi-ta-cell-reg-price,
.fi-ta-cell-accommodation-price,
.fi-ta-cell-dinner-price,
.fi-ta-cell-tour-price,
.fi-ta-badge,
.fi-wi-stats-overview-stat-value {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
}

/* --------------------------------------------- the table's own type

   Carbon's data-table values. The header was the same size and weight
   as the data under it, which left the two competing; SemiBold at the
   same size separates them without making the header shout.
*/
.fi-ta-header-cell .fi-ta-header-cell-label {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0;
}

.fi-ta-cell .fi-ta-text-item-label {
    font-size: 0.875rem;
    line-height: 1.43;
}

/* ------------------------------------------------- stat tiles

   Hierarchy by scale and weight rather than by colour, so the number
   is what the eye lands on and the label explains it afterwards. Three
   levels and no more: value, label, description.
*/
.fi-wi-stats-overview-stat-value {
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.fi-wi-stats-overview-stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.fi-wi-stats-overview-stat-description {
    font-size: 0.75rem;
    line-height: 1.4;
}

/* ------------------------------------------------- chart headings

   A chart's heading and its description were the same weight, so the
   explanation competed with the title it was explaining.
*/
.fi-wi-chart .fi-wi-chart-header-heading,
.fi-sc-component > .fi-section-header-heading {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.fi-wi-chart .fi-wi-chart-header-description {
    font-size: 0.8125rem;
    line-height: 1.45;
    opacity: 0.78;
}

/* ------------------------------------------------- spacing as grouping

   One unit inside a panel, double between panels. NN/G's point is
   that consistent spacing is what makes groups read as groups, and
   inconsistent spacing is what undoes them.
*/
.fi-wi {
    --iaam-gap: 1rem;
}

.fi-wi-stats-overview-stat {
    padding: 1.125rem 1.25rem;
}

/* ===================================================================
   Depth and presence.

   The typography above fixes legibility; this is the part that was
   actually making the panel feel flat. Everything sat on one plane —
   white cards, a grey page, a one-pixel border — so nothing came
   forward and nothing receded, and the eye had nowhere to land.

   NN/G's point about hierarchy is that it is built from scale, value,
   colour, spacing and placement together. Only spacing was doing any
   work here. What follows adds scale to the page heading and value
   (a little elevation) to the panels, and leaves colour alone
   entirely: on a surface where the visitor is doing a task, the accent
   belongs to primary actions, the current selection and state — never
   to decoration.
   =================================================================== */

/* The page title had the same presence as a section heading inside
   the page. It is the one thing that says where you are. */
.fi-header-heading {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.fi-header-subheading {
    font-size: 0.875rem;
    opacity: 0.75;
}

/*
 * A shadow rather than only a border, so a panel sits above the page
 * instead of being drawn on it. Kept very light: this is a working
 * tool that people look at all day, and heavy elevation on every card
 * is tiring and makes a dense screen noisier, not clearer.
 */
/*
 * Elevation declared once, not twice.
 *
 * Filament gives these panels a one-pixel border. Adding a shadow on
 * top of it produces the ghost card — two depth signals arguing, which
 * reads as neither. So in the light the border goes and the shadow
 * carries it, with a real offset and blur rather than a halo.
 *
 * In the dark it is the other way round: a shadow on a dark ground is
 * invisible, so the border stays and does the work alone.
 */
.fi-section,
.fi-wi-chart,
.fi-ta-ctn,
.fi-wi-stats-overview-stat {
    border-color: transparent;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 2px 6px rgba(16, 24, 40, 0.05);
}

.dark .fi-section,
.dark .fi-wi-chart,
.dark .fi-ta-ctn,
.dark .fi-wi-stats-overview-stat {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

/* Rows separate by a hairline rather than a full border, which at
   twenty rows was drawing more ink than the data. */
.fi-ta-row:not(:last-child) > td {
    border-bottom-color: rgba(16, 24, 40, 0.06);
}

.dark .fi-ta-row:not(:last-child) > td {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* ===================================================================
   The surfaces nobody draws.

   Text selection, the caret and the focus ring ship with browser
   defaults that belong to no design system — a blue that is Chrome's,
   not IAAM's. Theming them from the palette is the cheapest signal
   that a screen was built rather than assembled, and it is the part
   that gets skipped most reliably.

   Scrollbars are deliberately left alone. On a surface where somebody
   is doing a task, reinventing a standard affordance costs more than
   the flavour buys — a themed scrollbar is one more thing that behaves
   almost, but not quite, as expected.
   =================================================================== */

::selection {
    background: rgba(45, 74, 138, 0.18);
    color: inherit;
}

.dark ::selection {
    background: rgba(147, 180, 240, 0.26);
}

/* The caret follows the brand rather than the platform's black. */
.fi-input,
.fi-ta-search-field input,
input[type="text"],
input[type="email"],
input[type="search"],
textarea {
    caret-color: #2d4a8a;
}

.dark .fi-input,
.dark .fi-ta-search-field input,
.dark input[type="text"],
.dark input[type="email"],
.dark input[type="search"],
.dark textarea {
    caret-color: #93b4f0;
}

/*
 * A focus ring that is visible and ours.
 *
 * Only on :focus-visible, so it answers the keyboard and stays out of
 * the way of the mouse. Two pixels with an offset, which clears the
 * contrast floor against both the light and the dark surface — a focus
 * ring that cannot be seen is the same as not having one.
 */
.fi-ta-row a:focus-visible,
.fi-btn:focus-visible,
.fi-icon-btn:focus-visible,
.fi-link:focus-visible,
.fi-ta-header-cell-sort-btn:focus-visible {
    outline: 2px solid #2d4a8a;
    outline-offset: 2px;
    border-radius: 6px;
}

.dark .fi-ta-row a:focus-visible,
.dark .fi-btn:focus-visible,
.dark .fi-icon-btn:focus-visible,
.dark .fi-link:focus-visible,
.dark .fi-ta-header-cell-sort-btn:focus-visible {
    outline-color: #93b4f0;
}
