/*
 * Admin background and frosted glass (see .claude/skills/admin-ui/SKILL.md).
 * Plain CSS on Filament's stable fi-* class names.
 */

html,
body {
    background: #000;
}

html body .fi-body {
    background: transparent;
}

html body .admin-background-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
}

html body .fi-layout,
html body .fi-simple-layout {
    position: relative;
    z-index: 1;
}

html.admin-background-fallback body {
    background: #000;
}

html body .fi-sidebar,
html body .fi-topbar,
html body .fi-header,
html body .fi-section,
html body .fi-ta-ctn,
html body .fi-wi-widget,
html body .fi-simple-main,
html body .fi-main .fi-sc-form,
html body .fi-modal-window,
html body .fi-dropdown-panel {
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgb(255 255 255 / 0.08);
}

/* The sidebar takes .70 (from .66): its active item's count badge measured 4.49:1 over the active highlight. */
html body .fi-sidebar {
    background-color: rgb(9 9 11 / 0.70);
}

html body .fi-topbar {
    background-color: rgb(9 9 11 / 0.66);
}

html body .fi-header {
    background-color: rgb(9 9 11 / 0.62);
}

html body .fi-header {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
}

html body .fi-section,
html body .fi-ta-ctn,
html body .fi-wi-widget,
html body .fi-main .fi-sc-form {
    background-color: rgb(9 9 11 / 0.66);
}

html body .fi-main .fi-sc-form {
    padding: 1.25rem;
    border-radius: 0.75rem;
}

html body .fi-simple-main {
    background-color: rgb(9 9 11 / 0.72);
}

html body .fi-modal-window,
html body .fi-dropdown-panel {
    background-color: rgb(9 9 11 / 0.94);
}

/* Filament's own section rule is (0,3,0) and sets an opaque gray-900. These selectors are (0,3,2) and (0,4,2),
   so the glass wins over it (also for sections nested in a form). */
html body .fi-section:not(.fi-section-not-contained):not(.fi-aside) {
    background-color: rgb(9 9 11 / 0.66);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgb(255 255 255 / 0.08);
}

/* A section nested in a section or a form sits on the parent's glass: a light navy tint and the same hairline,
   with no second backdrop blur. */
html body :is(.fi-section, .fi-sc-form) .fi-section:not(.fi-section-not-contained):not(.fi-aside) {
    background-color: rgb(9 9 11 / 0.22);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 1px solid rgb(255 255 255 / 0.08);
}

/* Sections inside a modal sit on the modal's own .94 surface: no second glass, no second blur. */
html body .fi-modal-window .fi-section:not(.fi-section-not-contained):not(.fi-aside) {
    background-color: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* The cover upload (FilePond) preview panels sit on the form's glass too, not on their own opaque box. */
html body .filepond--item-panel,
html body .filepond--image-preview {
    background-color: rgb(9 9 11 / 0.66);
}

/* The tab bar (All / Low stock / Sold out) is content glass too. */
html body .fi-tabs.fi-tabs {
    background-color: rgb(9 9 11 / 0.66);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgb(255 255 255 / 0.08);
}

/* Inside glass (dark), text one step lighter so it reads over the lightest background pixel: muted text to gray-300,
   coloured text (badges, stock) to the 200 shades, and the active sidebar item to sky-200. */
html.dark body :is(.fi-sidebar, .fi-topbar, .fi-header, .fi-section, .fi-ta-ctn, .fi-wi-widget, .fi-simple-main, .fi-sc-form) :is(.dark\:text-gray-400, .dark\:text-gray-500, .fi-ta-text-description, .fi-section-header-description, .fi-fo-field-wrp-hint, .fi-fo-field-wrp-helper-text, [class*="text-gray-4"], [class*="text-gray-5"]) {
    color: rgb(209 213 219);
}

html.dark body :is(.fi-sidebar, .fi-topbar, .fi-header, .fi-section, .fi-ta-ctn, .fi-wi-widget, .fi-simple-main, .fi-sc-form) :is(.fi-ta-text, .fi-badge).fi-color-warning {
    color: #fde68a;
}

html.dark body :is(.fi-sidebar, .fi-topbar, .fi-header, .fi-section, .fi-ta-ctn, .fi-wi-widget, .fi-simple-main, .fi-sc-form) :is(.fi-ta-text, .fi-badge).fi-color-danger {
    color: #fee2e2;
}

html.dark body :is(.fi-sidebar, .fi-topbar, .fi-header, .fi-section, .fi-ta-ctn, .fi-wi-widget, .fi-simple-main, .fi-sc-form) :is(.fi-ta-text, .fi-badge).fi-color-primary,
html.dark body :is(.fi-sidebar, .fi-topbar, .fi-header, .fi-section, .fi-ta-ctn, .fi-wi-widget, .fi-simple-main, .fi-sc-form) :is(.fi-ta-text, .fi-badge).fi-color-info {
    color: #bae6fd;
}

html.dark body :is(.fi-sidebar, .fi-topbar, .fi-header, .fi-section, .fi-ta-ctn, .fi-wi-widget, .fi-simple-main, .fi-sc-form) :is(.fi-ta-text, .fi-badge).fi-color-success {
    color: #bbf7d0;
}

html.dark body .fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-label {
    color: #bae6fd;
}

html body .fi-sidebar-header-ctn,
html body .fi-sidebar-nav {
    background-color: transparent;
}

/* Dashboard stat cards take the content glass (.66, the same blur as the other widgets). Table headers inherit the table's glass. */
html body .fi-wi-stats-overview-stat {
    background-color: rgb(9 9 11 / 0.66);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
}

/* Inside glass, stat labels and descriptions use the lighter shades, and coloured text the 200 ones. */
html.dark body .fi-wi-stats-overview-stat-label,
html.dark body .fi-wi-stats-overview-stat-description {
    color: rgb(209 213 219);
}

html.dark body .fi-wi-stats-overview-stat-description[class*="warning"] {
    color: #fde68a;
}

html.dark body .fi-wi-stats-overview-stat-description[class*="danger"] {
    color: #fecaca;
}

html.dark body .fi-ta-header-cell,
html.dark body .fi-ta-header-cell-label {
    color: rgb(255 255 255);
}

/* Solid primary buttons one shade darker so white text reads at >= 4.5:1 (sky-600 measured 4.0:1; sky-700 ~5.9:1). */
html.dark body .fi-btn.fi-color-primary:not(.fi-outlined):not([aria-pressed]):not(label) {
    background-color: var(--color-700);
}

html.dark body .fi-btn.fi-color-primary:not(.fi-outlined):not([aria-pressed]):not(label):hover {
    background-color: var(--color-800);
}

/* The selected option of a primary toggle-button group gets the same darker fill (unselected options keep Filament's styling). */
html.dark body .fi-btn.fi-color-primary:not(.fi-outlined)[aria-pressed="true"],
html.dark body input:checked + label.fi-btn.fi-color-primary:not(.fi-outlined) {
    background-color: var(--color-700);
}

html.dark body .fi-btn.fi-color-primary:not(.fi-outlined)[aria-pressed="true"]:hover,
html.dark body input:checked + label.fi-btn.fi-color-primary:not(.fi-outlined):hover {
    background-color: var(--color-800);
}
