/* The frame's additions on top of the Materio theme (keep this small). */

.app-brand-img {
  max-height: 56px;
  max-width: 220px;
  object-fit: contain;
}

.app-brand-img-menu {
  max-height: 32px;
  max-width: 40px;
  object-fit: contain;
}

.form-control-color {
  height: 3.5rem;
}

#barcodePreview img {
  max-height: 90px;
}

/* the platform console: a thin red line on top so staff always know where they are. */
body.god-mode .layout-navbar { border-top: 3px solid var(--bs-danger); }
.matrix-table th, .matrix-table td { text-align: center; vertical-align: middle; }
.matrix-table th:first-child, .matrix-table td:first-child { text-align: start; }
.matrix-table .is-override { background: rgba(var(--bs-warning-rgb), .12); }
.activity-json { max-width: 360px; white-space: pre-wrap; word-break: break-word; font-size: .75rem; }

/* Connection health badge in the header (connection-health.js). */
.connection-health { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .65rem; border-radius: 999px;
  font-size: .8125rem; font-weight: 500; background: var(--bs-gray-100, #f6f7fb); color: var(--bs-body-color); white-space: nowrap; }
.connection-health .dot { width: .6rem; height: .6rem; border-radius: 50%; background: #a9a6b0; flex: 0 0 auto; }
.connection-health[data-state="excellent"] { background: var(--ns-green-bg); color: var(--ns-green-copy); }
.connection-health[data-state="excellent"] .dot { background: var(--ns-green-icon); box-shadow: 0 0 0 3px rgba(82, 173, 21, .18); }
.connection-health[data-state="good"] { background: var(--ns-green-bg); color: var(--ns-green-copy); }
.connection-health[data-state="good"] .dot { background: #8cc63f; }
.connection-health[data-state="slow"], .connection-health[data-state="server"] { background: #fff4de; color: #9a6400; }
.connection-health[data-state="slow"] .dot, .connection-health[data-state="server"] .dot { background: #ffab1d; }
.connection-health[data-state="unreachable"], .connection-health[data-state="offline"] { background: #ffe5e4; color: #c62c22; }
.connection-health[data-state="unreachable"] .dot, .connection-health[data-state="offline"] .dot { background: #ff4c51; animation: ns-pulse 1.2s infinite; }
@keyframes ns-pulse { 50% { opacity: .35; } }
@media (max-width: 575.98px) { .connection-health .label { display: none; } }

/* Collapsed menu: turn the arrow round so it reads "expand". */
.layout-menu-collapsed .menu-collapse-icon { transform: rotate(180deg); }
.app-brand .app-brand-text { font-size: 1.125rem; line-height: 1.2; max-width: 150px; white-space: nowrap; }
.layout-menu-collapsed:not(.layout-menu-hover) .app-brand .app-brand-text { display: none; }

/* Header tools (PO 2026-10-30). */
.ns-flag { font-size: 1.35rem; line-height: 1; cursor: default; }
.ns-notifications { min-width: 18rem; }

/* Searchable dropdowns (app/js/search-select.js). */
.ns-ss-native { position: absolute !important; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.ns-ss-button { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ns-ss-host { position: relative; }
.ns-ss-panel { max-width: 32rem; min-width: 14rem; top: 100%; left: 0; }
.ns-ss-list { max-height: 16rem; overflow-y: auto; }
.ns-ss-item { cursor: pointer; white-space: normal; }
.ns-ss-button.is-invalid ~ .invalid-feedback { display: block; }

/* Sign-in pages: full-screen photo, centred card, credit at the bottom (PO 2026-10-30). */
.auth-photo-page { min-height: 100vh; background: #13294b; }
.auth-photo { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.auth-photo-img { width: 100%; height: 100%; object-fit: cover; display: block; animation: auth-photo-in 1.2s ease both; }
.auth-photo-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.15) 60%, rgba(0,0,0,.45) 100%); }
/* No photo available: clean white with faint shapes behind the card. */
.auth-photo-fallback {
    /* Clean white behind the card. */
    background: #fff;
}
.auth-photo-fallback ~ .auth-photo-main .auth-photo-card { box-shadow: 0 1rem 2.5rem rgba(40, 42, 66, .10); border: 1px solid rgba(40, 42, 66, .06); }
.auth-photo-fallback .auth-photo-shade { display: none; }
.auth-photo-fallback ~ .auth-photo-credit { color: rgba(40, 42, 66, .6); text-shadow: none; }
.auth-photo-fallback ~ .auth-photo-credit a { color: inherit; }
.auth-photo-main { position: relative; z-index: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem 4.5rem; }
.auth-photo-card { width: 100%; max-width: 27rem; border: 0; border-radius: 1.25rem; background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .25); }
.auth-photo-logo { max-height: 3rem; max-width: 14rem; object-fit: contain; }
.auth-brand-logo { max-width: 16rem; }
.auth-photo-icon { width: 2.5rem; height: 2.5rem; object-fit: contain; }
.app-brand-icon-menu { width: 2rem; height: 2rem; object-fit: contain; flex-shrink: 0; }
.auth-photo-credit { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1; padding: .75rem 1rem; text-align: center; font-size: .8rem; color: rgba(255, 255, 255, .9); text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.auth-photo-credit a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.auth-photo-platform { margin-top: .25rem; opacity: .85; }
/* Guided tours (tour.js) */
.ns-tour-box { position: absolute; z-index: 1090; border-radius: .5rem; pointer-events: none;
  box-shadow: 0 0 0 3px var(--bs-primary), 0 0 0 9999px rgba(20, 20, 30, .45); transition: all .2s ease; }
.ns-tour-pop { position: absolute; z-index: 1091; }
.ns-tour-pop.is-mini { background: transparent; box-shadow: none !important; border: 0; }
.ns-tour-pop.is-mini .btn { text-transform: none; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .ns-tour-box { transition: none; } }

/* Walk-through guides (PO 2026-11-01): pictures of the real screens instead of videos */
.kb-thumb { aspect-ratio: 16 / 9; background: var(--bs-tertiary-bg); }
.kb-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.guide-shot { background: var(--bs-tertiary-bg); border-start-start-radius: var(--bs-card-inner-border-radius); border-end-start-radius: var(--bs-card-inner-border-radius); overflow: hidden; }
.guide-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
@media (max-width: 991.98px) { .guide-shot { border-radius: var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0; } }
.guide-tip { background: rgba(var(--bs-warning-rgb), .08); border-radius: .375rem; padding: .5rem .75rem; }
@media print { .guide-step { break-inside: avoid; } .guide-shot img { max-height: 9cm; object-fit: contain; } }

/* Charts drawn on the server (ADR-025, NormalSys\View\ColumnChart). Colours validated for colour-blind
   separation and contrast: blue = within the SLA / allowance, red = missed / overtime; dark mode has its own steps. */
.ns-chart { display: block; width: 100%; height: auto; max-height: 15rem; overflow: visible; font-family: inherit; }
.ns-chart .chart-grid { stroke: var(--bs-border-color); stroke-width: 1; shape-rendering: crispEdges; }
.ns-chart .chart-tick { fill: var(--bs-secondary-color); font-size: 10px; font-variant-numeric: tabular-nums; }
.ns-chart .chart-cap { fill: var(--bs-heading-color); font-size: 10.5px; font-weight: 600; }
.ns-chart .chart-hit { fill: transparent; }
.ns-chart .chart-col:hover .chart-hit { fill: var(--bs-border-color); fill-opacity: .35; }
.ns-chart .chart-seg:hover path { opacity: .85; }
.ns-chart .chart-ref { stroke: var(--bs-heading-color); stroke-width: 2; stroke-linecap: round; }
.chart-fill-good { fill: #2a78d6; }
.chart-fill-bad { fill: #d03b3b; }
.chart-key { display: inline-block; width: .625rem; height: .625rem; border-radius: 2px; }
.chart-key-good { background: #2a78d6; }
.chart-key-bad { background: #d03b3b; }
.chart-key-ref { display: inline-block; width: .875rem; height: 2px; border-radius: 1px; background: var(--bs-heading-color); }
[data-bs-theme=dark] .chart-fill-good { fill: #3987e5; }
[data-bs-theme=dark] .chart-fill-bad { fill: #e66767; }
[data-bs-theme=dark] .chart-key-good { background: #3987e5; }
[data-bs-theme=dark] .chart-key-bad { background: #e66767; }
@media (forced-colors: active) { .chart-fill-good { fill: CanvasText; } .chart-fill-bad { fill: Highlight; } }

/* Release Log and announcements (ADR-027). */
.release-area { letter-spacing: .06em; }
.campaign-sample { display: block; width: 100%; height: 44rem; border: 0; border-top: 1px solid var(--bs-border-color); background: #fff; }

/* Settings → Branding → Theme and colours (ADR-034, appearance.js). Colours come from the theme's tokens. */
.appearance-theme { display: block; position: relative; height: 100%; cursor: pointer; padding: 1rem 1.25rem; background: var(--bs-paper-bg);
  border: 2px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg, .75rem); transition: border-color .15s ease, box-shadow .15s ease; }
.appearance-theme:hover { border-color: var(--bs-primary); }
.appearance-theme.is-chosen { border-color: var(--bs-primary); box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .18); }
.appearance-theme:focus-within { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.appearance-theme-input { position: absolute; opacity: 0; pointer-events: none; }
.appearance-theme-body { display: flex; flex-direction: column; gap: .45rem; }
.appearance-theme-title { font-weight: 700; font-size: 1.0625rem; color: var(--bs-heading-color, var(--bs-body-color)); }
.appearance-theme-blurb { color: var(--bs-secondary-color); font-size: .875rem; }
.appearance-swatches { display: inline-flex; gap: .35rem; }
.appearance-swatch { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 1px solid rgba(var(--bs-body-color-rgb, 0, 0, 0), .2); }
.appearance-palette { display: inline-flex; align-items: center; gap: .65rem; padding: .45rem .85rem; cursor: pointer; background: var(--bs-paper-bg); color: var(--bs-body-color);
  border: 1px solid var(--bs-border-color); border-radius: 999px; }
.appearance-palette[hidden] { display: none; }
.appearance-palette:hover:not(:disabled) { border-color: var(--bs-primary); }
.appearance-palette.is-active { border-color: var(--bs-primary); box-shadow: 0 0 0 .15rem rgba(var(--bs-primary-rgb), .18); }
.appearance-palette-name { font-size: .875rem; font-weight: 500; }
.appearance-frame { display: block; width: 100%; height: 380px; background: #fff; border: 1px solid var(--bs-border-color); border-radius: .75rem; }
.appearance-notes { color: var(--bs-warning-text-emphasis); padding-inline-start: 1.1rem; }

/* Quiet notices (ND-004 page.notices, partials/notices.php). */
.ns-notice-small { color: var(--bs-primary); }
.ns-notice-small[data-level="warning"] { color: var(--bs-warning-text-emphasis); }
.ns-notice-line { position: fixed; inset: auto 0 0 0; z-index: 1030; padding: .25rem .75rem; font-size: .8125rem; text-align: center;
  background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
.ns-notice-line[data-level="warning"] { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
