@font-face {
  font-family: "Onest";
  src: url("/fonts/onest-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --main: #020B14;
  --accent: #8E44AD;
  --step-m: #ECF0F1;
  --step-a: #E67E22;
  --text: var(--step-m);
  --text-soft: rgba(236, 240, 241, .66);
  --text-faint: rgba(236, 240, 241, .58);
  --line: rgba(236, 240, 241, .12);
  --line-strong: rgba(236, 240, 241, .2);
  --surface: rgba(236, 240, 241, .055);
  --surface-strong: rgba(236, 240, 241, .085);
  --surface-hover: rgba(236, 240, 241, .075);
  --accent-soft: rgba(142, 68, 173, .16);
  --orange-soft: rgba(230, 126, 34, .14);
  --shadow: 0 28px 80px rgba(2, 11, 20, .58);
  --radius: 22px;
  --radius-small: 14px;
  --container: 1200px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--main);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -8%, rgba(142, 68, 173, .24), transparent 34rem),
    radial-gradient(circle at 92% 26%, rgba(230, 126, 34, .095), transparent 31rem),
    var(--main);
  font-family: "Onest", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  position: fixed;
  z-index: 9999;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

::selection {
  color: var(--step-m);
  background: rgba(142, 68, 173, .7);
}

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

button {
  cursor: pointer;
}

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

svg {
  display: block;
}

.ui-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: fixed;
  z-index: 10000;
  top: -80px;
  left: 16px;
  padding: 10px 16px;
  color: var(--step-m);
  background: var(--accent);
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

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

.muted {
  color: var(--text-soft);
}

.eyebrow {
  margin: 0 0 11px;
  color: var(--step-a);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.gradient-text {
  color: transparent;
  background: linear-gradient(110deg, var(--step-m) 4%, var(--accent) 55%, var(--step-a) 112%);
  background-clip: text;
  -webkit-background-clip: text;
}

.glass-card {
  background: linear-gradient(145deg, rgba(236, 240, 241, .075), rgba(236, 240, 241, .035));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(236, 240, 241, .035), var(--shadow);
  backdrop-filter: blur(22px);
}

.card-white {
  color: var(--main);
  background: var(--step-m);
}

/* Authentication */
.auth-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(400px, .92fr);
  background: var(--main);
}

.auth-story {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(52px, 7vw, 112px);
  border-right: 1px solid var(--line);
  background:
    linear-gradient(125deg, rgba(142, 68, 173, .1), transparent 42%),
    var(--main);
}

.auth-story::before {
  position: absolute;
  z-index: -1;
  inset: 28px;
  content: "";
  border: 1px solid rgba(236, 240, 241, .05);
  border-radius: 34px;
}

.auth-story__content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.ambient {
  position: absolute;
  z-index: -2;
  display: block;
  border-radius: 50%;
  filter: blur(18px);
  pointer-events: none;
}

.ambient--purple {
  width: min(48vw, 700px);
  aspect-ratio: 1;
  top: -32%;
  right: -22%;
  background: radial-gradient(circle, rgba(142, 68, 173, .32), rgba(142, 68, 173, 0) 68%);
}

.ambient--orange {
  width: min(34vw, 460px);
  aspect-ratio: 1;
  bottom: -22%;
  left: -14%;
  background: radial-gradient(circle, rgba(230, 126, 34, .17), rgba(230, 126, 34, 0) 70%);
}

.brand-lockup,
.brand-mobile,
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup {
  margin-bottom: clamp(72px, 10vh, 130px);
}

.brand-lockup strong,
.brand-lockup small,
.brand-mobile strong,
.brand-mobile small,
.brand strong,
.brand small {
  display: block;
}

.brand-lockup strong,
.brand-mobile strong,
.brand strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand-lockup small,
.brand-mobile small,
.brand small {
  margin-top: 1px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(230, 126, 34, .42), transparent 46%),
    var(--accent);
  border: 1px solid rgba(236, 240, 241, .18);
  border-radius: 13px;
  box-shadow: 0 10px 32px rgba(142, 68, 173, .28);
}

.brand-mark i::before,
.brand-mark i::after {
  position: absolute;
  left: 50%;
  content: "";
  background: var(--step-m);
  transform: translateX(-50%);
}

.brand-mark i::before {
  top: 9px;
  width: 5px;
  height: 5px;
  background: var(--step-a);
  border-radius: 50%;
}

.brand-mark i::after {
  top: 17px;
  width: 5px;
  height: 14px;
  border-radius: 999px;
}

