/*
 * The admin panel's shell in the app's design language: surfaces group with a fill, not an
 * outline; whatever is pressed is a pill; lime is the fill of whatever is on, chosen or done.
 * Only the admin panel loads this file, on every page.
 *
 * Filament's own rules all sit in `@layer components`, so these unlayered rules win over them
 * whatever their specificity, and over their `:hover`, `:focus` and `dark:` states too. A rule
 * here that sets a property therefore owns that property in every state; the states it needs
 * are written beside it. `PanelStyles` (both panels, inline at the end of <head>) is unlayered
 * as well and comes later, so the few rules that meet one of its rules carry `body.fi-body` to
 * outrank it.
 *
 * Dark mode is Filament's `.dark` on <html>. Its surfaces come off the gray ramp the panel
 * already re-declares for dark mode: the page is 950, a card 900, a tray or a raised control
 * 800.
 */

.fi-body {
  --shell-canvas: var(--sc-color-canvas);
  --shell-surface: var(--sc-color-white);
  /* The soft fill: the sidebar, trays, secondary buttons and the dividers inside a surface. */
  --shell-tray: var(--sc-color-surface-muted);
  --shell-tray-hover: var(--sc-color-line);
  /* A menu or a list floating over a surface. */
  --shell-raised: var(--sc-color-white);
  --shell-divider: var(--sc-color-surface-muted);
  --shell-ink: var(--sc-color-ink);
  --shell-muted: var(--sc-color-muted);
  --shell-lift: var(--sc-shadow-lift);
  --shell-float: var(--sc-shadow-float);
  --shell-popover: var(--sc-shadow-popover);
  --shell-sheet: var(--sc-shadow-sheet);
  /* On, chosen or done: lime with pine on it, in both themes. */
  --shell-on: var(--sc-color-clay);
  --shell-on-ink: var(--sc-color-pine);
  /* A selected table row: the brand's soft wash. */
  --shell-selected: var(--sc-color-sage);
  /* A control that is off: a switch's track. */
  --shell-off: var(--sc-color-line);
  /* The empty part of a progress bar. A step darker than the soft fill, so it shows on a tray too. */
  --shell-track: var(--gray-300);
  --shell-focus: var(--sc-color-pine);
}
.dark .fi-body {
  --shell-canvas: var(--gray-950);
  --shell-surface: var(--gray-900);
  --shell-tray: var(--gray-800);
  --shell-tray-hover: var(--gray-700);
  --shell-raised: var(--gray-800);
  --shell-divider: var(--gray-800);
  --shell-ink: var(--sc-color-white);
  /* Gray 400 lifted a fifth of the way to 300, so secondary text keeps 4.5:1 on the gray-800 tray
     and raised panels as well as on cards (gray 400 alone is 4.2:1 there). */
  --shell-muted: color-mix(in oklab, var(--gray-400) 80%, var(--gray-300));
  --shell-lift: var(--sc-shadow-panel-dark-lift);
  --shell-float: var(--sc-shadow-panel-dark-float);
  --shell-popover: var(--sc-shadow-panel-dark-float);
  --shell-sheet: var(--sc-shadow-panel-dark-float);
  --shell-selected: var(--sc-filament-shell-dark-selected);
  --shell-off: var(--gray-700);
  --shell-track: var(--gray-500);
  --shell-focus: var(--sc-color-clay);
}

/* ---- Focus: one visible ring on everything restyled below. ---- */

:is(
    .fi-btn,
    .fi-icon-btn,
    .fi-tabs-item,
    .fi-sidebar-item-btn,
    .fi-sidebar-group-dropdown-trigger-btn,
    .fi-sidebar-database-notifications-btn,
    .fi-topbar-item-btn,
    .fi-dropdown-list-item,
    .fi-pagination-item-btn,
    .fi-wi-stats-overview-stat,
    .fi-link,
    .fi-ta-header-cell-sort-btn,
    .fi-tenant-menu-trigger,
    .fi-user-menu-trigger,
    .fi-checkbox-input,
    .fi-radio-input,
    .fi-toggle
  ):focus-visible {
  outline: 2px solid var(--shell-focus);
  outline-offset: 2px;
}
.fi-ta-row:focus-visible,
.fi-ta-row:focus-within:has(:focus-visible) {
  outline: 2px solid var(--shell-focus);
  outline-offset: -2px;
}

/* ---- The page, the top bar and the sidebar. ---- */

