@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/Inter-Regular.woff2') format('woff2'), local('Inter'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/Inter-Medium.woff2') format('woff2'), local('Inter Medium'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/Inter-SemiBold.woff2') format('woff2'), local('Inter SemiBold'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/Inter-Bold.woff2') format('woff2'), local('Inter Bold'); }
html, body { font-family: 'Inter', system-ui, sans-serif; }

/* --- Shell chrome: give the drawer and app bar real separation from the content.
   Colours come from MudBlazor's palette CSS variables, so this tracks light/dark. --- */
.nettify-appbar { border-bottom: 1px solid var(--mud-palette-divider); }
.nettify-drawer { border-right: 1px solid var(--mud-palette-divider); }

/* Leaner top bar: trim the default 64px app bar to 52px and keep the main content flush with it. */
.nettify-appbar.mud-appbar { height: 52px; }
.nettify-appbar .mud-toolbar { min-height: 52px; height: 52px; }
.nettify-main { padding-top: 52px; }

/* Brand block at the top of the sidebar — same height as the app bar so the borders line up. */
.nettify-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    height: 52px;
    min-height: 52px;
    padding: 0 1rem;
    border-bottom: 1px solid var(--mud-palette-divider);
}
.nettify-brand-mark { width: 28px; height: 28px; flex: 0 0 auto; display: block; object-fit: contain; }
.nettify-brand-text { font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.01em; }

/* Section label between nav groups */
.nettify-navgroup {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    padding: 1.125rem 1.25rem 0.375rem;
}
.nettify-nav-empty { padding: 0.75rem 1.25rem; color: var(--mud-palette-text-secondary); }
/* Nested sub-pages under a parent nav item */
.nettify-nav-children { margin-left: 1.5rem; border-left: 1px solid var(--mud-palette-divider); padding-left: 2px; }

/* Nav items: tighter radius, a little breathing room, and a left accent when active */
.nettify-navmenu { padding: 0.5rem 0.5rem; }
.nettify-navmenu .mud-nav-link { position: relative; border-radius: 8px; margin: 1px 0; }
.nettify-navmenu .mud-nav-link.active {
    font-weight: 600;
    background-color: var(--mud-palette-action-default-hover);
}
.nettify-navmenu .mud-nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.3rem;
    bottom: 0.3rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--mud-palette-primary);
}

/* Centered status card for the OIDC redirect states */
.auth-status {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}
.auth-status-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem;
    max-width: 420px;
    width: 100%;
    border-radius: 16px;
}
.auth-status-mark { width: 44px; height: 44px; object-fit: contain; }

/* Account avatar + menu in the app bar */
.nettify-avatar { cursor: pointer; width: 30px; height: 30px; font-size: 0.6875rem; font-weight: 600; margin-left: 0.75rem; }
.nettify-usermenu-head { padding: 0.5rem 1rem 0.25rem; min-width: 220px; }

/* Tenant switcher — an outlined, compact select-like control */
.nettify-tenant-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 34px;
    max-width: 240px;
    padding: 0 6px 0 10px;
    border: 1px solid var(--mud-palette-divider);
    border-radius: 8px;
    cursor: pointer;
    color: inherit;
    user-select: none;
}
.nettify-tenant-btn:hover { background-color: var(--mud-palette-action-default-hover); }
.nettify-tenant-lead { flex: 0 0 auto; }
.nettify-tenant-current {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
}
.nettify-tenant-static { display: flex; align-items: center; gap: 0.375rem; padding: 0 0.5rem; }

/* Searchable tenant dropdown */
.nettify-tenant-popover { min-width: 260px; max-width: 300px; }
.nettify-tenant-search {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px 10px 6px;
    background: var(--mud-palette-surface);
}
.nettify-tenant-list { max-height: 300px; overflow-y: auto; }
.nettify-tenant-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; }
.nettify-tenant-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nettify-tenant-empty { padding: 10px 14px; color: var(--mud-palette-text-secondary); font-size: 0.8125rem; }

/* Responsive header: tighten so the tenant control + avatar always fit */
@media (max-width: 640px) {
    .nettify-tenant-btn { max-width: 128px; }
    .nettify-appbar .mud-toolbar { padding-left: 8px; padding-right: 8px; }
    .nettify-main > .mud-container { padding-left: 12px; padding-right: 12px; }
}

/* --- Shared components --- */

