/* ============================================================
   MedProctor OAuth2Provider — app styles

   Structural layout + utilities layered on top of the Kendo
   Default theme and whichever Fluent 2 Teams swatch is active
   (light / dark / classic / high-contrast, all shipped by
   MedProctor.Theming and linked from App.razor).

   This file defines NO color tokens. All colors come from the
   active swatch. Rules here reference --kendo-color-* so they
   re-paint automatically when the user toggles themes.
   ============================================================ */

/* ── Project-local non-color tokens ── */
:root {
    --app-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --app-fs-meta:   var(--kendo-font-size-xs, 11px);
    --app-fs-label:  11px;
}

/* ── Base reset ── */
html, body {
    height: 100%;
    margin: 0;
    font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ── Visible focus ring — WCAG 2.2 §2.4.11 ── */
:focus-visible {
    outline: 2px solid var(--kendo-color-primary);
    outline-offset: 2px;
}

/* tabindex="-1" elements are focused programmatically (e.g. page <h1> after navigation)
   for screen-reader route announcement only. They are never Tab-reachable, so a visible
   focus ring would confuse sighted users — suppress it. */
[tabindex="-1"]:focus { outline: none; }

/* ── Skip link (accessibility) ── */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    z-index: 10000;
    padding: 8px 12px;
    background: var(--kendo-color-primary);
    color: var(--kendo-color-on-primary);
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    transition: top 0.1s;
}
.skip-link:focus { top: 0; }

/* Visually hide content while keeping it available to assistive tech.
   Used by the IdleLogoutMonitor countdown announcer and any other aria-live
   region we don't want displayed. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Idle-logout warning card ──
   Hand-rolled overlay + TelerikCard instead of TelerikDialog, because the
   dialog's portal / content-caching behavior prevented the countdown body from
   updating once the dialog was mounted. Using a plain card inside an @if-gated
   overlay keeps the DOM fully under our control. */

.idle-logout-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background-color: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.idle-logout-card {
    width: 360px;
    max-width: 100%;
}

.idle-logout-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
}

.idle-logout-card__body {
    text-align: center;
}

.idle-countdown__time {
    font-size: 3.25rem;
    font-weight: 600;
    /* tabular-nums keeps the digits from jittering as seconds tick down. */
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    line-height: 1.1;
    margin: 4px 0 12px;
    color: var(--kendo-color-primary, #2563eb);
}
.idle-countdown__hint {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--kendo-color-on-app-surface, inherit);
    opacity: 0.85;
}

/* ── Admin shell ── */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-content {
    padding: 16px 20px;
    overflow: auto;
    min-height: calc(100vh - 48px);
    flex: 1;
}

@media (max-width: 575px) {
    .page-content { padding: 12px; }
}

.appbar-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-user {
    padding: 16px;
    border-bottom: 1px solid var(--kendo-color-border);
}
.drawer-user .name { font-weight: 600; font-size: 14px; }

/* Drawer brand header block (shield icon + "Identity Admin" text) */
.drawer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-bottom: 1px solid var(--kendo-color-border);
    min-height: 56px; /* align with AppBar height */
}

.drawer-brand {
    font-size: 14px;
    font-weight: 600;
    color: var(--kendo-color-on-app-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ────────────────────────────────────────────────────────────────────────
   Avatar + account popup
   ------------------------------------------------------------------------
   The visible widgets (button, avatar, chip, separator) are all Telerik
   components; the rules below only cover layout, the status-dot overlay
   (not built into TelerikAvatar), and small typographic tweaks inside the
   popup. All colors flow through --kendo-color-* tokens so the panel
   re-skins when the active swatch changes.
   ──────────────────────────────────────────────────────────────────────── */

/* Positioning wrapper so we can overlay a status dot on TelerikAvatar.
   Telerik renders the avatar as a fixed-size rounded element; the wrapper
   is display:inline-flex so sizing follows the avatar itself. */
.user-avatar-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.user-avatar-status {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--kendo-color-success);
    /* Ring cut out against whatever surface the avatar sits on, so the dot
       reads as a separate disc rather than bleeding into the avatar edge. */
    box-shadow: 0 0 0 2px var(--kendo-appbar-bg, var(--kendo-color-surface));
}
.user-avatar-status--lg {
    width: 14px;
    height: 14px;
    box-shadow: 0 0 0 3px var(--kendo-color-surface);
}

/* ── Popup shell ───────────────────────────────────────────────────────── */
/* TelerikPopup forwards Class onto its .k-popup root. Override only the
   chrome we care about (rounded corners, elevation) — base colors already
   come from --kendo-color-surface via the active swatch. */
.k-popup.user-menu-popup {
    border: 1px solid var(--kendo-color-border);
    border-radius: 8px;
    box-shadow: var(--kendo-elevation-3, 0 4px 8px rgba(0, 0, 0, 0.2));
    padding: 0;
}

.user-menu {
    display: flex;
    flex-direction: column;
}
.user-menu .k-separator { margin: 0; }

/* Header row: org label on the left, flat Telerik "Sign out" button on the right. */
.user-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 8px;
    gap: 8px;
}
.user-menu__org {
    font-size: 13px;
    font-weight: 600;
    color: var(--kendo-color-subtle);
}

