/* ================================================================
   app.css — Global Design System
   dormakaba Blazor Enterprise Template
   ================================================================ */

/* ── 1. Custom font ── */
/* Primary font — 1dormakaba (user-supplied files) */
@font-face {
    font-family: '1dormakaba';
    src: url('fonts/1dormakaba-Light.woff2') format('woff2'),
        url('fonts/1dormakaba-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: '1dormakaba';
    src: url('fonts/1dormakaba-Regular.woff2') format('woff2'),
        url('fonts/1dormakaba-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: '1dormakaba';
    src: url('fonts/1dormakaba-Semibold.woff2') format('woff2'),
        url('fonts/1dormakaba-Semibold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: '1dormakaba';
    src: url('fonts/1dormakaba-Bold.woff2') format('woff2'),
        url('fonts/1dormakaba-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Fallback font — dormakaba (original) */
@font-face {
    font-family: 'dormakaba';
    src: local('dormakaba'),
        url('fonts/dormakaba.woff2') format('woff2'),
        url('fonts/dormakaba.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'dormakaba';
    src: local('dormakaba-medium'),
        url('fonts/dormakaba-medium.woff2') format('woff2'),
        url('fonts/dormakaba-medium.woff') format('woff');
    font-weight: 500 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'dormakaba';
    src: local('dormakaba-bold'),
        url('fonts/dormakaba-bold.woff2') format('woff2'),
        url('fonts/dormakaba-bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ── 2. CSS custom properties — light mode ── */
:root {
    /* ─ Brand identity (fixed — never overridden by dark mode) ── */
    --brand-identity-blue: #003594;
    /* Dormakaba blue — always */
    --brand-identity-red: #E4002B;
    /* Dormakaba red  — always */
    --brand-red: #E4002B;
    /* Dormakaba red  — alias */

    /* ─ Primary brand ─────────────────────────────────── */
    --brand-primary: #003594;
    /* primary.main */
    --brand-primary-hover: #012059;
    /* primary.dark */
    --brand-primary-light: #416CBA;
    /* primary.light */
    --brand-primary-subtle: rgba(0, 53, 148, 0.12);
    /* primary.background */
    --brand-primary-subtle-hover: rgba(0, 53, 148, 0.18);
    --brand-primary-border: rgba(0, 53, 148, 0.5);
    /* primary.border */
    --color-primary-subtle: var(--brand-primary-subtle);
    /* alias — theme-aware subtle brand background used by page-level CSS */

    /* ─ Secondary brand ───────────────────────────────── */
    --brand-secondary: #484848;
    /* secondary.main */
    --brand-secondary-dark: #262625;
    /* secondary.dark */
    --brand-secondary-light: #959595;
    /* secondary.light */
    --brand-secondary-border: rgba(72, 72, 72, 0.5);
    /* secondary.border */
    --brand-secondary-bg: rgba(72, 72, 72, 0.08);
    /* secondary.background */

    /* ─ Grey scale ────────────────────────────────────── */
    --grey-50: #F9F9F9;
    --grey-100: #F5F5F5;
    --grey-200: #EDEDED;
    --grey-300: #D9D9D9;
    --grey-400: #B5B5B5;
    --grey-500: #959595;
    --grey-600: #6D6D6D;
    --grey-700: #484848;
    --grey-800: #262626;
    --grey-900: #1A1A1A;

    /* ─ Semantic — Error ──────────────────────────────── */
    --color-error: #E4002B;
    /* error.main */
    --color-error-dark: #A90003;
    /* error.dark */
    --color-error-light: #FF444D;
    /* error.light */
    --color-error-text: #5B0011;
    /* error.text */
    --color-error-bg: #FCE5E9;
    /* error.background */

    /* ─ Semantic — Warning ────────────────────────────── */
    --color-warning: #FFBB00;
    /* warning.main */
    --color-warning-dark: #FF9800;
    /* warning.dark */
    --color-warning-light: #FFDD00;
    /* warning.light */
    --color-warning-text: #664B00;
    /* warning.text */
    --color-warning-bg: #FFF8E5;
    /* warning.background */

    /* ─ Semantic — Info ───────────────────────────────── */
    --color-info: #416CBA;
    /* info.main */
    --color-info-dark: #003594;
    /* info.dark */
    --color-info-light: #82A3DE;
    /* info.light */
    --color-info-text: #344159;
    /* info.text */
    --color-info-bg: #F2F6FC;
    /* info.background */

    /* ─ Semantic — Success ────────────────────────────── */
    --color-success: #5FA82A;
    /* success.main */
    --color-success-dark: #176719;
    /* success.dark */
    --color-success-light: #9CC01C;
    /* success.light */
    --color-success-text: #264311;
    /* success.text */
    --color-success-bg: #EFF6E9;
    /* success.background */

    --color-bg: #F4F7FB;
    /* subtle brand-tinted background */
    --color-surface: #ffffff;
    --color-surface-2: #F9F9F9;
    /* grey-50 */
    --color-surface-elevated: #ffffff;
    --color-surface-subtle: var(--color-surface-2);
    /* alias — theme-aware subtle surface background used by page-level CSS */
    --color-surface-muted: var(--color-surface-2);
    /* alias — theme-aware muted surface background used by page-level CSS */

    --color-text: var(--grey-900);
    --color-text-muted: var(--grey-600);
    --color-text-subtle: var(--grey-500);

    --color-border: rgba(18, 32, 60, 0.09);
    --color-divider: rgba(18, 32, 60, 0.06);
    --color-overlay: rgba(18, 32, 60, 0.03);
    --border-subtle: var(--color-border);
    /* alias — theme-aware subtle border used by page-level CSS */

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10), 0 4px 8px rgba(0, 0, 0, 0.05);
    --shadow-sidebar: 0 8px 40px rgba(0, 53, 148, 0.07), 0 2px 8px rgba(0, 0, 0, 0.06);

    --sidebar-width: 244px;
    --sidebar-collapsed-width: 64px;
    --sidebar-gap: 12px;
    --topbar-height: 64px;

    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --ease-fast: 120ms ease;
    --ease-base: 220ms ease;
    --ease-slow: 360ms cubic-bezier(0.4, 0, 0.2, 1);

    --font-sans: '1dormakaba', 'dormakaba', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    --font-mono: 'Menlo', 'Monaco', 'Courier New', monospace;

    --text-2xs: 0.6875rem;
    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.875rem;
    --text-lg: 1rem;
    --text-xl: 1.1875rem;
    --text-2xl: 1.4375rem;
    --text-3xl: 2rem;

    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    --z-sidebar: 100;
    --z-topbar: 200;
    --z-dropdown: 300;
    --z-modal: 10050;
    --z-modal-dropdown: 10060;
    --z-brand: 10070;
    --z-toast: 10080;
}

/* ── 3. Dark mode overrides ── */
[data-theme="dark"] {
    --color-bg: #0D131A;
    --color-surface: #161c2d;
    --color-surface-2: #1c2236;
    --color-surface-elevated: #1e2740;

    --color-text: #e8edf8;
    --color-text-muted: #b0bde0;
    --color-text-subtle: #7a8ba0;

    --color-border: rgba(255, 255, 255, 0.07);
    --color-divider: rgba(255, 255, 255, 0.05);
    --color-overlay: rgba(255, 255, 255, 0.03);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.30), 0 2px 8px rgba(0, 0, 0, 0.20);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.20);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.45), 0 4px 8px rgba(0, 0, 0, 0.25);
    --shadow-sidebar: 0 8px 40px rgba(0, 0, 0, 0.40), 0 2px 8px rgba(0, 0, 0, 0.30);

    /* In dark mode, brand-primary is used as text/icon color throughout the app.
       Lighten it so active states, links, and icons are readable. */
    --brand-primary: #078aff;
    --brand-primary-hover: #4aa8ff;
    --brand-primary-light: #7ec8ff;
    --brand-primary-subtle: rgba(94, 179, 255, 0.14);
    --brand-primary-subtle-hover: rgba(94, 179, 255, 0.20);

    /* Status colors for stat widgets (hardcoded in component CSS, handled via scoped selectors in section 13) */
    --color-status-green: #4ade80;
    --color-status-orange: #fb923c;
    --color-status-red: #ff6b6b;

    /* Semantic token overrides — brighter for readability on dark backgrounds */
    --color-error: #ff6b6b;
    --color-error-bg: rgba(255, 107, 107, 0.10);
    --color-error-text: #ff6b6b;
    /* chip/label text on dark surface */
    --color-success: #4ade80;
    --color-success-bg: rgba(74, 222, 128, 0.10);
    --color-success-text: #4ade80;
    /* chip/label text on dark surface */
    --color-warning: #fbbf24;
    --color-warning-dark: #fb923c;
    --color-warning-bg: rgba(251, 191, 36, 0.10);
    --color-warning-text: #fbbf24;
    /* chip/label text on dark surface */
    --color-info: #078aff;
    --color-info-bg: rgba(7, 138, 255, 0.10);
    --color-info-text: #078aff;
    /* chip/label text on dark surface */

    /* neutral chip (brand-secondary) — keep readable on dark surfaces */
    --brand-secondary: #a8b8cc;
    --brand-secondary-bg: rgba(168, 184, 204, 0.12);
}

/* ── 4. Reset & base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    overflow: hidden;
    transition: background-color var(--ease-slow), color var(--ease-slow);
}

/* ── 5. Typography ── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--fw-semibold);
    line-height: 1.3;
    color: var(--color-text);
}

p {
    line-height: 1.65;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: opacity var(--ease-fast);
}

a:hover {
    opacity: 0.75;
}

strong {
    font-weight: var(--fw-semibold);
}

code,
pre,
kbd {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* ── 6. Scrollbar ── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-subtle);
}

/* ── 7. App shell ── */
.app-shell {
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── 8. Page content wrapper ── */
.page-content {
    margin-left: calc(var(--sidebar-width) + var(--sidebar-gap) * 2 + 4px);
    margin-top: var(--topbar-height);
    padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-2);
    flex: 1;
    overflow-y: auto;
    scrollbar-gutter: stable;
    transition: margin-left var(--ease-slow);
}

.page-content.sidebar-collapsed {
    margin-left: calc(var(--sidebar-collapsed-width) + var(--sidebar-gap) * 2 + 4px);
}

/* Pre-hydration: align content offset with persisted collapsed sidebar state.
   The flag is removed after first interactive render. */
html[data-sidebar-collapsed='true'] .page-content {
    margin-left: calc(var(--sidebar-collapsed-width) + var(--sidebar-gap) * 2 + 4px);
}

@media (max-width: 768px) {

    .page-content,
    .page-content.sidebar-collapsed {
        margin-left: 0;
        padding: var(--sp-5) var(--sp-4) var(--sp-8);
    }
}

/* ── 9. Page header ── */
.page-header {
    margin-bottom: var(--sp-6);
}

.page-header h1 {
    font-size: var(--text-2xl);
    font-weight: var(--fw-bold);
    color: var(--color-text);
    margin-bottom: 4px;
}

/* Blazor's FocusOnNavigate programmatically focuses the h1 after
   navigation (Routes.razor: <FocusOnNavigate Selector="h1">).
   Suppress the visible ring — headings are not interactive. */
h1:focus {
    outline: none;
}

.page-header .page-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ── 10. Grid utilities ── */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-4);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-4);
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--sp-4);
}

