/*
    Scoped to .fi-tp so nothing here can reach the Master Control page it is
    embedded in — the previewed theme is the TENANT's, and Master Control has
    a theme of its own.

    Written as plain CSS rather than Tailwind classes on purpose: these rules
    have to restate Filament's own chrome value-for-value (the topbar's
    min-h-16 and gray-950/5 ring, the sidebar's px-6 py-8 gap-y-7, the input's
    radius-lg and shadow), and a utility soup makes it impossible to check
    that against the vendor stylesheet. Every declaration below is traceable
    to a rule in filament/dist/theme.css.

    Sizes are in px, not rem: the preview is a scaled-down illustration
    sitting inside a form, so it must not respond to --root-font-size the way
    the real shell does — that would change the mock's proportions rather
    than its type scale. Proportions are held at roughly 0.6× the real thing.
*/
/* ── Frame ──────────────────────────────────────────────────── */
.fi-tp-frame { overflow: hidden; border-radius: 0.75rem; border: 1px solid rgb(229 231 235);
    background: rgb(243 244 246); }
.dark .fi-tp-frame { border-color: rgb(255 255 255 / 0.1); background: rgb(3 7 18); }
.fi-tp-vars { font-family: var(--font-sans-family); }

/* ── App shell ──────────────────────────────────────────────── */
/* .fi-body: bg-gray-50 / dark:bg-gray-950. */
.fi-tp-shell { background: var(--gray-50); color: var(--gray-950); }
.fi-tp--dark .fi-tp-shell { background: var(--gray-950); color: var(--color-white); }

/* .fi-topbar: min-h-16 px-4 bg-white ring-1 ring-gray-950/5, and in dark
   bg-gray-900 with a white/10 ring. --color-white is the same variable
   the framework reads, remapped to the preset's --card in light mode by
   TenantTheme; --gray-900 is the dark ramp's card stop. */
.fi-tp-topbar { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px;
    background: var(--color-white); box-shadow: 0 0 0 1px color-mix(in oklab, var(--gray-950) 5%, transparent); }
.fi-tp--dark .fi-tp-topbar { background: var(--gray-900);
    box-shadow: 0 0 0 1px color-mix(in oklab, var(--color-white) 10%, transparent); }