/* Identity row: Telerik avatar (with status overlay) + stacked name/email. */
.user-menu__identity {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
}
.user-menu__info { min-width: 0; }
.user-menu__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--kendo-color-on-surface);
    line-height: 1.2;
}
.user-menu__email {
    font-size: 12px;
    color: var(--kendo-color-subtle);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Theme toggle — stretch the flat Telerik button to fill the popup width and
   left-align its content. Telerik's .k-button rules stay in charge of focus
   ring, hover, and icon alignment. */
.user-menu__action-btn.k-button {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 16px;
    border-radius: 0;
}

/* Status row — houses the Telerik chip. No chrome, just spacing. */
.user-menu__status-row {
    padding: 10px 14px 14px;
}

/* Nav links inside the drawer */
.drawer-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--kendo-color-on-app-surface);
    text-decoration: none;
    font-size: 14px;
    border-radius: 4px;
    transition: background 0.15s;
}
.drawer-nav-link:hover,
.drawer-nav-link:focus {
    background: var(--kendo-color-base-subtle-hover);
}
.drawer-nav-link.active {
    background: var(--kendo-color-primary-subtle);
    color: var(--kendo-color-primary-on-subtle);
    font-weight: 600;
}

/* Section header that groups related drawer nav links (e.g. the JWE subnav) */
.drawer-nav-section-header {
    padding: 16px 16px 6px;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kendo-color-subtle);
    border-top: 1px solid var(--kendo-color-border);
}

/* Collapsible group toggle inside the drawer (e.g. the JWE group).
   Shares the visual footprint of .drawer-nav-link so a group header reads as
   "just another nav item" until the user interacts with it. */
.drawer-nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 0;
}

.drawer-nav-group-toggle:hover,
.drawer-nav-group-toggle:focus-visible {
    background: var(--kendo-color-base-subtle-hover);
    outline: none;
}

.drawer-nav-group-toggle.active-section {
    color: var(--kendo-color-primary-on-subtle);
    font-weight: 600;
}

.drawer-nav-chevron {
    margin-left: auto;
    transition: transform 120ms ease;
}

/* Submenu container — indented under the collapsible group toggle.
   Uses `hidden` attribute for collapsed state so assistive tech treats it
   correctly; CSS here only handles the visible styling. */
.drawer-nav-submenu {
    display: flex;
    flex-direction: column;
}

.drawer-nav-sublink {
    padding-left: 44px; /* aligns sublink icon with the JWE group icon */
    font-size: 13px;
}

/* Consistent label styling inside drawer links (works with both <a> and <button>) */
.drawer-nav-label {
    flex: 1;
}

/* Pin toggle in the drawer header */
.drawer-pin-btn {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: var(--kendo-color-subtle);
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.drawer-pin-btn:hover,
.drawer-pin-btn:focus-visible {
    background: var(--kendo-color-base-subtle-hover);
    color: var(--kendo-color-on-app-surface);
    outline: none;
}

.drawer-pin-btn.pinned {
    color: var(--kendo-color-primary);
}

/* Hidden logout form — submitted via JS from the AppBar logout button */
#logout-form { display: none; }

/* ── JWE admin pages: card grid + definition lists ── */
.jwe-card-grid,
.jwe-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.jwe-card {
    background: var(--kendo-color-surface);
    border: 1px solid var(--kendo-color-border);
    border-radius: 6px;
    padding: 16px 18px;
}

.jwe-card h2 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--kendo-color-subtle);
}

.jwe-dl {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 6px 12px;
    margin: 0 0 12px;
    font-size: 13px;
}