@media (max-width: 1280px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 960px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {

    .grid-2,
    .grid-3,
    .grid-4,
    .grid-auto {
        grid-template-columns: 1fr;
    }
}

/* ── 11. Spacing & utility classes ── */
.mt-4 {
    margin-top: var(--sp-4);
}

.mt-6 {
    margin-top: var(--sp-6);
}

.mb-4 {
    margin-bottom: var(--sp-4);
}

.mb-6 {
    margin-bottom: var(--sp-6);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--sp-2);
}

.gap-3 {
    gap: var(--sp-3);
}

.gap-4 {
    gap: var(--sp-4);
}

.w-full {
    width: 100%;
}

.text-primary {
    color: var(--brand-primary);
}

.text-muted {
    color: var(--color-text-muted);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-xs {
    font-size: var(--text-xs);
}

.fw-medium {
    font-weight: var(--fw-medium);
}

.fw-semibold {
    font-weight: var(--fw-semibold);
}

.fw-bold {
    font-weight: var(--fw-bold);
}

/* ── 12. Topbar icon button (global — used inside child components too) ── */
.topbar-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0;
    transition: background var(--ease-fast), color var(--ease-fast);
}

.topbar-icon-btn:hover {
    background: var(--color-overlay);
    color: var(--color-text);
}

