:root {
  color-scheme: light;
  --admin-canvas: #f5f7f6;
  --admin-surface: #ffffff;
  --admin-surface-muted: #f0f3f1;
  --admin-surface-accent: #e8f6ef;
  --admin-border: #d7ded9;
  --admin-border-strong: #b6c2bb;
  --admin-text: #17201b;
  --admin-text-muted: #607068;
  --admin-accent: #087a4b;
  --admin-accent-hover: #076b43;
  --admin-accent-foreground: #ffffff;
  --admin-danger: #b42318;
  --admin-danger-surface: #fff0ee;
  --admin-warning: #8a5600;
  --admin-warning-surface: #fff8e6;
  --admin-info: #175cd3;
  --admin-info-surface: #eff6ff;
  --admin-violet: #6941c6;
  --admin-violet-surface: #f5f3ff;
  --admin-focus: #12a868;
  --sidebar-width: 248px;
  --control-height: 42px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --admin-canvas: #101512;
  --admin-surface: #171e1a;
  --admin-surface-muted: #202923;
  --admin-surface-accent: #163c2a;
  --admin-border: #34433a;
  --admin-border-strong: #516158;
  --admin-text: #f1f5f2;
  --admin-text-muted: #a8b6ae;
  --admin-accent: #60d394;
  --admin-accent-hover: #7ce0a8;
  --admin-accent-foreground: #0a2115;
  --admin-danger: #ff8a80;
  --admin-danger-surface: #3f1d1b;
  --admin-warning: #f8c76c;
  --admin-warning-surface: #3b2c12;
  --admin-info: #84adff;
  --admin-info-surface: #172b50;
  --admin-violet: #c3a6ff;
  --admin-violet-surface: #2f2450;
  --admin-focus: #7ce0a8;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--admin-canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--admin-canvas);
  color: var(--admin-text);
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--admin-accent);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.65rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 1rem;
  line-height: 1.35;
}

code {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--admin-focus) 40%, transparent);
  outline-offset: 2px;
}

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

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.support-shell {
  min-height: 100vh;
}

.support-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--admin-border);
  background: var(--admin-surface);
}

.support-brand,
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.support-brand {
  height: 72px;
  padding: 0 22px;
  border-bottom: 1px solid var(--admin-border);
}

.support-brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--admin-accent);
  color: var(--admin-accent-foreground);
  font-size: 18px;
  font-weight: 750;
}

.support-brand > span:last-child,
.auth-brand > span:last-child,
.support-operator > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.support-brand small,
.auth-brand small,
.support-operator small {
  color: var(--admin-text-muted);
  font-size: 11px;
}

.support-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  padding: 18px 12px;
}

.support-nav-link {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--admin-text-muted);
  font-weight: 600;
  text-decoration: none;
}

.support-nav-link:hover {
  background: var(--admin-surface-muted);
  color: var(--admin-text);
}

.support-nav-link.is-active {
  border-color: color-mix(in srgb, var(--admin-accent) 26%, var(--admin-border));
  background: var(--admin-surface-accent);
  color: var(--admin-accent);
}

.support-sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--admin-border);
}

.support-operator {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 9px;
}

.support-operator strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--admin-border);
  border-radius: 50%;
  background: var(--admin-surface-muted);
  color: var(--admin-accent);
  font-weight: 700;
}

.support-main {
  min-height: 100vh;
  min-width: 0;
  margin-left: var(--sidebar-width);
  overflow-x: hidden;
  overflow-x: clip;
}

.support-topbar {
  display: flex;
  height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--admin-border);
  background: var(--admin-surface);
}

.support-topbar-note,
.muted-label {
  color: var(--admin-text-muted);
  font-size: 12px;
  font-weight: 650;
}

.support-mobile-header {
  display: none;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  background: var(--admin-surface);
  color: var(--admin-text-muted);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--admin-border-strong);
  background: var(--admin-surface-muted);
  color: var(--admin-text);
}

.logout-button:hover,
.logout-button:focus-visible {
  border-color: color-mix(in srgb, var(--admin-danger) 42%, var(--admin-border));
  color: var(--admin-danger);
}

.theme-sun,
:root[data-theme="dark"] .theme-moon {
  display: none;
}

:root[data-theme="dark"] .theme-sun {
  display: block;
}

