/* ==========================================================================
   Leanwave Service Desk — UI v2
   Brand palette sampled from the official Leanwave artwork. All other values
   (radii, shadows, motion timings) are provisional — see DESIGN.md.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-var.8e433c0592f7.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* brand */
  --brand-ink: #071218; --navy: #0b2637; --navy-2: #154b67; --accent: #3489b0; --accent-2: #5fb3d6;
  --accent-soft: #e6f2f8; --accent-ring: rgba(52, 137, 176, .28);
  --red: #c8102e;
  /* neutrals */
  --ink: #0f1c26; --ink-2: #334552; --muted: #637382; --line: #e3e9ef; --line-2: #eef2f6;
  --bg: #f4f7fa; --card: #ffffff;
  /* semantic */
  --ok: #1a7f4e; --ok-soft: #e4f5ec; --warn: #a65d00; --warn-soft: #fff3df; --bad: #c0362c; --bad-soft: #fdeceb;
  --info: #2563a8; --info-soft: #e8f0fb; --violet: #6741b8; --violet-soft: #f1ebfc;
  /* shape & depth */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(15, 28, 38, .05), 0 1px 1px rgba(15, 28, 38, .03);
  --sh-2: 0 1px 2px rgba(15, 28, 38, .04), 0 6px 18px -6px rgba(15, 28, 38, .12);
  --sh-3: 0 2px 4px rgba(15, 28, 38, .05), 0 18px 40px -12px rgba(11, 38, 55, .28);
  /* motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 140ms; --t: 220ms; --t-slow: 420ms;
  --gap: 18px;
  --focus: #3489b0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--ink);
  font-feature-settings: "cv11", "ss01", "tnum" 0;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); }
::selection { background: var(--accent-ring); }
a { color: #1d6a91; text-decoration-color: rgba(29, 106, 145, .35); text-underline-offset: 2px; transition: color var(--t-fast); }
a:hover { color: var(--navy-2); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 50; border-radius: var(--r-sm); box-shadow: var(--sh-2); }
h1 { font-size: 24px; letter-spacing: -.02em; font-weight: 700; margin: 0 0 14px; }
h2 { font-size: 15px; letter-spacing: -.01em; font-weight: 650; margin: 0 0 12px; }
h3 { font-size: 13.5px; font-weight: 650; margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- page transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 160ms var(--ease-out) both; }
::view-transition-new(root) { animation: vt-in 260ms var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
.side { view-transition-name: sidebar; }
.topbar { view-transition-name: topbar; }
::view-transition-old(sidebar), ::view-transition-new(sidebar), ::view-transition-old(topbar), ::view-transition-new(topbar) { animation: none; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 var(--accent-ring); } 70% { box-shadow: 0 0 0 10px rgba(52, 137, 176, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 137, 176, 0); } }
@keyframes pulse-p1 { 0%, 100% { box-shadow: 0 0 0 0 rgba(192, 54, 44, .45); } 50% { box-shadow: 0 0 0 4px rgba(192, 54, 44, 0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes draw { from { transform: scaleY(0); } to { transform: scaleY(1); } }


/* GSAP entrance targets start hidden only when JS has marked the page (early.js). */
.js-anim .content > .pagehead, .js-anim .content > h1, .js-anim .content > .filters, .js-anim .content > .tablewrap,
.js-anim .content > .grid > .card, .js-anim .content > .grid > div > .card, .js-anim .content > .card, .js-anim .content > .pager,
.js-anim .tablewrap tbody tr, .js-anim .wf-path > li, .js-anim .toasts li,
.js-anim .login-page .hero, .js-anim .login-page .tagline, .js-anim .login, .js-anim .login-foot { visibility: hidden; }
.anim-ready .content > *, .anim-ready .tablewrap tbody tr, .anim-ready .wf-path > li, .anim-ready .toasts li, .anim-ready .login-page > * { visibility: visible; }
.stat, .wf-path .wf-num, .toasts li { will-change: transform; }