.topbar-icon-btn svg[blazicon] {
    width: 20px;
    height: 20px;
}

/* ── Topbar icon button tooltips ──────────────────────────────────
   Shared tooltip for .topbar-icon-btn (Language, Info, Notifications)
   and .theme-toggle (ThemeToggle component uses its own class).
   Uses color-mix to match the sidebar nav tooltip style, slightly
   darkened at 88% opacity.
   ─────────────────────────────────────────────────────────────── */
.theme-toggle[data-tooltip] {
    position: relative;
    /* topbar-icon-btn already has position:relative */
}

:is(.topbar-icon-btn, .theme-toggle)[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: color-mix(in srgb, var(--color-text) 88%, transparent);
    color: var(--color-bg);
    font-size: var(--text-xs);
    font-weight: var(--fw-medium);
    font-family: var(--font-sans);
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    z-index: var(--z-dropdown);
    transition: opacity var(--ease-fast), transform var(--ease-fast);
}

:is(.topbar-icon-btn, .theme-toggle)[data-tooltip]::before {
    content: '';
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 4px solid transparent;
    border-bottom-color: color-mix(in srgb, var(--color-text) 88%, transparent);
    pointer-events: none;
    opacity: 0;
    z-index: var(--z-dropdown);
    transition: opacity var(--ease-fast), transform var(--ease-fast);
}