.fi-tp-topbar-start { display: flex; align-items: center; gap: 8px; }
.fi-tp-topbar-end { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.fi-tp-icon-btn { width: 13px; height: 13px; color: var(--gray-400); }

/* .fi-logo: text-xl font-bold tracking-tight, gray-950 / dark white. */
.fi-tp-brand { font-family: var(--font-heading-family); font-size: 12px; font-weight: 700;
    letter-spacing: -0.02em; color: var(--gray-950); }
.fi-tp--dark .fi-tp-brand { color: var(--color-white); }
.fi-tp-logo { height: 17px; width: auto; max-width: 96px; object-fit: contain; }
/* Mirrors the real .fi-logo-with-name override: logo + name side by
   side in the topbar, stacked above the heading on the login card. */
.fi-tp-logo-with-name { display: inline-flex; align-items: center; gap: 6px; }
.fi-tp-logo-with-name--auth { flex-direction: column; gap: 4px; }

.fi-tp-branch { display: flex; align-items: center; gap: 3px; font-size: 9px; font-weight: 500;
    color: var(--gray-700); }
.fi-tp--dark .fi-tp-branch { color: var(--gray-300); }
.fi-tp-branch-icon { width: 9px; height: 9px; color: var(--gray-400); }

.fi-tp-avatar { display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 19px; height: 19px; border-radius: 9999px; font-size: 9px; font-weight: 600;
    background: var(--primary-500); color: var(--primary-foreground); }
.fi-tp-avatar--lg { width: 30px; height: 30px; font-size: 13px; }

.fi-tp-body { display: flex; align-items: stretch; min-height: 250px; }

/* ── Sidebar ────────────────────────────────────────────────── */
/* Mirrors TenantTheme::sidebarCss() token for token — same --sidebar
   surface, same --sidebar-border ring, same accent treatment on the
   active item, same 70%/65% fades on idle icons and group labels. If one
   side changes, so must the other. */
.fi-tp-sidebar { flex-shrink: 0; width: 118px; background: var(--sidebar);
    box-shadow: inset -1px 0 0 var(--sidebar-border); }
/* .fi-sidebar-nav: px-6 py-8 gap-y-7. */
.fi-tp-nav { display: flex; flex-direction: column; gap: 14px; padding: 12px 10px; }
.fi-tp-group { display: flex; flex-direction: column; gap: 2px; }
/* .fi-sidebar-group-label: text-sm font-medium, gray-500. */
.fi-tp-group-label { margin-bottom: 2px; font-size: 8px; font-weight: 500; letter-spacing: 0.02em;
    color: color-mix(in oklab, var(--sidebar-foreground) 65%, transparent); }
/* .fi-sidebar-item-btn: gap-x-3 px-3 py-2 rounded-lg. */
.fi-tp-item { display: flex; align-items: center; gap: 6px; padding: 4px 6px;
    border-radius: var(--radius-md); }
.fi-tp-item-icon { width: 11px; height: 11px; flex-shrink: 0;
    color: color-mix(in oklab, var(--sidebar-foreground) 70%, transparent); }
.fi-tp-item-label { font-size: 9px; font-weight: 500; color: var(--sidebar-foreground);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-tp-item--active { background: var(--sidebar-accent); }
.fi-tp-item--active .fi-tp-item-icon,
.fi-tp-item--active .fi-tp-item-label { color: var(--sidebar-accent-foreground); }

/* ── Main content ───────────────────────────────────────────── */
.fi-tp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px;
    padding: 14px 12px; }
/* .fi-header-heading: text-2xl/3xl font-bold tracking-tight, gray-950. */
.fi-tp-heading { font-family: var(--font-heading-family); font-size: 15px; font-weight: 700;
    letter-spacing: -0.02em; color: var(--gray-950); }
.fi-tp--dark .fi-tp-heading { color: var(--color-white); }

/* .fi-section / .fi-wi-stats-overview-stat: rounded-xl bg-white p-6
   shadow-sm ring-1 ring-gray-950/5; dark:bg-gray-900 ring-white/10. */
.fi-tp-card { border-radius: var(--radius-xl); background: var(--color-white);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 0 0 1px color-mix(in oklab, var(--gray-950) 5%, transparent); }
.fi-tp--dark .fi-tp-card { background: var(--gray-900);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 0 0 1px color-mix(in oklab, var(--color-white) 10%, transparent); }

.fi-tp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fi-tp-stat { padding: 9px 10px; }
.fi-tp-stat-label { font-size: 8px; font-weight: 500; color: var(--gray-500); }
.fi-tp-stat-value { margin-top: 2px; font-size: 13px; font-weight: 600; letter-spacing: -0.02em;
    color: var(--gray-950); }
.fi-tp--dark .fi-tp-stat-value { color: var(--color-white); }

.fi-tp-account { display: flex; align-items: center; gap: 9px; padding: 10px; }
.fi-tp-account-main { flex: 1; min-width: 0; }
.fi-tp-account-heading { font-size: 10px; font-weight: 600; color: var(--gray-950); }
.fi-tp--dark .fi-tp-account-heading { color: var(--color-white); }
.fi-tp-account-name { font-size: 8px; color: var(--gray-500); }

/* ── Buttons ────────────────────────────────────────────────── */
/* .fi-btn: rounded-lg px-3 py-2 text-sm font-semibold shadow-sm. */
.fi-tp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    border-radius: var(--radius); padding: 5px 9px; font-size: 9px; font-weight: 600;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); }
.fi-tp-btn-icon { width: 10px; height: 10px; }
/* .fi-btn-color-primary: bg-primary-600. Its LABEL colour is resolved in
   PHP against the registered ramp, so a pale preset gets dark text
   instead of unreadable white; --primary-foreground is ThemePalette's
   answer to that same contrast question, so the two agree. */
.fi-tp-btn--primary { background: var(--primary-600); color: var(--primary-foreground); }
/* .fi-btn-color-gray: bg-white text-gray-700 ring-gray-950/10, and in
   dark bg-white/5 text-gray-200 ring-white/20. */
.fi-tp-btn--gray { background: var(--color-white); color: var(--gray-700);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 0 0 1px color-mix(in oklab, var(--gray-950) 10%, transparent); }
.fi-tp--dark .fi-tp-btn--gray { color: var(--gray-200);
    background: color-mix(in oklab, var(--color-white) 5%, transparent);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 0 0 1px color-mix(in oklab, var(--color-white) 20%, transparent); }