/* ---------- shell ---------- */
.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: radial-gradient(120% 60% at 0% 0%, rgba(52, 137, 176, .22), transparent 60%),
              linear-gradient(180deg, var(--brand-ink) 0%, var(--navy) 50%, #103a52 100%);
  color: #d6e4ee; padding: 18px 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.brand { padding: 4px 10px 20px; color: #fff; }
.brand img { display: block; width: 164px; height: auto; transition: opacity var(--t); }
.brand a:hover img { opacity: .85; }
.brand small { display: block; margin-top: 8px; font-size: 10.5px; color: #8fbcd6; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
  color: #c9dbe7; text-decoration: none; font-weight: 500; transition: background var(--t) var(--ease-out), color var(--t), transform var(--t-fast);
}
.side nav a .ico { opacity: .75; transition: opacity var(--t), transform var(--t) var(--ease-spring); }
.side nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side nav a:hover .ico { opacity: 1; transform: translateX(1px) scale(1.06); }
.side nav a:active { transform: scale(.98); }
.side nav a.active { background: linear-gradient(90deg, rgba(52, 137, 176, .38), rgba(52, 137, 176, .14)); color: #fff; box-shadow: inset 0 0 0 1px rgba(95, 179, 214, .25); }
.side nav a.active .ico { opacity: 1; color: var(--accent-2); }
.side nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-2); animation: draw var(--t) var(--ease-out); }
.side .section { padding: 16px 12px 6px; font-size: 10.5px; text-transform: uppercase; color: #6f98b2; letter-spacing: .12em; font-weight: 650; }
.side-foot { margin-top: auto; padding: 18px 12px 2px; font-size: 11px; color: #7fa6bd; line-height: 1.6; }
.side-foot a { color: #b9d7e8; }
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 28px; background: rgba(244, 247, 250, .78); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(227, 233, 239, .8);
}
.quick-search { position: relative; flex: 1; max-width: 440px; }
.quick-search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.quick-search input[type=search] { width: 100%; padding-left: 34px; background: #fff; border-color: var(--line); border-radius: var(--r-pill); height: 36px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.tz { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.tz .ico { width: 15px; height: 15px; } .tz a { color: var(--ink-2); text-decoration: none; } .tz a:hover { text-decoration: underline; }
.env { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn); text-transform: uppercase; letter-spacing: .06em; }
.me { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); padding: 3px 10px 3px 3px; border-radius: var(--r-pill); transition: background var(--t); }
.me:hover { background: #fff; box-shadow: var(--sh-1); color: var(--ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--navy-2)); }
.me-text { display: flex; flex-direction: column; line-height: 1.2; } .me-text strong { font-size: 13px; font-weight: 600; } .me-text small { font-size: 11px; color: var(--muted); }
.content { padding: 24px 28px 56px; max-width: 1440px; width: 100%; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead h1 { margin-bottom: 4px; }

/* ---------- surfaces ---------- */
.grid { display: grid; gap: var(--gap); }
.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)); }
.split { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--sh-1); transition: box-shadow var(--t) var(--ease-out), border-color var(--t); }
.card + .card { margin-top: var(--gap); }
.grid > .card + .card { margin-top: 0; }
.stat { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 28px; line-height: 1.1; letter-spacing: -.02em; font-weight: 700; }
.stat b a { text-decoration: none; color: inherit; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat::after { content: ""; position: absolute; right: -24px; top: -24px; width: 84px; height: 84px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 70%); }
.stat:hover { box-shadow: var(--sh-2); transform: translateY(-1px); transition: transform var(--t) var(--ease-out), box-shadow var(--t); }
.stat.alert b { color: var(--bad); } .stat.alert::after { background: radial-gradient(circle, var(--bad-soft), transparent 70%); }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--sh-1); }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: transparent; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; background: #fafbfd; position: sticky; top: 0; z-index: 1; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover td { background: #f6fafd; }
tbody tr:last-child td { border-bottom: 0; }
td a[href*="/tickets/"] { font-weight: 600; text-decoration: none; }
td a[href*="/tickets/"]:hover { text-decoration: underline; }
td:first-child a { white-space: nowrap; }
.card table th { background: transparent; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 550; background: #eef2f6; color: var(--ink-2); white-space: nowrap; line-height: 1.6; }
.badge[class*="st-"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-new { background: var(--info-soft); color: var(--info); }
.st-in_progress { background: var(--warn-soft); color: var(--warn); }
.st-waiting_location, .st-waiting_imd { background: var(--violet-soft); color: var(--violet); }
.st-resolved { background: var(--ok-soft); color: var(--ok); }
.st-closed { background: #eceff3; color: #56636f; }
.st-in_progress::before { animation: pulse-p1 2s infinite; box-shadow: 0 0 0 0 rgba(166, 93, 0, .4); }
.pr-P1 { background: var(--bad); color: #fff; font-weight: 700; animation: pulse-p1 2.2s ease-in-out infinite; }
.pr-P2 { background: #ffe4dc; color: #8a2a12; font-weight: 650; }
.pr-P3 { background: #eef2f6; color: var(--ink-2); } .pr-P4 { background: #f4f6f8; color: var(--muted); }
.sev-critical { color: var(--bad); font-weight: 650; }
.tag-warn { background: var(--warn-soft); color: var(--warn); } .tag-err { background: var(--bad-soft); color: var(--bad); } .tag-ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- forms ---------- */
form.inline { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
.card .filters { padding: 0; border: 0; box-shadow: none; background: transparent; }
.filters label { display: flex; flex-direction: column; font-size: 11.5px; color: var(--muted); gap: 4px; font-weight: 550; }
input[type=text], input[type=search], input[type=password], input[type=email], input[type=number], input[type=date], input[type=file], select, textarea {
  font: inherit; color: var(--ink); padding: 7px 11px; border: 1px solid #cfd8e1; border-radius: var(--r-sm); background: #fff; min-height: 36px; max-width: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
input:hover, select:hover, textarea:hover { border-color: #b4c2cf; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { width: 100%; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; vertical-align: -3px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.errorlist { color: var(--bad); margin: 6px 0; padding-left: 18px; font-size: 13px; }
details > summary { cursor: pointer; font-weight: 600; padding: 6px 0; list-style: none; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
details > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform var(--t) var(--ease-out); }
details[open] > summary::before { transform: rotate(45deg); }
details[open] > :not(summary) { animation: rise var(--t) var(--ease-out); }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: 13.5px;
  padding: 7px 14px; min-height: 36px; border-radius: var(--r-sm); border: 1px solid #cfd8e1; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none;
  box-shadow: var(--sh-1); transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t), background var(--t), border-color var(--t), color var(--t);
}
.btn:hover { border-color: #b4c2cf; box-shadow: var(--sh-2); transform: translateY(-1px); color: var(--ink); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: var(--sh-1); }
.btn.primary { background: linear-gradient(180deg, #1c5f80, var(--navy-2)); border-color: #12425b; color: #fff; }
.btn.primary:hover { background: linear-gradient(180deg, #2270965e, #1c5f80), var(--navy-2); color: #fff; box-shadow: 0 6px 16px -6px rgba(21, 75, 103, .6); }
.btn.danger { color: var(--bad); border-color: #ecc1bd; } .btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; } .btn.ghost:hover { background: #fff; border-color: var(--line); }
.btn.icon { padding: 0; width: 36px; }
.btn.small { padding: 4px 10px; min-height: 28px; font-size: 12.5px; }
.btn.u-full { width: 100%; }
.btn.is-loading { pointer-events: none; color: transparent !important; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn:not(.primary).is-loading::after { border-color: rgba(21,75,103,.25); border-top-color: var(--navy-2); }
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- toasts ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 14px; }
.messages li { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: var(--r-sm); margin-bottom: 8px; background: var(--info-soft); color: var(--info); font-weight: 550; border: 1px solid rgba(37, 99, 168, .15); }
.messages .success { background: var(--ok-soft); color: var(--ok); border-color: rgba(26, 127, 78, .18); }
.messages .error { background: var(--bad-soft); color: #8e231b; border-color: rgba(192, 54, 44, .2); }
.messages .warning { background: var(--warn-soft); color: var(--warn); border-color: rgba(166, 93, 0, .18); }
.toasts { position: fixed; top: 64px; right: 24px; z-index: 40; width: min(420px, calc(100vw - 32px)); margin: 0; }
.toasts li { position: relative; overflow: hidden; box-shadow: var(--sh-3); background-color: #fff; }
.toasts li span { flex: 1; }
.toast-x { border: 0; background: transparent; color: inherit; cursor: pointer; opacity: .6; padding: 2px; border-radius: 6px; display: grid; place-items: center; }
.toast-x:hover { opacity: 1; background: rgba(0,0,0,.05); }
.toast-x .ico { width: 16px; height: 16px; }

/* ---------- activity timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 2px solid var(--line); padding: 4px 0 14px 16px; position: relative; }
.timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #9aa6b8; position: absolute; left: -6px; top: 9px; box-shadow: 0 0 0 3px #fff; }
.timeline li.k-workflow::before { background: var(--accent); } .timeline li.k-alert::before { background: var(--red); }
.timeline li.k-note::before { background: var(--ok); } .timeline li.k-status::before { background: var(--warn); } .timeline li.k-escalation::before { background: var(--violet); }
.timeline .meta { font-size: 12px; color: var(--muted); }
.timeline .body { white-space: pre-wrap; word-break: break-word; }
.vis-internal { font-size: 10.5px; font-weight: 650; background: var(--warn-soft); color: var(--warn); padding: 1px 7px; border-radius: var(--r-pill); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- troubleshooting ---------- */
#troubleshooting { border-top: 3px solid var(--accent); scroll-margin-top: 80px; }
.wf { border: 1px solid rgba(52, 137, 176, .35); border-radius: var(--r); padding: 16px; background: linear-gradient(180deg, var(--accent-soft), #fff 70%); }
.wf .q { font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin: 6px 0 10px; color: var(--navy); }
.wf .opts { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 2px; }
.wf .opts .btn { min-height: 42px; padding: 9px 18px; font-size: 14px; }
.wf .src { font-size: 12px; color: var(--muted); }
.assume { font-size: 10.5px; font-weight: 650; background: var(--warn-soft); color: var(--warn); padding: 1px 7px; border-radius: var(--r-pill); }
.banner-p1 { display: flex; align-items: center; gap: 10px; background: linear-gradient(90deg, var(--bad), #d9534a); color: #fff; padding: 11px 14px; border-radius: var(--r); margin-bottom: 16px; font-weight: 600; box-shadow: 0 8px 20px -10px rgba(192, 54, 44, .7); animation: rise var(--t-slow) var(--ease-out); }
.wf-path { list-style: none; margin: 10px 0 0; padding: 0; }
.wf-path > li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.wf-path > li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 2px; width: 2px; border-radius: 2px; background: linear-gradient(var(--accent), var(--line)); }
.wf-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--navy-2); color: #fff; z-index: 1; }
.wf-path li.done .wf-num { background: var(--ok); }
.wf-path li.override .wf-num { background: var(--warn); }
.wf-path li.current .wf-num { background: var(--accent); animation: pulse-ring 2s ease-out infinite; }
.wf-path li.end .wf-num { background: #6b7785; } .wf-path li.end.solved .wf-num { background: var(--ok); }
.wf-path li.end.solved .wf-title { color: var(--ok); }
.wf-title { font-weight: 650; } .wf-answer { color: var(--navy-2); font-weight: 600; }
.wf-note { font-size: 13px; background: #f4f7fa; border-left: 3px solid var(--accent-2); padding: 6px 10px; margin: 6px 0; border-radius: 0 6px 6px 0; white-space: pre-wrap; }
.wf-path li.current .wf-body.wf { margin: 0; box-shadow: var(--sh-2); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; padding: 6px 0 6px 30px; position: relative; border-bottom: 1px dashed var(--line); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--navy-2); color: #fff; font-size: 11px; display: grid; place-items: center; }

/* ---------- misc ---------- */
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 12.5px; } dl.kv dd { margin: 0; word-break: break-word; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
pre.raw { white-space: pre-wrap; word-break: break-word; background: #0f1c26; color: #d5e4ee; padding: 14px; border-radius: var(--r-sm); max-height: 280px; overflow: auto; font-size: 12.5px; }
.bar { height: 8px; background: #e7ebf1; border-radius: 4px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--navy-2); }
.hidden { display: none; }

/* ---------- sign-in ---------- */
.login-page { position: relative; overflow: hidden; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px;
  background: linear-gradient(180deg, var(--brand-ink) 0%, var(--navy) 42%, var(--navy-2) 74%, var(--accent) 100%); }
.login-page::before, .login-page::after { content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; pointer-events: none; }
.login-page::before { width: 520px; height: 520px; left: -160px; top: -140px; background: radial-gradient(circle, #2d7fa6, transparent 65%); animation: drift 18s ease-in-out infinite alternate; }
.login-page::after { width: 460px; height: 460px; right: -140px; bottom: -160px; background: radial-gradient(circle, #5fb3d6, transparent 65%); animation: drift 22s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(60px, 40px) scale(1.1); } }
.login-page > * { position: relative; z-index: 1; }
.login-page .hero { width: 280px; max-width: 80vw; height: auto; margin-bottom: 8px; }
.login-page .tagline { color: #cfe3ef; margin: 0 0 26px; font-size: 15px; letter-spacing: .02em; }
.login { width: 100%; max-width: 390px; border: 1px solid rgba(255,255,255,.6); border-radius: var(--r-lg); padding: 26px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); background: rgba(255,255,255,.96); }
.login h1 { color: var(--navy); }
.login-foot { margin-top: 22px; font-size: 12px; color: #cfe3ef; } .login-foot a { color: #fff; }

/* ---------- utilities (inline styles are blocked by the CSP) ---------- */
.u-big { font-size: 16px; } .u-mt { margin-top: 12px; } .u-mt2 { margin-top: 18px; } .u-mts { margin-top: 8px; }
.u-w520 { max-width: 520px; } .u-w620 { max-width: 620px; } .u-w720 { max-width: 720px; }
.u-wrap { white-space: normal; } .u-pre { white-space: pre-wrap; } .u-full { width: 100%; } .u-w90 { width: 90px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } .me-text { display: none; } }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 10px; }
  .brand { padding: 4px 6px 10px; } .brand img { width: 130px; } .brand small, .side-foot, .side .section { display: none; }
  .side nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .side nav a { padding: 6px 10px; } .side nav a.active::before { display: none; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .content { padding: 16px; } .topbar { padding: 10px 16px; } .tz { display: none; }
  dl.kv { grid-template-columns: 1fr; } .toasts { top: 12px; right: 16px; }
}
@media print { .side, .topbar, .noprint, .filters, .toasts { display: none !important; } .layout { display: block; } .card { border: 0; box-shadow: none; } * { animation: none !important; } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* inline notices (e.g. "no longer listed in the digest") */
p.messages > span { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid transparent; font-weight: 550; }
p.messages > span.warning { background: var(--warn-soft); color: var(--warn); border-color: rgba(166, 93, 0, .2); }
p.messages > span.success { background: var(--ok-soft); color: var(--ok); }

/* ==========================================================================
   Hotline / guided mode — large type and big targets for non-specialists
   ========================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hotline { max-width: 960px; font-size: 16px; }
.hotline h1 { font-size: 28px; }
.hl-q { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.25; font-weight: 700; letter-spacing: -.02em; color: var(--navy); margin: 6px 0 18px; text-wrap: balance; }
h2.hl-q { margin-top: 4px; }
.hl-back { display: inline-block; font-size: 15px; font-weight: 600; text-decoration: none; margin-bottom: 6px; }
.btn.xl { min-height: 64px; padding: 14px 28px; font-size: 20px; border-radius: var(--r); }

/* wizard progress */
.wizard-steps { list-style: none; display: flex; gap: 10px; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.wizard-steps li { flex: 1 1 180px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); color: var(--muted); font-weight: 650; font-size: 16px; }
.wizard-steps li small { display: block; margin-left: auto; font-weight: 600; color: var(--navy-2); font-size: 14px; }
.wizard-steps li > span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #e9eef3; color: var(--ink-2); font-size: 14px; flex: none; }
.wizard-steps li.current { border-color: var(--accent); color: var(--navy); box-shadow: 0 0 0 4px var(--accent-ring); }
.wizard-steps li.current > span { background: var(--accent); color: #fff; }
.wizard-steps li.done > span { background: var(--ok); color: #fff; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tiles.issues { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; font: inherit; color: var(--ink); text-decoration: none; cursor: pointer;
  background: #fff; border: 2px solid var(--line); border-radius: var(--r); padding: 16px 18px; min-height: 84px;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t-fast) var(--ease-out), background var(--t); }
.tile strong { font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--navy); }
.tile span { font-size: 15px; color: var(--muted); line-height: 1.35; }
.tile em { font-style: normal; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ok); background: var(--ok-soft); padding: 2px 8px; border-radius: var(--r-pill); margin-bottom: 4px; }
.tile:hover { border-color: var(--accent); box-shadow: var(--sh-2); transform: translateY(-2px); color: var(--ink); }
.tile:active { transform: scale(.98); }
.tile:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.tile.suggested { border-color: var(--ok); background: linear-gradient(180deg, #f1faf5, #fff); }
.tile.ghost { border-style: dashed; background: transparent; }
.site-tile strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.tile-group { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 8px; }
.hl-search { position: relative; margin-bottom: 16px; }
.hl-search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.hl-search input[type=search] { width: 100%; height: 54px; font-size: 18px; padding-left: 44px; border-radius: var(--r); }
.tile[hidden] { display: none; }

/* guided screen */
.guide-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.guide-head h1 { margin: 4px 0 2px; }
.guide-ticket { font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .guide-ticket a { font-weight: 700; }
.guide-card { padding: 28px; border-top: 4px solid var(--accent); }
.guide-step { display: inline-block; font-size: 14px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: var(--r-pill); text-transform: uppercase; letter-spacing: .06em; }
.guide-escalate { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 17px; font-weight: 700; color: var(--violet); background: var(--violet-soft); padding: 10px 14px; border-radius: var(--r-sm); }
.guide-help { font-size: 18px; color: var(--ink-2); margin: -6px 0 16px; }
.guide-src { font-size: 14px; color: var(--muted); margin: -8px 0 18px; }
.guide-answers { display: flex; flex-wrap: wrap; gap: 14px; }
.guide-answers .btn.xl { flex: 1 1 220px; }
.btn.answer-yes { background: linear-gradient(180deg, #1f8d58, var(--ok)); border-color: #156b41; color: #fff; }
.btn.answer-yes:hover { color: #fff; box-shadow: 0 8px 18px -8px rgba(26, 127, 78, .7); }
.btn.answer-no { border-width: 2px; border-color: #c9d3dc; }
.guide-note { margin-top: 18px; font-size: 16px; } .guide-note textarea { font-size: 16px; margin-top: 8px; }
.guide-back { display: flex; gap: 12px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.guide-back .btn { font-size: 15px; }
.trail { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
.trail li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 15px; }
.trail-n { width: 26px; height: 26px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.trail-q { color: var(--ink-2); } .trail-a { font-weight: 700; color: var(--navy-2); text-align: right; }
.guide-done { text-align: center; border-top-color: #6b7785; }
.guide-done.solved { border-top-color: var(--ok); }
.done-mark { width: 84px; height: 84px; margin: 4px auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 42px; font-weight: 800; color: #fff; background: #6b7785; }
.guide-done.solved .done-mark { background: var(--ok); box-shadow: 0 12px 30px -10px rgba(26, 127, 78, .7); }
.guide-done .guide-answers { justify-content: center; } .guide-done .guide-answers .btn { flex: 0 1 360px; }
.js-anim .content > .hotline > * { visibility: hidden; }
.anim-ready .content > .hotline > *, .js-anim .content > .hotline .trail li { visibility: visible; }
@media (max-width: 820px) { .guide-card { padding: 20px; } .trail li { grid-template-columns: 26px 1fr; } .trail-a { grid-column: 2; text-align: left; } }

/* Ticket list: whole row opens the ticket; inline status change */
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: rgba(28, 95, 128, .05); }
.ticket-table .row-action select { min-width: 9.5rem; padding: 6px 8px; font-size: .9rem; }
.ticket-table .last-update { max-width: 22rem; }
.resolved-toggle { display: flex; gap: 8px; flex-wrap: wrap; }

/* Sites & stations: inline contact editing */
.contact-form { display: flex; gap: 6px; align-items: center; }
.contact-form input { min-width: 14rem; padding: 6px 8px; font-size: .9rem; }
.contact-cell { white-space: nowrap; }

/* Troubleshooting: device IPs and site contact right next to the step */
.step-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 16px; }
.step-facts > div { background: var(--surface-2, #f1f5f9); border: 1px solid var(--border, #dbe3ec); border-radius: 10px; padding: 8px 14px; }
.step-facts dt { font-size: .78rem; color: var(--muted, #64748b); text-transform: uppercase; letter-spacing: .04em; }
.step-facts dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 600; }
.hotline .step-facts dd { font-size: 1.35rem; }
/* Bigger, clearly visible "Go back one step" */
.btn.back-step { font-size: 1.05rem; font-weight: 600; padding: 12px 20px; min-height: 48px; gap: 10px; border: 2px solid var(--brand, #1c5f80); color: var(--brand, #1c5f80); background: #fff; }
.btn.back-step .ico { width: 22px; height: 22px; }
.btn.back-step:hover { background: rgba(28, 95, 128, .08); }
.assign-start { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.assign-start select { font-size: 1.15rem; padding: 12px 14px; min-width: 14rem; }

/* Tickets: Open / Resolved / All tabs */
.state-tabs { display: flex; gap: 6px; margin: 0 0 14px; border-bottom: 1px solid var(--border, #dbe3ec); }
.state-tabs a { padding: 10px 16px; font-weight: 600; color: var(--muted, #64748b); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.state-tabs a.active { color: var(--brand, #1c5f80); border-bottom-color: var(--brand, #1c5f80); }
.state-tabs .count { display: inline-block; min-width: 1.6em; padding: 1px 7px; margin-left: 4px; border-radius: 999px; background: var(--surface-2, #eef2f6); font-size: .85em; text-align: center; }
.step-facts > div.missing dd { font-size: .95rem; font-weight: 500; }
.switch-guide { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; font-size: .95rem; }
.switch-guide select { padding: 8px 10px; }

/* Response order 1–5 ("Priorities in order") */
.rank { display: inline-flex; align-items: center; justify-content: center; width: 1.7em; height: 1.7em; border-radius: 50%; font-weight: 700; font-size: .85rem; background: #eef2f6; color: #334155; }
.rank-1 { background: #b91c1c; color: #fff; }
.rank-2 { background: #ea580c; color: #fff; }
.rank-3 { background: #f59e0b; color: #1f2937; }
.rank-4 { background: #fde68a; color: #1f2937; }
.rank-5 { background: #e2e8f0; color: #334155; }
