/* Multi Services console
   Navy rail, gold pads, cool paper work area. */

:root {
    --board: #193351;
    --board-deep: #11243b;
    --board-edge: #2d4d73;
    --pad: #d9ae45;
    --paper: #eef1f5;
    --surface: #fbfcfd;
    --surface-sunk: #f3f5f8;
    --ink: #172433;
    --muted: #566679;
    --line: #d3dae3;
    --primary: #193351;
    --primary-hover: #11243b;
    --focus: #2563b0;
    --link: #1f5aa6;
    --ok: #1f6b49;
    --ok-bg: #dff0e7;
    --warn: #8a5a00;
    --warn-bg: #f7e9c6;
    --bad: #a62f27;
    --bad-bg: #f6dcd8;
    --sidebar: 248px;
    --font: "Chivo", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "Chivo Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 15px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--link); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

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

.mono { font-family: var(--font-mono); font-size: 13px; }
.muted { color: var(--muted); }

/* ---------- Buttons and fields ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { background: var(--surface-sunk); border-color: #b8c4d2; }
.btn-quiet { background: transparent; color: var(--muted); }
.btn-quiet:hover { background: rgba(23, 36, 51, .07); color: var(--ink); }
.btn-small { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #8c2620; }
.btn-bar { background: transparent; border-color: #3f628a; color: #dbe6f2; }
.btn-bar:hover { background: var(--board-deep); border-color: #5f86b3; color: #fff; }

.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field label .muted { margin-left: 4px; font-size: 13px; font-weight: 400; }
.input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}
.input:hover { border-color: #b8c4d2; }
.input:focus-visible { outline-offset: 0; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(37, 99, 176, .22); outline: 1px solid var(--focus); }
.input[aria-invalid="true"] { border-color: var(--bad); }
/* Own chevron instead of the browser's, so there is room between it and the edge of the field */
select.input {
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23566679' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    cursor: pointer;
}
select.select-compact { padding-right: 32px; background-position: right 10px center; }

.field-error { color: var(--bad); font-size: 13px; }
.field-hint { color: var(--muted); font-size: 13px; }

input[type="file"].input {
    height: auto;
    padding: 8px;
    cursor: pointer;
}
input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-sunk);
    font: 500 13px var(--font);
    cursor: pointer;
}

/* ---------- Notices ---------- */

.notice {
    padding: 12px 16px;
    border-left: 3px solid;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
}
.notice-ok { background: var(--ok-bg); border-color: var(--ok); color: #164d35; }
.notice-warn { background: var(--warn-bg); border-color: var(--warn); color: #5f3e00; }
.notice-error { background: var(--bad-bg); border-color: var(--bad); color: #7b211b; }

/* ---------- App shell ---------- */

body.app {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 24px 0;
    background: var(--board);
    color: #c8d6e6;
    overflow: hidden;
}

/* The logo and the nav icons start at the same x (16px), and the brand name and the
   nav labels start at the same x (58px), with no extra indentation for either. */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px 28px;
    color: #fff;
    text-decoration: none;
}
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
.brand-sub { display: block; color: #8fa8c4; font-size: 13px; font-weight: 400; letter-spacing: 0; }

.nav { display: grid; gap: 2px; padding: 0 8px; }
.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 10px 8px;
    border-radius: 6px;
    color: #c8d6e6;
    font-weight: 500;
    text-decoration: none;
}
.nav-gap { height: 10px; margin: 6px 8px; border-top: 1px solid var(--board-edge); }
.nav-link svg { width: 20px; height: 20px; flex: none; opacity: .85; }
.nav-link:hover { background: var(--board-deep); color: #fff; }
.nav-link[aria-current="page"] { background: var(--board-deep); color: #fff; }
.nav-link[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--pad);
}
.sidebar :focus-visible { outline-color: var(--pad); }

.sidebar-art {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 220px;
    pointer-events: none;
    opacity: .5;
}

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 68px;
    padding: 10px 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.icon-btn.menu-btn { display: none; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.topbar-title p { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-menu { position: relative; }
.user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px 5px 6px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}
.user-trigger:hover, .user-trigger[aria-expanded="true"] { background: var(--surface-sunk); border-color: var(--line); }
.user-caret { width: 16px; height: 16px; flex: none; color: var(--muted); transition: transform .15s ease; }
.user-trigger[aria-expanded="true"] .user-caret { transform: rotate(180deg); }
.user-chip {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 50%;
    background: var(--board);
    color: var(--pad);
    font-weight: 700;
    font-size: 14px;
}
.user-name { font-weight: 500; font-size: 14px; line-height: 1.2; }
.user-name small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }

.user-menu-list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 40;
    min-width: 210px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(17, 36, 59, .18);
}
.user-menu-list form { margin: 0; }
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.user-menu-item svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.user-menu-item:hover, .user-menu-item:focus-visible { background: var(--surface-sunk); }

.content { display: grid; gap: 16px; align-content: start; padding: 24px 32px 48px; }

.scrim { display: none; }

/* ---------- Toolbar ---------- */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.toolbar-grow { flex: 1; }
.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 36px; }
.toolbar form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 auto; }
.select { width: auto; min-width: 150px; }

