:root {
  --bg: #f6f7f9; --panel: #fff; --ink: #1d2330; --muted: #667085; --line: #e4e7ec;
  --accent: #2456d6; --accent-bg: #eef3fe; --ok: #137a43; --ok-bg: #e7f6ee; --bad: #b42318; --bad-bg: #fdecea;
  --warn: #8a5300; --warn-bg: #fff4e0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
header { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 28px; background: var(--ink); color: #fff; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 17px; letter-spacing: .3px; }
.brand span { font-weight: 400; opacity: .7; margin-left: 6px; }
.scope-pickers { display: flex; gap: 12px; align-items: center; }
.scope-label { display: flex; gap: 8px; align-items: center; opacity: .9; }
header select { background: #2c3445; color: #fff; border: 0; padding: 6px 10px; border-radius: 6px; font: inherit; }
nav { display: flex; gap: 2px; padding: 0 28px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
nav a { border: 0; background: none; padding: 14px 12px 12px; font: inherit; color: var(--muted); text-decoration: none; display: inline-block;
  cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
nav a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
main { padding: 24px 28px 60px; max-width: 1400px; }
.tab { display: none; } .tab.active { display: block; }
h2 { font-size: 15px; margin: 28px 0 8px; } .tab > h2:first-child, .section-head h2 { margin-top: 0; }
h3 { font-size: 15px; margin: 0 0 12px; } h4 { font-size: 13px; margin: 18px 0 8px; }
.hint { color: var(--muted); margin: 0 0 14px; line-height: 1.45; }
small { color: var(--muted); font-weight: 400; }
code { background: #eef0f3; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.tile .n { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); margin-top: 2px; }

table { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #fafbfc; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tr:last-child td { border-bottom: 0; }
td.empty { color: var(--muted); text-align: center; padding: 20px; }
td:first-child { white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.accept, .pill.matched { background: var(--ok-bg); color: var(--ok); }
.pill.reject, .pill.error { background: var(--bad-bg); color: var(--bad); }
.pill.off { background: #eef0f3; color: var(--muted); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; background: #eef0f3; color: #344054; white-space: nowrap; }
.chip.trust { background: var(--accent-bg); color: var(--accent); }
.chip.enforced { background: var(--warn-bg); color: var(--warn); }

form.inline { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
input, select { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--accent-bg); border-color: var(--accent); }
.btn { font: inherit; background: var(--accent); color: #fff; border: 0; padding: 7px 14px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.btn.ghost { background: none; color: var(--accent); border: 1px solid var(--line); }
.btn.link { background: none; color: var(--accent); padding: 0; border: 0; cursor: pointer; font: inherit; }
.btn.danger { background: none; color: var(--bad); padding: 0; border: 0; cursor: pointer; font: inherit; }
.btn.danger-solid { background: var(--bad); }
.btn.icon { background: none; border: 1px solid var(--line); color: var(--muted); padding: 2px 7px; border-radius: 5px; cursor: pointer; }
.btn.icon:disabled { opacity: .35; cursor: default; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
@media (max-width: 1050px) { .split { grid-template-columns: 1fr; } }
.split-side { position: sticky; top: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.section-head .hint { margin: 4px 0 0; max-width: 640px; }

.editor { margin-bottom: 18px; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.editor label, #simulator label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
label.check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; margin-top: 12px; }
label.check small { margin-left: 4px; }
.inline-check { margin-top: 0 !important; }
label.radio { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; }
.cond-head { display: flex; align-items: baseline; gap: 10px; } .cond-head h4 { margin-bottom: 8px; }
.cond-row { display: grid; grid-template-columns: 220px 170px minmax(0, 1fr) 30px; gap: 8px; margin-bottom: 8px; align-items: start; }
.cond-row .value-wrap { display: flex; flex-direction: column; gap: 3px; }
.cond-row .groups-box { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; }
.cond-row .groups-box label { flex-direction: row; font-weight: 500; gap: 5px; align-items: center; }
.cond-and { color: var(--muted); font-size: 12px; font-weight: 600; margin: -2px 0 6px 4px; }
.then-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.editor-actions { display: flex; gap: 8px; margin-top: 18px; align-items: center; }
.spacer { flex: 1; }

.band { margin-bottom: 18px; }
.band-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.band-num { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.band-head b { font-size: 14px; } .band-head small { margin-left: 2px; }
.band-sub { font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 6px 2px; text-transform: uppercase; letter-spacing: .4px; }
.policy { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.policy.disabled { opacity: .55; }
.policy .prio { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; text-align: center; }
.policy .title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.policy .logic { margin-top: 5px; color: #344054; line-height: 1.6; }
.policy .kw { font-weight: 700; color: var(--muted); font-size: 11px; letter-spacing: .5px; margin-right: 4px; }
.policy .then-assign { color: var(--ok); font-weight: 600; } .policy .then-reject { color: var(--bad); font-weight: 600; }
.policy .ctrls { display: flex; gap: 6px; align-items: center; }
.band-end { text-align: center; color: var(--muted); padding: 10px; border: 1px dashed var(--line); border-radius: 10px; }

#simulator { display: flex; flex-direction: column; gap: 10px; }
#simulator h3 { margin: 0; } #simulator .hint { margin: -6px 0 0; }
.sim-verdict { margin-top: 6px; padding: 12px; border-radius: 8px; font-weight: 600; }
.sim-verdict.accept { background: var(--ok-bg); color: var(--ok); } .sim-verdict.reject { background: var(--bad-bg); color: var(--bad); }
.sim-verdict small { display: block; color: inherit; opacity: .85; font-weight: 400; margin-top: 3px; }
.trace { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; }
.trace li { padding: 7px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.trace li.skipped { opacity: .45; }
.trace .t-tier { grid-column: 1 / -1; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.trace .t-detail { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }

#vlan-matrix input { width: 80px; padding: 5px 8px; }
#vlan-matrix input.overridden { border-color: var(--accent); background: var(--accent-bg); font-weight: 600; }

#toast { position: fixed; bottom: 20px; right: 20px; background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 420px; }
#toast.show { opacity: 1; } #toast.error { background: var(--bad); }
[hidden] { display: none !important; }
.editor label.radio { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; font-size: 14px; }

/* ---- Header user menu ---- */
.header-right { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.user-menu { display: flex; gap: 10px; align-items: center; padding-left: 16px; border-left: 1px solid #3a4356; }
.user-menu .who { opacity: .85; }
.user-menu button { background: none; border: 1px solid #4a5468; color: #fff; padding: 5px 10px; border-radius: 6px; font: inherit; cursor: pointer; }
.user-menu button:hover { background: #2c3445; }

/* ---- Sign-in page ---- */
body.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, #e3e9f8 0%, var(--bg) 60%); }
.login-shell { width: 100%; max-width: 440px; }
.login-brand { text-align: center; margin-bottom: 20px; }
.login-brand .brand { color: var(--ink); font-size: 22px; }
.login-brand p { color: var(--muted); margin: 6px 0 0; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; box-shadow: 0 12px 32px rgba(16, 24, 40, .08); }
.login-card h1 { font-size: 20px; margin: 0 0 18px; }
.login-alert { background: var(--bad-bg); color: var(--bad); border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; line-height: 1.4; }
.sso { display: grid; gap: 10px; }
.sso-btn { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; background: #fff; }
.sso-btn:hover { background: #fafbfc; border-color: #cfd4dc; }
.sso-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sso-btn.disabled { color: var(--muted); }
.sso-btn.disabled svg { filter: grayscale(1); opacity: .55; }
.sso-btn .soon { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-bg);
  padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 20px 0 16px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#login-form { display: grid; gap: 14px; }
#login-form label { display: grid; gap: 6px; font-weight: 500; }
#login-form input { padding: 10px 12px; font-size: 15px; }
.login-submit { padding: 11px 14px; font-size: 15px; font-weight: 600; margin-top: 4px; }
.login-submit:disabled { opacity: .7; cursor: progress; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

/* ---- Users & access, CloudNAC console ---- */
.access-block { margin-bottom: 32px; }
.notice { background: var(--accent-bg); border: 1px solid #cdd9f7; border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; line-height: 1.5; }
code.temp { font-size: 14px; padding: 2px 8px; background: #fff; border: 1px solid var(--line); }
.grant { margin: 2px 0; white-space: nowrap; }
.add-grant { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.add-grant select { padding: 3px 6px; font-size: 12.5px; }
.row-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.btn.danger-link { color: var(--bad); }
.pill.pending { background: var(--warn-bg); color: var(--warn); }
.readonly { color: var(--muted); font-style: italic; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin: 12px 0; }
.perm-grid fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 0; }
.perm-grid legend { font-weight: 600; font-size: 12px; color: var(--muted); padding: 0 4px; }
.perm-grid label { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; }
.perm-grid label.muted { color: var(--muted); }
.perm-list { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
details summary { cursor: pointer; color: var(--accent); }
.switch-row { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; max-width: 640px; }
.switch-row input { margin-top: 3px; width: 18px; height: 18px; }
.schools-row { display: grid; gap: 6px; margin: 10px 0; }
.schools-row textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.support-banner { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid #f1d9a6; padding: 10px 28px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.support-banner .btn { margin-left: auto; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 22px; width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(16, 24, 40, .35); }
dialog form { display: grid; gap: 12px; }
dialog label { display: grid; gap: 6px; font-weight: 500; }
dialog h3 { margin: 0; }
.editor-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; margin-bottom: 10px; }
.editor .perm-grid label { flex-direction: row; font-weight: 400; font-size: 13.5px; gap: 8px; }
.editor .schools-row { font-weight: 600; font-size: 13px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
.login-note { color: var(--muted); line-height: 1.5; margin: 0; }
#change-form { display: grid; gap: 14px; }
#change-form label { display: grid; gap: 6px; font-weight: 500; }
#change-form input { padding: 10px 12px; font-size: 15px; }
#console-tenants > h3 { margin: 28px 0 10px; }

/* ---- Network tab ---- */
.code-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
code.temp.big { font-size: 17px; letter-spacing: 1px; padding: 4px 10px; }
pre.cmd { background: #1d2330; color: #e6e9ef; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; margin: 8px 0; }
#enrol-panel p { margin: 6px 0; }
.own-secret { align-self: center; }
.own-secret summary { font-size: 13px; }
.own-secret input { margin-top: 6px; width: 220px; }
.secret { letter-spacing: .5px; }

/* ---- Nested device groups ---- */
.tree { display: inline-block; padding-left: calc(var(--depth, 0) * 18px); }
small.tree { color: var(--muted); }
.inline-label { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
#groups-table select { max-width: 260px; }

#direct-csr { width: 100%; font-size: 12.5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; margin-top: 6px; }
#direct-panel p { margin: 6px 0; }

.row-btns { display: flex; gap: 14px; align-items: center; justify-content: flex-end; white-space: nowrap; }
#edit-fields { display: grid; gap: 12px; }
#edit-note { margin: 0; }

/* ---- Breadcrumb ---- */
.crumbs { padding: 10px 28px 0; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { opacity: .6; }
.crumbs .here { color: var(--ink); font-weight: 600; }
.crumbs:empty { display: none; }
main { padding-top: 14px; }

/* ---- Monitor mode ---- */
.pill.monitor { background: #efe7ff; color: #5b3cc4; }
.monitor-banner { margin: 10px 28px 0; padding: 9px 14px; border-radius: 8px; background: #f4efff; color: #4a2fa8;
  border: 1px solid #ddd0fb; font-size: 13.5px; line-height: 1.45; }
.monitor-banner a { color: #4a2fa8; font-weight: 600; }
a.tile { text-decoration: none; color: inherit; }
.tile.monitor-tile { border-color: #ddd0fb; background: #faf7ff; }
.tile.monitor-tile .n { color: #5b3cc4; }
.view-switch { display: flex; gap: 6px; margin-bottom: 16px; }
.view-switch a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; background: var(--panel); }
.view-switch a.active { background: var(--accent-bg); color: var(--accent); border-color: #cdd9f7; font-weight: 600; }
#would-days { padding: 2px 6px; font-size: 13px; }
.sim-monitor { background: #f4efff; color: #4a2fa8; border-radius: 8px; padding: 8px 10px; margin: 10px 0 0; font-size: 13px; }