.fi-topbar {
  background-color: var(--shell-canvas);
  box-shadow: none;
}
.fi-topbar .fi-global-search-field .fi-input-wrp {
  border-radius: var(--sc-radius-capsule);
  background-color: var(--shell-surface);
}
/* In dark mode the search takes every other field's fill, Filament's white at 5%. */
.dark .fi-topbar .fi-global-search-field .fi-input-wrp {
  background-color: color-mix(in oklab, var(--sc-color-white) 5%, transparent);
}

/* ---- Secondary text: one grey, the shell's muted, on every surface and in both themes. ---- */

.fi-modal-description,
.fi-breadcrumbs li,
.fi-sc-text:not(.fi-badge):not(.fi-color):not(.fi-color-neutral) {
  color: var(--shell-muted);
}
.fi-user-menu-trigger,
.fi-tenant-menu-trigger {
  border-radius: var(--sc-radius-capsule);
}

/* The sidebar is the tray; on a phone it opens over the page, so it keeps its shadow there. */
body.fi-body .fi-sidebar {
  background-color: var(--shell-tray);
  border-inline-end: 0;
}
@media (min-width: 64rem) {
  .fi-body-has-topbar .fi-sidebar.fi-sidebar-open {
    box-shadow: none;
  }
}
.dark .fi-body .fi-sidebar {
  background-color: var(--shell-surface);
  border-inline-end: 0;
}
.fi-sidebar-header-controls::after,
.fi-sidebar-footer {
  border-color: var(--shell-divider);
}
.fi-sidebar-item-btn,
.fi-sidebar-group-dropdown-trigger-btn,
.fi-sidebar-database-notifications-btn {
  border-radius: var(--sc-radius-capsule);
}
.fi-sidebar-item-has-url > .fi-sidebar-item-btn:hover,
.fi-sidebar-group-dropdown-trigger-btn:hover,
.fi-sidebar-database-notifications-btn:hover {
  background-color: var(--shell-tray-hover);
}
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn:hover {
  background-color: var(--shell-raised);
  box-shadow: var(--shell-lift);
}
.fi-sidebar-item-btn:focus-visible {
  outline-offset: -2px;
}
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon {
  color: var(--shell-ink);
}
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label {
  font-weight: 600;
}
.fi-sidebar-item.fi-active
  > .fi-sidebar-item-btn
  > .fi-sidebar-item-grouped-border
  > .fi-sidebar-item-grouped-border-part {
  background-color: var(--shell-ink);
}

/* ---- Surfaces: sections, tables, widgets, the sign-in card. White and lifted, no ring. ---- */

.fi-section:not(.fi-section-not-contained):not(.fi-aside),
.fi-section.fi-aside:not(.fi-section-not-contained) > .fi-section-content-ctn,
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-wi-chart .fi-section,
.fi-fo-repeater-item,
.fi-fo-builder-item,
.fi-in-repeatable-item {
  border-radius: var(--sc-radius-card);
  background-color: var(--shell-surface);
  box-shadow: var(--shell-lift);
}
.fi-simple-main {
  background-color: var(--shell-surface);
  box-shadow: var(--shell-lift);
}
@media (min-width: 40rem) {
  .fi-simple-main {
    border-radius: var(--sc-radius-tray);
  }
}
/* A compact or secondary section sits inside another surface: the soft fill, no shadow. */
.fi-section:not(.fi-section-not-contained).fi-secondary:not(.fi-aside) {
  background-color: var(--shell-tray);
  box-shadow: none;
}

/* Dividers inside a surface are the quiet soft fill. PanelStyles sets dark-mode dividers too,
   so these carry `body.fi-body`. */
body.fi-body
  :is(
    .fi-section-header,
    .fi-section-content-ctn,
    .fi-section-footer,
    .fi-ta-header,
    .fi-ta-header-toolbar,
    .fi-ta-selection-indicator,
    .fi-ta-filter-indicators,
    .fi-ta-reorder-indicator,
    .fi-ta-filters-above-content-ctn,
    .fi-ta-filters-below-content,
    .fi-ta-ctn .fi-pagination,
    .fi-fo-repeater-item-header,
    .fi-modal-footer,
    .fi-modal-header
  ) {
  border-color: var(--shell-divider);
}
html body.fi-body :is(.fi-ta-table, .fi-ta-table > thead, .fi-ta-table > tbody, .fi-ta-content) > * {
  border-color: var(--shell-divider);
}
body.fi-body .fi-section.fi-divided > .fi-section-content-ctn > .fi-section-content > * {
  border-color: var(--shell-divider);
}

