/*
 * EatSmart admin: the frame around every page — body, sidebar, page header, sign-in screens.
 * docs/ADMIN-UI.md §2.3–2.4.
 */

.fi-body {
    background: var(--es-page);
    color: var(--es-text);
    font-family: var(--es-font-text);
    /* Numbers line up in columns everywhere, not only in tables: totals, stats, dates. */
    font-variant-numeric: tabular-nums lining-nums;
}

/* Keyboard focus is always visible and the same everywhere: a sage ring with a gap. */
.fi-body :focus-visible {
    outline: 2px solid var(--es-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .fi-body *, .fi-body *::before, .fi-body *::after {
        transition-duration: 0.01ms;
        animation-duration: 0.01ms;
    }
}

/* ---------- Sidebar ---------- */

/* On paper, not on a white panel: the menu is part of the page, the content sits on surfaces. */
.fi-sidebar {
    background: var(--es-page);
}
/* The phone drawer floats over the content, so there it gets the raised surface and a shadow. */
@media (max-width: 1023px) {
    .fi-sidebar.fi-sidebar-open {
        background: var(--es-raised);
        box-shadow: var(--es-shadow-float);
    }
}

.fi-sidebar-header {
    /* The topbar is gone (docs/ADMIN-UI.md §2.4): the name starts the page at the same height
       as the page title next to it. The environment mark follows the name, not the far edge. */
    padding-block: 28px 12px;
    justify-content: flex-start;
    align-items: baseline;
    gap: 8px;
}
.fi-logo {
    font-family: var(--es-font-serif);
    font-size: 21px;
    line-height: 26px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--es-text);
}

/* Environment mark under the name: staging and local can never be mistaken for production. */
.es-env-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    line-height: 18px;
    font-weight: 500;
    letter-spacing: 0.2px;
    background: var(--es-warn-wash);
    color: var(--es-warn-ink);
}
.es-env-badge--local {
    background: var(--es-track);
    color: var(--es-muted);
}

.fi-sidebar-nav {
    padding-top: 8px;
}
.fi-sidebar-group-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--es-muted);
    letter-spacing: 0;
}
.fi-sidebar-item-btn {
    border-radius: var(--es-radius-control);
    padding: 7px 10px;
    background: transparent;
    transition: background-color 0.12s;
}
.fi-sidebar-item-btn:hover {
    background: color-mix(in srgb, var(--es-surface) 70%, transparent);
}
.fi-sidebar-item-label {
    font-size: 14px;
    font-weight: 450;
    color: var(--es-text);
}
.fi-sidebar-item-icon {
    color: var(--es-muted);
}
/* Active item: a surface pill with ink text — the same pair as an open card in the app. */
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: var(--es-surface);
    box-shadow: inset 0 0 0 1px var(--es-hairline);
}
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon {
    color: var(--es-accent-ink);
    font-weight: 500;
}

/* User menu at the bottom of the menu: a hairline instead of Filament's 5 % black line. */
.fi-sidebar-footer {
    border-color: var(--es-hairline);
}

/* Phone: the menu button floats where the topbar used to be. */
.fi-layout-sidebar-toggle-btn-ctn {
    background: var(--es-page);
}

/* ---------- Page ---------- */

/* Content width: wide tables still fit, lines of text stay readable. 1200 + side padding. */
.fi-main {
    max-width: calc(1200px + 2 * 32px);
}
@media (max-width: 1023px) {
    .fi-main {
        padding-inline: 16px;
    }
}

.fi-header {
    padding-top: 28px;
}
.fi-header-heading {
    font-family: var(--es-font-serif);
    font-size: 26px;
    line-height: 32px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--es-text);
}
.fi-header-subheading {
    color: var(--es-muted);
    font-size: 14px;
}
@media (max-width: 639px) {
    .fi-header-heading {
        font-size: 22px;
        line-height: 28px;
    }
}

/* ---------- Sign-in, second factor, password reset ---------- */

.fi-simple-layout {
    background: var(--es-page);
}
/* One sheet of paper on the page: hairline, no shadow, the app's block radius. */
.fi-simple-main {
    background: var(--es-surface);
    border-radius: var(--es-radius-block);
    box-shadow: inset 0 0 0 1px var(--es-hairline);
    max-width: 400px;
}
.fi-simple-header .fi-logo {
    justify-content: center;
    font-size: 26px;
    line-height: 32px;
}
.fi-simple-header-heading {
    font-family: var(--es-font-serif);
    font-size: 20px;
    line-height: 26px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--es-text);
}
.fi-simple-header-subheading {
    color: var(--es-muted);
}

/* «Распознавание выключено» above every page while the emergency switch is off. */
.es-banner {
    margin: 16px 0 0;
    padding: 10px 14px;
    border-radius: var(--es-radius-control);
    background: var(--es-over-wash);
    color: var(--es-over-ink);
    font-size: 13.5px;
    font-weight: 500;
}
.es-banner a {
    margin-left: 8px;
    color: inherit;
    border-bottom: 1px solid currentColor;
    text-decoration: none;
}

/* Shown instead of Livewire's error overlay while the server restarts during a deploy. */
.es-server-notice {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 60;
    padding: 10px 16px;
    border-radius: var(--es-radius-control);
    background: var(--es-raised);
    color: var(--es-text);
    font-size: 13.5px;
    box-shadow: var(--es-shadow-float), inset 0 0 0 1px var(--es-hairline);
}
.es-server-notice[hidden] {
    display: none;
}