.jwe-dl dt {
    color: var(--kendo-color-subtle);
    font-weight: 500;
}

.jwe-dl dd {
    margin: 0;
    word-break: break-all;
}

/* Form field rows used by the mint/decrypt tester — label above input. */
.jwe-form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.jwe-form-row label {
    font-weight: 600;
    font-size: 13px;
}

/* ── Public shell: full-viewport, centered card ──
   Background intentionally pulls from the active swatch's --kendo-color-app-surface.
   theme-dark.css layers a soft violet radial gradient on top of this rule when the
   dark swatch is active; in light mode the flat surface is the correct aesthetic. */
.public-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kendo-color-app-surface);
    padding: 24px;
}

.public-card {
    width: 100%;
    max-width: 420px;
    background: var(--kendo-color-surface);
    border: 1px solid var(--kendo-color-border);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (max-width: 479px) {
    .public-card { padding: 24px 16px; }
    .public-shell { padding: 16px; align-items: flex-start; padding-top: 40px; }
}

.public-card h1 { font-size: 20px; margin: 0 0 8px; }
.public-card .subtitle { color: var(--kendo-color-subtle); font-size: 13px; margin-bottom: 20px; }

/* ── Two-column form grid (1-col on phones, 2-col ≥1024px) ──
   Used INSIDE .form-section__body to lay out individual fields. The vertical
   gap is handled by .form-field's own margin-bottom; the grid only owns
   horizontal spacing so the column gutter scales independently. */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 24px;
    row-gap: 0;
}
@media (min-width: 1024px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
}
.form-grid .full-row { grid-column: 1 / -1; }

/* ── Theme-aware colour contract ──
   Every rule below routes through --kendo-color-* tokens that the active
   Kendo Teams swatch (light / dark / classic / high-contrast — see
   App.razor) defines. Hard-coded RGBA values are reserved for shadows
   and overlays where a single subtle dark drop reads acceptably across
   themes; everything else flips automatically with the swatch. */

/* ── Page-level breadcrumb above the entity header ── */
.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--kendo-color-subtle);
    margin: 0 0 12px 0;
}
.page-breadcrumb a {
    color: inherit;
    text-decoration: none;
    transition: color 120ms ease;
}
.page-breadcrumb a:hover,
.page-breadcrumb a:focus-visible {
    color: var(--kendo-color-primary);
    text-decoration: underline;
}
.page-breadcrumb__sep {
    color: var(--kendo-color-subtle);
    opacity: 0.6;
}
.page-breadcrumb__current {
    color: var(--kendo-color-on-app-surface);
    font-weight: 500;
}

/* ── Entity / page header card ──
   Sits between the breadcrumb and the form sections. On Edit it shows the
   ClientId (large, monospace), the type chip, and audit metadata. On Create
   it shows the page title and a one-sentence lede. Surface + border come
   from the active swatch — same convention TelerikCard uses internally so
   the header reads as a sibling of the form sections in any theme. */
.entity-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
    margin: 0 0 24px 0;
    padding: 20px 24px;
    background: var(--kendo-color-surface);
    border: 1px solid var(--kendo-color-border);
    border-radius: 10px;
    color: var(--kendo-color-on-surface);
}
.entity-header__main {
    flex: 1;
    min-width: 0;
}
.entity-header__title {
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    word-break: break-word;
    color: var(--kendo-color-on-surface);
}
/* Title <code> stays plain monospace — the font shift alone signals
   "identifier" without the heavy badge background that read as visual
   noise at H1 size. */
.entity-header__title code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 1em;
    background: transparent;
    padding: 0;
    color: inherit;
}
.entity-header__lede {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--kendo-color-subtle);
    max-width: 70ch;
}
.entity-header__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    font-size: 0.85rem;
    color: var(--kendo-color-subtle);
}
/* Meta-item ids — same plain-monospace treatment as the title; the font
   shift carries the "this is an identifier" signal without a coloured pill. */
.entity-header__meta-item code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    background: transparent;
    padding: 0;
    color: var(--kendo-color-on-app-surface);
    margin-left: 2px;
}

/* ── Sectioned form layout ──
   .form-stack is the vertical column of sections; .form-section is one
   bordered panel with a header (icon + title + descriptive hint) and a
   body that contains a .form-grid of fields. */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-section {
    background: var(--kendo-color-surface);
    border: 1px solid var(--kendo-color-border);
    border-radius: 10px;
    overflow: hidden;
    color: var(--kendo-color-on-surface);
}