/* ---- Tables: as dense as before, with a quieter header and dividers. ---- */

.fi-ta-table > thead > tr,
.fi-ta-table > thead > tr.fi-ta-table-head-groups-row {
  background-color: transparent;
}
.fi-ta-header-cell,
.fi-ta-header-cell .fi-ta-header-cell-sort-btn {
  color: var(--shell-muted);
  font-weight: 500;
}
.fi-ta-header-cell-sort-btn {
  border-radius: var(--sc-radius-small);
}
.fi-ta-header-cell-sort-btn:hover {
  color: var(--shell-ink);
}
.fi-ta-table > tfoot,
.fi-ta-row.fi-ta-group-header-row > td,
.fi-ta-row.fi-striped {
  background-color: var(--shell-canvas);
}
.fi-ta-row.fi-clickable:hover {
  background-color: var(--shell-canvas);
}
/* A selected row: the soft wash, and a lime marker wide enough to read as a fill. */
.fi-ta-row.fi-selected:not(.fi-striped) {
  background-color: var(--shell-selected);
}
.fi-ta-row.fi-selected > :first-child {
  box-shadow: inset 4px 0 0 0 var(--shell-on);
}
[dir='rtl'] .fi-ta-row.fi-selected > :first-child {
  box-shadow: inset -4px 0 0 0 var(--shell-on);
}
.fi-ta-ctn :is(.fi-ta-selection-indicator, .fi-ta-filter-indicators, .fi-ta-reorder-indicator) {
  background-color: var(--shell-canvas);
}
.fi-ta-filters-before-content-ctn,
.fi-ta-filters-after-content-ctn {
  border-color: var(--shell-divider);
}
@media (max-width: 63.999rem) {
  .fi-ta-filters-before-content-ctn,
  .fi-ta-filters-after-content-ctn {
    border-radius: var(--sc-radius-inner);
    background-color: var(--shell-raised);
    box-shadow: var(--shell-popover);
  }
}
.fi-ta-empty-state-icon-bg {
  background-color: var(--shell-tray);
}

/* ---- Pagination: a tray of page pills, the current page a lifted pill. ---- */

.fi-pagination-items {
  gap: 2px;
  padding: 3px;
  border-radius: var(--sc-radius-capsule);
  background-color: var(--shell-tray);
  box-shadow: none;
}
.fi-pagination-item {
  border: 0;
}
.fi-pagination-item-btn {
  min-width: 2rem;
  justify-content: center;
  border-radius: var(--sc-radius-capsule);
}
.fi-pagination-item:first-child .fi-pagination-item-btn,
.fi-pagination-item:last-child .fi-pagination-item-btn {
  border-radius: var(--sc-radius-capsule);
}
.fi-pagination-item-btn:hover {
  background-color: var(--shell-tray-hover);
}
.fi-pagination-item.fi-active .fi-pagination-item-btn {
  background-color: var(--shell-raised);
  box-shadow: var(--shell-lift);
}
.fi-pagination-item.fi-active .fi-pagination-item-label {
  color: var(--shell-ink);
}

/* ---- Buttons: pills and circles. ---- */

.fi-btn {
  border-radius: var(--sc-radius-capsule);
}
.fi-btn.fi-size-xs,
.fi-btn.fi-size-sm {
  padding-inline: 0.75rem;
}
.fi-icon-btn {
  border-radius: var(--sc-radius-capsule);
}
/* A secondary (gray) button, outlined or not, is the soft fill, without the white face and its ring. */
.fi-btn:not(.fi-color):not(label) {
  background-color: var(--shell-tray);
  color: var(--shell-ink);
  box-shadow: none;
}
.fi-btn:not(.fi-color):not(label):not(.fi-disabled):not([disabled]):hover {
  background-color: var(--shell-tray-hover);
}
.fi-btn:not(.fi-color):not(label) > .fi-icon {
  color: var(--shell-muted);
}
/* A button group: one tray, its buttons pills inside it. */
.fi-btn-group {
  gap: 2px;
  padding: 3px;
  border-radius: var(--sc-radius-capsule);
  background-color: var(--shell-tray);
  box-shadow: none;
}
.fi-btn-group > .fi-btn {
  border-radius: var(--sc-radius-capsule);
}
/* Toggle buttons and button-group radios: the chosen one is lime. */
input:checked + label.fi-btn.fi-color-primary,
input:checked + label.fi-btn.fi-color-primary:hover {
  background-color: var(--shell-on);
  color: var(--shell-on-ink);
  box-shadow: none;
}
input:checked + label.fi-btn.fi-color-primary > .fi-icon {
  color: var(--shell-on-ink);
}
input:focus-visible + label.fi-btn {
  outline: 2px solid var(--shell-focus);
  outline-offset: 2px;
}

