/* =====================================================================
   OMS — application shell (AdminLTE 4 style layout on Bootstrap 5)
   Tokens, header, sidebar, content, cards, badges, alerts, toasts,
   login and error pages.
   ===================================================================== */

:root {
    --oms-header-h: 48px;
    --oms-sidebar-w: 236px;
    --oms-sidebar-mini-w: 56px;

    --oms-ink: #1c2733;
    --oms-muted: #627385;
    --oms-line: #dce1e7;
    --oms-bg: #f0f2f5;
    --oms-surface: #ffffff;
    --oms-surface-2: #f7f8fa;

    --oms-nav: #14212e;
    --oms-nav-2: #1b2b3a;
    --oms-nav-text: #b3c0cd;
    --oms-nav-muted: #6f8194;

    --oms-accent: #0b7285;
    --oms-accent-dark: #095c6b;
    --oms-accent-soft: #e3f4f7;
    --oms-signal: #3bc9db;

    --oms-success: #2b8a3e;
    --oms-warning: #b25e00;
    --oms-danger: #c92a2a;
    --oms-info: #1864ab;

    --oms-radius: 6px;
    --oms-shadow: 0 1px 2px rgba(20, 33, 46, .06);
    --oms-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --oms-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    /* Bootstrap overrides */
    --bs-body-font-family: var(--oms-font);
    --bs-body-font-size: .84375rem;
    --bs-body-color: var(--oms-ink);
    --bs-body-bg: var(--oms-bg);
    --bs-primary: #0b7285;
    --bs-primary-rgb: 11, 114, 133;
    --bs-link-color: #0b7285;
    --bs-link-color-rgb: 11, 114, 133;
    --bs-link-hover-color: #095c6b;
    --bs-link-hover-color-rgb: 9, 92, 107;
    --bs-border-color: var(--oms-line);
    --bs-border-radius: var(--oms-radius);
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    font-family: var(--oms-font);
    font-size: .84375rem;
    line-height: 1.45;
    color: var(--oms-ink);
    background: var(--oms-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--oms-accent); text-decoration: none; }
a:hover { color: var(--oms-accent-dark); text-decoration: underline; }

:focus-visible { outline: 2px solid var(--oms-signal); outline-offset: 2px; }

[hidden] { display: none !important; }

.skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 2000;
    padding: 8px 12px; background: var(--oms-nav); color: #fff; border-radius: var(--oms-radius);
}
.skip-link:focus { top: 8px; color: #fff; }

/* ---------------------------------------------------------------------
   Layout grid
   --------------------------------------------------------------------- */
.app-wrapper {
    display: grid;
    grid-template-columns: var(--oms-sidebar-w) minmax(0, 1fr);
    grid-template-rows: var(--oms-header-h) 1fr auto;
    grid-template-areas: "header header" "sidebar main" "sidebar footer";
    min-height: 100vh;
    transition: grid-template-columns .18s ease;
}
.sidebar-collapse .app-wrapper { grid-template-columns: var(--oms-sidebar-mini-w) minmax(0, 1fr); }

/* ---------------------------------------------------------------------
   Header
   --------------------------------------------------------------------- */
.app-header {
    grid-area: header;
    position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center; gap: 10px;
    height: var(--oms-header-h); padding: 0 12px 0 6px;
    background: var(--oms-nav); color: #fff;
    border-bottom: 1px solid #0d1722;
}
.header-btn {
    position: relative; display: inline-grid; place-items: center;
    width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--oms-radius);
    background: transparent; color: #d5dde6; font-size: 1.15rem; cursor: pointer;
}
.header-btn:hover { background: rgba(255, 255, 255, .09); color: #fff; }

.header-brand { display: inline-flex; align-items: center; gap: 8px; color: #fff; white-space: nowrap; }
.header-brand:hover { color: #fff; text-decoration: none; }
.brand-text { font-size: .9rem; font-weight: 500; letter-spacing: .09em; color: #cfd8e1; }
.brand-text b, .login-company b { color: var(--oms-signal); font-weight: 700; }

/* Brand mark: a fiber cross-section (cladding ring + lit core). */
.brand-mark {
    width: 22px; height: 22px; flex: none; border-radius: 50%;
    background: radial-gradient(circle, #fff 0 18%, var(--oms-signal) 19% 34%, transparent 35% 58%, var(--oms-accent) 59% 100%);
    box-shadow: 0 0 0 1px rgba(59, 201, 219, .35);
}
.brand-mark-lg { width: 40px; height: 40px; }

.header-search { position: relative; flex: 1 1 auto; max-width: 560px; margin-left: 18px; }
.header-search > .bi-search { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--oms-nav-muted); pointer-events: none; }
.header-search-input {
    width: 100%; height: 32px; padding: 0 34px 0 32px;
    border: 1px solid #2a3c4e; border-radius: var(--oms-radius);
    background: var(--oms-nav-2); color: #fff; font: inherit;
}
.header-search-input::placeholder { color: var(--oms-nav-muted); }
.header-search-input:focus { outline: 0; border-color: var(--oms-signal); background: #0f1a25; }
.header-search-key {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    padding: 0 6px; border: 1px solid #34495d; border-radius: 4px; background: transparent;
    color: var(--oms-nav-muted); font: 11px var(--oms-mono);
}
.search-results {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1040;
    max-height: 70vh; overflow: auto; background: var(--oms-surface); color: var(--oms-ink);
    border: 1px solid var(--oms-line); border-radius: var(--oms-radius); box-shadow: 0 10px 28px rgba(20, 33, 46, .18);
}
.search-empty { margin: 0; padding: 14px; color: var(--oms-muted); }
.search-table { width: 100%; border-collapse: collapse; }
.search-table th { padding: 7px 10px; font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--oms-muted); background: var(--oms-surface-2); text-align: left; position: sticky; top: 0; }
.search-table td { padding: 7px 10px; border-top: 1px solid #edf0f3; vertical-align: middle; }
.search-table tbody tr:hover { background: var(--oms-accent-soft); }
.search-module { display: inline-block; padding: 1px 7px; border-radius: 10px; background: #e9edf1; font-size: .6875rem; font-weight: 600; white-space: nowrap; }
.search-record { font-weight: 600; }
.search-open { font-weight: 600; }
.search-open.is-disabled { color: var(--oms-muted); }

.header-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.header-secure {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; margin-right: 4px;
    border-radius: 12px; font-size: .6875rem; font-weight: 600; letter-spacing: .04em;
}
.header-secure.is-secure { background: rgba(43, 138, 62, .22); color: #8ce99a; }
.header-secure.is-insecure { background: rgba(230, 119, 0, .2); color: #ffc078; }
.header-count {
    position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: #e03131; color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.header-user {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px;
    border: 0; border-radius: var(--oms-radius); background: transparent; color: #fff; cursor: pointer; text-align: left;
}
.header-user:hover { background: rgba(255, 255, 255, .09); }
.header-user-text { display: flex; flex-direction: column; line-height: 1.15; max-width: 180px; }
.header-user-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-user-role { font-size: .6875rem; color: var(--oms-nav-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-user > .bi { font-size: .7rem; color: var(--oms-nav-muted); }

.avatar {
    display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%;
    background: var(--oms-accent); color: #fff; font-size: .6875rem; font-weight: 700; letter-spacing: .03em;
}
.avatar-xl { width: 72px; height: 72px; font-size: 1.5rem; }

.dropdown-menu { font-size: .84375rem; border-color: var(--oms-line); box-shadow: 0 10px 28px rgba(20, 33, 46, .16); }
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 7px 14px; }
button.dropdown-item { width: 100%; border: 0; background: transparent; text-align: left; }
.user-menu { min-width: 220px; }
.user-menu-head { display: flex; flex-direction: column; padding: 8px 14px 10px; border-bottom: 1px solid var(--oms-line); margin-bottom: 4px; }
.user-menu-head span { color: var(--oms-muted); font-size: .75rem; word-break: break-all; }

.notif-menu { width: 340px; max-width: calc(100vw - 16px); padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--oms-line); font-weight: 600; }
.btn-link-plain { padding: 0; border: 0; background: none; color: var(--oms-accent); font-size: .75rem; font-weight: 600; cursor: pointer; }
.btn-link-plain:hover { text-decoration: underline; }
.notif-list { max-height: 360px; overflow: auto; }
.notif-empty { margin: 0; padding: 18px 12px; color: var(--oms-muted); text-align: center; }
.notif-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px 9px 14px; border-bottom: 1px solid #edf0f3; border-left: 3px solid transparent; color: var(--oms-ink); }
a.notif-item:hover { background: var(--oms-surface-2); text-decoration: none; color: var(--oms-ink); }
.notif-item.is-unread { border-left-color: var(--oms-accent); background: #f4fbfc; cursor: pointer; }
.notif-title { font-weight: 600; }
.notif-message { color: var(--oms-muted); font-size: .78rem; }
.notif-time { color: var(--oms-muted); font-size: .6875rem; }

/* ---------------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------------- */
.app-sidebar {
    grid-area: sidebar;
    position: sticky; top: var(--oms-header-h); z-index: 1020;
    display: flex; flex-direction: column;
    height: calc(100vh - var(--oms-header-h)); overflow: hidden;
    background: var(--oms-nav); color: var(--oms-nav-text);
}
.sidebar-wrapper { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 8px 0; scrollbar-width: thin; scrollbar-color: #2f4356 transparent; }
.sidebar-menu, .nav-treeview { list-style: none; margin: 0; padding: 0; }

.app-sidebar .nav-link {
    display: flex; align-items: center; gap: 10px; width: 100%;
    min-height: 34px; padding: 6px 14px 6px 16px;
    border: 0; border-left: 3px solid transparent; background: transparent;
    color: var(--oms-nav-text); font: inherit; text-align: left; white-space: nowrap; cursor: pointer;
}
.app-sidebar a.nav-link:hover, .app-sidebar button.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.app-sidebar .nav-link.active { color: #fff; }
.app-sidebar a.nav-link.active { background: rgba(59, 201, 219, .13); border-left-color: var(--oms-signal); font-weight: 600; }
.nav-icon { flex: none; width: 18px; font-size: 1rem; text-align: center; }
.nav-text { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.nav-arrow { flex: none; font-size: .65rem; transition: transform .15s ease; color: var(--oms-nav-muted); }
.menu-open > .nav-parent .nav-arrow { transform: rotate(90deg); }

.nav-treeview { display: none; padding: 2px 0 6px; background: rgba(0, 0, 0, .16); }
.menu-open > .nav-treeview { display: block; }
.nav-treeview .nav-link { min-height: 29px; padding: 4px 14px 4px 44px; font-size: .8125rem; }

.app-sidebar .nav-link.is-disabled { color: var(--oms-nav-muted); cursor: default; }
.nav-soon { flex: none; padding: 0 5px; border: 1px solid #33475a; border-radius: 8px; font-size: .5625rem; text-transform: uppercase; letter-spacing: .06em; color: var(--oms-nav-muted); }

.sidebar-foot { flex: none; padding: 8px 16px; border-top: 1px solid #1f3040; font: .6875rem var(--oms-mono); color: var(--oms-nav-muted); }

/* Icon-only sidebar */
.sidebar-collapse .app-sidebar .nav-text,
.sidebar-collapse .app-sidebar .nav-arrow,
.sidebar-collapse .app-sidebar .nav-soon,
.sidebar-collapse .app-sidebar .nav-treeview,
.sidebar-collapse .sidebar-foot { display: none; }
.sidebar-collapse .app-sidebar .nav-link { justify-content: center; padding: 6px 0; }

.sidebar-overlay { position: fixed; inset: var(--oms-header-h) 0 0 0; z-index: 1015; background: rgba(13, 23, 34, .5); }

/* ---------------------------------------------------------------------
   Content
   --------------------------------------------------------------------- */
.app-main { grid-area: main; min-width: 0; padding: 14px 18px 22px; }
.app-main:focus { outline: 0; }
.app-content-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-title { color: var(--oms-ink); margin: 0; font-size: 1.25rem; font-weight: 650; letter-spacing: -.01em; }
.breadcrumb { margin: 2px 0 0; padding: 0; font-size: .75rem; --bs-breadcrumb-divider-color: #9aa7b4; --bs-breadcrumb-item-active-color: var(--oms-muted); }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.section-title {
    display: flex; align-items: center; gap: 10px; margin: 16px 0 8px;
    font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--oms-muted);
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--oms-line); }

.app-footer {
    grid-area: footer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 9px 18px; border-top: 1px solid var(--oms-line); background: var(--oms-surface);
    color: var(--oms-muted); font-size: .75rem;
}
.footer-version { margin-left: auto; font-family: var(--oms-mono); }

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */
.oms-card { border: 1px solid var(--oms-line); border-radius: var(--oms-radius); background: var(--oms-surface); box-shadow: var(--oms-shadow); margin-bottom: 14px; }
.oms-card > .card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    min-height: 38px; padding: 7px 14px; background: var(--oms-surface); border-bottom: 1px solid var(--oms-line);
    border-radius: var(--oms-radius) var(--oms-radius) 0 0;
}
.oms-card .card-title { margin: 0; font-size: .84375rem; font-weight: 650; }
.oms-card .card-title .bi { color: var(--oms-accent); margin-right: 4px; }
.oms-card > .card-body { padding: 14px; }
.card-flush > .card-body { padding: 0; }
.card-tools { display: flex; align-items: center; gap: 8px; }
.card-note { color: var(--oms-muted); font-size: .75rem; }

/* Stat card */
.stat-grid { display: grid; gap: 10px; margin-bottom: 4px; }
.stat-grid-1 { grid-template-columns: 1fr; margin-bottom: 14px; }
.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card {
    display: flex; align-items: center; gap: 12px; min-width: 0; padding: 11px 12px;
    background: var(--oms-surface); border: 1px solid var(--oms-line); border-radius: var(--oms-radius); box-shadow: var(--oms-shadow);
}
.stat-icon { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: var(--oms-radius); font-size: 1.15rem; background: #e9edf1; color: #495057; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--oms-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-size: 1.375rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-value.is-loading { color: #c3ccd5; }
.stat-hint { font-size: .6875rem; color: var(--oms-muted); }
.stat-teal .stat-icon { background: #e3f4f7; color: #0b7285; }
.stat-indigo .stat-icon { background: #e8ecfe; color: #3b5bdb; }
.stat-blue .stat-icon { background: #e4effa; color: #1864ab; }
.stat-green .stat-icon { background: #e6f4e9; color: #2b8a3e; }
.stat-red .stat-icon { background: #fbe9e9; color: #c92a2a; }
.stat-gray .stat-icon { background: #eceff2; color: #6c7a89; }
.stat-slate .stat-icon { background: #e7ebef; color: #34495e; }

/* ---------------------------------------------------------------------
   Badges, tags, states
   --------------------------------------------------------------------- */
.badge-status {
    display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 10px;
    font-size: .71875rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.badge-status .bi { font-size: .625rem; }
.badge-status-success { background: #e6f4e9; color: #1e6b2d; border-color: #c3e6cb; }
.badge-status-secondary { background: #eceff2; color: #4b5a69; border-color: #d5dbe1; }
.badge-status-warning { background: #fff4e0; color: #8a4a00; border-color: #ffe0a8; }
.badge-status-danger { background: #fbe9e9; color: #a01f1f; border-color: #f3c2c2; }
.badge-status-primary { background: #e3f4f7; color: #095c6b; border-color: #bfe3ea; }

.empty-state, .loading-state { padding: 26px 14px; text-align: center; color: var(--oms-muted); }
.empty-state > .bi { font-size: 1.75rem; color: #b6c0ca; }
.empty-title { margin: 6px 0 2px; font-weight: 600; color: var(--oms-ink); }
.empty-text { margin: 0; }

.alert { font-size: .84375rem; padding: 9px 14px; border-radius: var(--oms-radius); }
.alert-dismissible .btn-close { padding: 12px; }

.btn { --bs-btn-font-size: .84375rem; --bs-btn-border-radius: var(--oms-radius); }
.btn-sm { --bs-btn-font-size: .78rem; }
.btn-primary {
    --bs-btn-bg: var(--oms-accent); --bs-btn-border-color: var(--oms-accent);
    --bs-btn-hover-bg: var(--oms-accent-dark); --bs-btn-hover-border-color: var(--oms-accent-dark);
    --bs-btn-active-bg: #074753; --bs-btn-active-border-color: #074753;
    --bs-btn-disabled-bg: var(--oms-accent); --bs-btn-disabled-border-color: var(--oms-accent);
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; --bs-btn-disabled-color: #fff;
}

/* Toasts */
.toast-stack { position: fixed; right: 16px; bottom: 16px; z-index: 1090; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.oms-toast {
    display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
    background: var(--oms-nav); color: #fff; border-radius: var(--oms-radius); border-left: 4px solid var(--oms-signal);
    box-shadow: 0 8px 24px rgba(20, 33, 46, .28); animation: toast-in .18s ease-out;
}
.oms-toast-success { border-left-color: #51cf66; }
.oms-toast-danger { border-left-color: #ff6b6b; }
.oms-toast-warning { border-left-color: #fcc419; }
.oms-toast > .bi { margin-top: 2px; }
.oms-toast-success > .bi { color: #8ce99a; }
.oms-toast-danger > .bi { color: #ffa8a8; }
.oms-toast-warning > .bi { color: #ffe066; }
.toast-text { flex: 1; }
.toast-close { border: 0; background: none; color: #9fb0c0; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.toast-close:hover { color: #fff; }
.oms-toast.is-leaving { opacity: 0; transition: opacity .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Session expiry banner */
.session-banner {
    position: fixed; left: 50%; top: 58px; transform: translateX(-50%); z-index: 1100;
    display: flex; align-items: center; gap: 12px; padding: 9px 14px; max-width: calc(100vw - 24px);
    background: #7a3e00; color: #fff; border-radius: var(--oms-radius); box-shadow: 0 8px 24px rgba(20, 33, 46, .3);
}
.session-time { font-family: var(--oms-mono); }

/* ---------------------------------------------------------------------
   Profile
   --------------------------------------------------------------------- */
.profile-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.profile-card .card-body { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 22px 14px; text-align: center; }
.profile-name { margin: 10px 0 0; font-size: 1.0625rem; font-weight: 650; }
.profile-username { margin: 0; font-family: var(--oms-mono); font-size: .78rem; color: var(--oms-muted); }
.profile-email { margin: 0; color: var(--oms-muted); word-break: break-all; }
.profile-roles { margin: 6px 0 8px; font-weight: 600; color: var(--oms-accent-dark); }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; }
.detail-list dt { font-weight: 500; color: var(--oms-muted); }
.detail-list dd { margin: 0; text-align: right; font-weight: 600; }

/* ---------------------------------------------------------------------
   Login (light)
   --------------------------------------------------------------------- */
.login-page {
    min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background:
        radial-gradient(900px 420px at 50% -120px, #d9eef2 0, transparent 70%),
        var(--oms-bg);
}
.login-shell { width: 100%; max-width: 380px; }
.login-card { padding: 26px 26px 20px; background: var(--oms-surface); border: 1px solid var(--oms-line); border-radius: 10px; box-shadow: 0 12px 34px rgba(20, 33, 46, .09); }
.login-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--oms-line); }
.login-company { margin: 0; font-size: 1.0625rem; font-weight: 500; letter-spacing: .1em; color: var(--oms-nav); }
.login-company b { color: var(--oms-accent); }
.login-product { margin: 0; font-size: .75rem; color: var(--oms-muted); }
.login-title { margin: 0 0 12px; font-size: 1.0625rem; font-weight: 650; }
.login-foot { margin: 14px 0 0; font-size: .71875rem; color: var(--oms-muted); }
.login-version { margin: 12px 0 0; text-align: center; font-size: .71875rem; color: var(--oms-muted); }

/* ---------------------------------------------------------------------
   Error pages (loaded without Bootstrap)
   --------------------------------------------------------------------- */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.error-box { max-width: 460px; padding: 28px; text-align: center; background: var(--oms-surface); border: 1px solid var(--oms-line); border-radius: 10px; }
.error-box h1 { margin: 0 0 8px; font-size: 1.25rem; }
.error-code { margin: 0; font: 700 2.5rem var(--oms-mono); color: var(--oms-accent); }
.error-ref { font: .75rem var(--oms-mono); color: var(--oms-muted); word-break: break-word; }
.error-link { font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------------
   Installer
   --------------------------------------------------------------------- */
.install-page { padding: 24px 14px 40px; }
.install-shell { max-width: 760px; margin: 0 auto; }
.install-shell .login-brand { border-bottom: 0; margin-bottom: 4px; }

/* Auto-fitting statistics row used by the module screens */
.stat-grid-auto { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 12px; min-height: 62px; }
.stat-amber .stat-icon { background: #fff4e0; color: #b25e00; }
.oms-card > .card-header { flex-wrap: wrap; }

/* Avatars with a photo */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-form { display: flex; gap: 6px; margin: 8px 0 2px; }

/* Two-factor authentication */
.code-input { font: 600 1.125rem var(--oms-mono); letter-spacing: .25em; text-align: center; }
.tfa-setup { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--oms-line); }
.tfa-setup canvas { border: 1px solid var(--oms-line); border-radius: var(--oms-radius); max-width: 100%; height: auto; }
.tfa-steps { flex: 1 1 260px; }
.tfa-steps p { margin: 0 0 6px; }
.tfa-secret { font: 600 .9375rem var(--oms-mono); letter-spacing: .06em; padding: 6px 10px; background: var(--oms-surface-2); border: 1px dashed #c5ced7; border-radius: var(--oms-radius); word-break: break-all; }
.tfa-confirm { display: flex; gap: 8px; max-width: 280px; }
.tfa-codes { margin-top: 12px; padding: 12px; border: 1px solid #ffe0a8; background: #fffaf0; border-radius: var(--oms-radius); }
.tfa-codes pre { margin: 8px 0; padding: 10px; background: #fff; border: 1px solid var(--oms-line); border-radius: var(--oms-radius); font: .875rem var(--oms-mono); columns: 2; }
.wo-created { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.wo-created .btn-close { margin-left: auto; }
.wo-current { margin-bottom: 10px; color: var(--oms-muted); }

/* Security screens */
.top-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.top-grid .oms-card { margin-bottom: 8px; }
.top-table td, .top-table th { padding-left: 10px; padding-right: 10px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.num-bad { color: var(--oms-danger); font-weight: 600; }
.settings-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.perm-matrix th, .perm-matrix td { text-align: center; }
.perm-matrix th:first-child { text-align: left; }
.perm-col { width: 76px; }
.key-reveal .key-value { display: block; margin: 8px 0; padding: 9px 12px; background: #fff; border: 1px solid #ffe0a8; border-radius: var(--oms-radius); font: 600 .9375rem var(--oms-mono); word-break: break-all; user-select: all; }
.key-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.cert-list { max-width: 640px; }
.cert-list dd { text-align: left; }

/* Company logo */
.brand-logo { height: 26px; width: auto; max-width: 120px; object-fit: contain; border-radius: 3px; background: #fff; padding: 2px; }
.brand-logo-lg { height: 46px; max-width: 150px; background: transparent; padding: 0; }
.app-settings { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.logo-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; margin-bottom: 10px; color: var(--oms-muted); }
.logo-preview .bi { font-size: 1.8rem; color: #9aa7b4; }
.logo-preview img { max-width: 100%; max-height: 110px; object-fit: contain; }
@media (max-width: 991.98px) { .app-settings { grid-template-columns: minmax(0, 1fr); } }