.form-section__header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--kendo-color-border);
    /* Subtle tint behind the section header so it reads as a "label band"
       above the form body. Uses the swatch's neutral subtle fill so it's
       light-grey on light themes, dark-grey on dark themes. */
    background: var(--kendo-color-base-subtle);
}

.form-section__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    /* Tinted-primary pill: the Kendo swatches define both the background
       fill (--kendo-color-primary-subtle) and the matching foreground
       (--kendo-color-primary-on-subtle) so contrast holds in every theme. */
    background: var(--kendo-color-primary-subtle);
    color: var(--kendo-color-primary-on-subtle);
    flex-shrink: 0;
}

.form-section__heading {
    flex: 1;
    min-width: 0;
}

.form-section__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--kendo-color-on-app-surface);
}

.form-section__hint {
    margin: 4px 0 0 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--kendo-color-subtle);
}

.form-section__body {
    padding: 20px 24px 8px 24px;
}

/* ── Per-field block ──
   Each form field is wrapped in .form-field so the label, input, hint, and
   ValidationMessage stay vertically grouped with consistent spacing. The
   bottom margin owns the inter-field rhythm (form-grid intentionally has
   row-gap: 0 so the .form-field margin can vary if needed). */
.form-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.form-field__label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 6px;
    color: var(--kendo-color-on-app-surface);
}

.form-field__required {
    color: var(--kendo-color-error);
    font-weight: 600;
    line-height: 1;
}

.form-field__optional {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--kendo-color-subtle);
    text-transform: lowercase;
    letter-spacing: 0.01em;
}

.form-field__hint {
    margin: 6px 0 0 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--kendo-color-subtle);
}

.form-field__hint code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85em;
    background: var(--kendo-color-base-subtle);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--kendo-color-on-app-surface);
}

.form-field .validation-message {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--kendo-color-error);
}

/* ── Form footer (sticky-feel action bar at the bottom of the form) ──
   Replaces the older .form-actions div. Uses sticky positioning so the
   action buttons stay reachable when the form scrolls long. The spacer
   div in the middle pushes destructive / left-aligned actions away from
   the primary action on the right. The drop shadow stays a low-opacity
   black so it reads as a subtle elevation cue in both light and dark
   themes (a white shadow on dark would invert the cue). */
.form-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding: 14px 18px;
    background: var(--kendo-color-surface);
    border: 1px solid var(--kendo-color-border);
    border-radius: 10px;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.18);
    z-index: 10;
    color: var(--kendo-color-on-surface);
}
.form-footer__spacer {
    flex: 1;
}
@media (max-width: 575px) {
    .form-footer { flex-direction: column-reverse; align-items: stretch; }
    .form-footer > .form-footer__spacer { display: none; }
    .form-footer > * { width: 100%; }
}

/* ── Empty state (shown when an Edit page receives an unknown id) ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 32px;
    background: var(--kendo-color-surface);
    border: 1px solid var(--kendo-color-border);
    border-radius: 10px;
    color: var(--kendo-color-on-surface);
}
.empty-state h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}
.empty-state p {
    margin: 0;
    color: var(--kendo-color-subtle);
}

/* ── Destructive-action banner (Delete page) ──
   Red-tinted band used on the Delete page to anchor the irreversibility
   warning above the summary + action buttons. Tokens are theme-aware:
   --kendo-color-error-subtle is light pink in light mode, dark red-tinted
   in dark mode; --kendo-color-on-error-subtle is the matching readable
   text. Border + icon use --kendo-color-error directly so the accent
   stays vivid in both themes. */
.danger-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    margin: 0 0 16px 0;
    background: var(--kendo-color-error-subtle);
    color: var(--kendo-color-on-error-subtle);
    border: 1px solid var(--kendo-color-error);
    border-left-width: 4px;
    border-radius: 8px;
}
.danger-banner__icon {
    color: var(--kendo-color-error);
    flex-shrink: 0;
    line-height: 1;
    padding-top: 1px;
}
.danger-banner__body {
    flex: 1;
    min-width: 0;
}
.danger-banner__title {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}
.danger-banner__hint {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}
.danger-banner__hint code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
    /* On the already-tinted error-subtle background, the regular base-subtle
       fill blends in; stepping the contrast up with a slightly darker overlay
       keeps the inline ClientId visually distinct without leaving the band. */
    background: var(--kendo-color-error);
    color: var(--kendo-color-on-error);
    padding: 1px 6px;
    border-radius: 3px;
}