.support-content {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 30px 32px 56px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-description,
.muted-copy {
  margin-bottom: 0;
  color: var(--admin-text-muted);
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--admin-accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.panel-card {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface);
}

.panel-card:not(.compact-card, .operator-list-card, .access-list-card) {
  padding: 24px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.metric-card {
  display: flex;
  min-height: 76px;
  flex-direction: column;
  justify-content: center;
  padding: 13px 16px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface);
  color: var(--admin-text-muted);
  text-decoration: none;
}

.metric-card strong {
  color: var(--admin-text);
  font-size: 1.45rem;
}

.metric-card:hover,
.metric-card.is-selected {
  border-color: color-mix(in srgb, var(--admin-accent) 42%, var(--admin-border));
}

.metric-card.is-selected {
  background: var(--admin-surface-accent);
  color: var(--admin-accent);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(190px, 1.25fr) repeat(3, minmax(145px, .8fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 22px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: var(--admin-text);
  font-size: 12px;
  font-weight: 650;
}

.field small {
  color: var(--admin-text-muted);
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--admin-border-strong);
  border-radius: 7px;
  background: var(--admin-surface);
  color: var(--admin-text);
  font-size: 14px;
  font-weight: 400;
}

.field input,
.field select {
  padding: 0 11px;
}

.field textarea {
  min-height: 92px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.55;
}

.field input::placeholder,
.field textarea::placeholder {
  color: color-mix(in srgb, var(--admin-text-muted) 78%, transparent);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--admin-focus);
  outline: 3px solid color-mix(in srgb, var(--admin-focus) 25%, transparent);
}

.button {
  display: inline-flex;
  min-height: var(--control-height);
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  border-color: var(--admin-accent);
  background: var(--admin-accent);
  color: var(--admin-accent-foreground);
}

.button-primary:hover {
  border-color: var(--admin-accent-hover);
  background: var(--admin-accent-hover);
}

.button-secondary {
  border-color: var(--admin-border-strong);
  background: var(--admin-surface);
  color: var(--admin-text);
}

.button-secondary:hover {
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}

.button-text {
  min-height: 34px;
  padding-inline: 8px;
  background: transparent;
  color: var(--admin-danger);
}

.button-text:hover {
  background: var(--admin-danger-surface);
}

.button-danger {
  border-color: var(--admin-danger);
  background: var(--admin-danger);
  color: #fff;
}

.button-small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
}

.button-block {
  width: 100%;
}

.ticket-table-wrap {
  margin: 0 -24px -24px;
  overflow-x: auto;
  border-top: 1px solid var(--admin-border);
}

.ticket-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

.ticket-table th,
.ticket-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--admin-border);
  text-align: left;
  vertical-align: middle;
}

.ticket-table th {
  background: var(--admin-surface-muted);
  color: var(--admin-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.ticket-table tbody tr:hover {
  background: color-mix(in srgb, var(--admin-surface-muted) 58%, transparent);
}

.ticket-table tbody tr:last-child td {
  border-bottom: 0;
}

.ticket-table td > small {
  display: block;
  margin-top: 2px;
  color: var(--admin-text-muted);
}

.ticket-reference {
  color: var(--admin-text);
  font-weight: 750;
  text-decoration: none;
}

.ticket-reference:hover {
  color: var(--admin-accent);
}

.row-action {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  color: var(--admin-text-muted);
  font-size: 18px;
  text-decoration: none;
}

.row-action:hover {
  background: var(--admin-surface-accent);
  color: var(--admin-accent);
}

.status-pill,
.priority-pill,
.role-pill,
.state-pill,
.internal-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  background: var(--admin-surface-muted);
  color: var(--admin-text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.status-new,
.status-reopened,
.state-active {
  border-color: color-mix(in srgb, var(--admin-accent) 38%, var(--admin-border));
  background: var(--admin-surface-accent);
  color: var(--admin-accent);
}

.status-in_progress {
  border-color: color-mix(in srgb, var(--admin-info) 36%, var(--admin-border));
  background: var(--admin-info-surface);
  color: var(--admin-info);
}

.status-waiting_for_customer,
.state-pending,
.priority-high {
  border-color: color-mix(in srgb, var(--admin-warning) 38%, var(--admin-border));
  background: var(--admin-warning-surface);
  color: var(--admin-warning);
}

.status-closed,
.state-disabled {
  color: var(--admin-text-muted);
}

.priority-urgent {
  border-color: color-mix(in srgb, var(--admin-danger) 42%, var(--admin-border));
  background: var(--admin-danger-surface);
  color: var(--admin-danger);
}

.priority-low {
  color: var(--admin-text-muted);
}

.breadcrumb {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--admin-text-muted);
  font-size: 12px;
}

.breadcrumb a {
  color: var(--admin-text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--admin-accent);
}

.ticket-heading {
  align-items: center;
}

.heading-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ticket-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 22px;
  align-items: start;
}

.ticket-thread {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-card {
  overflow: hidden;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface);
}

.message-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--admin-border);
  background: var(--admin-surface-muted);
}

