:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --text: #1d2330;
    --muted: #5d6677;
    --border: #dfe3ea;
    --primary: #0f8f86;
    --primary-dark: #0b6f68;
    --primary-soft: #e3f4f2;
    --surface-2: #f0f2f5;
    --side: #0f1720;
    --side-2: #17212c;
    --side-3: #1f2b38;
    --side-text: #c9d2dd;
    --side-muted: #7f8b99;
    --side-border: #243241;
    --ok: #1f8a4c;
    --ok-soft: #e4f4ea;
    --warn: #b38600;
    --warn-soft: #fbf3d9;
    --nodata: #9aa1ad;
    --radius: 10px;
    --danger: #b42318;
    --danger-bg: #fdecea;
    --notice-bg: #eef4fc;
    --critical: #b42318;
    --high: #c4520f;
    --medium: #8a6a00;
    --low: #3d6b3d;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
}

* { box-sizing: border-box; }

body { margin: 0; }

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }

a { color: var(--primary); }

code {
    font-family: Consolas, "Cascadia Mono", monospace;
    background: var(--bg);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

/* ---------- Shell (left menu) ---------- */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.sb-state { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }

.app { display: flex; min-height: 100vh; }

.sb {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 280px;
    flex: none;
    display: flex;
    flex-direction: column;
    background: var(--side);
    color: var(--side-text);
    transition: width 0.18s;
    z-index: 40;
}

.sb .icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.sb-brand { display: flex; align-items: center; gap: 0.5rem; padding: 0.9rem 0.9rem 0.6rem; }
.sb-logo { display: flex; align-items: center; gap: 0.55rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; flex: 1; min-width: 0; }
.sb-logo .icon { width: 26px; height: 26px; color: #3cc2b8; }
.sb-collapse { color: var(--side-muted); cursor: pointer; padding: 0.3rem; border-radius: 6px; display: inline-flex; }
.sb-collapse:hover { background: var(--side-3); color: #fff; }

/* Search in the menu: the button opens the search page, Enter searches. */
.sb-search { display: flex; align-items: center; gap: 0.5rem; margin: 0.2rem 0.9rem 0.3rem; padding: 0 0.6rem; background: var(--side-2); border: 1px solid var(--side-border); border-radius: 8px; }
.sb-search:focus-within { border-color: #3cc2b8; }
.sb-search button { background: none; border: 0; padding: 0; margin: 0; color: var(--side-muted); display: inline-flex; cursor: pointer; }
.sb-search button:hover { color: #fff; }
.sb-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: #fff; padding: 0.5rem 0; font: inherit; font-size: 0.86rem; }
.sb-search input::placeholder { color: var(--side-muted); }
.sb-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0.25rem 0.6rem 1rem; }
/* Menu scrollbar: thin and dark, so it does not look like a white strip next to the footer. */
.sb-scroll { scrollbar-width: thin; scrollbar-color: var(--side-border) transparent; }
.sb-scroll::-webkit-scrollbar { width: 6px; }
.sb-scroll::-webkit-scrollbar-track { background: transparent; }
.sb-scroll::-webkit-scrollbar-thumb { background: var(--side-border); border-radius: 999px; }
.sb-scroll::-webkit-scrollbar-thumb:hover { background: var(--side-muted); }

.sb-group { margin-top: 0.9rem; }
.sb-group h6 {
    margin: 0 0 0.3rem;
    padding: 0 0.6rem;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--side-muted);
    font-weight: 600;
}

.sb-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 7px;
    color: var(--side-text);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}
.sb-link:hover { background: var(--side-2); color: #fff; }
.sb-link.active { background: var(--side-3); color: #fff; box-shadow: inset 3px 0 0 #3cc2b8; }
.sb-link.active .icon { color: #3cc2b8; }
.sb-text { overflow: hidden; text-overflow: ellipsis; }

.sb-badge { margin-left: auto; font-size: 0.62rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--side-3); color: var(--side-text); }
.sb-badge-soon { background: rgba(60, 194, 184, 0.16); color: #6fd9d0; letter-spacing: 0.03em; text-transform: uppercase; }
.sb-badge-new { background: #e5484d; color: #fff; }

.sb-foot { border-top: 1px solid var(--side-border); padding: 0.75rem 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.85rem; }
.sb-me { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.sb-avatar { width: 30px; height: 30px; flex: none; border-radius: 999px; background: var(--side-3); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.78rem; }
.sb-email { color: var(--side-text); white-space: nowrap; }
.sb-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.sb-foot form { margin: 0; }
.sb-signout { display: inline-flex; align-items: center; gap: 0.4rem; background: none; border: none; color: var(--side-muted); padding: 0.3rem 0.4rem; border-radius: 6px; font-size: 0.85rem; }
.sb-signout:hover { background: var(--side-3); color: #fff; }
.sb .lang-switch a[style*="--muted"] { color: var(--side-muted) !important; }
.sb .lang-switch a[style*="--primary"] { color: #6fd9d0 !important; }

/* Narrow menu on desktop */
#nav-collapse:checked ~ .app .sb { width: 64px; }
#nav-collapse:checked ~ .app .sb .sb-text,
#nav-collapse:checked ~ .app .sb .sb-badge { display: none; }
#nav-collapse:checked ~ .app .sb .sb-group h6 { visibility: hidden; height: 4px; overflow: hidden; }
#nav-collapse:checked ~ .app .sb .sb-link { justify-content: center; padding: 0.55rem 0; }
#nav-collapse:checked ~ .app .sb .sb-brand { flex-direction: column; padding: 0.9rem 0.4rem 0.4rem; }
#nav-collapse:checked ~ .app .sb .sb-logo { flex: none; }
#nav-collapse:checked ~ .app .sb .sb-foot { align-items: center; padding: 0.75rem 0.4rem; }
#nav-collapse:checked ~ .app .sb .sb-collapse .icon { transform: scaleX(-1); }
#nav-collapse:checked ~ .app .sb .sb-search { margin: 0.2rem 0.6rem 0.3rem; padding: 0.5rem 0; justify-content: center; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.appbar { display: none; }

.sb-scrim { display: none; }

.content { padding: 1.75rem 2rem 2.5rem; width: 100%; max-width: 1600px; margin: 0; }

@media (max-width: 900px) {
    .sb { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-105%); transition: transform 0.2s; }
    #nav-toggle:checked ~ .app .sb { transform: none; }
    #nav-toggle:checked ~ .app .sb-scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 32, 0.45); z-index: 30; }
    .sb .sb-text, .sb .sb-badge { display: inline !important; }
    .sb .sb-group h6 { visibility: visible !important; height: auto !important; }
    .sb .sb-link { justify-content: flex-start !important; padding: 0.5rem 0.6rem !important; }
    .sb-collapse { display: none; }
    .sb { width: 280px !important; }

    .appbar {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        position: sticky;
        top: 0;
        z-index: 20;
        padding: 0.6rem 1rem;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
    }
    .appbar .icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
    .appbar-menu { display: inline-flex; padding: 0.35rem; border-radius: 6px; cursor: pointer; color: var(--text); }
    .appbar-menu:hover { background: var(--surface-2); }
    .appbar-brand { font-weight: 700; color: var(--text); text-decoration: none; }

    .content { padding: 1.25rem 1rem 2rem; }
}

/* ---------- Sign-in ---------- */

.auth-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr);
    background: var(--surface);
}

.auth-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 3rem;
    color: #e6f1f0;
    background:
        linear-gradient(160deg, rgba(15, 23, 32, 0.55) 0%, rgba(15, 23, 32, 0.78) 55%, rgba(11, 111, 104, 0.82) 100%),
        url("/img/login-network.jpg") center / cover no-repeat,
        #0f1720;
    overflow: hidden;
}

.auth-split .icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.auth-logo { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.25rem; letter-spacing: 0.01em; }
.auth-logo .icon { width: 1.6rem; height: 1.6rem; color: #6fd9d0; }

.auth-hero-text { max-width: 34rem; }
.auth-hero-text h2 { font-size: 2.3rem; line-height: 1.15; margin: 0 0 0.9rem; color: #fff; font-weight: 700; }
.auth-hero-text p { font-size: 1.05rem; color: #c9dcda; margin: 0 0 1.5rem; }

.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.auth-points li {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.65rem 0.9rem;
    background: rgba(15, 23, 32, 0.55);
    border: 1px solid rgba(111, 217, 208, 0.25);
    border-radius: 10px;
    backdrop-filter: blur(4px);
    color: #e6f1f0;
}
.auth-points .icon { width: 1.25rem; height: 1.25rem; color: #6fd9d0; flex: none; }

.auth-hero-foot { margin: 0; font-size: 0.85rem; color: #9fb8b5; }

.auth-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1.5rem;
    position: relative;
    /* Light background with some life: a green glow at the top, a blue one at the bottom and a soft dot grid.
       Drawn by the browser (no image to download). */
    background:
        radial-gradient(ellipse 60% 45% at 85% 10%, rgba(15, 143, 134, 0.30), transparent 70%),
        radial-gradient(ellipse 55% 45% at 10% 90%, rgba(47, 111, 214, 0.26), transparent 70%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='%230f8f86' fill-opacity='.22'/%3E%3C/svg%3E"),
        #f7f9fb;
}

.auth-top {
    position: absolute; top: 1.25rem; left: 1.5rem; right: 1.5rem;
    display: flex; justify-content: flex-end; align-items: center;
}
.auth-logo-small { display: none; color: var(--primary); font-size: 1.1rem; }
.auth-logo-small .icon { color: var(--primary); width: 1.4rem; height: 1.4rem; }

.auth-card {
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;
    padding: 2rem 2rem 1.75rem;
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(15, 40, 60, 0.10);
}
.auth-card h1 { font-size: 1.75rem; margin: 0 0 0.35rem; }
.auth-sub { color: var(--muted); margin: 0 0 1.5rem; }
.auth-card input[type=email], .auth-card input[type=password], .auth-card input[type=text], .auth-card input:not([type]) {
    padding: 0.7rem 0.85rem; border-radius: 8px; background: var(--surface);
}
.auth-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 143, 134, 0.18); }
.auth-card button.primary { width: 100%; padding: 0.75rem 1rem; border-radius: 8px; font-weight: 600; margin-top: 1rem; }

.auth-secure { display: flex; align-items: center; gap: 0.4rem; margin: 2rem 0 0; font-size: 0.85rem; color: var(--muted); }
.auth-secure .icon { width: 1rem; height: 1rem; color: var(--primary); }

@media (max-width: 900px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-top { justify-content: space-between; }
    .auth-logo-small { display: inline-flex; }
    .auth-side { justify-content: flex-start; padding-top: 5rem; }
    .auth-card { padding: 1.5rem 1.25rem 1.35rem; border-radius: 14px; }
}

.auth-card form { display: flex; flex-direction: column; gap: 0.4rem; }

/* Forgot password link next to the Password label, and the reset password pages. */
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 0.5rem; }
.auth-label-row label { margin-top: 0; }
.auth-forgot { font-size: 0.88rem; font-weight: 500; }
.auth-button { display: block; width: 100%; padding: 0.75rem 1rem; border-radius: 8px; font-weight: 600; margin-top: 1rem; box-sizing: border-box; }
.auth-alt { text-align: center; margin: 1.1rem 0 0; }
.auth-hint { font-size: 0.85rem; margin: 0.2rem 0 0; }
.auth-card .notice { margin: 1rem 0 0; }

/* Legal notices under the sign-in form and on the Terms and Privacy pages. */
.legal-foot { width: 100%; max-width: 400px; margin: 1.5rem auto 0; padding-top: 1rem; text-align: center; font-size: 0.78rem; color: var(--muted); }
.legal-foot p { margin: 0 0 0.35rem; }
.legal-notice { line-height: 1.45; }
.legal-links { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem !important; font-size: 0.85rem; }
.legal-copy { margin-top: 0.5rem !important; }
.auth-side .login-version { margin-top: 0.4rem; }

.legal-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); padding: 1.25rem 1.5rem 2rem; box-sizing: border-box; }
.legal-page .icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.legal-top { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 48rem; margin: 0 auto; }
.legal-logo { color: var(--primary); font-size: 1.1rem; text-decoration: none; }
.legal-logo .icon { color: var(--primary); width: 1.4rem; height: 1.4rem; }
.legal-body { flex: 1; width: 100%; max-width: 48rem; margin: 0 auto; }
.legal-doc { line-height: 1.6; }
.legal-doc h1 { font-size: 1.9rem; margin: 0.5rem 0 0.25rem; }
.legal-doc h2 { font-size: 1.1rem; margin: 1.6rem 0 0.4rem; }
.legal-doc p, .legal-doc li { color: var(--text); }
.legal-doc ul { padding-left: 1.3rem; margin: 0.3rem 0 0; }
.legal-doc li { margin-bottom: 0.3rem; }
.legal-back { margin: 1.5rem 0 0; font-size: 0.9rem; }
.legal-date { color: var(--muted); font-size: 0.88rem; margin: 0 0 1rem; }
.legal-intro { font-size: 1.02rem; }
.legal-page .legal-foot { max-width: 48rem; margin-top: 2.5rem; border-top: 1px solid var(--border); }

label { font-weight: 600; margin-top: 0.5rem; }

input[type=email], input[type=password], input[type=text], input:not([type]) {
    font: inherit;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}

input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.validation-message { color: var(--danger); font-size: 0.9rem; }

.qr { display: block; width: 200px; height: 200px; margin: 0.5rem auto; image-rendering: pixelated; }

.codes { columns: 2; padding-left: 1.2rem; }

/* ---------- Buttons ---------- */

button, .button {
    font: inherit;
    cursor: pointer;
    border-radius: 6px;
    padding: 0.55rem 1rem;
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.primary { background: var(--primary); color: #fff; margin-top: 0.75rem; }
.primary:hover { background: var(--primary-dark); }

.secondary-button { background: var(--surface); border-color: var(--border); color: var(--text); }

.link-button { background: none; border: none; color: var(--primary); padding: 0; }
.link-button:hover { text-decoration: underline; }

/* ---------- Messages ---------- */

.error { background: var(--danger-bg); color: var(--danger); padding: 0.6rem 0.8rem; border-radius: 6px; }
.notice { background: var(--notice-bg); padding: 0.6rem 0.8rem; border-radius: 6px; }
.secondary { color: var(--muted); }

/* ---------- Dashboard ---------- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card, .panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.panel { margin-bottom: 1.5rem; overflow-x: auto; }

.card-title { color: var(--muted); font-weight: 600; }
.card-number { font-size: 2rem; font-weight: 700; margin: 0.25rem 0; }
.card-number.danger { color: var(--danger); }
.card-detail { color: var(--muted); font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
td.number, th.number { text-align: right; }
tr.overdue td:first-child { color: var(--danger); font-weight: 600; }

.sev { font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.sev-critical { color: var(--critical); }
.sev-high { color: var(--high); }
.sev-medium { color: var(--medium); }
.sev-low { color: var(--low); }

/* ---------- Blazor ---------- */

#blazor-error-ui {
    background: #fff4ce;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ---------- Tickets list + clickable Home cards ---------- */
a.card-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.card-link:hover,
a.card-link:focus-visible {
    border-color: #2563eb;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filters label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #4b5563;
}

.filters label.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    padding-bottom: 0.45rem;
}

.filters select {
    min-width: 11rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    color: #111827;
}

.filters .link-button {
    padding-bottom: 0.45rem;
}

.result-count {
    margin: 0 0 0.75rem;
}


/* ---------- Ticket detail ---------- */
.back-link {
    font-size: 0.9rem;
    text-decoration: none;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin: -0.5rem 0 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 0.5rem 1rem;
    margin: 0;
}

.detail-grid dt {
    color: #6b7280;
}

.detail-grid dd {
    margin: 0;
}

.pre-wrap {
    white-space: pre-wrap;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.actions select,
.field textarea {
    padding: 0.45rem 0.55rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    color: #111827;
}

.actions select {
    min-width: 16rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #4b5563;
}

.field textarea {
    width: 100%;
    max-width: 48rem;
    resize: vertical;
}

.primary-button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.primary-button:hover:not(:disabled) {
    background: var(--primary-dark);
}

.primary-button:disabled,
.secondary-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.notice-success {
    padding: 0.6rem 0.9rem;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    background: #f0fdf4;
    color: #166534;
}

table a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
}

table a:hover {
    color: #2563eb;
    text-decoration: underline;
}


/* ---------- Monitoring schedule ---------- */

.filters input[type=time] {
    padding: 0.35rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
}

.plan-edit { margin-left: 0.5rem; }
tr.plan-edit-row td { background: var(--notice-bg); }

/* ---------- Calendar ---------- */

.cal-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.cal-month { margin: 0 0.5rem; min-width: 11rem; text-align: center; }
.cal-counts { margin-left: auto; font-size: 0.9rem; }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    background: var(--surface);
    margin-bottom: 0.75rem;
}

.cal-loading { opacity: 0.55; }

.cal-head {
    padding: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: capitalize;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.cal-cell {
    min-height: 6.5rem;
    padding: 0.3rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    cursor: pointer;
    min-width: 0;
}

.cal-cell:hover { background: #f9fafb; }
.cal-other { background: #fafbfc; color: #9aa1ad; }
.cal-today .cal-day { background: var(--primary); color: #fff; border-radius: 999px; padding: 0 0.4rem; }
.cal-selected { outline: 2px solid var(--primary); outline-offset: -2px; }

.cal-day { font-size: 0.8rem; font-weight: 600; align-self: flex-start; }

.cal-chip {
    display: block;
    font-size: 0.75rem;
    line-height: 1.25;
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
    border-left: 3px solid;
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-chip:hover { text-decoration: underline; }
.cal-time { font-weight: 600; }

.cal-incident { border-color: #1f5fae; background: #e8f0fb; }
.cal-finding { border-color: #c4520f; background: #fdf0e6; }
.cal-monitoring { border-color: #2f7d4f; background: #e7f4ec; }
.cal-task { border-color: #6b4fbb; background: #f0ecfa; }
.cal-chip.cal-overdue { background: var(--danger-bg); color: var(--danger); }

.cal-more { font-size: 0.75rem; align-self: flex-start; }

.cal-dot {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 2px;
    border-left: 3px solid;
    vertical-align: middle;
}

.cal-overdue-dot { background: var(--danger-bg); border-color: var(--danger); }

.cal-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.85rem; margin-bottom: 1.25rem; }

@media (max-width: 760px) {
    .cal-cell { min-height: 4.5rem; }
    .cal-chip .cal-time { display: none; }
}

.cal-views { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.cal-views button { border: none; border-radius: 0; background: var(--surface); color: var(--text); padding: 0.4rem 0.8rem; }
.cal-views button + button { border-left: 1px solid var(--border); }
.cal-views button.cal-view-active { background: var(--primary); color: #fff; }

.cal-grid-week .cal-cell { min-height: 18rem; }
.cal-grid-week .cal-chip { white-space: normal; }
.cal-sub { display: block; font-size: 0.7rem; color: var(--muted); }
.cal-chip.cal-overdue .cal-sub { color: var(--danger); }
.cal-sub { overflow: hidden; text-overflow: ellipsis; }
.filters label.checkbox .cal-dot, .cal-legend .cal-dot { flex-shrink: 0; min-width: 0.7rem; }


/* ---------- Confirmation modal ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(29, 35, 48, 0.45);
}

.modal-box {
    width: 100%;
    max-width: 28rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 12px 32px rgba(29, 35, 48, 0.25);
}

.modal-box h2 {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
}

.modal-box p {
    margin: 0 0 0.75rem;
}

/* ---------- Monitoring step status ---------- */
.step-pill {
    display: inline-block;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.step-pill-ok { background: #e7f4e7; color: #2f5e2f; }
.step-pill-failed { background: var(--danger-bg); color: var(--danger); }
.step-pill-na { background: #eef0f3; color: var(--muted); }
.step-pill-pending { background: #fff5d6; color: #7a5d00; }

/* ---------- Page header ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.page-sub { margin: 0.25rem 0 0; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.page-actions .button { margin-top: 0; }

.text-crit { color: var(--critical); }

.pill { display: inline-flex; align-items: center; font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill-soon { background: var(--primary-soft); color: var(--primary-dark); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.7rem; }
.pill-done { background: var(--ok-soft); color: var(--ok); }
.pill-running { background: var(--primary-soft); color: var(--primary-dark); }
.pill-late { background: var(--danger-bg); color: var(--danger); }
.pill-todo { background: var(--surface-2); color: var(--muted); }

button.small, .button.small { padding: 0.3rem 0.75rem; font-size: 0.85rem; margin-top: 0; }

/* ---------- Overview ---------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
}
.kpi:hover, .kpi:focus-visible { border-color: var(--primary); }
.kpi-label { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.kpi-value { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-detail { color: var(--muted); font-size: 0.85rem; }

.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; min-width: 0; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.9rem; }
.dash-head h2 { margin: 0; }
.dash-sub { margin: 0.15rem 0 0; font-size: 0.85rem; }
.dash-link { font-size: 0.88rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.dash-link:hover { text-decoration: underline; }
.dash-h3 { font-size: 0.95rem; margin: 1.25rem 0 0.5rem; }
.dash-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.dash-two .dash-card { margin-bottom: 1.25rem; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 999px; flex: none; }

/* Customer board */
.cust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.85rem; }
.cust-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--nodata);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    background: var(--surface);
}
.cust-card:hover { background: #fafbfc; border-color: var(--primary); }
.cust-top { display: flex; align-items: center; gap: 0.5rem; }
.cust-name { font-weight: 700; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cust-health { font-size: 0.75rem; font-weight: 600; color: var(--muted); margin: -0.35rem 0 0 1.1rem; }
.health-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--nodata); flex: none; }
.cust-stats { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.82rem; color: var(--muted); }
.cust-row { display: grid; grid-template-columns: 4.6rem 1fr; gap: 0.5rem; }
.cust-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.cust-stats b.text-crit { color: var(--critical); }
.cust-next { font-size: 0.8rem; }
.health-critical { border-left-color: var(--critical); }
.health-critical .health-dot { background: var(--critical); }
.health-critical .cust-health { color: var(--critical); }
.health-warning { border-left-color: var(--warn); }
.health-warning .health-dot { background: var(--warn); }
.health-warning .cust-health { color: var(--warn); }
.health-ok { border-left-color: var(--ok); }
.health-ok .health-dot { background: var(--ok); }
.health-ok .cust-health { color: var(--ok); }

/* Today's monitoring */
.today { display: grid; grid-template-columns: 140px 1fr; gap: 1.25rem; align-items: start; }
.ring-box { position: relative; width: 130px; height: 130px; }
.ring, .donut { width: 100%; height: 100%; transform: none; }
.ring-track { fill: none; stroke: var(--surface-2); stroke-width: 3.6; }
.ring-value { fill: none; stroke: var(--primary); stroke-width: 3.6; stroke-linecap: round; }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-text b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.ring-text span { font-size: 0.78rem; color: var(--muted); }

.today-list { list-style: none; margin: 0; padding: 0; }
.today-item {
    display: grid;
    grid-template-columns: 4.6rem minmax(0, 1fr) 7.5rem 8.5rem 6rem;
    gap: 0.75rem;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
}
.today-item:last-child { border-bottom: none; }
.today-time { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 0.88rem; }
.state-late .today-time { color: var(--critical); }
.today-main { display: flex; flex-direction: column; min-width: 0; }
.today-main b, .today-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-main span { font-size: 0.82rem; }
.today-progress { display: flex; align-items: center; gap: 0.45rem; font-size: 0.8rem; }
.today-action { text-align: right; }
.state-done .today-main b { color: var(--muted); font-weight: 600; }

.bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; min-width: 40px; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }

/* Findings */
.sev-summary { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 0.75rem; }
.donut { width: 116px; height: 116px; flex: none; }
.donut-seg { fill: none; stroke-width: 3.6; }
.donut-text { font-size: 7px; font-weight: 700; text-anchor: middle; fill: var(--text); }
.seg-critical { stroke: var(--critical); background: var(--critical); }
.seg-high { stroke: var(--high); background: var(--high); }
.seg-medium { stroke: #d2a106; background: #d2a106; }
.seg-low { stroke: #6b9a6b; background: #6b9a6b; }
.sev-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; flex: 1; }
.sev-legend li { display: grid; grid-template-columns: 12px 1fr auto; gap: 0.5rem; align-items: center; font-size: 0.88rem; }
.sev-legend b { font-variant-numeric: tabular-nums; }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0; border-top: 1px solid var(--border); }
.mini-list .sev { width: 4.6rem; flex: none; }
.mini-list .cal-dot { flex: none; }
.mini-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-main b, .mini-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-main b { font-weight: 600; font-size: 0.92rem; }
.mini-main span { font-size: 0.8rem; }
.sla { font-size: 0.78rem; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sla-late { color: var(--critical); }

/* Tickets */
.stack { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.stack > span { display: block; height: 100%; }
.stack-open { background: var(--high); }
.stack-progress { background: var(--primary); }
.stack-done { background: var(--ok); }
.stack-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; padding: 0; margin: 0.6rem 0 0.75rem; font-size: 0.85rem; }
.stack-legend a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.stack-legend a:hover { text-decoration: underline; }

.load-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.load-list li { display: grid; grid-template-columns: minmax(0, 11rem) 1fr 2rem; gap: 0.75rem; align-items: center; font-size: 0.88rem; }
.load-list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.load-list b { text-align: right; font-variant-numeric: tabular-nums; }

/* Agent monitoring (preview) */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.feature-card h2 { font-size: 1rem; margin: 0.65rem 0 0.35rem; }
.feature-card p { margin: 0; font-size: 0.9rem; line-height: 1.45; }
.feature-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-dark); }
.feature-icon .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.steps-list { margin: 0 0 1rem; padding-left: 1.25rem; line-height: 1.6; }

@media (max-width: 1100px) {
    .dash-two { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .today { grid-template-columns: 1fr; }
    .ring-box { margin: 0 auto; }
    .today-item { grid-template-columns: 4rem minmax(0, 1fr) auto; }
    .today-progress { display: none; }
    .today-state { grid-column: 2; }
    .today-action { grid-column: 3; grid-row: 1 / span 2; }
    .sev-summary { flex-direction: column; align-items: stretch; }
    .mini-main b { white-space: normal; }
    .kpi-value { font-size: 1.6rem; }
    .donut { margin: 0 auto; }
}
/* ---------- Periodic monitoring ---------- */
.pm-filter select { padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font: inherit; color: var(--text); min-width: 12rem; }
.pm-filter { margin: 0; }
.pm-notice { margin: 0 0 1rem; }
.kpi-button { font: inherit; text-align: left; cursor: pointer; }
.kpi-on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.pm-empty { display: flex; gap: 1rem; align-items: flex-start; }
.pm-empty h2 { margin: 0.3rem 0 0.6rem; }
.pm-empty .steps-list { margin-bottom: 1rem; }
.pm-none { margin: 0.5rem 0 0; }

.seg { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.85rem; }
.seg-btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.75rem; font-size: 0.85rem; font-weight: 600; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); }
.seg-btn:hover { border-color: var(--primary); color: var(--text); }
.seg-on, .seg-on:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }
.seg-count { font-variant-numeric: tabular-nums; font-size: 0.78rem; padding: 0 0.4rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.seg-on .seg-count { background: var(--surface); color: var(--primary-dark); }

.table-wrap { overflow-x: auto; margin: 0 -0.25rem; }
.data-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th:first-child { border-top-left-radius: 6px; }
.data-table th:last-child { border-top-right-radius: 6px; }
.data-table td { vertical-align: middle; font-size: 0.9rem; }
.data-table tbody tr:hover td { background: #fafbfc; }
.data-table tr.plan-edit-row td, .data-table tr.plan-edit-row:hover td { background: var(--surface-2); }
.cell-two { display: flex; flex-direction: column; gap: 0.1rem; min-width: 10rem; }
.cell-two .secondary { font-size: 0.82rem; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions .button, .cell-actions button.small { vertical-align: middle; }
.nowrap { white-space: nowrap; }
.pm-late td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
.pm-running td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.pm-paused td { color: var(--muted); }
.pill-soon-due { background: var(--warn-soft); color: #7a5d00; }
.pill-paused { background: var(--surface-2); color: var(--muted); font-style: italic; }

.pm-results-col { min-width: 11rem; }
.pm-results { display: flex; align-items: center; gap: 0.6rem; }
.pm-stack { flex: 1; min-width: 70px; height: 8px; background: #f5e3a3; }
.res-ok { background: var(--ok); }
.res-failed { background: var(--critical); }
.res-na { background: var(--nodata); }
.res-pending { background: #f5e3a3; }
.pm-res-text { font-size: 0.82rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pm-legend { margin: 0.75rem 0 0; font-size: 0.8rem; color: var(--muted); }
.pm-legend li { display: inline-flex; align-items: center; gap: 0.4rem; }

@media (max-width: 720px) {
    .page-actions { width: 100%; }
    .pm-filter, .pm-filter select { width: 100%; }
    .pm-empty { flex-direction: column; }

    /* Tables become one card per row on phones */
    .table-wrap { margin: 0; overflow: visible; }
    .data-table, .data-table tbody, .data-table td { display: block; width: 100%; }
    .data-table thead { display: none; }
    .data-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.75rem; margin-bottom: 0.6rem; }
    .data-table td:first-child, .data-table .cell-actions, .data-table tr.plan-edit-row td { grid-column: 1 / -1; }
    .data-table tr.plan-edit-row { display: block; }
    .data-table td { border: none; padding: 0.2rem 0; text-align: left; }
    .data-table td.number { text-align: left; }
    .data-table td[data-label]::before { content: attr(data-label); display: block; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
    .data-table .cell-actions { text-align: left; padding-top: 0.5rem; }
    .data-table tbody tr:hover td { background: none; }
    .pm-late td:first-child, .pm-running td:first-child { box-shadow: none; }
    .pm-late { border-left: 4px solid var(--critical) !important; }
    .pm-running { border-left: 4px solid var(--primary) !important; }
    .cell-two { min-width: 0; }
}

/* ---------- Search page ---------- */
.search-box { display: flex; align-items: center; gap: 0.6rem; max-width: 40rem; margin: 0 0 1.25rem; padding: 0 0.85rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 143, 134, 0.15); }
.search-box .icon { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted, #6b7280); stroke-width: 1.8; stroke-linecap: round; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 0.75rem 0; font: inherit; font-size: 1rem; color: var(--text); }
.search-h2 { font-size: 1.05rem; margin: 0 0 0.5rem; display: flex; gap: 0.5rem; align-items: baseline; }
.search-h2 .secondary { font-size: 0.85rem; font-weight: 500; }
.search-ico { display: inline-flex; width: 28px; height: 28px; flex: none; align-items: center; justify-content: center; border-radius: 7px; background: var(--surface-2); color: var(--primary); }
.search-ico .icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Back arrow and customer tabs ---------- */
.back-row { margin: 0 0 0.75rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; color: var(--muted); }
.back-link:hover { color: var(--primary); }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin: 0 0 1.25rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tab { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.6rem 0.9rem; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab-on { color: var(--primary); border-bottom-color: var(--primary); }
.tab-count { font-size: 0.72rem; font-weight: 700; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tab-count-alert { background: var(--danger-bg); color: var(--danger); }
.kpi-value-small { font-size: 1.15rem; padding: 0.35rem 0 0.2rem; }

/* ---------- New / import forms (customers and assets) ---------- */
.form-card { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 143, 134, 0.08); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; margin-bottom: 0.5rem; }
.form-grid .field { margin-top: 0; }
.form-grid .field input, .form-grid .field select { width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font: inherit; color: var(--text); }
.form-wide { grid-column: 1 / -1; }
.form-card input[type=file] { margin: 0.5rem 0 0.25rem; font: inherit; }
.form-card .table-wrap { margin: 0.5rem 0 1rem; max-height: 22rem; overflow: auto; }
.import-error td:last-child { color: var(--danger); font-weight: 600; }
.import-skip td { color: var(--muted); }
.import-done td:last-child { color: var(--ok); font-weight: 600; }
.import-ready td:last-child { color: var(--primary-dark); }
.dash-links { display: inline-flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

/* ---------- Customer profile ---------- */
.avatar { width: 36px; height: 36px; flex: none; border-radius: 8px; background: var(--primary-soft); color: var(--primary-dark); display: inline-grid; place-items: center; font-weight: 700; font-size: 0.82rem; overflow: hidden; border: 1px solid var(--border); }
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.avatar-lg { width: 56px; height: 56px; border-radius: 12px; font-size: 1.15rem; }
.cust-cell { display: flex; align-items: center; gap: 0.7rem; }
.cust-head { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.cust-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.cust-inactive { margin: 0 0 1rem; }
.cust-id { flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 5.5rem; padding: 0.35rem 0.9rem 0.4rem; border: 1px solid var(--primary); border-radius: 12px; background: var(--primary-soft); line-height: 1.1; cursor: help; }
.cust-id-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary-dark); }
.cust-id-value { font-family: Consolas, "Cascadia Mono", monospace; font-size: 1.85rem; font-weight: 700; letter-spacing: 0.04em; color: var(--primary-dark); }
/* "Showing 1–50 of 120" under a short list that links to the full one. */
.list-more { margin: 0.75rem 0 0; font-size: 0.9rem; }
@media (max-width: 720px) {
    .cust-head { flex-wrap: wrap; }
    .cust-id { min-width: 4.8rem; padding: 0.3rem 0.7rem; }
    .cust-id-value { font-size: 1.5rem; }
}
.cust-head .page-sub a, .cust-head .page-sub span { white-space: nowrap; }
.card-head .primary-button, .dash-head .primary-button { white-space: nowrap; }
.cust-table tr.overdue td:first-child { color: inherit; font-weight: inherit; }
.row-inactive td { color: var(--muted); }
.row-inactive .avatar { filter: grayscale(1); opacity: 0.7; }
.plain-link { color: inherit; font-weight: 400; }
.icon-link { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; font-weight: 600; color: #128c7e; text-decoration: none; margin-right: 0.6rem; white-space: nowrap; }
.icon-link:hover { text-decoration: underline; }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-bottom: 0.85rem; }
.list-tools .seg { margin-bottom: 0; }
.search-box-inline { flex: 1 1 18rem; margin: 0; max-width: 28rem; }
.search-box-inline input { padding: 0.5rem 0; font-size: 0.92rem; }
.form-h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 1.1rem 0 0.6rem; padding-top: 0.9rem; border-top: 1px solid var(--border); }
.cust-form > .dash-head + .form-h3, .cust-form > .error + .form-h3 { border-top: 0; padding-top: 0; margin-top: 0.25rem; }
.form-hint { font-size: 0.82rem; margin: -0.3rem 0 0.6rem; }
.cust-logo-actions .form-hint { margin: 0; flex-basis: 100%; }
.form-grid .field textarea { width: 100%; max-width: none; padding: 0.55rem 0.7rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.checkbox-line { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; font-size: 0.92rem; cursor: pointer; }
.cust-logo-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.9rem; }
.cust-logo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; }
.file-button { position: relative; overflow: hidden; }
.file-button input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.addr { font-style: normal; display: flex; flex-direction: column; }
.contact-editor { padding: 0.25rem 0 0.5rem; }
.manage-card .manage-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.manage-card .manage-row p { margin: 0.2rem 0 0; font-size: 0.88rem; }
.danger-button { background: var(--surface); border: 1px solid var(--danger); color: var(--danger); }
.danger-button:hover:not(:disabled) { background: var(--danger); color: #fff; }
.danger-button:disabled { opacity: 0.5; cursor: not-allowed; }
.modal-box .danger-button { background: var(--danger); color: #fff; }
.link-button.danger { color: var(--danger); }
.cell-actions .link-button + .link-button { margin-left: 0.75rem; }
.sb-foot-row > .sb-text { overflow: visible; }

@media (max-width: 720px) {
    .manage-card .manage-row { flex-direction: column; align-items: flex-start; }
    .cust-head .avatar-lg { width: 44px; height: 44px; }
    .search-box-inline { max-width: none; }
}

/* ---------- Findings and Tickets lists ---------- */
.list-tools-sub { margin-top: -0.25rem; }
.inline-select select { padding: 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font: inherit; font-size: 0.85rem; color: var(--text); max-width: 16rem; }
.inline-select select:focus { outline: none; border-color: var(--primary); }
.checkbox-inline { margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
a.seg-btn { text-decoration: none; }
.seg-btn .dot { width: 8px; height: 8px; }
.filter-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.4rem 0.3rem 0.75rem; font-size: 0.85rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); }
.filter-chip a { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 999px; text-decoration: none; color: inherit; font-weight: 700; }
.filter-chip a:hover { background: var(--surface); }
.empty-state { text-align: center; padding: 1.5rem 1rem; border: 1px dashed var(--border); border-radius: 8px; }
.empty-state p { margin: 0 0 0.5rem; }
.empty-state .button { margin-top: 0.4rem; }
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; max-width: 34rem; }
.work-table td:first-child { box-shadow: inset 3px 0 0 transparent; }
.work-table .sev-row-critical td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
.work-table .sev-row-high td:first-child { box-shadow: inset 3px 0 0 var(--high); }
.work-table .sev-row-medium td:first-child { box-shadow: inset 3px 0 0 #d2a106; }
.work-table .sev-row-low td:first-child { box-shadow: inset 3px 0 0 #6b9a6b; }
.work-table tr.row-done td { color: var(--muted); }
.work-table tr.row-done td:first-child { box-shadow: inset 3px 0 0 var(--border); }
.work-table tr.row-done a b { font-weight: 600; }
.pill-link { text-decoration: none; }
.pill-link:hover { text-decoration: underline; }
.due-pill { align-self: flex-start; }
.avatar-sm { width: 26px; height: 26px; border-radius: 999px; font-size: 0.7rem; }

@media (max-width: 720px) {
    .inline-select, .inline-select select { width: 100%; max-width: none; }
    .work-table tr { border-left-width: 4px; }
    .work-table .sev-row-critical { border-left-color: var(--critical); }
    .work-table .sev-row-high { border-left-color: var(--high); }
    .work-table .sev-row-medium { border-left-color: #d2a106; }
    .work-table .sev-row-low { border-left-color: #6b9a6b; }
    .work-table tr.row-done { border-left-color: var(--border); }
    .work-table td:first-child { box-shadow: none !important; }
    .clamp-1 { max-width: none; }
}

/* ---------- Company profile ---------- */
.co-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.co-layout .dash-card { margin-bottom: 1.25rem; }
.co-side .checkbox-line { margin: 0.25rem 0 0.4rem; }
.co-notice { margin: 0 0 1rem; }
.co-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.9rem; margin: 0 0 0.75rem; font-size: 0.9rem; }
.co-facts dt { color: var(--muted); }
.co-facts dd { margin: 0; }
.form-grid .field textarea { width: 100%; }
.field .form-hint { display: block; margin-top: 0.3rem; font-weight: 400; }

/* Company in the menu footer */
.sb-company { display: flex; align-items: center; gap: 0.55rem; min-width: 0; padding-bottom: 0.55rem; border-bottom: 1px solid var(--side-border); }
.sb-company-logo { width: 30px; height: 30px; flex: none; border-radius: 7px; object-fit: contain; background: #fff; }
.sb-company-initial { display: grid; place-items: center; background: var(--side-3); color: #fff; font-weight: 700; font-size: 0.8rem; }
.sb-company-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nav-collapse:checked ~ .app .sb .sb-company { justify-content: center; }

@media (max-width: 960px) {
    .co-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Users (/settings/users) ---------- */
.avatar-round { border-radius: 999px; }
.user-you { font-weight: 400; font-size: 0.85em; margin-left: 0.3rem; }
.user-active { display: flex; width: fit-content; margin-top: 0.75rem; }
.user-role-filter { padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font: inherit; font-size: 0.88rem; color: var(--text); }
.user-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.6rem; margin: 0 0 0.75rem; }
.user-role { display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.65rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.user-role input { margin-top: 0.2rem; flex: none; }
.user-role > span { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.9rem; }
.user-role .secondary { font-size: 0.82rem; line-height: 1.35; }
.user-role-on { border-color: var(--primary); background: var(--primary-soft); }
.user-role-locked { cursor: not-allowed; opacity: 0.75; }
.user-customers { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 1rem; max-height: 14rem; overflow: auto; padding: 0.6rem 0.75rem; margin: 0 0 0.5rem; border: 1px solid var(--border); border-radius: 8px; }
.user-customers .checkbox-line { margin: 0.2rem 0; }
.user-actions { display: grid; gap: 0.6rem; }
.user-action { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; }
.user-action .button, .user-action button { flex: none; }
.user-action .form-hint { margin: 0; }

@media (max-width: 720px) {
    .user-role-filter { width: 100%; }
    .user-action { flex-direction: column; align-items: flex-start; }
}

/* ---------- Tooltips (wwwroot/js/tooltip.js) ---------- */
.og-tip { position: fixed; left: 0; top: 0; z-index: 1000; max-width: min(300px, calc(100vw - 16px)); padding: 0.45rem 0.65rem; border-radius: 6px; background: #13202b; color: #f3f6f8; font-size: 0.8rem; font-weight: 400; line-height: 1.4; white-space: pre-line; text-align: left; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.12s ease; }
.og-tip.show { opacity: 1; visibility: visible; }
.tip { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin: -2px 0 -2px 0.15rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; vertical-align: middle; }
.tip .icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tip:hover, .tip:focus-visible { color: var(--primary); }
.tip:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.field-label { display: inline-flex; align-items: center; gap: 0.1rem; }
@media (pointer: coarse) {
    .tip { width: 28px; height: 28px; margin: -6px 0 -6px 0; }
}

/* ---------- Notification preferences (/account/notifications, Users > Alerts) ---------- */
.np-card { max-width: 860px; }
.np-toggle { display: flex; width: fit-content; }
.np-block { border: 0; padding: 0; margin: 0; min-width: 0; }
.np-block:disabled { opacity: 0.55; }
.np-legend { font-size: 0.9rem; font-weight: 600; margin: 0.25rem 0 0.5rem; padding: 0; }
.np-channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.6rem; margin: 0 0 0.75rem; }
.np-channel { display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.65rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.np-channel input { margin-top: 0.2rem; flex: none; }
.np-channel > span { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; font-size: 0.9rem; }
.np-channel .secondary { font-size: 0.82rem; line-height: 1.35; }
.np-channel-on { border-color: var(--primary); background: var(--primary-soft); }
.np-block:disabled .np-channel { cursor: not-allowed; }
.np-pill { margin-top: 0.15rem; }
.np-email { margin: 0 0 0.75rem; }
.np-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.np-severities { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.9rem; }
.np-sev { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.8rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 0.9rem; }
.np-sev input { margin: 0; }
.np-sev-on { border-color: var(--primary); background: var(--primary-soft); }
.np-block:disabled .np-sev { cursor: not-allowed; }
.np-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.np-dot-critical { background: var(--critical); }
.np-dot-high { background: var(--high); }
.np-dot-medium { background: var(--medium); }
.np-dot-low { background: var(--low); }

/* ---------- Finding source (PMon / AMon / Manual) ---------- */

.src-badge { display: inline-flex; align-items: center; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; padding: 0.1rem 0.45rem; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.src-pmon { background: var(--primary-soft); border-color: #b9e2dd; color: var(--primary-dark); }
.src-amon { background: #f1ecfb; border-color: #d8ccf2; color: #5a3ea8; }

/* ---------- Pager (server-side pages) ---------- */

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}
.pager-buttons { display: flex; align-items: center; gap: 0.5rem; }
.pager-page { color: var(--muted); white-space: nowrap; }
.button.is-disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.is-busy .table-wrap, .is-busy .pager { opacity: 0.6; transition: opacity 0.15s; }

/* ---------- App version ---------- */

.app-version { font-size: 0.72rem; color: var(--side-muted); padding: 0 0 0.15rem; }
.login-version { font-size: 0.75rem; color: var(--muted); text-align: center; margin-top: 1rem; }

/* ---------- Record numbers (Customer ID, FND-..., TK-...) ---------- */

.rec-no { display: block; font-family: Consolas, "Cascadia Mono", monospace; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); white-space: nowrap; line-height: 1.3; }
.rec-no-lg { font-size: 0.85rem; margin: 0 0 0.15rem; }
h1 .rec-no { display: inline-block; vertical-align: middle; margin: 0 0 0 0.4rem; padding: 0.1rem 0.45rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }

/* ---------- Errors, help and support ---------- */
.pill-wait { background: var(--warn-soft); color: var(--warn); }
.pill-attn { background: var(--warn-soft); color: var(--warn); margin-left: 0.35rem; }
.err-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; background: var(--surface-2); color: var(--text); padding: 0.1rem 0.45rem; border-radius: 6px; border: 1px solid var(--border); letter-spacing: 0.02em; }
.err-code-sm { font-size: 0.75rem; padding: 0.05rem 0.35rem; margin: 0 0.35rem; }
.err-code-lg { font-size: 1.35rem; }
.error .error-links { display: inline-flex; flex-wrap: wrap; gap: 0.75rem; margin-left: 0.5rem; }
.error .error-links a { color: var(--danger); font-weight: 600; }

.problem-card { max-width: 640px; margin: 2rem auto; text-align: center; padding: 2rem 1.75rem; }
.problem-card h1 { margin: 0.5rem 0 0.75rem; }
.problem-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 999px; background: var(--danger-bg); color: var(--danger); }
.problem-icon .icon, .support-context .icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.problem-icon .icon { width: 28px; height: 28px; }
.problem-code-row { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.problem-code-row .err-code { font-size: 1.1rem; }
.problem-actions { justify-content: center; flex-wrap: wrap; margin-top: 1.25rem; }

.help-toc ul { margin: 0.25rem 0 0; padding-left: 1.1rem; columns: 2; column-gap: 2rem; }
.help-toc li { margin: 0.2rem 0; }
.help-section { scroll-margin-top: 1rem; }
.help-section h2, .help-toc h2 { margin-top: 0; font-size: 1.05rem; }
.help-section ol, .help-section ul { padding-left: 1.2rem; }
.help-statuses { list-style: none; padding-left: 0 !important; }
.help-statuses li { margin: 0.4rem 0; display: flex; gap: 0.6rem; align-items: center; }
.help-statuses .pill { min-width: 9.5rem; justify-content: center; }

.support-context { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem 0.9rem; margin-bottom: 1rem; border-radius: 8px; background: var(--danger-bg); color: var(--text); }
.support-context > .icon { width: 20px; height: 20px; color: var(--danger); flex: none; margin-top: 0.1rem; }
.support-context > div { display: flex; flex-direction: column; gap: 0.2rem; }
.support-shot { display: flex; gap: 0.75rem; align-items: flex-start; }
.support-shot img { max-width: 260px; max-height: 180px; border: 1px solid var(--border); border-radius: 6px; object-fit: contain; background: var(--surface-2); }
.support-privacy { margin: 0.75rem 0 0; }
.empty-state { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 0.5rem 0; }

.sp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.sp-side-stack { display: flex; flex-direction: column; gap: 1rem; }
.sp-side h2, .sp-section-title { font-size: 1rem; margin: 0 0 0.75rem; }
.sp-section-title { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.sp-waiting { background: var(--warn-soft); color: #6b5200; margin-bottom: 1rem; }
.sp-thread { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.sp-msg { max-width: 85%; padding: 0.7rem 0.9rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.sp-msg.sp-mine { align-self: flex-end; background: var(--primary-soft); border-color: #bfe3df; }
.sp-msg.sp-theirs { align-self: flex-start; }
.sp-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.8rem; margin-bottom: 0.3rem; }
.sp-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-shot img { display: block; margin-top: 0.6rem; max-width: 100%; max-height: 320px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); }
.sp-reply { margin-top: 0.5rem; }
.sp-reply textarea, .support-context + * textarea { width: 100%; }
.sp-reply-actions { align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.sp-after { margin: 0; }
.sp-status-pick select { min-width: 12rem; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font: inherit; color: var(--text); }
.sp-side .form-hint { display: block; margin-top: 1rem; }
.sp-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.45rem 0.9rem; margin: 0; font-size: 0.9rem; }
.sp-facts dt { color: var(--muted); }
.sp-facts dd { margin: 0; overflow-wrap: anywhere; }
.diag-small { font-size: 0.8rem; color: var(--muted); }
.diag-block { margin-top: 1rem; }
.diag-block summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.diag-block pre { margin: 0.5rem 0 0; padding: 0.75rem; max-height: 360px; overflow: auto; background: var(--side); color: var(--side-text); border-radius: 8px; font-size: 0.78rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-related { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.sp-related li { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.9rem; }

.err-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 0.5rem 0 0; border-bottom: 1px solid var(--border); }
.err-bars-dense { gap: 1px; }
.err-bar { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; min-width: 2px; }
.err-bar span { display: block; width: 100%; background: var(--danger); opacity: 0.75; border-radius: 3px 3px 0 0; }
.err-bar:hover span { opacity: 1; }
.err-bar span.err-zero { height: 2px !important; background: var(--border); opacity: 1; }
.err-axis { display: flex; justify-content: space-between; font-size: 0.75rem; margin-top: 0.3rem; }

#blazor-error-ui .report { margin-left: 0.75rem; font-weight: 600; }

@media (max-width: 900px) {
    .sp-layout { grid-template-columns: 1fr; }
    .sp-msg { max-width: 100%; }
    .help-toc ul { columns: 1; }
}

/* ---------- Platform metrics ---------- */

.mx-title-row { display: flex; align-items: center; gap: 8px; }

/* Satellite orbit loading marker (LoadingOrbit). Fades in after 0.4 s so fast pages never flash it. */
.og-orbit { display: inline-flex; align-items: center; flex: none; }
.og-orbit-title { width: 28px; height: 28px; }
.og-orbit-block { display: flex; min-height: 44px; padding: 0.25rem 0; }
.mx-orbit { color: var(--muted, #597b8f); opacity: 0; transition: opacity 120ms; }
.mx-orbit-active { opacity: 1; animation: og-orbit-in 160ms ease-out 400ms both; }
@keyframes og-orbit-in { from { opacity: 0; } to { opacity: 1; } }
.mx-satellite { transform: translate(29px, 16px); }
/* The satellite follows the orbit ellipse (16,16, rx 13, ry 5.6) with plain transforms: works in every browser. */
@media (prefers-reduced-motion: no-preference) {
    .mx-orbit-active .mx-satellite { animation: mx-orbit-travel 4s linear infinite; }
}
@keyframes mx-orbit-travel {
    0% { transform: translate(29.00px, 16.00px); }
    4.17% { transform: translate(28.56px, 17.45px); }
    8.33% { transform: translate(27.26px, 18.80px); }
    12.5% { transform: translate(25.19px, 19.96px); }
    16.67% { transform: translate(22.50px, 20.85px); }
    20.83% { transform: translate(19.36px, 21.41px); }
    25% { transform: translate(16.00px, 21.60px); }
    29.17% { transform: translate(12.64px, 21.41px); }
    33.33% { transform: translate(9.50px, 20.85px); }
    37.5% { transform: translate(6.81px, 19.96px); }
    41.67% { transform: translate(4.74px, 18.80px); }
    45.83% { transform: translate(3.44px, 17.45px); }
    50% { transform: translate(3.00px, 16.00px); }
    54.17% { transform: translate(3.44px, 14.55px); }
    58.33% { transform: translate(4.74px, 13.20px); }
    62.5% { transform: translate(6.81px, 12.04px); }
    66.67% { transform: translate(9.50px, 11.15px); }
    70.83% { transform: translate(12.64px, 10.59px); }
    75% { transform: translate(16.00px, 10.40px); }
    79.17% { transform: translate(19.36px, 10.59px); }
    83.33% { transform: translate(22.50px, 11.15px); }
    87.5% { transform: translate(25.19px, 12.04px); }
    91.67% { transform: translate(27.26px, 13.20px); }
    95.83% { transform: translate(28.56px, 14.55px); }
    100% { transform: translate(29.00px, 16.00px); }
}
@media (prefers-reduced-motion: reduce) {
    .mx-orbit { transition-duration: 0s; }
    .mx-orbit-active { animation-duration: 0s; }
}

.mx-section { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0.25rem 0 0.6rem; }
.mx-bars .err-bar span { background: var(--primary); }
.mx-bars-sm { height: 44px; padding-top: 0.2rem; }
.mx-mini { display: grid; gap: 0.9rem; }
.mx-mini-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; font-size: 0.9rem; margin-bottom: 0.15rem; }
.mx-mini-head b, .mx-rank-text b { font-variant-numeric: tabular-nums; }
.mx-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.mx-rank-text { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.88rem; }
.mx-rank-text code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mx-rank-bar { height: 6px; background: var(--surface-2); border-radius: 999px; margin-top: 0.25rem; overflow: hidden; }
.mx-rank-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.mx-table td.number, .mx-table th.number, .mx-endpoints td.number, .mx-endpoints th.number, .mx-months td.number, .mx-months th.number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mx-table th .tip, .mx-table th [data-tip] { vertical-align: middle; }
.mx-up { color: var(--ok); font-weight: 600; }
.mx-down { color: var(--danger); font-weight: 600; }
.mx-months th[scope="row"] { text-align: left; font-weight: 600; white-space: nowrap; }
.mx-scroll { overflow-x: auto; }
.mx-errors { list-style: none; margin: 0.9rem 0 0; padding: 0; display: grid; gap: 0.65rem; }
.mx-errors li { display: grid; gap: 0.15rem; font-size: 0.88rem; min-width: 0; }
.mx-errors a { overflow-wrap: anywhere; }
.mx-errors code, .mx-endpoints code { font-size: 0.8rem; overflow-wrap: anywhere; }
.mx-endpoints .pill { margin-left: 0.35rem; }
.mx-foot { font-size: 0.8rem; margin: -0.5rem 0 0; }

@media (max-width: 720px) {
    /* The months table stays a table and scrolls sideways */
    .mx-scroll { overflow-x: auto !important; }
    .mx-months { display: table; width: max-content; min-width: 100%; }
    .mx-months thead { display: table-header-group; }
    .mx-months tbody { display: table-row-group; }
    .mx-months tr { display: table-row; border: none; padding: 0; margin: 0; }
    .mx-months th, .mx-months td { display: table-cell; width: auto; padding: 0.35rem 0.55rem; border-bottom: 1px solid var(--border); }
    .mx-months td.number { text-align: right; }
}

/* ---------- Marketplace: product cards, What's new, order page ---------- */
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.mp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.mp-card-soon { opacity: 0.8; }
.mp-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.mp-card-head h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.mp-card p { margin: 0; }
.mp-card-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.mp-price { font-size: 0.95rem; }
.mp-pill { font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.mp-pill-soon { background: var(--surface-2); color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.mp-pill-on { background: rgba(15, 143, 134, 0.12); color: var(--primary); }
.mp-type { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--primary); margin-right: 0.4rem; }
.mp-new { border-left: 4px solid var(--primary); }
.mp-new .dash-head p { margin: 0.25rem 0 0; }
.mp-new-list { list-style: none; margin: 0; padding: 0; }
.mp-new-list li { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.6rem 0; border-top: 1px solid var(--border); }
.mp-new-actions { display: flex; gap: 0.5rem; align-items: center; }
.mp-new-actions a.primary-button { text-decoration: none; }
.mp-order { max-width: 640px; }
.mp-order h2 { margin: 0.25rem 0 0.75rem; }
.mp-order-prices { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.25rem; margin: 1rem 0; }
.mp-order-prices dt { color: var(--muted); }
.mp-order-prices dd { margin: 0; }
/* AI connector page and platform Marketplace catalog */
.ai-empty { text-align: center; padding: 2rem 1.5rem; max-width: 640px; }
.ai-empty-icon { width: 2rem; height: 2rem; color: var(--primary); }
.ai-empty h2 { margin: 0.5rem 0; }
.ai-empty .form-hint { margin: 1.25rem 0 0.5rem; }
.ai-usage { margin: 0 0 0.5rem; font-size: 1.1rem; }
.ai-meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 0.75rem; }
.ai-meter span { display: block; height: 100%; background: var(--primary); }
.ai-meter span.ai-meter-high { background: var(--danger); }
.ai-consent { font-size: 0.88rem; line-height: 1.5; background: var(--surface-2); padding: 0.6rem 0.75rem; border-radius: 6px; margin: 0 0 0.75rem; }
.pm-table td { vertical-align: middle; }
.pm-table select, .pm-price { padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font: inherit; color: var(--text); }
.pm-price { width: 7.5rem; }
.ai-steps { list-style: none; counter-reset: ai-step; margin: 0 0 1rem; padding: 0; font-size: 0.9rem; }
.ai-steps li { counter-increment: ai-step; display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0; }
.ai-steps li::before { content: counter(ai-step); display: inline-flex; align-items: center; justify-content: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; font-size: 0.75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.ai-steps li.ai-step-done::before { content: "\2713"; background: var(--ok-soft); color: var(--ok); }
.ai-steps li.ai-step-todo { color: var(--muted); }
.ai-warn { background: var(--warn-soft); color: #7a5d00; margin: 0 0 0.75rem; }
/* Ticket recommendations */
.rc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.rc-head h2 { margin: 0; }
.rc-head .primary-button { display: inline-flex; align-items: center; gap: 0.4rem; }
.rc-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.6rem; }
.rc-item { border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: 8px; padding: 0.7rem 0.9rem; background: var(--surface); }
.rc-item.rc-worked { border-left-color: var(--ok); }
.rc-item.rc-failed { border-left-color: var(--danger); }
.rc-item.rc-discarded { opacity: 0.7; }
.rc-line { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.rc-num { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6rem; height: 1.6rem; border-radius: 999px; background: var(--surface-2); font-weight: 700; font-size: 0.8rem; }
.rc-title { flex: 1 1 auto; min-width: 12rem; }
.rc-src-ai { background: var(--notice-bg); color: #2f5bd3; }
.rc-src-library { background: var(--ok-soft); color: var(--ok); }
.rc-details, .rc-notes { margin: 0.45rem 0 0; }
.rc-meta { margin: 0.35rem 0 0; font-size: 0.8rem; }
.rc-actions { margin-top: 0.5rem; }
.rc-sub { font-size: 1rem; margin: 1.1rem 0 0.5rem; display: flex; align-items: center; gap: 0.35rem; }
.rc-lib { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.rc-lib li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 1px dashed var(--border); border-radius: 8px; padding: 0.5rem 0.75rem; }
.check-inline { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.rc-ai { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.1rem; padding: 0.75rem 0.9rem; border-radius: 8px; background: var(--notice-bg); }
.rc-ai .rc-sub { margin-top: 0; }
.rc-ai .primary-button { display: inline-flex; align-items: center; gap: 0.4rem; }

/* ---------- Notes ---------- */
.field-inline { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.field-inline select { padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font: inherit; color: var(--text); max-width: 16rem; }
.note-tags-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.85rem; font-size: 0.88rem; }
.note-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.35rem 0; }
.note-tag { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.6rem; font-size: 0.82rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.note-tag:hover { border-color: var(--primary); color: var(--text); }
.note-tag-on, .note-tag-on:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }
.note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.note-item { border: 1px solid var(--border); border-radius: 8px; padding: 0.85rem 1rem; background: var(--surface); min-width: 0; }
.note-pinned { border-left: 3px solid var(--primary); background: var(--primary-soft); }
.note-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.note-title { font-size: 1rem; overflow-wrap: anywhere; }
.note-pin { display: inline-flex; color: var(--primary-dark); }
.note-line .icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.note-pin .icon { width: 1.05rem; height: 1.05rem; }
.note-line .pill { display: inline-flex; align-items: center; gap: 0.3rem; }
.note-line .pill .icon { width: 0.9rem; height: 0.9rem; }
.notes-panel .field-label { display: inline-flex; align-items: center; gap: 0.3rem; }
.note-link { text-decoration: none; }
.note-body { margin: 0.45rem 0 0.2rem; overflow-wrap: anywhere; }
.note-body-clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.note-more { font-size: 0.85rem; }
.note-meta { margin: 0.35rem 0 0; font-size: 0.84rem; }
.note-actions { margin-top: 0.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.note-history { margin: 0.75rem 0 0; padding: 0.5rem 0 0 1.25rem; border-top: 1px dashed var(--border); }
.note-history li { margin-bottom: 0.75rem; }
.note-history .note-title { margin: 0.2rem 0 0; font-weight: 600; }
.note-editor { border: 1px solid var(--border); border-radius: 8px; padding: 0.85rem 1rem; margin-bottom: 1rem; background: var(--surface-2); }
.note-item .note-editor { margin: 0; border: 0; padding: 0; background: transparent; }
.note-editor .form-h3 { margin-top: 0; }

/* ---------- My tasks ---------- */
.task-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.task-kpi { font: inherit; text-align: left; cursor: pointer; }
.task-kpi-on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.task-kpi-late .kpi-value { color: var(--danger); }
.task-row { display: flex; align-items: flex-start; gap: 0.75rem; }
.task-check { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; flex: none; accent-color: var(--primary); cursor: pointer; }
.task-main { flex: 1 1 auto; min-width: 0; }
.task-links { margin-top: 0.35rem; }
.task-number { font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.task-late { border-left: 3px solid var(--danger); }
.task-done .task-title { color: var(--muted); text-decoration: line-through; }
.task-focus { box-shadow: 0 0 0 2px var(--primary); }
.task-notes-clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.task-editor .form-wide { grid-column: 1 / -1; }
.home-tasks { list-style: none; margin: 0; padding: 0; }
.home-tasks li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.home-tasks li:last-child { border-bottom: none; }
.home-tasks a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.home-tasks a:hover { text-decoration: underline; }
.home-tasks-more { margin: 0.5rem 0 0; font-size: 0.88rem; }
@media (max-width: 640px) {
    .task-kpis { gap: 0.5rem; }
    .task-kpi { padding: 0.7rem 0.8rem; }
}

/* Process tickets and ticket templates */
.pill-proc { background: var(--primary-soft); color: var(--primary-dark); }
.nt-proc { font-size: 0.8rem; color: var(--muted); margin-left: 0.35rem; white-space: nowrap; }
.nt-kind { margin-bottom: 0.6rem; }
.nt-help { font-size: 0.85rem; margin: 0.3rem 0 0.8rem; }
.notice-warn { background: var(--warn-soft); color: #6b5100; border-left: 4px solid var(--warn); padding: 0.6rem 0.8rem; border-radius: 6px; margin: 0 0 0.8rem; }
.tt-row { border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 0.9rem 0.5rem; margin: 0 0 0.6rem; background: var(--surface); }
.tt-row .form-grid { margin-bottom: 0.3rem; }
.tt-row-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.2rem; }
.tt-move { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; }
.tt-actions { white-space: nowrap; }
.tt-actions .link-button + .link-button { margin-left: 0.7rem; }
.danger-link, .link-button.danger-link { color: var(--danger); }
.pt-progress { display: flex; align-items: center; gap: 0.6rem; min-width: 12rem; }
.pt-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; min-width: 6rem; }
.pt-bar > span { display: block; height: 100%; background: var(--ok); border-radius: 999px; transition: width 0.2s; }
.pt-values { margin: 0 0 1rem; }
.rc-item.pt-done { border-left-color: var(--ok); }
.rc-item.pt-notapplicable { opacity: 0.75; border-left-color: var(--muted); }

/* IT policies */
.policy-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.25rem; align-items: start; }
.policy-main, .policy-side { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.policy-main > .dash-card, .policy-side > .dash-card { margin: 0; }
.policy-side h2 { font-size: 1rem; margin: 0 0 0.6rem; }
.policy-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.8rem; margin: 0; font-size: 0.9rem; }
.policy-facts dt { color: var(--muted); font-weight: 600; }
.policy-facts dd { margin: 0; overflow-wrap: anywhere; }
.policy-review-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; background: var(--warn-soft); border-left: 4px solid var(--warn); border-radius: 8px; padding: 0.8rem 1rem; margin: 0 0 1.25rem; }
.policy-review-banner p { margin: 0.25rem 0 0; }
.policy-review-late { background: var(--danger-bg); border-left-color: var(--danger); }
.policy-editor { margin: 0 0 0.8rem; }
.policy-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0 0 0.5rem; }
.policy-toolbar .seg { margin: 0 0.6rem 0 0; }
.policy-toolbar .small { min-width: 2.2rem; padding: 0.3rem 0.55rem; }
.policy-text { width: 100%; min-height: 18rem; padding: 0.7rem 0.8rem; border: 1px solid var(--border); border-radius: 6px; font: 0.9rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); background: var(--surface); resize: vertical; }
.policy-doc { line-height: 1.55; overflow-wrap: anywhere; }
.policy-doc h2 { font-size: 1.3rem; margin: 0.4rem 0 0.7rem; }
.policy-doc h3 { font-size: 1.05rem; margin: 1.2rem 0 0.4rem; }
.policy-doc h4 { font-size: 0.95rem; margin: 1rem 0 0.3rem; }
.policy-doc p, .policy-doc ul, .policy-doc ol { margin: 0 0 0.7rem; }
.policy-doc ul, .policy-doc ol { padding-left: 1.4rem; }
.policy-doc hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.policy-doc code { background: var(--surface-2); padding: 0 0.25rem; border-radius: 4px; }
.policy-table { overflow-x: auto; margin: 0 0 0.8rem; }
.policy-table table { border-collapse: collapse; min-width: 50%; font-size: 0.9rem; }
.policy-table th, .policy-table td { border: 1px solid var(--border); padding: 0.35rem 0.6rem; text-align: left; vertical-align: top; }
.policy-table th { background: var(--surface-2); }
.policy-preview { border: 1px solid var(--border); border-radius: 6px; padding: 0.9rem 1.1rem; min-height: 10rem; background: var(--surface); }
.policy-doc-scroll { max-height: 60vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 0.8rem 1rem; margin: 0 0 0.8rem; }
.modal-box.modal-wide { max-width: 52rem; }
.policy-diff { border: 1px solid var(--border); border-radius: 6px; max-height: 32rem; overflow: auto; font: 0.85rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.diff-line { white-space: pre-wrap; overflow-wrap: anywhere; padding: 0 0.6rem; min-height: 1.2em; }
.diff-mark { display: inline-block; width: 1.2rem; color: var(--muted); user-select: none; }
.diff-added { background: var(--ok-soft); }
.diff-removed { background: var(--danger-bg); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, 0.25); }
.policy-template-list { list-style: none; margin: 0; padding: 0; }
.policy-template-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--border); }
.policy-template-item:last-child { border-bottom: none; }
.policy-template-item p { margin: 0.25rem 0 0; }
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; margin: 0 0 1rem; padding: 0 0 0.7rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.wizard-steps .link-button { color: var(--muted); text-decoration: none; }
.wizard-steps .link-button:disabled { cursor: default; opacity: 0.7; }
.wizard-steps .wizard-done .link-button { color: var(--primary-dark); }
.wizard-steps .wizard-on .link-button { color: var(--text); font-weight: 700; }
@media (max-width: 1000px) {
    .policy-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .policy-template-item { flex-direction: column; align-items: flex-start; }
}

/* Policy print page (no menu) */
.print-page { max-width: 52rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; background: #fff; color: #111827; }
.print-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; margin: 0 0 1.5rem; }
.print-head { display: flex; align-items: center; gap: 1rem; border-bottom: 2px solid #1d2330; padding: 0 0 0.8rem; margin: 0 0 1rem; }
.print-logo { max-height: 64px; max-width: 160px; object-fit: contain; }
.print-company { font-size: 0.9rem; color: #4b5563; font-weight: 600; }
.print-title { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.print-meta { font-size: 0.85rem; color: #4b5563; margin-top: 0.2rem; }
.print-facts { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin: 0 0 1.2rem; }
.print-facts th, .print-facts td { border: 1px solid #d1d5db; padding: 0.3rem 0.5rem; text-align: left; }
.print-facts th { background: #f3f4f6; width: 18%; white-space: nowrap; }
.print-warning { border: 1px solid #b45309; color: #92400e; padding: 0.4rem 0.7rem; border-radius: 4px; font-weight: 600; }
.print-history { margin-top: 2rem; break-before: page; }
.print-history h2 { font-size: 1.15rem; }
.print-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.print-table th, .print-table td { border: 1px solid #d1d5db; padding: 0.3rem 0.45rem; text-align: left; vertical-align: top; }
.print-table th { background: #f3f4f6; }
.print-foot { margin-top: 2rem; font-size: 0.75rem; color: #6b7280; border-top: 1px solid #d1d5db; padding-top: 0.5rem; }
@media print {
    .print-tools { display: none; }
    .print-page { padding: 0; max-width: none; }
    .print-doc .policy-doc h3 { break-after: avoid; }
    .print-table tr, .policy-table tr { break-inside: avoid; }
}
.policy-history td { vertical-align: top; }
.policy-history .cell-two span:first-child { overflow-wrap: anywhere; }
.policy-history td:first-child .cell-two { min-width: 4rem; }
.policy-history .cell-two .link-button { align-self: flex-start; text-align: left; padding: 0; }
.policy-history td:nth-child(3) { min-width: 10rem; max-width: 18rem; overflow-wrap: anywhere; }

/* Account security (two-step verification and recovery codes) */
.notice-danger { background: #fef3f2; color: #912018; border-left: 4px solid var(--danger); padding: 0.6rem 0.8rem; border-radius: 6px; margin: 0 0 0.8rem; }
.auth-card .notice-danger, .auth-card .notice-warn { margin: 1rem 0 0; }
.sec-card { max-width: 860px; }
.sec-card h2 .pill { margin-left: 0.4rem; vertical-align: middle; }
.sec-block { border-top: 1px solid var(--border); padding-top: 0.9rem; margin-top: 0.9rem; }
.sec-block:first-of-type { border-top: 0; padding-top: 0; margin-top: 0.4rem; }
.sec-block h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.sec-block label, .sec-card > label { display: block; font-weight: 600; margin: 0.6rem 0 0.25rem; }
.sec-code-input { max-width: 12rem; letter-spacing: 0.08em; }
.sec-block input[type=password] { max-width: 20rem; }
.sec-codes { background: var(--surface-2, #f6f8fa); border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem 0.8rem 0.8rem 2rem; max-width: 26rem; }
.sec-codes li { margin: 0.15rem 0; }
.sec-codes code { font-size: 1rem; letter-spacing: 0.06em; }
.sec-qr { margin: 0.5rem 0; }
.sec-steps { margin: 0 0 0.6rem; padding-left: 1.3rem; }
.sec-steps li { margin: 0.3rem 0; }
.sec-form-error { margin-top: 0.6rem; max-width: 34rem; }

/* Resolve form: minimum explanation, AI draft and AI mark */
.field-hint { margin: -0.35rem 0 0.6rem; font-size: 0.82rem; color: var(--muted); }
.field-hint.hint-ok { color: #166534; }
.notice-info { background: var(--notice-bg); color: #1e3a8a; border-left: 4px solid #2f5bd3; padding: 0.6rem 0.8rem; border-radius: 6px; margin: 0 0 0.8rem; }
.ai-button { display: inline-flex; align-items: center; gap: 0.4rem; }
.ai-mark { display: inline-block; margin-left: 0.4rem; font-size: 0.78rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; }
.ai-unavailable { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.ai-unavailable-compact { margin: 0 0 0.75rem; font-size: 0.88rem; }

/* Library: Resolved tickets tab */
.lib-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; margin: 0 0 1rem; }
.lib-filters .field { margin: 0; min-width: 10rem; }
.lib-filters .field select, .lib-filters .field input { height: 2.4rem; box-sizing: border-box; padding: 0 0.6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font: inherit; font-size: 0.9rem; color: var(--text); }
.lib-search { flex: 1 1 16rem; height: 2.4rem; box-sizing: border-box; }
.lib-filter-actions { display: flex; align-items: center; gap: 0.5rem; }
.lib-steps { margin-top: 0.5rem; }
.lib-steps summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.lib-steps ol { margin: 0.5rem 0 0; padding-left: 1.25rem; display: grid; gap: 0.45rem; }
.lib-steps .pill { margin-right: 0.35rem; }
