/* Wuxla IT Service Desk — design system
   Brand: navy #063263, orange #EA6020, blue #0D73C8, tint #F4F7FA, typeface Carlito (as used in
   the company profile). */
@font-face { font-family: "Carlito"; src: url("/static/fonts/carlito-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Carlito"; src: url("/static/fonts/carlito-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Carlito"; src: url("/static/fonts/carlito-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --navy: #063263; --navy-deep: #04254b; --orange: #ea6020; --orange-dark: #c94d12; --blue: #0d73c8; --sky: #0688d3;
  --bg: #f4f7fa; --surface: #ffffff; --surface-2: #f4f7fa; --surface-3: #e9eef5; --border: #dfe6ef; --border-strong: #c9d3e0;
  --text: #0f2440; --heading: #063263; --muted: #5b6b82; --faint: #8a97a8;
  --accent: #063263; --accent-text: #ffffff; --link: #0d73c8; --focus: #0d73c8;
  --up: #12805c; --up-bg: #dff5ec; --down: #c5281c; --down-bg: #fde7e4;
  --warn: #a35a00; --warn-bg: #fdf0d5; --info: #0b5cab; --info-bg: #e1effc;
  --pause: #5b6b82; --pause-bg: #e9eef5; --orange-bg: #fdeadf;
  --side: #063263; --side-2: #04254b; --side-text: #c4d3e6; --side-active: rgba(255, 255, 255, .1);
  --c1: #0d73c8; --c2: #ea6020; --c3: #12805c; --c4: #7a4fd0;
  --shadow-sm: 0 1px 2px rgba(6, 50, 99, .06);
  --shadow: 0 1px 2px rgba(6, 50, 99, .05), 0 4px 14px rgba(6, 50, 99, .06);
  --shadow-lg: 0 18px 50px rgba(4, 37, 75, .22);
  --radius: 14px; --radius-sm: 9px;
  --font: "Carlito", Calibri, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #071526; --surface: #0d2038; --surface-2: #122945; --surface-3: #183355; --border: #1f3a5c; --border-strong: #2c4c74;
  --text: #e4ecf6; --heading: #ffffff; --muted: #9db0c8; --faint: #7187a3;
  --accent: #2f8fe6; --accent-text: #ffffff; --link: #6bb6f5; --focus: #6bb6f5;
  --up: #4fd3a3; --up-bg: #0f3a2f; --down: #ff8f84; --down-bg: #47201d;
  --warn: #f6c35b; --warn-bg: #45330f; --info: #8cc4f8; --info-bg: #123a63;
  --pause: #9db0c8; --pause-bg: #183355; --orange-bg: #4a2714; --orange: #ff7a3d;
  --side: #06182e; --side-2: #040f1e; --side-active: rgba(255, 255, 255, .08);
  --c1: #5aaef2; --c2: #ff8a4f; --c3: #4fd3a3; --c4: #b196f2;
  --shadow-sm: none; --shadow: 0 1px 0 rgba(255, 255, 255, .02); --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.2; margin: 0; color: var(--heading); letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; color: var(--heading); }
h3 { font-size: 15px; margin: 0 0 8px; color: var(--heading); }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
p { margin: 0 0 10px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 16px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- app shell */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%); color: var(--side-text); padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 20px; text-decoration: none !important; }
.brand .mark { width: 42px; height: 42px; background: #fff; border-radius: 11px; padding: 4px; flex: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.brand .mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand .word { font-weight: 700; font-size: 21px; letter-spacing: .02em; color: #fff; line-height: 1.05; }
.brand .word b { color: var(--orange); }
.brand .tag-line { font-size: 10.5px; letter-spacing: .04em; color: var(--side-text); opacity: .85; font-weight: 400; display: block; margin-top: 3px; }
.nav a { display: flex; align-items: center; gap: 11px; color: var(--side-text); padding: 8px 11px; border-radius: 9px; margin-bottom: 2px;
  font-size: 14.5px; transition: background .15s, color .15s; position: relative; }
.nav a:hover { background: var(--side-active); text-decoration: none; color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; font-weight: 700; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--orange); }
.nav a svg { flex: none; opacity: .9; }
.nav .sect { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; opacity: .55; padding: 16px 11px 6px; }
.nav .count { margin-left: auto; background: var(--orange); color: #fff; border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 0 7px; min-width: 20px; text-align: center; }
.side-foot { margin-top: auto; padding: 14px 10px 2px; font-size: 12px; color: var(--side-text); opacity: .8; line-height: 1.5; }
.side-foot b { color: #fff; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 11px 26px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(160%) blur(10px); position: sticky; top: 0; z-index: 5; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.searchbox { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 7px 12px;
  color: var(--muted); cursor: pointer; min-width: 260px; font: inherit; font-size: 14px; }
.searchbox:hover { border-color: var(--border-strong); background: var(--surface-2); }
.searchbox kbd { margin-left: auto; }
kbd { font-family: var(--mono); font-size: 11px; background: var(--surface); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12.5px; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatar.client { background: var(--orange); }
.avatar.system { background: var(--surface-3); color: var(--muted); }
.userchip { display: flex; align-items: center; gap: 9px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.userchip:hover { text-decoration: none; border-color: var(--border-strong); }
.userchip small { color: var(--muted); display: block; line-height: 1; font-size: 11px; text-transform: capitalize; }
.userchip span { line-height: 1.15; font-weight: 700; font-size: 13.5px; }
.icon-btn { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 10px; }
.content { padding: 24px 26px 70px; max-width: 1480px; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { display: block; width: 44px; height: 4px; background: var(--orange); border-radius: 2px; margin-bottom: 10px; }
.title-wrap .sub { color: var(--muted); margin-top: 3px; }
.crumb { color: var(--muted); font-size: 13.5px; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.content > .grid, .content > .card, .content > .tabs + .card { margin-bottom: 16px; }

/* ---------- cards, tiles */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2, .card.flush > .card-head { padding: 16px 18px 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.tile { padding: 16px 18px; display: block; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; overflow: hidden; }
a.tile:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--border-strong); box-shadow: 0 8px 24px rgba(6, 50, 99, .1); }
.tile .label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; }
.tile .value { font-size: 32px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; color: var(--heading); line-height: 1.15; }
.tile .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tile .sub b.up { color: var(--up); } .tile .sub b.down { color: var(--down); }
.tile.alert .value { color: var(--down); }
.tile.accent::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--orange); }
.tile.alert::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--down); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.callout { background: var(--surface-2); border-left: 4px solid var(--orange); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text); }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.click { cursor: pointer; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
tr.bad td { background: var(--down-bg); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 30px; display: block; margin-bottom: 6px; }

/* ---------- badges & chips */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  background: var(--pause-bg); color: var(--pause); line-height: 1.5; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-up, .b-online, .b-completed, .b-resolved, .b-met, .b-ok { background: var(--up-bg); color: var(--up); }
.b-down, .b-offline, .b-failed, .b-critical, .b-rejected, .b-timeout, .b-breached, .b-P1 { background: var(--down-bg); color: var(--down); }
.b-warning, .b-acknowledged, .b-running, .b-sent, .b-at_risk, .b-waiting_client, .b-waiting_vendor { background: var(--warn-bg); color: var(--warn); }
.b-info, .b-pending, .b-new, .b-P3, .b-in_progress { background: var(--info-bg); color: var(--info); }
.b-open { background: var(--down-bg); color: var(--down); }
.b-t-open { background: var(--surface-3); color: var(--heading); }
.b-P2 { background: var(--orange-bg); color: var(--orange-dark); }
:root[data-theme="dark"] .b-P2 { color: var(--orange); }
.b-P4, .b-closed, .b-paused, .b-none { background: var(--pause-bg); color: var(--pause); }
.prio { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.prio::before { display: none; }
.tag { display: inline-block; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0 7px; font-size: 12px; margin-right: 4px; color: var(--muted); }
.sla { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 2px 9px; border-radius: 7px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sla svg { flex: none; }
.sla.ok { background: var(--up-bg); color: var(--up); } .sla.at_risk { background: var(--warn-bg); color: var(--warn); }
.sla.breached { background: var(--down-bg); color: var(--down); } .sla.met { background: transparent; color: var(--up); padding-left: 0; }
.sla.paused, .sla.none { background: var(--pause-bg); color: var(--pause); }

/* ---------- meters */
.meter { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.meter .bar { flex: 1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.meter .fill { height: 100%; background: var(--up); border-radius: 3px; }
.meter .fill.w { background: #e09b1b; } .meter .fill.c { background: var(--down); }
.meter span { width: 42px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }

/* ---------- buttons & forms */
button, .btn { font: inherit; font-weight: 700; font-size: 14px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); padding: 7px 14px;
  border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; }
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
button:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 1px 2px rgba(6, 50, 99, .25); }
button.primary:hover, .btn.primary:hover { background: var(--navy-deep); border-color: var(--navy-deep); }
:root[data-theme="dark"] button.primary:hover { background: #1f7fd6; border-color: #1f7fd6; }
button.cta, .btn.cta { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 2px 8px rgba(234, 96, 32, .3); }
button.cta:hover, .btn.cta:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
button.danger { color: var(--down); border-color: color-mix(in srgb, var(--down) 45%, var(--border)); }
button.danger:hover { background: var(--down-bg); }
button.sm { padding: 3px 10px; font-size: 13px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.ghost { background: transparent; border-color: transparent; }
.ghost:hover { background: var(--surface-3); }
label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 4px; color: var(--heading); }
.field { margin-bottom: 14px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
input, select, textarea { font: inherit; width: 100%; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
textarea.code, textarea[name=script], textarea[name=content] { font-family: var(--mono); font-size: 12.5px; min-height: 170px; }
input[type=checkbox], input[type=radio] { width: auto; margin-right: 7px; accent-color: var(--orange); }
.check { display: flex; align-items: center; font-weight: 400; color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.error { background: var(--down-bg); color: var(--down); padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.notice { background: var(--info-bg); color: var(--info); padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.secret-box { font-family: var(--mono); background: var(--surface-2); border: 1px dashed var(--border-strong); padding: 10px 12px; border-radius: var(--radius-sm); word-break: break-all; user-select: all; }
.select-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border-strong); border-radius: 10px; padding: 6px 12px; }
.select-list .check { margin: 5px 0; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; }
.search { max-width: 260px; }
.btn-col { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row + .table-wrap, .row + div { margin-top: 10px; }
details { margin-top: 12px; }
.qr { background: #fff; padding: 8px; border-radius: 10px; width: 200px; height: 200px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a, .seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font-size: 13.5px; color: var(--muted); font-weight: 700; box-shadow: none; }
.seg a:hover, .seg button:hover { color: var(--text); text-decoration: none; background: transparent; }
.seg .active { background: var(--surface); color: var(--heading); box-shadow: var(--shadow-sm); }
.seg .n { font-weight: 400; opacity: .7; margin-left: 4px; }

/* ---------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 700; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--heading); border-bottom-color: var(--orange); }

/* ---------- console & charts */
.console { background: #04182f; color: #d6e6f7; border-radius: 10px; padding: 13px 14px; max-height: 480px; overflow: auto; font-family: var(--mono); font-size: 12.5px;
  white-space: pre-wrap; word-break: break-word; border: 1px solid #0d335c; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .hover-line { stroke: var(--muted); stroke-dasharray: 3 3; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .s1 { stroke: var(--c1); } .chart .s2 { stroke: var(--c2); } .chart .s3 { stroke: var(--c3); } .chart .s4 { stroke: var(--c4); }
.chart .mark-bad { stroke: var(--down); stroke-width: 1.5; opacity: .45; }
.chart .bar1 { fill: var(--c1); } .chart .bar2 { fill: var(--c3); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.legend i.l-bad { background: var(--down); opacity: .6; }
.chart-tip { font-size: 12.5px; color: var(--muted); min-height: 18px; font-variant-numeric: tabular-nums; }
.l1 { background: var(--c1); } .l2 { background: var(--c2); } .l3 { background: var(--c3); } .l4 { background: var(--c4); }
.bars { display: flex; gap: 2px; height: 30px; align-items: stretch; }
.bars span { flex: 1; border-radius: 2px; background: var(--pause-bg); }
.bars span.ok { background: var(--up); } .bars span.part { background: #e09b1b; } .bars span.bad { background: var(--down); }
.ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 17px; color: var(--heading); flex: none; position: relative; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring .track { stroke: var(--surface-3); } .ring .val { stroke: var(--up); stroke-linecap: round; }
.ring.w .val { stroke: #e09b1b; } .ring.c .val { stroke: var(--down); }
.stat-row { display: flex; align-items: center; gap: 14px; }
.stat-row + .stat-row { margin-top: 14px; }

/* ---------- modal, drawer, toast, command palette */
.modal-back { position: fixed; inset: 0; background: rgba(4, 24, 47, .5); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 16px; z-index: 50; overflow-y: auto; animation: fadein .15s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); border-radius: 16px; border: 1px solid var(--border); width: 100%; max-width: 640px; padding: 22px; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal.wide { max-width: 940px; }
.modal-head { display: flex; align-items: center; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-head button { margin-left: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 11px; max-width: 400px; box-shadow: var(--shadow-lg); animation: pop .18s ease; border-left: 4px solid var(--orange); }
.toast.err { background: #a8201a; border-left-color: #fff; }
.palette { max-width: 600px; padding: 0; overflow: hidden; }
.palette input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 16px 18px; font-size: 17px; box-shadow: none !important; }
.palette .results { max-height: 46vh; overflow-y: auto; padding: 6px; }
.palette .item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; cursor: pointer; color: var(--text); }
.palette .item small { color: var(--muted); margin-left: auto; }
.palette .item.sel { background: var(--surface-3); }
.palette .group { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: 8px 12px 3px; }
.palette .foot { border-top: 1px solid var(--border); padding: 8px 14px; font-size: 12px; color: var(--muted); display: flex; gap: 14px; }

/* ---------- skeleton */
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel.h1 { height: 30px; width: 240px; margin-bottom: 20px; } .skel.block { height: 96px; } .skel.tall { height: 320px; }

/* ---------- helpdesk: board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--surface-3); border-radius: var(--radius); padding: 10px; min-height: 200px; transition: background .15s, box-shadow .15s; }
.col.over { box-shadow: inset 0 0 0 2px var(--orange); background: var(--orange-bg); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; color: var(--heading); font-size: 13.5px; text-transform: uppercase; letter-spacing: .06em; }
.col-head .n { background: var(--surface); border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .12s, border-color .12s; border-left: 4px solid var(--border-strong); display: block; color: inherit; }
.tcard:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(6, 50, 99, .12); text-decoration: none; }
.tcard.dragging { opacity: .45; }
.tcard.p-P1 { border-left-color: var(--down); } .tcard.p-P2 { border-left-color: var(--orange); } .tcard.p-P3 { border-left-color: var(--blue); }
.tcard .top { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.tcard .subj { font-weight: 700; color: var(--heading); line-height: 1.3; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .bot { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.tnum { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.subject-cell b { color: var(--heading); }
.subject-cell .meta { font-size: 12.5px; color: var(--muted); }

/* ---------- helpdesk: ticket detail */
.ticket { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.timeline { display: flex; flex-direction: column; gap: 14px; }
.ev { display: flex; gap: 12px; }
.ev .bubble { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: 11px 14px; box-shadow: var(--shadow-sm); }
.ev .who { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; flex-wrap: wrap; }
.ev .who b { color: var(--heading); }
.ev .who time { color: var(--faint); font-size: 12.5px; }
.ev .body { white-space: pre-wrap; word-break: break-word; }
.ev.note .bubble { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.ev.client .bubble { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.ev.sys { align-items: center; color: var(--muted); font-size: 13px; padding-left: 10px; }
.ev.sys::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); flex: none; margin: 0 9px 0 2px; }
.composer { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.composer.note { background: var(--warn-bg); }
.composer .ctabs { display: flex; gap: 2px; padding: 8px 10px 0; align-items: center; }
.composer .ctabs button { border: 0; background: transparent; box-shadow: none; padding: 6px 12px; border-radius: 8px 8px 0 0; color: var(--muted); border-bottom: 3px solid transparent; }
.composer .ctabs button.active { color: var(--heading); border-bottom-color: var(--orange); }
.composer textarea { border: 0; border-radius: 0; background: transparent; box-shadow: none !important; min-height: 110px; padding: 12px 14px; }
.composer .cfoot { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--border); flex-wrap: wrap; background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.composer .cfoot select, .composer .cfoot input { width: auto; padding: 6px 9px; font-size: 13.5px; }
.props .field { margin-bottom: 11px; }
.props label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.props select, .props input { padding: 6px 9px; font-size: 14px; }
.slabox { display: grid; gap: 8px; }
.slabox .line { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; }
.linkcard { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); }
.linkcard:hover { text-decoration: none; border-color: var(--border-strong); background: var(--surface-2); }
.linkcard + .linkcard { margin-top: 8px; }
.impact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.impact label { border: 1px solid var(--border-strong); border-radius: 11px; padding: 10px 12px; cursor: pointer; font-weight: 400; display: block; margin: 0; }
.impact label b { display: block; color: var(--heading); }
.impact label small { color: var(--muted); }
.impact input { position: absolute; opacity: 0; }
.impact label:has(input:checked) { border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 20%, transparent); background: var(--orange-bg); }

/* ---------- login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-hero { background: linear-gradient(150deg, var(--navy) 0%, var(--navy-deep) 70%, #021a36 100%); color: #fff; padding: 56px 60px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden; }
.login-hero::before { content: ""; position: absolute; right: -140px; top: -120px; width: 520px; height: 520px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .04); }
.login-hero::after { content: ""; position: absolute; left: -90px; bottom: -160px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(234, 96, 32, .28), transparent 65%); }
.login-hero .eyebrow { width: 56px; height: 5px; }
.login-hero h1 { color: #fff; font-size: 40px; max-width: 520px; position: relative; }
.login-hero p { color: #c4d3e6; font-size: 17px; max-width: 480px; margin-top: 14px; position: relative; }
.login-hero ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; position: relative; }
.login-hero li { display: flex; gap: 12px; align-items: center; color: #e4ecf6; font-size: 15.5px; }
.login-hero li i { width: 26px; height: 26px; border-radius: 8px; background: rgba(255, 255, 255, .1); display: grid; place-items: center; flex: none; font-style: normal; color: var(--orange); font-weight: 700; }
.login-hero .contact { margin-top: 44px; font-size: 13.5px; color: #9fb6d1; position: relative; }
.login-pane { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--surface); }
.login { width: 100%; max-width: 380px; }
.login .logo { width: 250px; max-width: 80%; display: block; margin: 0 0 28px; }
:root[data-theme="dark"] .login .logo, :root[data-theme="dark"] .sp-head img { background: #fff; border-radius: 12px; padding: 10px 14px; }
.login h2 { font-size: 24px; margin-bottom: 4px; }
.login .tagline { color: var(--muted); margin-bottom: 22px; }
.login button[type=submit] { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.login .foot { margin-top: 22px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- client portal */
.portal-top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.portal-top .in { max-width: 1040px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; }
.portal-top img { height: 40px; display: block; }
:root[data-theme="dark"] .portal-top img { background: #fff; border-radius: 8px; padding: 4px 8px; }
.portal-top nav { display: flex; gap: 4px; margin-left: 14px; }
.portal-top nav a { padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 700; }
.portal-top nav a.active, .portal-top nav a:hover { background: var(--surface-3); color: var(--heading); text-decoration: none; }
.portal-hero { background: linear-gradient(135deg, var(--navy), var(--navy-deep)); color: #fff; }
.portal-hero .in { max-width: 1040px; margin: 0 auto; padding: 30px 20px 34px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.portal-hero h1 { color: #fff; }
.portal-hero p { color: #c4d3e6; margin: 4px 0 0; }
.portal-body { max-width: 1040px; margin: 0 auto; padding: 22px 20px 70px; }
.portal-body > .grid, .portal-body > .card { margin-bottom: 16px; }
.help-line { display: flex; gap: 12px; align-items: flex-start; }
.help-line + .help-line { margin-top: 12px; }
.help-line i { width: 34px; height: 34px; border-radius: 10px; background: var(--orange-bg); color: var(--orange-dark); display: grid; place-items: center; flex: none; font-style: normal; }

/* ---------- public status page */
.sp { max-width: 860px; margin: 0 auto; padding: 32px 16px 60px; }
.sp-head { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.sp-head img { height: 46px; }
.sp-overall { padding: 16px 18px; border-radius: var(--radius); font-weight: 700; font-size: 17px; margin: 20px 0; }
.sp-overall.operational { background: var(--up-bg); color: var(--up); }
.sp-overall.degraded { background: var(--down-bg); color: var(--down); }
.sp-comp { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.sp-comp:last-child { border-bottom: 0; }
.sp-comp .row { justify-content: space-between; margin-bottom: 8px; }

/* ---------- print (client service report) */
@media print {
  .side, .topbar, .actions, .tabs, #toasts, .no-print { display: none !important; }
  .app { display: block; } .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  th { background: #063263 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-head { display: flex !important; }
}
.print-head { display: none; align-items: center; gap: 16px; border-bottom: 3px solid var(--orange); padding-bottom: 12px; margin-bottom: 18px; }
.print-head img { height: 54px; }

@media (max-width: 1180px) { .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr; } .ticket, .g-main { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 40; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; }
  .g2, .form-grid, .impact { grid-template-columns: 1fr; }
  .content { padding: 16px 16px 60px; }
  .topbar { padding: 10px 14px; }
  .searchbox { min-width: 0; } .searchbox span, .searchbox kbd { display: none; }
  .userchip div { display: none; } .userchip { padding: 3px; }
  .login-wrap { grid-template-columns: 1fr; } .login-hero { display: none; }
  .portal-top nav { margin-left: 0; }
}
@media (max-width: 560px) { .g4, .g5 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.mt-s { margin-top: 6px; }
.w70 { width: 70px !important; }
.down-text { color: var(--down); }
.page-head > h1 { position: relative; padding-top: 14px; }
.page-head > h1::before { content: ""; position: absolute; top: 0; left: 0; width: 44px; height: 4px; border-radius: 2px; background: var(--orange); }
a.tag:hover { text-decoration: none; border-color: var(--border-strong); color: var(--text); }
.row.nowrap { flex-wrap: nowrap; }
.search { width: auto; min-width: 150px; }
input.search { width: 230px; }
.subject-cell { min-width: 220px; }
.composer .ctabs select { width: auto; max-width: 230px; padding: 5px 9px; font-size: 13.5px; }

.callout pre { font-family: inherit; font-size: inherit; }

/* ---------- documentation & vault */
.md { line-height: 1.6; word-break: break-word; }
.md h1 { font-size: 23px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--orange); }
.md h2 { font-size: 18px; margin: 22px 0 8px; } .md h3 { font-size: 15.5px; margin: 16px 0 6px; } .md h4 { font-size: 14px; margin: 14px 0 4px; color: var(--heading); }
.md p { margin: 0 0 12px; } .md ul, .md ol { margin: 0 0 12px; padding-left: 22px; } .md li { margin: 3px 0; }
.md li.task { list-style: none; margin-left: -22px; }
.md code { background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.md blockquote { margin: 0 0 12px; background: var(--surface-2); border-left: 4px solid var(--orange); padding: 10px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.md .table-wrap { margin: 0 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.md th { background: var(--navy); color: #fff; text-transform: none; letter-spacing: 0; font-size: 13px; }
.md td { font-size: 14px; } .md tbody tr:nth-child(odd) td { background: var(--surface-2); }
.md .console { margin: 0 0 12px; }
.editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.editor textarea { min-height: 62vh; font-family: var(--mono); font-size: 13px; }
.rev-box { max-height: 50vh; overflow: auto; }
.secret-rows { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.srow { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); min-width: 0; }
.srow:last-child { border-bottom: 0; } .srow.top { align-items: flex-start; }
.srow label { width: 120px; flex: none; margin: 0; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.srow .mono { font-size: 14px; word-break: break-all; } .srow pre { font-family: var(--font); }
.otp { font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: .08em; color: var(--heading); }
@media (max-width: 1000px) { .editor { grid-template-columns: 1fr; } .editor textarea { min-height: 40vh; } }
@media print { .ticket { grid-template-columns: 1fr; } }

/* ---------- remote sessions */
.connect-card { text-align: left; }
.connect-card .cicon { width: 52px; height: 52px; border-radius: 14px; background: var(--orange-bg); color: var(--orange-dark); display: grid; place-items: center; margin-bottom: 12px; }
:root[data-theme="dark"] .connect-card .cicon { color: var(--orange); }
.remote-wrap { background: #04182f; border-color: #0d335c; }
.remote-wrap:fullscreen { border-radius: 0; display: flex; flex-direction: column; }
.remote-bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.remote-bar select { width: auto; padding: 4px 8px; font-size: 13px; }
.remote-stage { position: relative; display: flex; justify-content: center; align-items: center; min-height: 360px; flex: 1; overflow: hidden; }
.remote-stage canvas { max-width: 100%; max-height: 74vh; display: block; cursor: crosshair; outline: none; background: #000; }
.remote-wrap:fullscreen .remote-stage canvas { max-height: calc(100vh - 52px); }
.remote-stage canvas:focus { box-shadow: 0 0 0 2px var(--orange); }
.remote-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #c4d3e6; background: rgba(4, 24, 47, .82); padding: 20px; text-align: center; }
.term-frame { width: 100%; height: 68vh; min-height: 380px; border: 0; display: block; background: #04182f; }
.remote-wrap:fullscreen .term-frame { height: calc(100vh - 52px); }
a.tag svg { vertical-align: -1px; }

.env-banner { background: var(--orange); color: #fff; text-align: center; font-weight: 700; font-size: 13px; padding: 5px 12px; letter-spacing: .03em; }
.side-foot .ver { opacity: .7; font-size: 11px; }
