/*
    Admin panel overrides.

    Plain CSS on purpose. This panel registers no compiled theme, so it is
    served Filament's prebuilt stylesheet, which carries Filament's own fi-*
    component classes and NO Tailwind utilities - `.flex` resolves to
    display:block and `.bg-white` to nothing at all. Colours come from
    Filament's own custom properties so this follows the panel into dark mode.

    The sidebar looked the same colour as the page because it is: .fi-sidebar
    is declared twice in the core stylesheet, and the later rule sets
    `background-color:#0000`, so the page background shows straight through it.

    The doubled selector (.fi-sidebar.fi-sidebar) is deliberate - it raises
    specificity above that rule without resorting to !important, so this stays
    overridable later.
*/

.fi-sidebar.fi-sidebar {
    background-color: var(--color-white, #fff);
    border-inline-end: 1px solid var(--gray-200);
}

/* The header sits above the sidebar, so it needs the same treatment to avoid
   a seam where the two meet. */
.fi-sidebar-header {
    background-color: transparent;
}

:where(.dark) .fi-sidebar.fi-sidebar {
    background-color: var(--gray-900);
    border-inline-end-color: var(--gray-800);
}

/* Give the active item a little more presence now that it sits on white
   rather than on the tinted page. */
.fi-sidebar-item-active .fi-sidebar-item-btn {
    background-color: var(--gray-100);
}

:where(.dark) .fi-sidebar-item-active .fi-sidebar-item-btn {
    background-color: var(--gray-800);
}

/*
    Density.

    The lead screen is a data-entry screen, not a marketing page: staff open
    it to read a property and change a status. Filament's defaults are built
    for comfort - 24px of padding inside every section, a label on its own
    line above every input - and on a lead with eight sections that pushed the
    save button and the notes below two screenfuls of mostly whitespace. The
    legacy showed the same information in one dense table.

    Filament's own `fi-compact` already halves section padding; these trim
    what it leaves, and nothing here changes a font size - the complaint was
    wasted space, not that the text was too big to read.
*/

/* Sections sit closer together vertically. */
.fi-sc-component-ctn > .fi-sc-component + .fi-sc-component,
.fi-sc > .fi-section + .fi-section {
    margin-block-start: calc(var(--spacing) * 3);
}

/* A section heading does not need as much room as its contents. */
.fi-section.fi-compact .fi-section-header {
    padding-block: calc(var(--spacing) * 2);
}

/* Inline labels: give the label a sensible share rather than a third of the
   row, so the input keeps the width where the content actually is. */
.fi-fo-field-has-inline-label .fi-fo-field-label-col {
    max-width: 10.5rem;
}

/* The gap between fields inside a section. The default leaves a full line of
   air between every row. */
.fi-section-content .fi-sc-component-ctn {
    row-gap: calc(var(--spacing) * 3);
}

/* Helper text is guidance, not body copy, and it was taking a full line at
   the same size as the value above it. */
.fi-fo-field-wrp-hint,
.fi-fo-field-wrp-helper-text {
    font-size: var(--text-xs);
    line-height: 1.3;
}