/* ---------- Tables ---------- */

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; }
th {
    padding: 11px 16px;
    background: var(--surface-sunk);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
}
td { padding: 12px 16px; border-bottom: 1px solid #e3e8ef; vertical-align: middle; font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f3f6fa; }
.col-right { text-align: right; }
.nowrap { white-space: nowrap; }

.col-check { width: 44px; padding-right: 0; }
.col-actions { width: 56px; padding-left: 0; text-align: right; }
.col-actions-2 { width: 96px; white-space: nowrap; }
.col-actions-2 .icon-btn { display: inline-grid; vertical-align: middle; }
.application-name { font-weight: 500; }
.check { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
tbody tr.is-selected td, tbody tr.is-selected:hover td { background: #e3ecf7; }

.serial-cell { white-space: nowrap; font-family: var(--font-mono); font-size: 14px; font-weight: 500; letter-spacing: .01em; }

tr[data-href] { cursor: pointer; }
.row-link { color: var(--ink); font-weight: 500; text-decoration: none; }
.row-link:hover { color: var(--link); text-decoration: underline; }

.endpoint { display: flex; align-items: baseline; gap: 8px; }
.method { color: var(--muted); font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.source { white-space: nowrap; }
.source small { display: block; color: var(--muted); font-size: 12px; font-family: var(--font-mono); }

.tag {
    display: inline-block;
    margin-right: 8px;
    padding: 1px 7px;
    border-radius: 4px;
    background: #e3ecf7;
    color: var(--board);
    font-size: 12px;
    font-weight: 500;
}

.preview {
    max-width: 210px;
    overflow: hidden;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-wide { max-width: 440px; }

.pill {
    display: inline-block;
    min-width: 44px;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }

.empty {
    display: grid;
    justify-items: start;
    gap: 12px;
    padding: 40px 24px;
    background: var(--surface);
    border: 1px dashed #b8c4d2;
    border-radius: 8px;
}
.empty h2 { font-size: 17px; font-weight: 700; }
.empty p { max-width: 52ch; color: var(--muted); }
.empty .actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Selection bar ---------- */

.selection-bar {
    position: fixed;
    bottom: 24px;
    left: calc(var(--sidebar) + (100vw - var(--sidebar)) / 2);
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100vw - 32px);
    padding: 10px 10px 10px 20px;
    border-radius: 10px;
    background: var(--board);
    color: #fff;
    box-shadow: 0 12px 32px rgba(17, 36, 59, .35);
    transform: translateX(-50%);
    animation: bar-in .18s ease-out;
}
.selection-bar :focus-visible { outline-color: var(--pad); }
.selection-count { margin-right: 12px; font-weight: 500; white-space: nowrap; }
.has-selection .content { padding-bottom: 104px; }
@keyframes bar-in { from { opacity: 0; transform: translate(-50%, 12px); } }

.delete-list {
    max-height: 168px;
    margin: 0;
    padding: 10px 12px 10px 28px;
    overflow: auto;
    background: var(--surface-sunk);
    border: 1px solid var(--line);
    border-radius: 6px;
}
.delete-list:empty { display: none; }
.delete-list li + li { margin-top: 2px; }
.delete-list .more { color: var(--muted); font-family: var(--font); list-style: none; margin-left: -16px; }

/* ---------- Pagination ---------- */

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.pager-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.pager-summary { color: var(--muted); font-size: 13px; }
.per-page { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.select-compact { width: auto; height: 34px; padding: 0 8px; font-size: 14px; }
.pager-links { display: flex; flex-wrap: wrap; gap: 4px; }
.pager-links a, .pager-links span {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.pager-links a { color: var(--ink); background: var(--surface); border-color: var(--line); }
.pager-links a:hover { background: var(--surface-sunk); border-color: #b8c4d2; }
.pager-links [aria-current="page"] { background: var(--board); color: #fff; }
.pager-links .is-disabled, .pager-links .gap { color: #8997a8; }

/* ---------- Modal ---------- */

.modal {
    width: min(480px, calc(100% - 32px));
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 24px 60px rgba(17, 36, 59, .35);
}
.modal[open] { animation: modal-in .16s ease-out; }
.modal::backdrop { background: rgba(17, 36, 59, .55); }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }

.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; }
.modal-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.icon-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.icon-btn:hover { background: var(--surface-sunk); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn-danger:hover { background: var(--bad-bg); color: var(--bad); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tabs { display: flex; gap: 4px; margin: 0 24px; border-bottom: 1px solid var(--line); }
.tab {
    margin-bottom: -1px;
    padding: 8px 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { border-bottom-color: var(--primary); color: var(--ink); }

.modal-body { display: grid; gap: 16px; padding: 20px 24px 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.link-download { display: inline-flex; align-items: center; gap: 6px; width: fit-content; font-size: 14px; font-weight: 500; }
.link-download svg { width: 16px; height: 16px; flex: none; }

.format-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.format-list li + li { margin-top: 2px; }

/* ---------- Audit detail ---------- */

.back-link { display: inline-flex; align-items: center; gap: 6px; width: fit-content; font-size: 14px; font-weight: 500; text-decoration: none; }
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { text-decoration: underline; }

.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px 24px;
    margin: 0;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.facts .wide { grid-column: 1 / -1; }

.panes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pane { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pane-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 10px 16px;
    background: var(--surface-sunk);
    border-bottom: 1px solid var(--line);
}
.pane-head h2 { flex: 1 1 auto; font-size: 15px; font-weight: 700; }
.segmented { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.segmented button { height: 26px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--board); color: #fff; }

.code {
    margin: 0;
    max-height: 560px;
    padding: 16px;
    overflow: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.pane-note { padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--warn-bg); color: #5f3e00; font-size: 13px; }
.pane-empty { padding: 24px 16px; color: var(--muted); }
.tok-key { color: #1f4f8f; }
.tok-str { color: #8a4b12; }
.tok-num { color: #5a3fa0; }
.tok-kw { color: #a62f27; }

/* ---------- Sign in ---------- */

/* The two-tone split is painted on the page background too (same 1.1fr / 1fr ratio as the grid),
   so it still reaches the bottom of the window if a browser reports a shorter layout height */
html.guest-page { background: linear-gradient(to right, var(--board) 52.381%, var(--paper) 52.381%); }

/* Pinned to the window instead of sized with vh, so it always fills it, even after a resize */
body.guest {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    overflow: auto;
}

.login-board {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 48px;
    background: var(--board);
    color: #c8d6e6;
    overflow: hidden;
}
.login-board .brand { padding: 0; position: relative; z-index: 1; }
.login-statement {
    position: relative;
    z-index: 1;
    max-width: 30ch;
    background: var(--board);
    /* Soft halo so a trace passing behind the text never cuts through it */
    box-shadow: 0 0 24px 18px var(--board);
}
.login-statement h2 { color: #fff; font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.login-statement p { margin-top: 12px; color: #a6bbd3; font-size: 16px; }

.traces { position: absolute; inset: 0; width: 100%; height: 100%; }
.trace { fill: none; stroke: var(--pad); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; opacity: .6; }
.pad { fill: var(--board); stroke: var(--pad); stroke-width: 2.5; opacity: .85; }
.pad-hole { fill: var(--board-deep); }

@media (prefers-reduced-motion: no-preference) {
    .trace { stroke-dasharray: 1; stroke-dashoffset: 1; animation: trace-draw 1.8s cubic-bezier(.5, 0, .2, 1) forwards; }
    .pad, .pad-hole { opacity: 0; animation: pad-in .4s ease-out forwards; }
    .trace:nth-of-type(2) { animation-delay: .15s; }
    .trace:nth-of-type(3) { animation-delay: .3s; }
    .trace:nth-of-type(4) { animation-delay: .45s; }
    .trace:nth-of-type(5) { animation-delay: .6s; }
    .trace:nth-of-type(6) { animation-delay: .75s; }
    .trace:nth-of-type(7) { animation-delay: .9s; }
    .pad, .pad-hole { animation-delay: 1.5s; }
}
@keyframes trace-draw { to { stroke-dashoffset: 0; } }
@keyframes pad-in { to { opacity: .85; } }

.login-form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.login-form { display: grid; gap: 20px; width: min(360px, 100%); }
.login-form h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.login-form .lead { margin-top: 6px; color: var(--muted); }
.login-form .btn { height: 42px; width: 100%; }

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
    .col-preview { display: none; }
}

@media (max-width: 960px) {
    body.app { display: block; }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: var(--sidebar);
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar-open .sidebar { transform: none; }
    .sidebar-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(17, 36, 59, .5); }
    .sidebar-open { overflow: hidden; }

    .icon-btn.menu-btn { display: grid; }
    .selection-bar { left: 50%; }
    .topbar { padding: 10px 16px; }
    .content { padding: 20px 16px 40px; }
    .user-name, .user-caret { display: none; }
    .user-trigger { padding: 4px; }

    .panes { grid-template-columns: minmax(0, 1fr); }

    html.guest-page { background: var(--paper); }
    body.guest { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .login-board { padding: 24px; gap: 56px; }
    .login-statement h2 { font-size: 26px; }
    .traces { opacity: .5; }
}

@media (max-width: 760px) {
    .col-app, .col-customer { display: none; }
}

@media (max-width: 600px) {
    .col-date, .col-by { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar { transition: none; }
    .modal[open] { animation: none; }
    .selection-bar { animation: none; }
}

/* ---------- Admins and roles ---------- */

.chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: #e3ecf7;
    color: var(--board);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
.chip-strong { background: var(--board); color: #fff; }
.you { margin-left: 6px; font-size: 13px; font-weight: 400; }

.panel { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.role-form { display: grid; gap: 16px; max-width: 880px; }
.role-details { display: grid; gap: 16px; }

.perm-groups { display: grid; gap: 16px; }
.perm-group { min-width: 0; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.perm-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: var(--surface-sunk);
    border-bottom: 1px solid var(--line);
    border-radius: 8px 8px 0 0;
}
.perm-group-head h2 { font-size: 16px; font-weight: 700; }
.perm-all { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; cursor: pointer; }
.perm-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.perm { display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; cursor: pointer; }
.perm:hover { background: #f4f7fb; }
.perm .check { margin-top: 3px; }
.perm-label { display: block; font-size: 14px; font-weight: 500; }
.perm-description { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.perm input:disabled + span { opacity: .75; }
.perm input:disabled, .perm-all input:disabled { cursor: not-allowed; }

.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

/* ---------- No access ---------- */

body.message-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.message-card { display: grid; justify-items: start; gap: 12px; width: min(440px, 100%); padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.message-card .brand-mark { width: 40px; height: 40px; }
.message-card h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.message-card p { color: var(--muted); }
.message-actions { display: flex; align-items: center; gap: 8px; padding-top: 8px; }

@media (max-width: 760px) {
    .perm-list { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Change password, and ticking a choice ---------- */

.password-form { display: grid; gap: 16px; max-width: 480px; }

.check-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-weight: 400; }
.check-row .check { margin-top: 3px; }
.check-label { display: block; font-size: 14px; font-weight: 500; }