/* ── Summary list (key/value table for read-only views) ──
   Used on the Delete page to show the row about to be removed. Two-column
   layout on wide viewports, stacked on narrow. Each row is a
   .summary-list__row with a <dt> (label) + <dd> (value). */
.summary-list {
    margin: 0;
    padding: 16px 24px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.summary-list__row {
    display: grid;
    grid-template-columns: minmax(140px, 200px) 1fr;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--kendo-color-border);
    align-items: baseline;
}
.summary-list__row:last-child {
    border-bottom: none;
}
.summary-list__row--multiline {
    align-items: flex-start;
}
.summary-list dt {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--kendo-color-subtle);
}
.summary-list dd {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--kendo-color-on-surface);
    word-break: break-word;
}
.summary-list dd code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.95em;
    color: inherit;
}
.summary-list__line {
    margin-bottom: 2px;
}
.summary-list__line:last-child {
    margin-bottom: 0;
}
@media (max-width: 575px) {
    .summary-list__row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/* ── Grid container (horizontal scroll on narrow viewports) ── */
.grid-container { overflow-x: auto; }
.grid-container .k-grid { min-width: 900px; }

/* Rows styled for click-to-open interaction. Pointer cursor signals the affordance;
   the Kendo default theme already paints hover/selected row backgrounds, we just
   switch the cursor. */
.clickable-rows .k-grid-table .k-master-row { cursor: pointer; }

/* ── Utility classes ── */
.row         { display: flex; gap: 8px; align-items: stretch; }
.row > *     { flex: 1; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.grow        { flex: 1; }
.full        { width: 100%; }

.mt-4  { margin-top:  4px; }
.mt-6  { margin-top:  6px; }
.mt-8  { margin-top:  8px; }
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }

.mono, code.mono {
    font-family: var(--app-font-mono);
    font-size: var(--app-fs-label);
    color: var(--kendo-color-subtle);
}

/* ── Error / status banners ── */
.connect-error {
    display: block;
    padding: 8px 10px;
    border-radius: var(--kendo-border-radius-md, 4px);
    border: 1px solid var(--kendo-color-error);
    background: var(--kendo-color-error-subtle);
    color: var(--kendo-color-error-on-subtle);
    font-size: var(--app-fs-meta);
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.info-banner {
    display: block;
    padding: 8px 10px;
    border-radius: var(--kendo-border-radius-md, 4px);
    border: 1px solid var(--kendo-color-success);
    background: var(--kendo-color-success-subtle);
    color: var(--kendo-color-success-on-subtle);
    font-size: var(--app-fs-meta);
}

/* ── Secret display block ── */
.secret-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--kendo-color-base-subtle);
    border: 1px solid var(--kendo-color-border);
    border-radius: var(--kendo-border-radius-md, 4px);
    padding: 10px 12px;
    font-family: var(--app-font-mono);
    font-size: 14px;
    word-break: break-all;
}

/* ── Consent scope list ── */
.scope-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.scope-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--kendo-color-base-subtle);
    border: 1px solid var(--kendo-color-border);
    border-radius: 20px;
    font-size: 12px;
}

/* ── Floating AI chat ── */

/* Floating action button — bottom-right corner */
.chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--kendo-color-primary);
    color: var(--kendo-color-on-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.chat-fab:hover  { background: var(--kendo-color-primary-hover); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32); }
.chat-fab:active { background: var(--kendo-color-primary-active); transform: scale(0.95); }