.message-card > header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-card time {
  color: var(--admin-text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.message-internal_note {
  border-color: color-mix(in srgb, var(--admin-violet) 35%, var(--admin-border));
}

.message-internal_note > header {
  background: var(--admin-violet-surface);
}

.internal-badge {
  border-color: color-mix(in srgb, var(--admin-violet) 40%, var(--admin-border));
  color: var(--admin-violet);
}

.message-body {
  padding: 16px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.composer {
  margin-top: 18px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface);
}

.composer-tabs {
  display: flex;
  gap: 2px;
  padding: 6px;
  border-bottom: 1px solid var(--admin-border);
  background: var(--admin-surface-muted);
}

.composer-tab {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--admin-text-muted);
  font-weight: 700;
  cursor: pointer;
}

.composer-tab.is-active {
  border-color: var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-text);
}

.composer-panel {
  padding: 18px;
}

.composer-panel .button {
  margin-top: 12px;
}

.ticket-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.compact-card {
  overflow: hidden;
  padding: 18px;
}

.compact-card h2 {
  margin-bottom: 14px;
}

.detail-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--admin-border);
}

.detail-list dt {
  color: var(--admin-text-muted);
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 650;
  text-align: right;
}

.inline-admin-form + .inline-admin-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--admin-border);
}

.inline-admin-form .button {
  width: 100%;
  margin-top: 9px;
}

.action-details {
  padding: 0;
}

.action-details > summary {
  padding: 16px 18px;
  font-weight: 750;
  cursor: pointer;
}

.action-details[open] > summary {
  border-bottom: 1px solid var(--admin-border);
}

.action-details > form {
  padding: 18px;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.evidence-list {
  display: flex;
  margin: 0;
  padding: 0;
  flex-direction: column;
  gap: 12px;
  list-style: none;
}

.evidence-list li {
  display: flex;
  gap: 10px;
}

.evidence-list li > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.evidence-list time,
.evidence-list small {
  color: var(--admin-text-muted);
  font-size: 10px;
}

.evidence-summary {
  width: 100%;
}

.evidence-summary code {
  overflow-wrap: anywhere;
}

.evidence-details {
  margin-top: 8px;
  border-top: 1px solid var(--admin-border);
}

.evidence-details > summary {
  padding: 8px 0;
  color: var(--admin-accent);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.evidence-details dl {
  display: flex;
  margin: 0;
  flex-direction: column;
  gap: 7px;
}

.evidence-details dl div {
  min-width: 0;
}

.evidence-details dt {
  color: var(--admin-text-muted);
  font-size: 10px;
}

.evidence-details dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: 10px;
}

.evidence-events {
  display: flex;
  margin: 10px 0;
  padding-left: 18px;
  flex-direction: column;
  gap: 7px;
}

.evidence-events li {
  display: flex;
  padding-left: 3px;
  flex-direction: column;
  gap: 1px;
}

.evidence-events strong,
.evidence-events code {
  font-size: 10px;
  overflow-wrap: anywhere;
}

.evidence-download {
  width: 100%;
  margin-top: 4px;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--admin-text-muted);
}

.status-dot-recipient_mx_accepted,
.status-dot-transport_accepted,
.status-dot-gateway_accepted {
  background: var(--admin-accent);
}

.status-dot-failed,
.status-dot-bounced,
.status-dot-complained,
.status-dot-suppressed {
  background: var(--admin-danger);
}

.status-dot-delayed {
  background: var(--admin-warning);
}

.evidence-disclaimer {
  margin: 14px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--admin-border);
  color: var(--admin-text-muted);
  font-size: 11px;
}

.notice-stack {
  display: flex;
  margin-bottom: 20px;
  flex-direction: column;
  gap: 8px;
}

.notice {
  padding: 12px 14px;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  background: var(--admin-surface);
}

.notice-success {
  border-color: color-mix(in srgb, var(--admin-accent) 36%, var(--admin-border));
  background: var(--admin-surface-accent);
  color: var(--admin-accent);
}

.notice-error {
  border-color: color-mix(in srgb, var(--admin-danger) 40%, var(--admin-border));
  background: var(--admin-danger-surface);
  color: var(--admin-danger);
}

.notice-warning {
  border-color: color-mix(in srgb, var(--admin-warning) 40%, var(--admin-border));
  background: var(--admin-warning-surface);
}

.empty-state {
  padding: 54px 20px;
  color: var(--admin-text-muted);
  text-align: center;
}

.empty-state h1,
.empty-state h2 {
  margin-bottom: 7px;
  color: var(--admin-text);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(270px, .8fr) minmax(0, 1.4fr);
  gap: 20px;
  align-items: start;
}

.checkbox-fieldset {
  display: flex;
  margin: 0;
  padding: 0;
  border: 0;
  flex-direction: column;
  gap: 8px;
}

.checkbox-fieldset legend {
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 650;
}

.check-row {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  cursor: pointer;
}

.check-row input {
  accent-color: var(--admin-accent);
}