/* ---- Badges: pills without a ring. Their colours keep their meaning. ---- */

.fi-badge {
  border-radius: var(--sc-radius-capsule);
  box-shadow: none;
}
.fi-badge:not(.fi-color) {
  background-color: var(--shell-tray);
  color: var(--shell-ink);
}
/* The active filter indicator: the filters are on. */
.fi-ta-filter-indicators .fi-badge {
  background-color: var(--shell-on);
  color: var(--shell-on-ink);
}
.fi-ta-filter-indicators .fi-badge .fi-badge-delete-btn-icon {
  color: var(--shell-on-ink);
}
.fi-icon-btn .fi-icon-btn-badge-ctn {
  border-radius: var(--sc-radius-capsule);
}

/* ---- Tabs: a tray with the current tab a lifted pill. ---- */

.fi-tabs:not(.fi-contained) {
  gap: 2px;
  padding: 4px;
  border-radius: var(--sc-radius-capsule);
  background-color: var(--shell-tray);
  box-shadow: none;
}
.fi-tabs.fi-contained {
  border-color: var(--shell-divider);
}
.fi-tabs.fi-vertical:not(.fi-contained) {
  border-radius: var(--sc-radius-card);
}
.fi-tabs-item {
  border-radius: var(--sc-radius-capsule);
}
.fi-tabs-item:hover {
  background-color: var(--shell-tray-hover);
}
.fi-tabs-item.fi-active,
.fi-tabs-item.fi-active:hover {
  background-color: var(--shell-raised);
  box-shadow: var(--shell-lift);
}
/* Inside a surface the tabs have no tray, so the current one takes the soft fill. */
.fi-tabs.fi-contained .fi-tabs-item.fi-active,
.fi-tabs.fi-contained .fi-tabs-item.fi-active:hover {
  background-color: var(--shell-tray);
  box-shadow: none;
}
.fi-tabs.fi-contained .fi-tabs-item:hover {
  background-color: var(--shell-tray);
}
.fi-tabs-item.fi-active .fi-tabs-item-label,
.fi-tabs-item.fi-active > .fi-icon {
  color: var(--shell-ink);
}
.fi-tabs-item.fi-active .fi-tabs-item-label {
  font-weight: 600;
}

/* ---- Fields keep their outline, on the inner radius. ---- */

.fi-input-wrp,
.fi-fo-file-upload .filepond--root,
.fi-fo-file-upload .filepond--panel-root,
.fi-fo-markdown-editor,
.fi-fo-rich-editor,
.fi-fo-key-value,
.fi-fo-table-repeater,
.fi-fieldset {
  border-radius: var(--sc-radius-inner);
}
.fi-fieldset {
  border-color: var(--shell-divider);
}
/* A focused field's ring is the focus colour, lime in dark mode; an invalid one keeps Filament's
   danger ring, focused or not. Filament's own condition for the focus ring, repeated. */
.fi-input-wrp:not(.fi-disabled):not(.fi-invalid):not(:has(.fi-ac-action:focus)):focus-within {
  --tw-ring-color: var(--shell-focus);
}
.fi-input-wrp .fi-input-wrp-prefix,
.fi-input-wrp .fi-input-wrp-suffix {
  border-color: var(--shell-divider);
}

/* ---- Toggles, checkboxes and radios: lime when on, with pine on it. ---- */

.fi-toggle.fi-toggle-on {
  background-color: var(--shell-on);
}
.fi-toggle.fi-toggle-off {
  background-color: var(--shell-off);
}
.fi-toggle.fi-toggle-on .fi-icon {
  color: var(--shell-on-ink);
}

input[type='checkbox'].fi-checkbox-input:is(:checked, :indeterminate),
input[type='radio'].fi-radio-input:checked {
  background-color: var(--shell-on);
  background-image: none;
}
/* The check and the dash are drawn in pine through a mask: a background image cannot take a
   colour variable. */