/* .fi-copyright-footer p: py-4 text-xs, gray-400. */
.fi-tp-copyright { margin-top: auto; padding-top: 8px; text-align: center; font-size: 8px;
    color: var(--gray-400); }

/* ── Login (SimplePage) ─────────────────────────────────────── */
/* .fi-simple-layout on the --login-panel backdrop, exactly as
   TenantTheme::authCss() paints the real one. */
.fi-tp-simple { display: flex; flex-direction: column; align-items: center;
    padding: 18px 12px 10px; background: var(--login-panel); }
/* .fi-simple-main: my-16 w-full px-12 py-12 rounded-xl bg-white shadow-sm
   ring-1 ring-gray-950/5, max-w-md. */
.fi-tp-simple-main { width: 100%; max-width: 232px; padding: 20px 22px;
    border-radius: var(--radius-xl); background: var(--color-white);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 0 0 1px color-mix(in oklab, var(--gray-950) 5%, transparent); }
.fi-tp--dark .fi-tp-simple-main { background: var(--gray-900);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 0 0 1px color-mix(in oklab, var(--color-white) 10%, transparent); }

/* .fi-simple-header: column, centred; .fi-logo has mb-4. */
.fi-tp-simple-header { display: flex; flex-direction: column; align-items: center; text-align: center; }
.fi-tp-logo--auth { height: 26px; max-width: 132px; margin-bottom: 8px; }
.fi-tp-brand--auth { font-size: 14px; margin-bottom: 8px; }
/* .fi-simple-header-heading: text-2xl font-bold tracking-tight. */
.fi-tp-simple-heading { font-family: var(--font-heading-family); font-size: 13px; font-weight: 700;
    letter-spacing: -0.02em; color: var(--gray-950); }
.fi-tp--dark .fi-tp-simple-heading { color: var(--color-white); }
.fi-tp-simple-subheading { margin-top: 3px; font-size: 9px; color: var(--gray-500); }

.fi-tp-form { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.fi-tp-field { display: flex; flex-direction: column; gap: 3px; }
.fi-tp-label-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
/* .fi-fo-field-lbl: text-sm font-medium, gray-950. */
.fi-tp-label { font-size: 9px; font-weight: 500; color: var(--gray-950); }
.fi-tp--dark .fi-tp-label { color: var(--color-white); }
/* .fi-input-wrp: rounded-lg bg-white shadow-sm ring-1 ring-gray-950/10;
   .fi-input: px-3 py-1.5 text-sm. */
.fi-tp-input { border-radius: var(--radius); padding: 5px 7px; font-size: 9px;
    background: var(--color-white); color: var(--gray-500);
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.1), 0 0 0 1px color-mix(in oklab, var(--gray-950) 10%, transparent); }
.fi-tp--dark .fi-tp-input { background: color-mix(in oklab, var(--color-white) 5%, transparent);
    box-shadow: 0 0 0 1px color-mix(in oklab, var(--color-white) 20%, transparent); }
.fi-tp-link { font-size: 8px; font-weight: 500; color: var(--primary-600); }
.fi-tp-remember { display: flex; align-items: center; gap: 5px; }
/* .fi-checkbox-input: rounded-sm, ring-1 ring-gray-950/20. */
.fi-tp-checkbox { width: 10px; height: 10px; border-radius: var(--radius-sm);
    background: var(--color-white); box-shadow: 0 0 0 1px color-mix(in oklab, var(--gray-950) 20%, transparent); }
.fi-tp--dark .fi-tp-checkbox { background: transparent;
    box-shadow: 0 0 0 1px color-mix(in oklab, var(--color-white) 20%, transparent); }
/* Scoped to the form: Filament's own sign-in button is full width, but the
   topbar/stat buttons above reuse .fi-tp-btn--primary and must not be. */
.fi-tp-form .fi-tp-btn { width: 100%; margin-top: 2px; }
.fi-tp-pin-link { text-align: center; font-size: 8px; color: var(--gray-500); text-decoration: underline;
    text-underline-offset: 3px; }
.fi-tp-simple-copyright { margin-top: 10px; font-size: 8px; color: var(--login-panel-muted); }