:is(.topbar-icon-btn, .theme-toggle)[data-tooltip]:hover::after,
:is(.topbar-icon-btn, .theme-toggle)[data-tooltip]:hover::before,
:is(.topbar-icon-btn, .theme-toggle)[data-tooltip]:focus-visible::after,
:is(.topbar-icon-btn, .theme-toggle)[data-tooltip]:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--radius-full);
    background: var(--color-error);
    color: #fff;
    font-size: 10px;
    font-weight: var(--fw-bold);
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}

/* ── 12b. Blazor error UI ── */
#blazor-error-ui {
    display: none;
    background: var(--color-surface);
    border: 1px solid var(--color-error);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-4) var(--sp-6);
    position: fixed;
    bottom: var(--sp-6);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    color: var(--color-text);
    font-size: var(--text-sm);
    font-family: var(--font-sans);
    white-space: nowrap;
}

/* ── 13. Modal ── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: var(--sp-4);
    animation: modal-fade-in var(--ease-fast) forwards;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--sp-8));
    width: 100%;
    animation: modal-slide-in var(--ease-base);
    overflow: hidden;
}

@keyframes modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.modal-small {
    max-width: 420px;
}

.modal-medium {
    max-width: 620px;
}

.modal-large {
    max-width: 900px;
}

.modal-extralarge {
    max-width: min(1280px, calc(100vw - var(--sp-8)));
}

.modal-maximized {
    max-width: none !important;
    max-height: none !important;
    width: calc(100vw - var(--sp-8)) !important;
    height: calc(100vh - var(--sp-8)) !important;
    border-radius: var(--radius-lg);
}

/* Modal header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--color-divider);
    flex-shrink: 0;
    gap: var(--sp-3);
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: var(--fw-semibold);
    color: var(--color-text);
    margin: 0;
    line-height: 1.3;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    flex-shrink: 0;
}

/* Control buttons (maximize, close) */
.modal-ctrl-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0;
    transition: background var(--ease-fast), color var(--ease-fast);
}

.modal-ctrl-btn svg {
    width: 15px;
    height: 15px;
}

.modal-ctrl-btn:hover {
    background: var(--color-overlay);
    color: var(--color-text);
}

.modal-close-btn:hover {
    background: var(--color-error-bg);
    color: var(--color-error);
}

/* Modal body */
.modal-body {
    padding: var(--sp-5);
    overflow-y: auto;
    flex: 1;
}

/* ── 12. Blazor error UI ── */
#blazor-error-ui {
    display: none;
    background: var(--color-surface);
    border: 1px solid var(--color-error);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-4) var(--sp-6);
    position: fixed;
    bottom: var(--sp-6);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    color: var(--color-text);
    font-size: var(--text-sm);
    font-family: var(--font-sans);
    white-space: nowrap;
}

#blazor-error-ui .reload {
    margin-left: var(--sp-3);
    color: var(--color-error);
    font-weight: var(--fw-medium);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    margin-left: var(--sp-3);
    opacity: 0.55;
}

/* ── 13. Dark mode component overrides ──────────────────────────────
   Scoped CSS cannot target ancestor themes. These rules use the exact
   Blazor-generated attribute selectors from the compiled styles bundle.
   ─────────────────────────────────────────────────────────────────── */
/* quick-icon and nav-item.active now inherit the correct color via --brand-primary override above */

[data-theme="dark"] .stat-blue .stat-icon-wrap[b-8fc2ldkvb3] {
    color: #078aff !important;
}

[data-theme="dark"] .stat-green .stat-icon-wrap[b-8fc2ldkvb3] {
    color: var(--color-success) !important;
}

[data-theme="dark"] .stat-orange .stat-icon-wrap[b-8fc2ldkvb3] {
    color: var(--color-warning-dark) !important;
}

[data-theme="dark"] .stat-red .stat-icon-wrap[b-8fc2ldkvb3] {
    color: var(--color-error) !important;
}

/* ── 14. Focus & accessibility ── */
:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ── 15. AppSkeleton ─────────────────────────────────────────────
   A reusable shimmer block used by AppSkeleton and any component
   that implements its own IsLoading state (e.g. AppStatWidget).
   ─────────────────────────────────────────────────────────────── */
.app-skeleton {
    display: inline-block;
    border-radius: var(--radius-md);
    background: linear-gradient(90deg,
            var(--color-overlay) 25%,
            var(--color-divider) 50%,
            var(--color-overlay) 75%);
    background-size: 200% 100%;
    animation: app-shimmer 1.4s ease-in-out infinite;
    vertical-align: middle;
}

.app-skeleton--circle {
    border-radius: var(--radius-full);
}

@keyframes app-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}