.brand-mark--large {
  width: 50px;
  height: 50px;
  border-radius: 16px;
}

.brand-mark--large i::before {
  top: 11px;
  width: 6px;
  height: 6px;
}

.brand-mark--large i::after {
  top: 21px;
  width: 6px;
  height: 18px;
}

.auth-story h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(46px, 5.25vw, 78px);
  font-weight: 800;
  line-height: .99;
  letter-spacing: -.055em;
}

.auth-lead {
  max-width: 650px;
  margin: 30px 0 0;
  color: var(--text-soft);
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.65;
}

.trust-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 34px;
  color: rgba(236, 240, 241, .74);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .025em;
}

.trust-line span {
  position: relative;
}

.trust-line span:not(:last-child)::after {
  position: absolute;
  right: -13px;
  color: var(--accent);
  content: "•";
}

.signal-card {
  width: fit-content;
  max-width: 610px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(52px, 8vh, 90px);
  padding: 15px 18px;
  background: rgba(236, 240, 241, .055);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(18px);
}

.signal-card > span:last-child,
.signal-card strong,
.signal-card small {
  display: block;
}

.signal-card strong {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.signal-card small {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 11px;
}

.signal-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: var(--step-a);
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(230, 126, 34, .12), 0 0 28px rgba(230, 126, 34, .65);
}

.auth-panel {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 88px);
  background: radial-gradient(circle at 100% 0, rgba(142, 68, 173, .12), transparent 38%);
}

.auth-card {
  width: min(470px, 100%);
  padding: clamp(28px, 4vw, 46px);
  border-radius: 26px;
}

.auth-card h2 {
  margin: 0 0 9px;
  font-size: clamp(34px, 3vw, 46px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.045em;
}

.auth-card > .muted {
  margin: 0 0 32px;
}

.brand-mobile {
  display: none;
  margin-bottom: 56px;
}

.auth-footnote {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--text-faint);
  font-size: 11px;
}

.auth-footnote span {
  color: var(--step-a);
  font-size: 7px;
}