.operator-list-card {
  overflow: hidden;
  padding: 24px 0 0;
}

.operator-list-card > .section-heading,
.access-list-card > .section-heading {
  padding: 0 24px;
}

.operator-list {
  border-top: 1px solid var(--admin-border);
}

.operator-row {
  border-bottom: 1px solid var(--admin-border);
}

.operator-row:last-child {
  border-bottom: 0;
}

.operator-row > summary {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.operator-row > summary::-webkit-details-marker {
  display: none;
}

.operator-row > summary:hover {
  background: var(--admin-surface-muted);
}

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

.operator-identity small {
  overflow: hidden;
  color: var(--admin-text-muted);
  text-overflow: ellipsis;
}

.operator-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 18px;
  border-top: 1px solid var(--admin-border);
  background: var(--admin-surface-muted);
}

.invitation-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
}

.invitation-result h2,
.invitation-result p {
  margin-bottom: 4px;
}

.copy-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.copy-row code {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: var(--admin-surface);
}

.security-callout {
  display: flex;
  margin-bottom: 18px;
  padding: 13px;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  background: var(--admin-surface-muted);
  flex-direction: column;
  gap: 4px;
}

.security-callout p {
  margin: 3px 0 0;
  color: var(--admin-text-muted);
  font-size: 12px;
}

.access-list-card {
  margin-top: 20px;
  overflow: hidden;
  padding: 24px 0 0;
}

.access-list {
  border-top: 1px solid var(--admin-border);
}

.access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--admin-border);
}

.access-row:last-child {
  border-bottom: 0;
}

.access-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.access-row small {
  color: var(--admin-text-muted);
}

.remove-access-form {
  display: flex;
  align-items: end;
  gap: 8px;
}

.compact-field {
  width: 170px;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  padding: 28px 18px;
  place-items: center;
}

.auth-panel {
  width: min(100%, 430px);
  padding: 28px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface);
}

.auth-panel-wide {
  width: min(100%, 560px);
}

.auth-brand {
  margin-bottom: 34px;
}

.auth-heading {
  margin-bottom: 22px;
}

.auth-heading p:last-child {
  margin-bottom: 0;
  color: var(--admin-text-muted);
}

.auth-secondary-link {
  display: block;
  margin-top: 18px;
  color: var(--admin-text-muted);
  text-align: center;
}

.secret-box,
.technical-details,
.recovery-grid {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  background: var(--admin-surface-muted);
}

.secret-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recovery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.recovery-grid code {
  padding: 6px;
  border: 1px solid var(--admin-border);
  border-radius: 5px;
  background: var(--admin-surface);
  text-align: center;
}

.sidebar-scrim {
  display: none;
}

@media (max-width: 1040px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-submit {
    width: 100%;
  }

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

  .ticket-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .support-sidebar {
    transform: translateX(-101%);
    transition: transform 160ms ease;
  }

  .support-shell.sidebar-open .support-sidebar {
    transform: translateX(0);
  }

  .support-main {
    margin-left: 0;
  }

  .support-topbar {
    display: none;
  }

  .support-mobile-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    height: 58px;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-bottom: 1px solid var(--admin-border);
    background: var(--admin-surface);
  }

  .mobile-brand {
    font-weight: 750;
  }

  .support-content {
    padding: 22px 16px 40px;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 25;
    border: 0;
    background: rgba(5, 12, 8, .58);
  }

  .support-shell.sidebar-open .sidebar-scrim {
    display: block;
  }

  .metric-grid,
  .admin-grid,
  .invitation-result {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

  .ticket-table-wrap {
    margin-inline: -24px;
  }

  .ticket-table {
    min-width: 0;
  }

  .ticket-table thead {
    display: none;
  }

  .ticket-table,
  .ticket-table tbody,
  .ticket-table tr,
  .ticket-table td {
    display: block;
  }

  .ticket-table tr {
    position: relative;
    padding: 12px 42px 12px 16px;
    border-bottom: 1px solid var(--admin-border);
  }

  .ticket-table td {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    padding: 5px 0;
    border: 0;
  }

  .ticket-table td::before {
    content: attr(data-label);
    color: var(--admin-text-muted);
    font-size: 11px;
  }

  .ticket-table td:first-child {
    display: block;
  }

  .ticket-table td:first-child::before,
  .ticket-table td:last-child::before {
    display: none;
  }

  .ticket-table td:last-child {
    position: absolute;
    top: 13px;
    right: 10px;
  }

  .page-header {
    flex-direction: column;
  }

  .ticket-sidebar {
    display: flex;
  }

  .message-card > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .operator-row > summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .operator-row > summary .role-pill,
  .operator-row > summary .state-pill {
    grid-column: 2;
  }

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

  .access-row,
  .remove-access-form {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-field {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