input[type='checkbox'].fi-checkbox-input:is(:checked, :indeterminate)::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background-color: var(--shell-on-ink);
  mask: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E")
    center / 100% 100% no-repeat;
}
input[type='checkbox'].fi-checkbox-input:indeterminate::before {
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.5 6.75a1.25 1.25 0 0 0 0 2.5h7a1.25 1.25 0 0 0 0-2.5h-7z'/%3E%3C/svg%3E");
}
input[type='radio'].fi-radio-input:checked {
  background-image: radial-gradient(circle, var(--shell-on-ink) 0 3px, transparent 3.5px);
}
/* An invalid choice stays red, a disabled one grey. */
input[type='checkbox'].fi-checkbox-input.fi-invalid:is(:checked, :indeterminate),
input[type='radio'].fi-radio-input.fi-invalid:checked {
  background-color: var(--danger-600);
}
input[type='checkbox'].fi-checkbox-input.fi-invalid:is(:checked, :indeterminate)::before {
  background-color: var(--sc-color-white);
}
input[type='radio'].fi-radio-input.fi-invalid:checked {
  background-image: radial-gradient(circle, var(--sc-color-white) 0 3px, transparent 3.5px);
}
input[type='checkbox'].fi-checkbox-input:disabled:is(:checked, :indeterminate),
input[type='radio'].fi-radio-input:disabled:checked {
  background-color: var(--shell-off);
}

/* ---- Menus: a raised panel on the inner radius, its items small rounded rows. ---- */

.fi-dropdown-panel {
  border-radius: var(--sc-radius-inner);
  background-color: var(--shell-raised);
  box-shadow: var(--shell-popover);
}
.fi-dropdown-panel .fi-dropdown-list {
  padding: 4px;
}
.fi-dropdown-panel .fi-dropdown-list-item {
  border-radius: var(--sc-radius-small);
}
/* Filament picks a dark item's text shade against its own gray-900 menu; on the raised gray-800
   one, the 400 step of red and blue falls under 4.5:1 (3.99 and 4.36), so they take the 300 step,
   at rest and on hover or focus. Green and amber keep 400, which already passes. */
.dark .fi-dropdown-panel .fi-dropdown-list-item:is(.fi-color-danger, .fi-color-info) {
  --dark-text: var(--color-300);
  --dark-hover-text: var(--color-300);
}
.fi-dropdown-header,
.fi-dropdown-panel .fi-dropdown-list:not(:first-child) {
  border-color: var(--shell-divider);
}
body.fi-body .fi-dropdown-panel > * + *,
body.fi-body .fi-dropdown-panel.fi-divided > * {
  border-color: var(--shell-divider);
}
.fi-global-search-results-ctn {
  border-radius: var(--sc-radius-inner);
  background-color: var(--shell-raised);
  box-shadow: var(--shell-popover);
  overflow: hidden;
}

/* ---- Tooltips: a raised surface like a menu's, with ink on it, in both themes. Tippy's own light
   and dark themes read --tippy-background-color, which the arrow takes too. ---- */

.tippy-box {
  --tippy-background-color: var(--shell-raised);
  border-radius: var(--sc-radius-small);
  background-color: var(--tippy-background-color);
  box-shadow: var(--shell-float);
  color: var(--shell-ink);
}
.tippy-arrow {
  color: var(--tippy-background-color);
}

/* ---- Modals and slide-overs: the tray radius, no ring. ---- */

.fi-modal > .fi-modal-window-ctn > .fi-modal-window {
  background-color: var(--shell-surface);
  box-shadow: var(--shell-sheet);
}
.fi-modal:not(.fi-modal-slide-over):not(.fi-width-screen) > .fi-modal-window-ctn > .fi-modal-window {
  border-radius: var(--sc-radius-tray);
}
.fi-modal.fi-modal-has-sticky-header:not(.fi-modal-slide-over):not(.fi-width-screen)
  > .fi-modal-window-ctn
  > .fi-modal-window
  > .fi-modal-header {
  border-radius: var(--sc-radius-tray) var(--sc-radius-tray) 0 0;
}
.fi-modal.fi-modal-has-sticky-footer:not(.fi-modal-slide-over):not(.fi-width-screen)
  > .fi-modal-window-ctn
  > .fi-modal-window
  > .fi-modal-footer {
  border-radius: 0 0 var(--sc-radius-tray) var(--sc-radius-tray);
}
.fi-modal.fi-modal-slide-over:not(.fi-modal-slide-over-from-start) > .fi-modal-window-ctn > .fi-modal-window {
  border-start-start-radius: var(--sc-radius-tray);
  border-end-start-radius: var(--sc-radius-tray);
}
.fi-modal.fi-modal-slide-over.fi-modal-slide-over-from-start > .fi-modal-window-ctn > .fi-modal-window {
  border-start-end-radius: var(--sc-radius-tray);
  border-end-end-radius: var(--sc-radius-tray);
}
.fi-modal-icon-bg {
  background-color: var(--shell-tray);
}