/* Controls */
.field {
  display: grid;
  gap: 8px;
  margin: 19px 0;
  color: rgba(236, 240, 241, .8);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.field em {
  color: var(--step-a);
  font-style: normal;
}

.field small {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.5;
  text-transform: none;
}

input,
textarea,
select {
  width: 100%;
  color: var(--text);
  background: rgba(236, 240, 241, .055);
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

input,
select {
  min-height: 48px;
  padding: 0 14px;
}

textarea {
  min-height: 112px;
  padding: 13px 14px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

input:hover,
textarea:hover,
select:hover {
  background: rgba(236, 240, 241, .075);
  border-color: var(--line-strong);
}

input:focus,
textarea:focus,
select:focus {
  background: rgba(236, 240, 241, .075);
  border-color: rgba(142, 68, 173, .82);
  box-shadow: 0 0 0 4px rgba(142, 68, 173, .14), 0 0 28px rgba(142, 68, 173, .08);
}

select option {
  color: var(--text);
  background: var(--main);
}

input[type="date"] {
  color-scheme: dark;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 19px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 13px;
  font-weight: 750;
  letter-spacing: -.01em;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, filter .18s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button:focus-visible,
.icon-button:focus-visible,
.text-button:focus-visible {
  outline: 2px solid var(--step-a);
  outline-offset: 3px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.button--primary {
  color: var(--step-m);
  background: linear-gradient(135deg, var(--accent), rgba(142, 68, 173, .76));
  box-shadow: 0 13px 32px rgba(142, 68, 173, .26);
}

.button--primary:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 18px 42px rgba(142, 68, 173, .34);
}

.button--danger {
  color: var(--main);
  background: var(--step-a);
  box-shadow: 0 12px 30px rgba(230, 126, 34, .2);
}

.button--ghost {
  color: rgba(236, 240, 241, .82);
  background: rgba(236, 240, 241, .025);
  border-color: var(--line);
}

.button--ghost:hover:not(:disabled) {
  color: var(--step-m);
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.button--wide {
  width: 100%;
  justify-content: space-between;
  margin-top: 11px;
  padding: 0 20px;
}

.button--small {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  font-size: 12px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  color: rgba(236, 240, 241, .82);
  background: rgba(236, 240, 241, .035);
  border: 1px solid var(--line);
  border-radius: 13px;
  transition: transform .18s ease, color .18s ease, background .18s ease, border-color .18s ease;
}

.icon-button:hover {
  color: var(--step-m);
  background: var(--surface-hover);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.icon-button--accent {
  color: var(--step-m);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(142, 68, 173, .24);
}

.form-error {
  margin: 12px 0;
  padding: 11px 13px;
  color: var(--step-a);
  background: var(--orange-soft);
  border: 1px solid rgba(230, 126, 34, .22);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* App shell */
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 max(24px, calc((100vw - var(--container)) / 2 + 24px));
  background: rgba(2, 11, 20, .78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(130%);
}

.brand {
  color: var(--text);
  text-decoration: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 11px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 5px 0 8px;
}

.user-chip strong,
.user-chip small {
  display: block;
  line-height: 1.25;
}

.user-chip strong {
  max-width: 180px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip small {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 11px;
}

.avatar {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--step-m);
  background: var(--accent-soft);
  border: 1px solid rgba(142, 68, 173, .35);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.page {
  width: min(var(--container), 100%);
  margin: 0 auto;
  padding: clamp(52px, 6vw, 78px) 24px 90px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(48px, 6vw, 76px);
  font-weight: 850;
  line-height: .98;
  letter-spacing: -.06em;
}

.page-heading .muted {
  max-width: 640px;
  margin: 19px 0 0;
  font-size: 15px;
}

.trust-strip {
  min-height: 48px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 30px;
  margin: 34px 0 18px;
  padding: 12px 18px;
  color: var(--text-soft);
  background: rgba(236, 240, 241, .025);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.trust-strip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trust-strip i {
  width: 5px;
  height: 5px;
  display: inline-block;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(142, 68, 173, .75);
}

.trust-strip span:nth-child(2) i {
  background: var(--step-a);
  box-shadow: 0 0 12px rgba(230, 126, 34, .65);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(145px, 1fr)) minmax(300px, 1.65fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card,
.quick-check {
  min-height: 126px;
  padding: 21px;
  border-radius: 18px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: linear-gradient(145deg, rgba(236, 240, 241, .07), rgba(236, 240, 241, .028));
  border: 1px solid var(--line);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.stat-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 18px 42px rgba(2, 11, 20, .34);
  transform: translateY(-3px);
}

.stat-card strong,
.stat-card div span {
  display: block;
}

.stat-card strong {
  font-size: 34px;
  font-weight: 820;
  line-height: 1;
  letter-spacing: -.055em;
}

.stat-card div span {
  margin-top: 7px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
}

.stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
}

.stat-card--active .stat-icon {
  color: var(--accent);
  background: var(--accent-soft);
}

.stat-card--inactive .stat-icon {
  color: var(--step-a);
  background: var(--orange-soft);
}

.stat-card--deleted .stat-icon {
  color: var(--text-soft);
  background: rgba(236, 240, 241, .08);
}

.quick-check {
  border: 1px solid rgba(236, 240, 241, .82);
  box-shadow: 0 16px 44px rgba(2, 11, 20, .28);
}

.quick-check > label {
  display: block;
  margin-bottom: 9px;
  color: rgba(2, 11, 20, .62);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.quick-check > div {
  display: flex;
  gap: 8px;
}

.quick-check input {
  min-height: 42px;
  color: var(--main);
  background: rgba(2, 11, 20, .055);
  border-color: rgba(2, 11, 20, .13);
}

.quick-check input::placeholder {
  color: rgba(2, 11, 20, .42);
}

.quick-check input:hover,
.quick-check input:focus {
  background: rgba(2, 11, 20, .075);
  border-color: rgba(142, 68, 173, .6);
}

.quick-check output {
  min-height: 18px;
  display: block;
  margin-top: 7px;
  color: rgba(2, 11, 20, .58);
  font-size: 11px;
  font-weight: 700;
}

.quick-check .check-blocked,
.quick-check .check-error {
  color: var(--step-a);
}

.quick-check .check-allowed {
  color: var(--accent);
}

.content-card {
  overflow: hidden;
  border-radius: var(--radius);
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(120px, .72fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.search-field {
  position: relative;
}

.search-field > .ui-icon {
  position: absolute;
  z-index: 1;
  top: 14px;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-faint);
}

.search-field input {
  padding-left: 42px;
}

.compact-field {
  display: grid;
  gap: 6px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.compact-field input,
.compact-field select {
  min-height: 44px;
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.table-meta {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 20px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.table-meta p {
  margin: 0;
}

.table-meta label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-meta select {
  width: 68px;
  min-height: 34px;
  padding: 0 8px;
  font-size: 11px;
}

.table-wrap {
  min-height: 330px;
  overflow-x: auto;
}

.table-wrap[aria-busy="true"] {
  cursor: progress;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 12px 17px;
  color: var(--text-faint);
  background: rgba(236, 240, 241, .028);
  border-block: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .11em;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 18px 17px;
  border-bottom: 1px solid rgba(236, 240, 241, .075);
  font-size: 12px;
  vertical-align: middle;
}

tbody tr {
  transition: background .16s ease;
}

tbody tr:hover {
  background: rgba(236, 240, 241, .028);
}

tbody tr.is-deleted {
  opacity: .62;
}

td strong,
td small {
  display: block;
}

td strong {
  font-weight: 700;
}

td small {
  max-width: 300px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-cell {
  color: var(--step-m);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .015em;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .045em;
  white-space: nowrap;
  text-transform: uppercase;
}

.status::before {
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 50%;
}

.status--active {
  color: var(--step-m);
  background: var(--accent-soft);
  border-color: rgba(142, 68, 173, .22);
}

.status--active::before {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(142, 68, 173, .8);
}

.status--inactive {
  color: var(--step-a);
  background: var(--orange-soft);
  border-color: rgba(230, 126, 34, .2);
}

.status--inactive::before {
  background: var(--step-a);
}

.status--deleted {
  color: var(--text-soft);
  background: rgba(236, 240, 241, .075);
  border-color: var(--line);
}

.status--deleted::before {
  background: var(--text-faint);
}

.actions-cell {
  min-width: 195px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 13px;
}

.text-button {
  padding: 0;
  color: rgba(236, 240, 241, .84);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 750;
  transition: color .16s ease;
}

.text-button:hover {
  color: var(--step-m);
}

.danger-link {
  color: var(--step-a);
}

.muted-link {
  color: var(--text-faint);
}

.empty-state {
  display: grid;
  place-items: center;
  padding: 72px 24px;
  text-align: center;
}

.empty-state > div {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(142, 68, 173, .2);
  border-radius: 17px;
}

.empty-state h2 {
  margin: 18px 0 5px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.035em;
}

.empty-state p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
}

.pagination {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 15px 18px;
  color: var(--text-soft);
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
}

/* Dialogs and feedback */
.dialog {
  width: min(580px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  padding: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 100% 0, rgba(142, 68, 173, .14), transparent 35%),
    rgba(2, 11, 20, .96);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(2, 11, 20, .74);
  backdrop-filter: blur(9px);
}

.dialog > form,
.dialog > div:not(.dialog-header) {
  padding: 28px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 28px 0;
}

.dialog form > .dialog-header {
  padding: 0;
}

.dialog h2 {
  margin: 0;
  font-size: 31px;
  font-weight: 820;
  line-height: 1.12;
  letter-spacing: -.045em;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 27px;
}

.dialog-actions--center {
  justify-content: center;
}

.dialog--compact {
  width: min(440px, calc(100vw - 28px));
  text-align: center;
}

.dialog--compact form {
  padding: 36px;
}

.dialog--compact p {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

.dialog--wide {
  width: min(860px, calc(100vw - 28px));
}

.confirm-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin: 0 auto 19px;
  color: var(--step-a);
  background: var(--orange-soft);
  border: 1px solid rgba(230, 126, 34, .22);
  border-radius: 18px;
  font-size: 24px;
  font-weight: 850;
}

.toggle-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  padding: 16px;
  background: rgba(236, 240, 241, .04);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row strong {
  font-size: 12px;
}

.toggle-row small {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.45;
}

.toggle-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle {
  position: relative;
  width: 48px;
  height: 27px;
  flex: 0 0 auto;
  background: rgba(236, 240, 241, .18);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background .2s ease, border-color .2s ease;
}

.toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  content: "";
  background: var(--step-m);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(2, 11, 20, .35);
  transition: transform .2s ease;
}

.toggle-row input:focus-visible + .toggle {
  outline: 2px solid var(--step-a);
  outline-offset: 3px;
}

.toggle-row input:checked + .toggle {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-row input:checked + .toggle::after {
  transform: translateX(21px);
}

.audit-list {
  max-height: 62vh;
  overflow: auto;
}

.audit-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 13px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.audit-item:last-child {
  border: 0;
}

.audit-marker {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--surface-strong);
  border-radius: 11px;
  font-weight: 850;
}

.audit-marker--create,
.audit-marker--restore {
  color: var(--step-m);
  background: var(--accent-soft);
}

.audit-marker--update {
  color: var(--step-a);
  background: var(--orange-soft);
}

.audit-marker--delete {
  color: var(--step-a);
  background: var(--orange-soft);
}

.audit-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.audit-head time,
.audit-item p {
  color: var(--text-faint);
  font-size: 11px;
}

.audit-item p {
  margin: 5px 0 0;
}

.audit-changes {
  color: var(--text-soft) !important;
}

.toast {
  position: fixed;
  z-index: 1000;
  right: 22px;
  bottom: 22px;
  max-width: min(430px, calc(100vw - 44px));
  padding: 13px 17px;
  color: var(--step-m);
  background: rgba(2, 11, 20, .94);
  border: 1px solid rgba(142, 68, 173, .38);
  border-radius: 13px;
  box-shadow: 0 16px 50px rgba(2, 11, 20, .52), 0 0 28px rgba(142, 68, 173, .16);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(18px);
}

.toast--error {
  border-color: rgba(230, 126, 34, .45);
  box-shadow: 0 16px 50px rgba(2, 11, 20, .52), 0 0 28px rgba(230, 126, 34, .13);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(142, 68, 173, .56) rgba(236, 240, 241, .045);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: rgba(236, 240, 241, .035);
}

::-webkit-scrollbar-thumb {
  background: rgba(142, 68, 173, .55);
  border: 2px solid var(--main);
  border-radius: 999px;
}

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

  .quick-check {
    grid-column: 1 / -1;
  }

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

  .search-field {
    grid-column: span 2;
  }

  .compact-field:last-of-type {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .auth-shell {
    display: block;
  }

  .auth-story {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
    padding: 24px;
  }

  .brand-mobile {
    display: inline-flex;
  }

  .topbar {
    min-height: 68px;
    padding: 0 18px;
  }

  .page {
    padding: 48px 18px 72px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .page-heading .button {
    align-self: flex-start;
  }

  .trust-strip {
    gap: 9px 19px;
    margin-top: 28px;
  }

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

  .quick-check {
    grid-column: 1 / -1;
  }

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

  .search-field,
  .compact-field:last-of-type {
    grid-column: 1 / -1;
  }

  thead {
    display: none;
  }

  table,
  tbody {
    display: block;
  }

  tbody {
    padding: 0 14px 14px;
  }

  tbody tr {
    display: block;
    margin-top: 12px;
    padding: 8px 15px;
    background: rgba(236, 240, 241, .035);
    border: 1px solid var(--line);
    border-radius: 16px;
  }

  tbody tr:hover {
    background: rgba(236, 240, 241, .05);
  }

  td {
    display: grid;
    grid-template-columns: minmax(92px, .72fr) minmax(0, 1.28fr);
    gap: 15px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(236, 240, 241, .07);
    text-align: right;
  }

  td::before {
    color: var(--text-faint);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
  }

  td:last-child {
    border-bottom: 0;
  }

  td small {
    margin-left: auto;
  }

  .actions-cell {
    min-width: 0;
  }

  .row-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 560px) {
  .auth-panel {
    padding: 16px;
  }

  .auth-card {
    padding: 27px 22px;
    border-radius: 22px;
  }

  .brand-mobile {
    margin-bottom: 46px;
  }

  .topbar {
    gap: 10px;
  }

  .brand small,
  .user-chip > span:last-child,
  .button--icon-label span {
    display: none;
  }

  .topbar-actions {
    gap: 7px;
  }

  .topbar .button,
  .topbar .icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
  }

  .user-chip {
    padding: 0;
  }

  .page {
    padding: 40px 14px 64px;
  }

  .page-heading {
    gap: 26px;
  }

  .page-heading h1 {
    font-size: clamp(43px, 14vw, 58px);
  }

  .page-heading .button {
    width: 100%;
  }

  .trust-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 14px 15px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .quick-check {
    grid-column: auto;
  }

  .stat-card,
  .quick-check {
    min-height: 112px;
  }

  .filters {
    grid-template-columns: 1fr;
    padding: 15px;
  }

  .search-field,
  .compact-field:last-of-type {
    grid-column: auto;
  }

  .filters .button {
    width: 100%;
  }

  .table-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
  }

  tbody {
    padding: 0 9px 9px;
  }

  tbody tr {
    padding: 7px 12px;
  }

  td {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
  }

  .pagination {
    gap: 8px;
  }

  .pagination .button {
    padding: 0 10px;
  }

  .dialog > form,
  .dialog > div:not(.dialog-header),
  .dialog--compact form {
    padding: 23px 19px;
  }

  .dialog-header {
    padding: 23px 19px 0;
  }

  .dialog h2 {
    font-size: 27px;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dialog-actions .button {
    width: 100%;
    padding-inline: 10px;
  }

  .audit-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    max-width: calc(100vw - 28px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