/* AdminDataGrid */
.admin-datagrid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.admin-datagrid-tools { display: flex; align-items: center; gap: 0.5rem; }
.admin-datagrid-search { min-width: 220px; }
/* Per-row edit/delete actions — kept tight and right-aligned in the trailing column. */
.nettify-row-actions { display: flex; align-items: center; gap: 0.25rem; justify-content: flex-end; }
/* Two-up field layout inside the content editor dialogs. */
.nettify-form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.nettify-form-row > * { flex: 1 1 0; min-width: 150px; }
.admin-datagrid-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 2rem;
    color: var(--mud-palette-text-secondary);
}
/* Reserve a stable height for the loading state so the grid body doesn't collapse to a thin
   bar and snap back on every page/sort/search — the indicator stays centered in the same box. */
.admin-datagrid-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 2rem;
}

/* PageHeader */
.nettify-page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.nettify-page-header-actions { display: flex; gap: 0.5rem; align-items: center; }
.nettify-breadcrumbs { font-size: 0.8125rem; }

/* FormActions */
.nettify-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.nettify-form-actions-primary { display: flex; gap: 0.5rem; margin-left: auto; }

/* StatCard */
.nettify-statcard { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem; height: 100%; }
.nettify-statcard-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex: 0 0 auto;
}
.nettify-statcard-value { font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.nettify-statcard-label { color: var(--mud-palette-text-secondary); font-size: 0.8125rem; }
.nettify-statcard-trend { font-size: 0.75rem; margin-top: 2px; }

/* AccessSummary — role chips + compact permissions-by-area table */
.nettify-access-roles { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.nettify-access-tablewrap { overflow-x: auto; }
.nettify-access-table td, .nettify-access-table th { vertical-align: middle; }
.nettify-access-table th { font-weight: 600; color: var(--mud-palette-text-secondary); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.nettify-access-areacol { width: 1%; white-space: nowrap; }
.nettify-access-area { display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; font-weight: 500; }
.nettify-access-actions { display: flex; flex-wrap: wrap; gap: 4px; }

/* Audit entry detail dialog */
.nettify-audit-detail { display: flex; flex-direction: column; gap: 2px; }
.nettify-audit-row { display: flex; gap: 1rem; padding: 4px 0; }
.nettify-audit-label { width: 130px; flex: 0 0 auto; color: var(--mud-palette-text-secondary); }
.nettify-audit-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nettify-audit-json {
    background: var(--mud-palette-background-gray);
    border-radius: 8px;
    padding: 10px;
    font-size: 0.75rem;
    overflow: auto;
    max-height: 220px;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 4px 0 0;
}
@media (max-width: 600px) { .nettify-audit-diff { grid-template-columns: 1fr; } }

/* Account profile block */
.nettify-profile { display: flex; align-items: center; gap: 1rem; }
.nettify-profile-meta { min-width: 0; }
.nettify-profile-name { line-height: 1.2; }
.nettify-profile-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Content area index cards */
.nettify-area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.nettify-area-card { padding: 1rem 1.25rem; height: 100%; }
.nettify-area-card:hover { border-color: var(--mud-palette-primary); }
.nettify-area-soon { opacity: 0.6; }
.nettify-area-head { display: flex; align-items: center; justify-content: space-between; }
.nettify-area-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Command palette */
.nettify-cmdk-input { width: 100%; }
.nettify-cmdk-item { display: flex; align-items: center; gap: 0.75rem; width: 100%; }
.nettify-cmdk-item .cmdk-group { margin-left: auto; font-size: 0.6875rem; color: var(--mud-palette-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

/* Connectivity banner */
.nettify-offline-banner { position: sticky; top: 0; z-index: 1200; }

/* Global loading bar (ILoadingService) */
.nettify-loading-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 2000; }

/* Command palette */
.nettify-cmdk {
    position: fixed;
    top: 12vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(560px, 92vw);
    z-index: 1401;
}
.nettify-cmdk-panel { border-radius: 12px; overflow: hidden; padding: 8px; }
.nettify-cmdk-list { max-height: 50vh; overflow-y: auto; margin-top: 4px; }

/* Density preference */
:root[data-density="compact"] .nettify-main > .mud-container { padding-top: 12px; padding-bottom: 12px; }
:root[data-density="compact"] .nettify-statcard { padding: 0.875rem 1rem; }

/* Respect reduced-motion preference globally */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