/* Chat panel — slides up from just above the FAB */
.chat-panel {
    position: fixed;
    bottom: 88px;
    right: 24px;
    z-index: 1099;
    width: 380px;
    height: 520px;
    background: var(--kendo-color-surface);
    border: 1px solid var(--kendo-color-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;

    /* Hidden by default — scale + fade in on open */
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.97);
    transform-origin: bottom right;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.chat-panel-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Narrow viewport: full-width panel */
@media (max-width: 479px) {
    .chat-panel {
        right: 8px;
        left: 8px;
        width: auto;
        bottom: 80px;
    }
    .chat-fab { bottom: 16px; right: 16px; }
}

/* MCP tool-status badges in the chat header */
.chat-tools-warn {
    font-size: 10px;
    color: var(--kendo-color-warning-on-subtle, #92400e);
    background: var(--kendo-color-warning-subtle, #fef3c7);
    border: 1px solid var(--kendo-color-warning, #fbbf24);
    border-radius: 4px;
    padding: 1px 5px;
    cursor: help;
    white-space: nowrap;
}
.chat-tools-ok {
    font-size: 10px;
    color: var(--kendo-color-success-on-subtle, #065f46);
    background: var(--kendo-color-success-subtle, #d1fae5);
    border: 1px solid var(--kendo-color-success, #4ade80);
    border-radius: 4px;
    padding: 1px 5px;
    white-space: nowrap;
}

/* Panel header strip */
.chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 0 14px;
    height: 48px;
    background: var(--kendo-color-surface-alt);
    border-bottom: 1px solid var(--kendo-color-border);
    flex-shrink: 0;
}
.chat-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--kendo-color-on-app-surface);
}
/* Right-side action cluster — "new chat" + "close" */
.chat-panel-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .k-animation-container,
    .k-drawer,
    .k-dialog { transition: none !important; animation: none !important; }
}

/* ── AppBar username: hide on very narrow viewports ── */
.appbar-username { display: none; }
@media (min-width: 576px) { .appbar-username { display: inline; } }

/* ── Full-width plain inputs in Static SSR forms ── */
.mp-text-input { width: 100%; box-sizing: border-box; display: block; }

/* ── Responsive form action row ── */
.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}
@media (max-width: 575px) {
    .form-actions { flex-direction: column-reverse; }
    .form-actions > * { width: 100%; }
}


/* ── Login page ── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: var(--kendo-color-app-surface);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--kendo-color-surface);
    border: 1px solid var(--kendo-color-border);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
@media (max-width: 479px) { .login-card { padding: 24px 16px; } }

/* Brand block */
.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.login-brand .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--kendo-color-primary);
    padding: 5px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.login-brand .brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1); /* white on primary background */
}
.login-brand .brand-text {
    font-size: 16px;
    font-weight: 600;
}
.login-brand .brand-text .muted {
    display: block;
    font-size: 11px;
    color: var(--kendo-color-subtle);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Heading + subheading */
.login-heading { font-size: 22px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.login-sub     { font-size: 13px; color: var(--kendo-color-subtle); margin: 0 0 24px; }

/* Error banner */
.login-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--kendo-color-error-subtle);
    border: 1px solid var(--kendo-color-error);
    color: var(--kendo-color-error-on-subtle);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* Form fields */
.login-field { margin-bottom: 16px; }
.login-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--kendo-color-subtle);
    margin-bottom: 6px;
}
.login-field input {
    width: 100%;
    padding: 8px 10px;
    background: var(--kendo-color-surface);
    color: var(--kendo-color-on-app-surface);
    border: 1px solid var(--kendo-color-border);
    border-radius: var(--kendo-border-radius-md, 4px);
    font: inherit;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.login-field input:focus {
    border-color: var(--kendo-color-primary);
    box-shadow: 0 0 0 3px var(--kendo-color-primary-subtle);
}

/* Primary submit button */
.login-submit {
    width: 100%;
    padding: 9px 14px;
    margin-top: 8px;
    background: var(--kendo-color-primary);
    color: var(--kendo-color-on-primary);
    border: 1px solid var(--kendo-color-primary);
    border-radius: var(--kendo-border-radius-md, 4px);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.login-submit:hover  { background: var(--kendo-color-primary-hover);  border-color: var(--kendo-color-primary-hover); }
.login-submit:active { background: var(--kendo-color-primary-active); border-color: var(--kendo-color-primary-active); }

/* "or" divider */
.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    color: var(--kendo-color-subtle);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.login-divider::before,
.login-divider::after { content: ""; flex: 1; border-top: 1px solid var(--kendo-color-border); }

/* External identity (Entra) button */
.login-entra {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 9px 14px;
    background: var(--kendo-color-base-subtle);
    color: var(--kendo-color-on-app-surface);
    border: 1px solid var(--kendo-color-border);
    border-radius: var(--kendo-border-radius-md, 4px);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
    box-sizing: border-box;
}
.login-entra:hover  { background: var(--kendo-color-base-subtle-hover); }
.login-entra:active { background: var(--kendo-color-base-subtle-active); }
.login-entra .ms-logo { width: 18px; height: 18px; object-fit: contain; flex: 0 0 auto; }

/* Footer */
.login-foot { text-align: center; margin-top: 16px; font-size: 11px; color: var(--kendo-color-subtle); }