/* ---- Wizards: the step header is a tray, its steps separated by a quiet chevron. The current
   step and the steps done are lime with pine on them; the steps to come are neutral. ---- */

.fi-sc-wizard:not(.fi-contained) .fi-sc-wizard-header {
  border-radius: var(--sc-radius-card);
  background-color: var(--shell-tray);
  box-shadow: none;
}
.fi-sc-wizard.fi-contained {
  border-radius: var(--sc-radius-card);
  background-color: var(--shell-surface);
  box-shadow: var(--shell-lift);
}
.fi-sc-wizard.fi-contained .fi-sc-wizard-header {
  border-color: var(--shell-divider);
}
.fi-sc-wizard-header-step-separator {
  color: var(--shell-tray-hover);
}
.fi-sc-wizard.fi-contained .fi-sc-wizard-header-step-separator {
  color: var(--shell-divider);
}
.fi-sc-wizard-header-step-btn:focus-visible {
  outline: 2px solid var(--shell-focus);
  outline-offset: -2px;
  border-radius: var(--sc-radius-card);
}
.fi-sc-wizard-header-step .fi-sc-wizard-header-step-icon-ctn {
  border: 0;
  background-color: var(--shell-surface);
}
.fi-sc-wizard.fi-contained .fi-sc-wizard-header-step:not(.fi-active):not(.fi-completed) .fi-sc-wizard-header-step-icon-ctn {
  background-color: var(--shell-tray);
}
.fi-sc-wizard-header-step:is(.fi-active, .fi-completed) .fi-sc-wizard-header-step-icon-ctn {
  background-color: var(--shell-on);
}
.fi-sc-wizard-header-step:is(.fi-active, .fi-completed)
  .fi-sc-wizard-header-step-icon-ctn
  :is(.fi-sc-wizard-header-step-number, .fi-icon) {
  color: var(--shell-on-ink);
}
.fi-sc-wizard-header-step:not(.fi-active):not(.fi-completed)
  .fi-sc-wizard-header-step-icon-ctn
  :is(.fi-sc-wizard-header-step-number, .fi-icon) {
  color: var(--shell-muted);
}
.fi-sc-wizard-header-step:is(.fi-active, .fi-completed) .fi-sc-wizard-header-step-label {
  color: var(--shell-ink);
}
.fi-sc-wizard-header-step.fi-active .fi-sc-wizard-header-step-label {
  font-weight: 600;
}
.fi-sc-wizard-header-step:not(.fi-active):not(.fi-completed) .fi-sc-wizard-header-step-label {
  color: var(--shell-muted);
}

/* ---- Notifications: a lifted card. ---- */

.fi-no-notification {
  border-radius: var(--sc-radius-card);
  background-color: var(--shell-surface);
  box-shadow: var(--shell-float);
}

/* ---- Encuestas' results: each option's share as a progress bar like Reportes' mini bars, on
   the quiet track. ---- */

.sc-poll-results {
  --sc-poll-fill: var(--sc-status-success-report-mark);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dark .sc-poll-results {
  --sc-poll-fill: var(--sc-status-success-report-dark-mark);
}
.sc-poll-results-muted {
  color: var(--shell-muted);
}
.sc-poll-results-summary {
  font-size: 0.875rem;
}
.sc-poll-results-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
}
.sc-poll-results-label {
  font-weight: 500;
}
.sc-poll-results-count {
  white-space: nowrap;
}
.sc-poll-results-bar {
  height: 0.5rem;
  margin-top: 0.375rem;
  border-radius: var(--sc-radius-capsule);
  background-color: var(--shell-track);
  overflow: hidden;
}
.sc-poll-results-bar > span {
  display: block;
  height: 100%;
  background-color: var(--sc-poll-fill);
}

