@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/inter/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/inter/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/inter/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/inter/inter-latin-700-normal.woff2') format('woff2');
}

/* Lato (vattenagarna.se's typeface) — static family has no 500/600, so CSS
   font matching falls back: 500 -> 400, 600 -> 700. Only used when the
   brand sets BRAND_FONT=Lato. */
@font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/lato/lato-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/lato/lato-latin-700-normal.woff2') format('woff2');
}

/* Compact topbar and sidebar header — match height across both columns */
.fi-topbar nav,
.fi-sidebar-header {
    height: 2.625rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Constrain sidebar logo so it sits with breathing room inside the header */
.fi-sidebar-header img {
    max-height: 1.75rem !important;
    padding-block: 0.125rem !important;
}

/* Scale down logo inside topbar */
.fi-topbar nav img {
    max-height: 1.5rem !important;
}

/* Compact main content horizontal padding */
.fi-main {
    padding-inline: 1.25rem !important;
}

/* Compact sidebar nav */
.fi-sidebar-nav {
    padding-block: 1rem !important;
    padding-inline: 0.75rem !important;
}

.fi-sidebar-nav-groups {
    gap: 0.25rem !important;
}

.fi-sidebar-group {
    gap: 0 !important;
}

.fi-sidebar-group-button {
    padding-block: 0.25rem !important;
}

.fi-sidebar-group-items {
    gap: 0 !important;
}

.fi-sidebar-item-button {
    padding-block: 0.25rem !important;
}

/* Live clock in topbar */
.fi-topbar-clock {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* Developer card in sidebar footer */
.fadmin-dev-card {
    flex-shrink: 0;
}

/* Stronger Section panel contrast — default ring (gray-950/5%) is nearly invisible on white */
.fi-section {
    --tw-ring-color: rgb(203 205 211) !important;
}
.dark .fi-section {
    --tw-ring-color: rgb(255 255 255 / 0.16) !important;
}
.fi-section-content-ctn,
.fi-section-footer {
    border-color: rgb(203 205 211) !important;
}
.dark .fi-section-content-ctn,
.dark .fi-section-footer {
    border-color: rgb(255 255 255 / 0.16) !important;
}

/* Give Section headers a subtle background so they stand out from the body.
   Tighten the vertical padding (Filament's default py-4 = 16px top+bottom) so
   the heading band doesn't waste space above/below the h3. */
.fi-section-header {
    background-color: rgb(236 238 242) !important;
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}
.dark .fi-section-header {
    background-color: rgb(255 255 255 / 0.10) !important;
}

/* ---------------------------------------------------------------------------
   Compact density pass for data views & forms.
   Filament's defaults (p-6 section body, gap-6 between fields) are roomy.
   --------------------------------------------------------------------------- */

/* Section body padding: default p-6 (24px) -> 16px */
.fi-section-content {
    padding: 1rem !important;
}

/* Schema grid: tighten the gap between fields/entries (default gap-6 = 24px).
   Keep a comfortable column gap so adjacent columns don't crowd; shrink rows. */
.fi-fo-component-ctn,
.fi-in-component-ctn {
    row-gap: 0.625rem !important;
    column-gap: 1.5rem !important;
}

/* Inline labels are often single long Swedish compound words with no spaces
   ("Aviseringspreferens"); in a narrow inline column they can't wrap and
   overflow onto the value. Let them break so label and value never collide. */
.fi-in-entry-wrp-label span,
.fi-fo-field-wrp-label span {
    overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------------------
   Quick-access tiles (dashboard)
   Plain CSS, not Tailwind: the panel loads Filament's precompiled stylesheet,
   so utility classes written in a widget blade are never generated.
   --------------------------------------------------------------------------- */
.fadmin-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.75rem;
}

.fadmin-quick-tile {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    background-color: rgb(255 255 255);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
    outline: 1px solid rgb(203 205 211);
    outline-offset: -1px;
    text-decoration: none;
    transition: transform 120ms ease, box-shadow 120ms ease, outline-color 120ms ease;
}

.fadmin-quick-tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgb(0 0 0 / 0.08);
    outline-color: rgb(var(--primary-500));
}

.fadmin-quick-tile:focus-visible {
    outline: 2px solid rgb(var(--primary-600));
    outline-offset: 2px;
}

.dark .fadmin-quick-tile {
    background-color: rgb(255 255 255 / 0.05);
    outline-color: rgb(255 255 255 / 0.16);
    box-shadow: none;
}

.dark .fadmin-quick-tile:hover {
    background-color: rgb(255 255 255 / 0.08);
    outline-color: rgb(var(--primary-400));
}

/* Icon chip — colour comes from the tile's data-colour, mapped below.
   Filament's colour variables are comma-separated triplets ("245, 158, 11"),
   so the rgb(... / alpha) slash form does not parse; tint via color-mix and
   declare an opaque fallback first for browsers without it. */
.fadmin-quick-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    background-color: rgb(236 238 242);
    background-color: color-mix(in srgb, rgb(var(--tile-rgb)) 12%, transparent);
    color: rgb(var(--tile-rgb));
}

/* Size the glyph here rather than trusting the blade's utility classes —
   the panel serves precompiled CSS, so h-6/w-6 is not guaranteed to exist. */
.fadmin-quick-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.dark .fadmin-quick-icon {
    background-color: rgb(63 63 70);
    background-color: color-mix(in srgb, rgb(var(--tile-rgb)) 22%, transparent);
}

.fadmin-quick-tile[data-colour='primary'] { --tile-rgb: var(--primary-600); }
.fadmin-quick-tile[data-colour='success'] { --tile-rgb: var(--success-600); }
.fadmin-quick-tile[data-colour='warning'] { --tile-rgb: var(--warning-600); }
.fadmin-quick-tile[data-colour='info']    { --tile-rgb: var(--info-600); }
.fadmin-quick-tile[data-colour='gray']    { --tile-rgb: var(--gray-500); }

.dark .fadmin-quick-tile[data-colour='primary'] { --tile-rgb: var(--primary-400); }
.dark .fadmin-quick-tile[data-colour='success'] { --tile-rgb: var(--success-400); }
.dark .fadmin-quick-tile[data-colour='warning'] { --tile-rgb: var(--warning-400); }
.dark .fadmin-quick-tile[data-colour='info']    { --tile-rgb: var(--info-400); }
.dark .fadmin-quick-tile[data-colour='gray']    { --tile-rgb: var(--gray-400); }

.fadmin-quick-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.fadmin-quick-label {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
    color: rgb(17 24 39);
}

.dark .fadmin-quick-label {
    color: rgb(243 244 246);
}

.fadmin-quick-desc {
    font-size: 0.75rem;
    line-height: 1rem;
    color: rgb(107 114 128);
}

.dark .fadmin-quick-desc {
    color: rgb(156 163 175);
}

@media (prefers-reduced-motion: reduce) {
    .fadmin-quick-tile {
        transition: none;
    }

    .fadmin-quick-tile:hover {
        transform: none;
    }
}
