:root {
  --blue: #008BFF;
  --blue-ui: #0070D8;
  --blue-ui-h: #005CB3;
  --navy: #001A3D;
  --navy-mid: #003878;
  --lblue: #F2F9FF;
  --lav: #E0DEF3;
  --teal: #AEE7E6;
  --teal-d: #16A39C;
  --peri: #C1D5F8;
  --amber: #FFB547;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ink: #272727;
  --ink-soft: #5B6878;
  --ink-faint: #7d8b9a;
  --bg: #F2F9FF;
  --bg-deep: #001A3D;
  --card: #ffffff;
  --line: #E1EAF4;
  --line-strong: #CFDDEC;
  --accent: #0070D8;
  --accent-hover: #005CB3;
  --accent-soft: #E8F3FF;
  --accent-ink: #ffffff;
  --ok: #0E8A72;
  --ok-bg: #E7F8F6;
  --warn: #8A5A00;
  --warn-bg: #FFF6E8;
  --bad: #C8372D;
  --bad-bg: #FDF0EE;
  --pending: #A9BED2;
  --info: #003878;
  --info-bg: #E8F3FF;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 26, 61, 0.04), 0 16px 40px rgba(0, 26, 61, 0.06);
  --shadow-lg: 0 24px 60px rgba(0, 26, 61, 0.16);
  --mono: "Cascadia Mono", "SF Mono", ui-monospace, Consolas, monospace;
  --sans: "Open Sans", "Segoe UI", system-ui, sans-serif;
  --display: Montserrat, "Segoe UI", system-ui, sans-serif;
  --head: Montserrat, "Segoe UI", system-ui, sans-serif;
  --body: "Open Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
*, *::before, *::after {
  -webkit-user-select: none;
  user-select: none;
}
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not(:disabled):not([readonly]),
textarea:not(:disabled):not([readonly]) {
  -webkit-user-select: text;
  user-select: text;
}
::selection { background: #C1D5F8; color: var(--ink); }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 480px at -8% -10%, rgba(0, 139, 255, 0.08), transparent 55%),
    radial-gradient(700px 420px at 110% 0%, rgba(0, 56, 120, 0.06), transparent 50%),
    repeating-linear-gradient(0deg, rgba(0, 26, 61, 0.045) 0 1px, transparent 1px 3px);
}
body > * { position: relative; z-index: 1; }

h1 {
  font-family: var(--display);
  font-size: clamp(32px, 4vw, 40px);
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.045em;
  line-height: 0.98;
}
h2 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 640;
  margin: 0 0 14px;
  letter-spacing: -0.03em;
}
h3 { font-size: 13px; font-weight: 650; margin: 20px 0 8px; letter-spacing: 0.04em; text-transform: uppercase; }
a { color: var(--accent); text-underline-offset: 3px; }
.muted { color: var(--ink-soft); margin: 0; }
.quiet { color: var(--ink-faint); font-weight: 400; }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.01em; }
.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 16px 18px 0;
  background: linear-gradient(180deg, rgba(242, 249, 255, 0.94), rgba(242, 249, 255, 0));
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 8px 8px 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 62px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: 0 8px 28px rgba(0, 26, 61, 0.06);
  backdrop-filter: blur(16px);
}
.brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.03em;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.brand-logo { height: 32px; width: auto; display: block; }
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent);
  display: inline-flex;
}
.brand-mark.big { width: 28px; height: 28px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.topbar nav a:hover { color: var(--ink); background: rgba(22, 19, 17, 0.04); }
.topbar nav a.active { background: var(--navy); color: #fff; }
.account-menu { position: relative; margin-left: auto; }
.account-trigger {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
}
.account-trigger::-webkit-details-marker { display: none; }
.account-trigger:hover,
.account-menu[open] .account-trigger { background: rgba(22, 19, 17, 0.05); }
.account-trigger .who { color: var(--ink); font-weight: 650; font-size: 13px; }
.account-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 196px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 60;
}
.account-panel-name {
  margin: 0;
  padding: 8px 10px 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line);
}
.account-panel a,
.account-panel .linklike {
  display: flex;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.account-panel a:hover,
.account-panel .linklike:hover { background: #F4F9FF; color: var(--ink); }
.account-panel form { margin: 0; }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.linklike {
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 0;
}
.linklike:hover { color: var(--ink); }

.page { max-width: 1180px; margin: 0 auto; padding: 36px 24px 88px; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-head > a.btn:not(.primary),
.page-head > .btn:not(.primary) {
  background: #fff;
  color: var(--ink);
  border-color: #B7C9DC;
  box-shadow: 0 1px 2px rgba(0, 26, 61, 0.08);
}
.page-head > a.btn:not(.primary):hover,
.page-head > .btn:not(.primary):hover {
  background: #F4F9FF;
  border-color: #8FB0D4;
  color: var(--ink);
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
input, select, textarea {
  font: inherit;
  font-size: 15px;
  font-weight: 450;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #A9BED2; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid rgba(0, 112, 216, 0.35);
  outline-offset: 1px;
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 120px; }
.form-row { display: flex; gap: 14px; align-items: flex-end; }
.form-row.wrap { flex-wrap: wrap; }
.form-row label { flex: 1; min-width: 160px; }
.email-secondary-action { margin-top: 14px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-transform: none;
  padding: 11px 18px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.btn:hover { background: rgba(22, 19, 17, 0.04); }
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(0, 112, 216, 0.22);
}
.btn.primary:hover { background: var(--accent-hover); color: #fff; }
.btn.small-btn { padding: 6px 12px; font-size: 12.5px; }
.btn.danger { color: var(--bad); background: var(--bad-bg); border-color: rgba(196, 50, 26, 0.28); }
.btn.danger:hover { background: #F8D6D2; color: var(--bad); }
.btn.disabled, a.btn.disabled, .btn:disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}

.flash {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid transparent;
}
.flash-success { background: var(--ok-bg); color: var(--ok); border-color: #C9E8E2; }
.flash-error { background: var(--bad-bg); color: var(--bad); border-color: #F0D0CB; }
.flash-warn { background: var(--warn-bg); color: var(--warn); border-color: #F0D7A8; }

body.auth-shell { background: var(--bg-deep); }
body.auth-shell::before { display: none; }
body.auth-shell .page {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(380px, 0.85fr);
}
.auth-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  overflow: hidden;
  padding: 48px;
  background:
    radial-gradient(460px 320px at 50% 58%, rgba(226, 74, 27, 0.24), transparent 68%),
    linear-gradient(165deg, #003878 0%, #001A3D 72%);
}
.auth-hero-brand {
  margin: 0;
  color: #ffffff;
}
.auth-hero-brand .brand-kicker { color: #e7a08c; font-size: 12px; }
.auth-hero-brand .brand-copy { color: #ffffff; font-size: 34px; font-weight: 680; letter-spacing: -0.03em; }
.auth-hero-brand .brand-mark.big {
  width: 56px;
  height: 56px;
  border-radius: 14px 14px 14px 5px;
  box-shadow: 10px 10px 0 rgba(226, 74, 27, 0.22);
}
.auth-slip-brand {
  margin: 0 0 6px;
  color: var(--ink);
}
.auth-slip-brand .brand-copy { font-size: 15px; font-weight: 700; }
.auth-scene {
  position: relative;
  width: min(520px, 88%);
  aspect-ratio: 1;
}
.auth-orbit,
.auth-orbit-inner {
  position: absolute;
  border: 1px solid rgba(255, 253, 249, 0.1);
  border-radius: 50%;
  animation: auth-spin 80s linear infinite;
}
.auth-orbit { inset: 4%; }
.auth-orbit-inner {
  inset: 16%;
  border-color: rgba(226, 74, 27, 0.28);
  animation-duration: 54s;
  animation-direction: reverse;
}
.auth-orbit::before,
.auth-orbit-inner::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.auth-orbit::before {
  top: 12%;
  left: 16%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(226, 74, 27, 0.75);
}
.auth-orbit-inner::after {
  right: 8%;
  bottom: 18%;
  background: #ffffff;
  opacity: 0.8;
}
.auth-stack {
  position: absolute;
  inset: 24% 20%;
  display: grid;
}
.auth-slip {
  grid-area: 1 / 1;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #f3eee6);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.28);
}
.auth-slip:nth-child(1) {
  transform: rotate(-9deg) translate(-22px, 14px);
  opacity: 0.42;
  background: #2a2420;
  border: 1px solid rgba(255, 253, 249, 0.08);
  box-shadow: none;
}
.auth-slip:nth-child(2) {
  transform: rotate(7deg) translate(20px, -8px);
  opacity: 0.72;
}
.auth-slip:nth-child(3) {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 20px;
  animation: auth-float 7.5s ease-in-out infinite;
}
.auth-slip-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px 8px 8px 3px;
  background: var(--accent);
  box-shadow: 7px 7px 0 rgba(226, 74, 27, 0.16);
}
.auth-slip-line {
  height: 8px;
  width: 100%;
  border-radius: 999px;
  background: rgba(22, 19, 17, 0.08);
}
.auth-slip-line.mid { width: 74%; }
.auth-slip-line.short { width: 42%; }
@keyframes auth-float {
  0%, 100% { transform: rotate(-1.5deg) translateY(0); }
  50% { transform: rotate(-1.5deg) translateY(-12px); }
}
@keyframes auth-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .auth-orbit,
  .auth-orbit-inner,
  .auth-slip:nth-child(3) { animation: none; }
}
.auth-stage {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
}
.auth-card {
  width: min(420px, 100%);
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 8px 4px;
  box-shadow: none;
  margin: 0;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--ink);
}
.auth-card h1 { font-size: 42px; }
.auth-card .btn.primary { width: 100%; margin-top: 6px; }
.app-shell .auth-card,
body.auth-shell .page > .auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  max-width: 460px;
}
body.auth-shell .page > .auth-card { margin: 12vh auto; }

.task-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  border-left: 3px solid var(--pending);
}
.task-card.state-done { border-left-color: var(--ok); }
.task-card.state-issue { border-left-color: var(--bad); }
.task-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.task-card details { margin: 8px 0 12px; }
.task-card summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600; }
.task-card details p { margin: 8px 0 0; font-size: 14px; }
.complete-form {
  border-top: 1px dashed var(--line-strong);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chip-done { background: var(--ok-bg); color: var(--ok); }
.chip-late { background: var(--warn-bg); color: var(--warn); }
.chip-issue { background: var(--bad-bg); color: var(--bad); }
.chip-pending { background: #E7F1FB; color: var(--ink-faint); }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.dot-done { background: var(--ok); }
.dot-late { background: var(--warn); }
.dot-issue { background: var(--bad); }
.dot-pending { background: transparent; border: 2px solid var(--pending); }
.dot-link { display: inline-flex; padding: 4px; border-radius: 50%; }
.dot-link:hover { background: #E7F1FB; }
.legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  margin-bottom: 28px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.stat {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 18px 16px 16px 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  position: relative;
}
.stat::before { display: none; }
.stat-num {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  line-height: 1;
  order: 2;
}
.stat-num.ok { color: var(--ok); }
.stat-num.warn { color: var(--warn); }
.stat-num.bad { color: var(--bad); }
.stat-num.muted-num { color: var(--ink); }
.stat-label {
  order: 1;
  font-size: 11px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin-bottom: 8px;
}
.stat-link { text-decoration: none; display: flex; flex-direction: column; color: inherit; }
.stat-link:hover .stat-num { color: var(--accent); }

.table-wrap { overflow-x: auto; }
table.grid, table.list { border-collapse: collapse; width: 100%; font-size: 14px; }
table.grid th, table.grid td, table.list th, table.list td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
table.list tbody tr { transition: background 0.12s ease; }
table.list tbody tr:hover { background: #F4F9FF; }
table.grid th, table.list th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  font-weight: 700;
}
table.grid td.cell { text-align: center; }
table.grid th:not(.task-col) { text-align: center; }
.task-col { min-width: 220px; }
.inactive-row { opacity: 0.45; }
.current-row { background: #F4F9FF; }
.actions { white-space: nowrap; }
.actions > * { margin-right: 6px; }
table.matrix td { text-align: center; }
table.matrix th { font-weight: 650; }

.date-picker { display: flex; gap: 8px; align-items: flex-end; }
.export-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  background: #F4F9FF;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 16px;
}
.empty {
  padding: 36px 8px;
  text-align: center;
  color: var(--ink-soft);
}
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 0; }
.detail-grid dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  font-weight: 700;
}
.detail-grid > div { min-width: 0; }
.detail-grid dd { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; word-break: break-word; }
.remarks {
  background: #F4F9FF;
  border-radius: 14px;
  padding: 16px 16px;
  white-space: pre-wrap;
}
.evidence-img { max-width: 100%; border: 1px solid var(--line); border-radius: 12px; }
.role-list { margin: 0 0 14px; padding-left: 20px; }

.ticket-block { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #F4F9FF; }
.ticket-block summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.ticket-block .form-row { margin-top: 12px; }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.file-list .file-name { font-weight: 600; flex: 1; word-break: break-all; }

.filter-bar label { min-width: 130px; }
.grow-2 { flex: 2; }
.type-hints { margin: 4px 0 12px; line-height: 1.7; text-transform: none; letter-spacing: 0; font-weight: 450; }
.entra-field { flex: 1; min-width: 160px; position: relative; }
.entra-field label { min-width: 0; }
.entra-results {
  position: absolute;
  z-index: 2;
  top: calc(100% - 22px);
  left: 0;
  right: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.entra-results-list { list-style: none; margin: 0; padding: 0; }
.entra-result {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.entra-result:last-child { border-bottom: 0; }
.entra-result:hover, .entra-result:focus-visible { background: #F4F9FF; }
.entra-result span { color: var(--ink-soft); font-size: 12px; }
.entra-status { min-height: 18px; margin: 3px 0 0; text-transform: none; letter-spacing: 0; font-weight: 450; }
.requester-details-row { align-items: flex-start; }
.required-legend { margin: 0; color: var(--ink-soft); font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 450; }
.field-label { display: inline; }
.required-mark { color: var(--accent); font-weight: 700; }
.queue-empty { margin: 16px 0 0; }
.queue-table { margin-top: 16px; }
.stat-word { font-size: 18px; line-height: 1.25; letter-spacing: -0.03em; padding: 2px 0; }
.sla-breach { color: var(--bad); font-weight: 700; }
.chip.prio-P1 { background: var(--bad-bg); color: var(--bad); }
.chip.prio-P2 { background: var(--warn-bg); color: var(--warn); }
.chip.prio-P3 { background: var(--info-bg); color: var(--info); }
.chip.prio-P4 { background: #E7F1FB; color: var(--ink-soft); }
.split-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-bottom: 28px; }
.split-panels .panel { margin-bottom: 0; }
.split-panels + .panel { margin-top: 8px; }
.ticket-export-panel { grid-column: span 2; }
.ticket-export-panel .export-form { flex-wrap: nowrap; }
.ticket-export-panel .export-form label { min-width: 150px; }

.weekly-metrics { margin-bottom: 20px; }
.weekly-metrics-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.weekly-metrics-head h2 { margin: 0 0 4px; }
.weekly-metrics-head .muted { margin: 0; }
.weekly-totals { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.weekly-totals-compare { gap: 16px 24px; }
.weekly-total-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  padding: 10px 14px;
  background: #F4F9FF;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.weekly-total-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  width: 100%;
  margin-bottom: 2px;
}
.weekly-total { font-size: 13px; color: var(--ink-soft); }
.weekly-total strong {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 640;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
  letter-spacing: -0.03em;
}
.weekly-total.bad-text strong,
.weekly-total strong.bad-text { color: var(--bad); }
.weekly-total strong.ok-text { color: var(--ok); }
.weekly-total strong.warn-text { color: var(--warn); }
.weekly-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.chart-card {
  background: linear-gradient(180deg, #ffffff, #F4F9FF);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px 10px;
}
.chart-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.chart-frame { position: relative; height: 220px; width: 100%; }

.thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #F4F9FF;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.thread-head-avatar { width: 40px; height: 40px; font-size: 13px; flex: 0 0 auto; }
.thread-head-id { min-width: 0; }
.thread-head-name {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-transform: none;
}
.thread-head-sub {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.thread-head-sub .quiet { margin-left: 8px; }
.thread {
  list-style: none;
  margin: 0 0 20px;
  padding: 8px 4px 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}
.thread-system {
  align-self: center;
  min-width: 0;
  max-width: min(88%, 560px);
  overflow-wrap: anywhere;
  list-style: none;
}
.thread-day {
  align-self: center;
  list-style: none;
  margin: 4px 0 2px;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 650;
}
.thread-system-box {
  background: var(--warn-bg);
  color: var(--ink-soft);
  border: 1px solid #D7E6F5;
  border-radius: 12px;
  padding: 6px 12px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.4;
}
.thread-system-box p { margin: 0; overflow-wrap: anywhere; word-break: break-word; }
.thread-system-time {
  display: block;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10.5px;
}
.thread-item {
  align-self: flex-start;
  min-width: 0;
  max-width: min(78%, 640px);
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 4px;
  padding: 10px 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(22, 19, 17, 0.03);
  text-align: left;
}
.thread-item.mine {
  align-self: flex-end;
  background: #EAF4FF;
  border-color: #C1D5F8;
  border-radius: 16px 16px 4px 16px;
}
.thread-meta { display: flex; align-items: center; justify-content: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; text-align: left; }
.thread-author { font-weight: 700; font-size: 13px; color: var(--ink); }
.thread-body { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font-size: 14px; }
.thread-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.thread-edit-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.thread-edit-btn svg { width: 14px; height: 14px; }
.thread-edit-btn:hover,
.thread-item.is-editing .thread-edit-btn { background: #fff; color: var(--accent); }
.thread-edited {
  color: var(--ink-faint);
  font-size: 11px;
  font-style: italic;
}
.thread-item.is-editing > .thread-body,
.thread-item.is-editing > .thread-files,
.thread-item.is-editing .thread-edit-btn { display: none; }
.thread-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
  padding: 10px;
  border: 1px solid #C1D5F8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 26, 61, 0.06);
}
.thread-editor[hidden] { display: none; }
.thread-editor textarea {
  min-height: 76px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #F7FBFF;
}
.thread-editor-actions { display: flex; justify-content: flex-end; gap: 8px; }
.thread-existing { margin: 0; }
.thread-existing .attach-item { position: relative; }
.thread-remove-flag {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.thread-time {
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}
.thread-form { border-top: 1px dashed var(--line-strong); padding-top: 16px; }
.thread-files { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; margin-top: 8px; }
.thread-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #D5E3F0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 650;
}
.thread-file svg { width: 14px; height: 14px; flex: none; color: var(--ink-soft); }
.thread-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.thread-file svg { margin-left: 2px; }
.thread-file:hover { color: var(--accent); border-color: #8FB0D4; }
.thread-editor .attach-picker { gap: 0; }
.message-box { position: relative; display: block; width: 100%; }
.message-box textarea {
  display: block;
  width: 100%;
  min-height: 148px;
  padding-bottom: 36px;
}
.thread-editor .message-box textarea { min-height: 96px; }
.attach-clip {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5B6878;
  cursor: pointer;
}
.attach-clip svg { width: 18px; height: 18px; }
.attach-clip:hover { color: var(--accent); }
.attach-clip:disabled { opacity: 0.4; cursor: default; }
.attach-in-box .attach-picker { gap: 0; }
.attachment-field { display: flex; flex-direction: column; gap: 6px; }
.attach-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.attachment-field input[type="file"] {
  padding: 14px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: #F4F9FF;
  font: inherit;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}
.thread-form-actions { align-items: flex-end; }
.resolution-fields.is-locked {
  opacity: 0.72;
  background: #F4F9FF;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  padding: 12px 14px;
}
.resolution-fields .resolution-hint { margin: 0 0 10px; }
.resolution-fields:not(.is-locked) .resolution-hint { display: none; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.pager-meta { font-size: 13px; color: var(--ink-soft); }
.pager-links { display: flex; align-items: center; gap: 8px; }
.pager-page { font-size: 13px; color: var(--ink-soft); min-width: 7.5em; text-align: center; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.72fr);
  gap: 20px;
  align-items: start;
}
.workspace-aside { display: flex; flex-direction: column; gap: 18px; }
.workspace-aside .panel { margin-bottom: 0; }
.ticket-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ticket-ref {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: #ffffff;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 700;
  margin-right: 8px;
  vertical-align: 4px;
}
h1.ticket-summary-heading {
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
}
h1.ticket-summary-heading .ticket-ref {
  font-size: 14.5px;
  vertical-align: baseline;
}
.properties { display: grid; gap: 14px; }
.properties div { min-width: 0; }
.properties dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  font-weight: 700;
}
.properties dd { margin: 4px 0 0; font-weight: 650; }

.ticket-list { display: flex; flex-direction: column; }
.ticket-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) auto;
  gap: 12px 18px;
  align-items: center;
  padding: 18px 4px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-decoration: none;
  color: inherit;
  box-shadow: none;
  transition: background 0.12s ease;
}
.ticket-row:hover {
  background: #F4F9FF;
  color: inherit;
}
.ticket-row-title { font-weight: 650; letter-spacing: -0.02em; }
.ticket-row-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.ticket-row-sub { color: var(--ink-soft); font-size: 13px; margin: 2px 0 0; }

.form-actions {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: rgba(242, 249, 255, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 { margin: 0; }
.step-no {
  display: inline-flex;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  vertical-align: -2px;
}
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.role-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px;
  background: #F4F9FF;
}
.role-card strong { display: block; margin-bottom: 4px; letter-spacing: -0.02em; }
.filter-bar {
  background: #F4F9FF;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
}
.member-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.member-head h2 { margin: 0; }
.member-count { margin: 0; color: var(--ink-faint); font-size: 13px; font-weight: 650; }
.member-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px;
  background: #F4F9FF;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.member-search { display: flex; gap: 8px; align-items: center; }
.member-search input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff;
}
.member-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.member-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.member-tab span {
  min-width: 1.4em;
  padding: 1px 6px;
  border-radius: 999px;
  background: #E7F1FB;
  color: var(--ink);
  font-size: 12px;
  text-align: center;
}
.member-tab:hover { color: var(--ink); border-color: var(--ink); }
.member-tab.active {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}
.member-tab.active span { background: rgba(255, 253, 249, 0.16); color: #ffffff; }

.user-portal { max-width: 760px; margin-left: auto; margin-right: auto; }
.user-portal-title { color: var(--ink); }
.user-identity {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.user-identity > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: baseline;
}
.user-identity dt { margin: 0; font-weight: 700; color: var(--ink); letter-spacing: 0.08em; font-size: 11px; text-transform: uppercase; }
.user-identity dd { margin: 0; font-size: 16px; }
.user-topic-field, .user-priority-field { max-width: 420px; }
[data-issue-subcategory-wrap][hidden] { display: none !important; }
.user-ticket-details { display: flex; flex-direction: column; gap: 14px; }
.user-ticket-details[hidden] { display: none; }
.user-ticket-details h2 { margin-bottom: 0; }
.priority-picker { display: flex; flex-direction: column; gap: 12px; }
.priority-picker h3 { margin: 4px 0 0; text-transform: none; letter-spacing: -0.02em; font-size: 16px; }
.priority-box:disabled {
  opacity: 1;
  cursor: default;
  background: #F4F9FF;
  color: var(--ink-faint);
  font-weight: 700;
}
.priority-box.is-p1:disabled { color: var(--bad); background: var(--bad-bg); }
.priority-box.is-p2:disabled { color: var(--warn); background: var(--warn-bg); }
.priority-box.is-p3:disabled { color: var(--info); background: var(--info-bg); }
.priority-box.is-p4:disabled { color: var(--ink-soft); background: #E7F1FB; }
.drop-field input[type="file"] {
  padding: 22px 14px;
  border: 1px dashed var(--line-strong);
  background:
    linear-gradient(180deg, rgba(226, 74, 27, 0.04), transparent 70%),
    #F4F9FF;
}
.user-ticket-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.status-filters {
  display: flex;
  gap: 8px;
  margin: -8px 0 18px;
}
.status-filters a {
  text-decoration: none;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 650;
}
.status-filters a.active,
.status-filters a:hover {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}

@media (max-width: 960px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-hero { min-height: 360px; padding: 36px 28px; gap: 22px; }
  .auth-hero-brand .brand-copy { font-size: 26px; }
  .auth-hero-brand .brand-mark.big { width: 44px; height: 44px; }
  .auth-scene { width: min(280px, 70vw); }
  .workspace { grid-template-columns: 1fr; }
  .ticket-row { grid-template-columns: 1fr; }
  .ticket-row-meta { justify-content: flex-start; }
  .ticket-export-panel { grid-column: 1 / -1; }
  .ticket-export-panel .export-form { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 10px 0; }
  .topbar-inner { border-radius: 22px; padding: 10px 12px; }
  .page { padding: 22px 14px 56px; }
  .form-row { flex-direction: column; align-items: stretch; }
  .page-head { flex-direction: column; align-items: stretch; }
  .chart-frame { height: 200px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .fact-sheet { grid-template-columns: 1fr; }
}

.desk-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
}
.desk-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.desk-tab {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 14px 12px;
  border-bottom: 2px solid transparent;
}
.desk-tab span {
  display: inline-flex;
  min-width: 1.4em;
  justify-content: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #E7F1FB;
  color: var(--ink);
  font-size: 12px;
}
.desk-tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.desk-search { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.desk-search input { min-width: min(320px, 70vw); }
.desk-lenses { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.desk-lenses a {
  text-decoration: none;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 650;
}
.desk-lenses a span { margin-left: 6px; color: var(--ink-faint); }
.desk-lenses a.active { background: var(--navy); color: #ffffff; border-color: var(--navy); }
.desk-lenses a.active span { color: #ffffff; }
.desk-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.desk-panel-head h1 { font-size: 28px; margin: 0; }
.desk-sort { display: flex; gap: 8px; align-items: flex-end; }
.desk-sort label { min-width: 160px; }
.desk-table td a { color: var(--ink); font-weight: 650; text-decoration: none; }
.desk-table td a:hover { color: var(--accent); }
.assign-inline { display: flex; gap: 6px; align-items: center; min-width: 160px; }
.assign-inline select { min-width: 140px; max-width: 180px; padding: 6px 8px; font-size: 13px; border-radius: 10px; }
.handle-assign { margin-bottom: 16px; }
.handle-assign label, .handle-top label { min-width: 220px; max-width: 320px; }
.composer {
  margin-top: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #F4F9FF;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.composer-fields {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.composer-fields:disabled { opacity: 0.55; }
.composer-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.composer-meta form { margin: 0; }
.composer-meta select,
.composer textarea,
.composer input[type="file"] { background: #fff; }
.composer-form { display: flex; flex-direction: column; gap: 12px; }
.composer .reply-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.composer .reply-kinds label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: auto;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
.composer .reply-kinds label:has(input:checked) {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}
.composer .reply-kinds input {
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  flex: none;
}
.composer-comment,
.composer-comment .message-box { width: 100%; }
.composer-comment textarea { min-height: 148px; }
.composer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px 12px;
}
.composer-actions .attachment-field { min-width: 0; align-self: stretch; }
.composer-actions input[type="file"] { padding: 8px 10px; }
.composer-actions > .btn { justify-self: end; margin-bottom: 1px; }
.composer-file-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: 100%;
}
.composer-file-row [data-attach-list-host] { flex: 1; min-width: 0; }
.composer-file-row .attach-list { margin: 0; }
.composer-file-row > .btn { flex: none; margin-left: auto; white-space: nowrap; }
.attach-add-btn { white-space: nowrap; }
@media (max-width: 720px) {
  .composer-meta,
  .composer-actions { grid-template-columns: 1fr; display: flex; flex-direction: column; align-items: stretch; }
}
.resolution-card fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}
.resolution-card fieldset:disabled { opacity: 0.55; }
.resolution-sheet { border-top: 1px solid var(--line); padding-top: 14px; }
.resolution-sheet[hidden] { display: none; }
.resolution-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 14px 18px;
}
.resolution-notes-field { grid-column: 1 / -1; }
.resolution-vendor { grid-column: 1; }
.resolution-vendor[hidden] { display: none; }
.sn-notes { display: grid; gap: 14px; }
.work-notes textarea {
  background: #F4F9FF;
  border-color: var(--line);
}
.work-notes textarea:focus { background: #fff; }
.transfer-form { flex-wrap: wrap; align-items: flex-end; }
.transfer-note { min-width: 220px; flex: 1; }
.transfer-note input { padding: 8px 10px; font-size: 14px; }
.subject-link { letter-spacing: -0.02em; }
.thread-count {
  display: inline-flex;
  margin-left: 8px;
  min-width: 1.4em;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: #E7F1FB;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}
.row-overdue { background: #F4F9FF; }
.prio-tone {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.prio-tone-p4, .prio-tone-low { background: #E7F1FB; color: var(--ink-soft); }
.prio-tone-p3, .prio-tone-normal { background: #fff3c4; color: #7a5b10; }
.prio-tone-p2, .prio-tone-high { background: #fde2dc; color: #9b2c2c; }
.prio-tone-p1, .prio-tone-emergency { background: #f3c4bc; color: #7a1d1d; }
.fact-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.fact-sheet > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.fact-sheet > div:nth-child(4n+1),
.fact-sheet > div:nth-child(4n+2) { background: #F4F9FF; }
.fact-sheet dt {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}
.fact-sheet dd { margin: 0; font-weight: 600; }
.agent-action-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.agent-action-row .inline-form { align-items: flex-end; }
.resolve-form { border-top: 1px dashed var(--line-strong); padding-top: 16px; }
.reply-kinds { display: flex; flex-wrap: wrap; gap: 14px; }
.reply-kind {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}
.reply-kind input { width: auto; }

/* Shared card, table, and form rhythm for User and IT pages */
.page:has(.desk) { max-width: 1440px; }
.page:has(.agent-ticket) { max-width: 1080px; }
.agent-ticket h1,
.user-portal h1 { overflow-wrap: anywhere; }

.panel > h2,
.panel > h3:first-child {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.panel > h3 { margin-top: 18px; }
.panel .remarks { margin-top: 4px; }
.panel .empty,
.panel > .muted { margin: 4px 0 2px; }

.metric-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  border: 0;
  margin-bottom: 18px;
}
.metric-strip .stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px 16px;
  box-shadow: var(--shadow);
}
a.metric-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
a.metric-link:hover { border-color: var(--blue); }
a.metric-link.active { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(0, 26, 61, 0.12); }
#ticket-queue { scroll-margin-top: 96px; }
.metric-strip .stat-num { font-size: 30px; }

.user-portal .stat-row {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.user-portal .stat { padding: 16px 18px; }
.user-portal .stat + .stat { border-left: 1px solid var(--line); }
.user-portal .stat-word { font-size: 17px; overflow-wrap: anywhere; }
.user-portal .ticket-ref {
  background: #E7F1FB;
  color: var(--ink);
  justify-content: center;
  min-width: 0;
}
.user-portal .panel > .ticket-list { margin: 2px -22px -8px; }
.user-portal .ticket-row {
  grid-template-columns: 112px minmax(0, 1fr) auto;
  padding: 14px 22px;
}
.user-portal .ticket-row:hover { background: #F4F9FF; }
.user-portal .page-head,
.agent-ticket .page-head,
.desk-toolbar { align-items: center; }

.fact-sheet {
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
  padding: 6px 18px 8px;
}
.fact-sheet > div,
.fact-sheet > div:nth-child(4n+1),
.fact-sheet > div:nth-child(4n+2) {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 10px 0;
  background: transparent;
  border-bottom: 1px solid var(--line);
}
.fact-sheet > div:nth-last-child(-n+2) { border-bottom: 0; }
.fact-sheet dt {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.fact-sheet dd { font-size: 14px; overflow-wrap: anywhere; }

.desk-panel { padding-bottom: 14px; }
.desk-panel-head { margin-bottom: 12px; }
.desk-panel-head h1 { font-size: 22px; letter-spacing: -0.03em; }
.desk-panel .table-wrap {
  margin: 0 -22px;
  border-top: 1px solid var(--line);
}
.desk-table { min-width: 1080px; }
.desk-table th,
.desk-table td { padding: 10px 12px; }
.desk-table th { white-space: nowrap; background: #F4F9FF; }
.desk-table tbody tr { background: #fff; }
.desk-table tbody tr:hover,
.desk-table tbody tr.row-overdue { background: #F4F9FF; }
.desk-table td.mono,
.desk-table td.small { white-space: nowrap; }
.desk-table .subject-link {
  display: inline;
  font-weight: 650;
}
.desk-panel .pager { margin: 12px 0 2px; }
.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--bad); }

table.list thead th { background: #F4F9FF; }
table.tally th:last-child,
table.tally td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  width: 5.5em;
}
.split-panels .panel { display: flex; flex-direction: column; }
.split-panels .panel > .muted { margin-top: 4px; }
.filter-bar {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0 0 4px;
  margin-bottom: 8px;
}
.queue-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px 14px;
  align-items: end;
  margin-bottom: 8px;
}
.queue-filters label { min-width: 0; }
.queue-filters .filter-actions { display: flex; align-items: flex-end; }
.queue-filters .filter-actions .btn { min-height: 46px; }
.weekly-metrics .chart-card { box-shadow: none; }

.resolution-card:has(fieldset:disabled) {
  background: transparent;
  box-shadow: none;
  border-style: dashed;
}
.resolution-card:has(fieldset:disabled) h2 { color: var(--ink-soft); }
.resolution-card .stack { gap: 12px; }
.composer-note { margin: -4px 0 0; }

.user-ticket-form .panel { display: flex; flex-direction: column; gap: 14px; }
.user-identity { margin-bottom: 4px; }
.user-ticket-actions {
  margin-top: -2px;
  padding: 4px 2px 0;
}
.user-ticket-actions .btn:not(.primary) {
  background: #fff;
  color: var(--ink);
  border-color: #B7C9DC;
  box-shadow: 0 1px 2px rgba(0, 26, 61, 0.08);
}
.user-ticket-actions .btn:not(.primary):hover {
  background: #F4F9FF;
  border-color: #8FB0D4;
  color: var(--ink);
}
.info-tip { position: relative; display: inline-flex; vertical-align: middle; margin-left: 4px; }
.info-tip-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--ink-soft);
  font: 700 11px/14px var(--sans);
  cursor: help;
}
.info-tip-text {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 5;
  width: min(280px, 70vw);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
}
.info-tip:hover .info-tip-text,
.info-tip:focus-within .info-tip-text { display: block; }
.attach-store,
.attach-picker-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.attach-picker { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.attach-add-btn { background: #fff; }
.attach-error {
  margin: 0;
  color: var(--bad);
  font-size: 13px;
  font-weight: 650;
}
.attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.attach-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 2px 2px 2px 8px;
  border: 1px solid #D5E3F0;
  border-radius: 999px;
  background: #fff;
}
.attach-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
}
.attach-size {
  color: var(--ink-faint);
  font-size: 11.5px;
  white-space: nowrap;
}
.attach-remove {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.attach-remove svg { width: 12px; height: 12px; }
.attach-remove:hover { background: #F4F9FF; color: var(--bad); }
.drop-field input[type="file"] { padding: 16px 14px; }

@media (max-width: 1100px) {
  .metric-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .queue-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .metric-strip,
  .user-portal .stat-row { grid-template-columns: 1fr 1fr; }
  .user-portal .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
  .user-portal .ticket-row { grid-template-columns: 1fr; padding: 14px 16px; }
  .fact-sheet,
  .fact-sheet > div { grid-template-columns: 1fr; }
  .fact-sheet > div:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .fact-sheet > div:last-child { border-bottom: 0; }
  .desk-panel .table-wrap,
  .user-portal .panel > .ticket-list { margin-left: -14px; margin-right: -14px; }
}

body.signin-page { background: #fff; }
body.signin-page::before { display: none; }
body.signin-page .page { max-width: none; margin: 0; padding: 0; min-height: 100vh; }
body.signin-page .page > .flash { margin: 0; }
.signin { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; background: #fff; }
.si-left { position: relative; background: var(--navy); overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.si-left::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.4px); background-size: 18px 18px; }
.glow { position: absolute; left: 50%; top: 50%; width: 640px; height: 640px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(0,139,255,.30), rgba(0,139,255,0) 62%); }
.stage { position: absolute; inset: 0; }
.orbits { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.orbit { position: absolute; left: 0; top: 0; width: calc(var(--r) * 2); height: calc(var(--r) * 2); margin: calc(var(--r) * -1) 0 0 calc(var(--r) * -1); border: 1px solid rgba(255,255,255,.09); border-radius: 50%; animation: spin var(--d) linear infinite; }
.orbit.rev { animation-direction: reverse; }
.orbit.rev .ic { animation-direction: normal; }
.orbit-200 { --r: 200px; --d: 80s; }
.orbit-275 { --r: 275px; --d: 110s; }
.orbit-350 { --r: 350px; --d: 140s; }
.sat { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a))); }
.sat-200 { --r: 200px; }
.sat-275 { --r: 275px; }
.sat-350 { --r: 350px; }
.a-n40 { --a: -40deg; }
.a-140 { --a: 140deg; }
.a-60 { --a: 60deg; }
.a-25 { --a: 25deg; }
.a-205 { --a: 205deg; }
.a-300 { --a: 300deg; }
.a-100 { --a: 100deg; }
.a-280 { --a: 280deg; }
.a-190 { --a: 190deg; }
.ic { position: absolute; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: #062B5C; border: 1px solid rgba(95,180,255,.28); display: grid; place-items: center; color: #6FBCFF; animation: spin var(--d) linear infinite reverse; box-shadow: 0 0 0 6px rgba(0,26,61,.6); transition: background .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease), opacity .45s var(--ease); }
.ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pt { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: #5FB4FF; box-shadow: 0 0 10px 2px rgba(0,139,255,.7); }
.pt.dim { background: rgba(255,255,255,.5); box-shadow: none; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; }
.ic.alert { background: #3A2A0A; border-color: var(--amber); color: var(--amber); animation: spin var(--d) linear infinite reverse, ping 1s ease-out infinite; }
.orbit.rev .ic.alert { animation: spin var(--d) linear infinite, ping 1s ease-out infinite; }
.ic.away { opacity: .18; }
.ic.fixed { background: #0B4A4E; border-color: #5ED6CF; color: #9BEDE7; }
.ic .ok { position: absolute; right: -3px; top: -3px; width: 18px; height: 18px; border-radius: 50%; background: var(--teal-d); display: grid; place-items: center; opacity: 0; transform: scale(.4); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.ic .ok svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 2.4; }
.ic.fixed .ok { opacity: 1; transform: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 0% { box-shadow: 0 0 0 6px rgba(0,26,61,.6), 0 0 0 0 rgba(255,181,71,.55); } 100% { box-shadow: 0 0 0 6px rgba(0,26,61,.6), 0 0 0 18px rgba(255,181,71,0); } }
.token { position: absolute; left: 0; top: 0; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; display: grid; place-items: center; opacity: 0; z-index: 3; }
.token svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.token.out { background: var(--amber); color: var(--navy); box-shadow: 0 0 0 8px rgba(255,181,71,.18), 0 10px 30px rgba(255,181,71,.35); }
.token.back { background: #5ED6CF; color: var(--navy); box-shadow: 0 0 0 8px rgba(94,214,207,.18), 0 10px 30px rgba(94,214,207,.35); }
.cwrap { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 2; }
.tk { position: absolute; left: 0; top: 0; width: 360px; transform: translate(-50%, -50%) scale(.14); opacity: 0; background: #fff; border-radius: 20px; padding: 22px 24px; box-shadow: 0 28px 70px rgba(0,0,0,.38); transition: transform .55s var(--ease), opacity .35s var(--ease), border-radius .55s var(--ease); }
.tk.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.tk.hide { transform: translate(-50%, -50%) scale(.14); opacity: 0; border-radius: 60px; transition: transform .45s cubic-bezier(.55,0,.75,.2), opacity .35s ease .1s, border-radius .45s; }
.tk-top { display: flex; justify-content: space-between; align-items: center; height: 30px; }
.tk-id { font: 600 14px var(--head); color: var(--ink-soft); }
.xf { position: relative; display: block; }
.xf > span { position: absolute; right: 0; top: 0; white-space: nowrap; opacity: 0; transform: translateY(6px); filter: blur(3px); transition: opacity .5s var(--ease), transform .5s var(--ease), filter .5s var(--ease); }
.tk[data-s="1"] .xf .x1, .tk[data-s="2"] .xf .x2, .tk[data-s="3"] .xf .x3 { opacity: 1; transform: none; filter: blur(0); }
.st { width: 130px; height: 30px; }
.st > span { height: 30px; padding: 0 12px; border-radius: 15px; font: 600 13px/30px var(--head); display: flex; align-items: center; gap: 6px; }
.st i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st .x1 { background: #E3F1FF; color: #0062BF; }
.st .x2 { background: var(--lav); color: #3E3683; }
.st .x2 i { animation: pulse 1.2s ease-in-out infinite; }
.st .x3 { background: var(--teal); color: #0B5A57; }
@keyframes pulse { 50% { opacity: .3; } }
.tk-ttl { font: 700 22px/1.3 var(--head); color: var(--ink); margin: 14px 0 12px; letter-spacing: -0.01em; height: 29px; white-space: pre; }
.tk-ttl .ch { display: inline-block; opacity: 0; transform: translateY(.35em); filter: blur(4px); animation: chIn .5s var(--ease) forwards; animation-delay: calc(260ms + var(--i) * 32ms); }
@keyframes chIn { to { opacity: 1; transform: none; filter: blur(0); } }
.tk-meta { display: flex; gap: 8px; height: 28px; }
.tag2 { display: inline-flex; white-space: nowrap; align-items: center; gap: 6px; font: 600 13px/26px var(--body); padding: 0 12px; border-radius: 14px; opacity: 0; transform: scale(.92); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.tk.tags-on .tag2 { opacity: 1; transform: none; }
.tk.tags-on .tag2 + .tag2 { transition-delay: .1s; }
.tag2.cat { background: var(--lblue); color: var(--navy-mid); border: 1px solid var(--peri); }
.tag2.hi { background: #FFF2E0; color: #8A4500; border: 1px solid #FFD8A8; }
.tag2.no { background: #F1F4F8; color: #4A5666; border: 1px solid #DCE3EC; }
.tag2 svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tk .bar { height: 6px; border-radius: 3px; background: #EAF0F7; margin: 20px 0 14px; overflow: hidden; }
.tk .bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--blue); transition: width .8s var(--ease), background .5s; }
.tk[data-s="1"] .bar i { width: 12%; }
.tk[data-s="2"] .bar i { width: 58%; }
.tk[data-s="3"] .bar i { width: 100%; background: var(--teal-d); }
.tk-foot { height: 21px; font-size: 14px; color: var(--ink-soft); }
.tk-foot > span { left: 0; right: auto; }
.tk-foot b { color: var(--ink); font-weight: 600; }
.si-right { display: flex; align-items: center; justify-content: center; padding: 48px 40px; background: #fff; }
.si-box { width: 100%; max-width: 400px; }
.si-box .logo { height: 52px; width: auto; display: block; margin-bottom: 56px; }
.si-box h1 { font-size: 40px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; }
.si-box .lead { margin: 0 0 32px; color: var(--ink-soft); font-size: 18px; line-height: 1.5; }
.si-box .btn { width: 100%; min-height: 56px; font-size: 16px; border-radius: 28px; font-family: var(--head); font-weight: 700; }
.ms { width: 20px; height: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms i { display: block; }
.ms i:nth-child(1) { background: #F25022; }
.ms i:nth-child(2) { background: #7FBA00; }
.ms i:nth-child(3) { background: #00A4EF; }
.ms i:nth-child(4) { background: #FFB900; }
.signin-status { min-height: 1.2em; margin: 14px 0 0; color: var(--ink-soft); font-size: 14px; }
@media (max-width: 960px) {
  .signin { grid-template-columns: 1fr; }
  .si-left { min-height: 0; height: 380px; }
  .orbits { transform: scale(.6); }
  .si-right { padding: 36px 24px 48px; align-items: flex-start; }
  .si-box .logo { height: 44px; margin-bottom: 32px; }
  .si-box h1 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .si-left * { animation: none !important; transition: none !important; }
}