/* ---- Stat widgets: one big figure per card, its label and trend small around it. ---- */

.fi-wi-stats-overview-stat {
  padding: 1.25rem 1.5rem;
}
a.fi-wi-stats-overview-stat:hover {
  box-shadow: var(--shell-float);
}
.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-content {
  gap: 0.375rem;
}
.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-label {
  font-size: 0.8125rem;
  color: var(--shell-muted);
}
.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-value {
  font-size: 2.5rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--shell-ink);
}
.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-description {
  font-size: 0.8125rem;
}
.fi-wi-stats-overview-stat .fi-wi-stats-overview-stat-chart {
  border-radius: 0 0 var(--sc-radius-card) var(--sc-radius-card);
}

/* ---- Puesta en marcha (setup.css, which the ops panel loads too): the admin panel's look.
   setup.css loads after this file, so these name the panel on <body> to outrank it. ---- */

.fi-body.fi-panel-admin .sc-setup {
  --sc-border: var(--shell-divider);
  --sc-soft: var(--shell-tray);
  --sc-track: var(--shell-track);
  --sc-muted: var(--shell-muted);
  --sc-faint: var(--shell-muted);
}
.fi-body.fi-panel-admin .sc-setup-stage {
  border: 0;
  border-radius: var(--sc-radius-inner);
  background-color: var(--shell-tray);
}
.fi-body.fi-panel-admin button.sc-setup-stage:hover {
  background-color: var(--shell-tray-hover);
}
.fi-body.fi-panel-admin .sc-setup-stage[aria-pressed='true'] {
  background-color: var(--shell-on);
  color: var(--shell-on-ink);
}
.fi-body.fi-panel-admin .sc-setup-stage[aria-pressed='true'] .sc-setup-bar {
  background-color: var(--shell-surface);
}
.fi-body.fi-panel-admin .sc-setup-stage[aria-pressed='true'] :is(.sc-setup-muted, .sc-setup-faint) {
  color: var(--shell-on-ink);
}
.fi-body.fi-panel-admin .sc-setup-stage:focus-visible,
.fi-body.fi-panel-admin .sc-quick-card:focus-visible {
  outline-color: var(--shell-focus);
}
.fi-body.fi-panel-admin .sc-setup-notes {
  border-radius: var(--sc-radius-inner);
}
.fi-body.fi-panel-admin .sc-quick-card {
  border: 0;
  border-radius: var(--sc-radius-inner);
  background-color: var(--shell-tray);
  color: var(--shell-ink);
}
.fi-body.fi-panel-admin .sc-quick-card:hover {
  background-color: var(--shell-tray-hover);
}
.fi-body.fi-panel-admin .sc-quick-icon {
  border-radius: var(--sc-radius-small);
}
.fi-body.fi-panel-admin .sc-quick-card:hover .sc-quick-arrow {
  color: var(--shell-ink);
}
.dark .fi-body.fi-panel-admin .sc-quick-card {
  --sc-tone-soft: var(--gray-700);
}
/* In dark mode each job's icon keeps its area's tint, as in light: payments green, announcements
   red, fines amber, from the dark report status colours. */
.dark .fi-body.fi-panel-admin .sc-quick-card.sc-quick-record-payment {
  --sc-tone-soft: var(--sc-status-success-report-dark-soft);
  --sc-tone-ink: var(--sc-status-success-report-dark-ink);
}
.dark .fi-body.fi-panel-admin .sc-quick-card.sc-quick-new-announcement {
  --sc-tone-soft: var(--sc-status-danger-report-dark-soft);
  --sc-tone-ink: var(--sc-status-danger-report-dark-ink);
}
.dark .fi-body.fi-panel-admin .sc-quick-card.sc-quick-place-fine {
  --sc-tone-soft: var(--sc-status-warning-report-dark-soft);
  --sc-tone-ink: var(--sc-status-warning-report-dark-ink);
}
/* The setup guide's own page puts the stages on the canvas, not in a section: white and lifted there. */
.fi-body.fi-panel-admin .sc-setup-page .sc-setup-stage:not([aria-pressed='true']) {
  background-color: var(--shell-surface);
  box-shadow: var(--shell-lift);
}
.fi-body.fi-panel-admin .sc-setup-page button.sc-setup-stage:not([aria-pressed='true']):hover {
  background-color: var(--shell-tray);
}
