:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #181b20;
  --panel-2: #20242b;
  --panel-3: #2a3039;
  --text: #f1f4f7;
  --muted: #9aa6b2;
  --line: #323944;
  --accent: #4f8cff;
  --accent-2: #22b8a7;
  --danger: #ff6b6b;
  --success: #67d391;
  --shadow: 0 18px 70px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

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

button,
a {
  border: 0;
  border-radius: 6px;
  background: var(--panel-3);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

button:hover,
a:hover {
  filter: brightness(1.08);
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #12151a;
  color: var(--text);
  outline: 0;
}

input,
select {
  min-height: 40px;
  padding: 0 11px;
}

textarea {
  resize: vertical;
  padding: 11px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.setup-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.setup-panel {
  display: grid;
  width: min(460px, 100%);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 24px;
  box-shadow: var(--shadow);
}

.setup-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #06101f;
  font-weight: 900;
}

.setup-panel h1,
.setup-panel p {
  margin: 0;
}

.setup-panel h1 {
  font-size: 28px;
}

.setup-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.setup-panel button,
.form-actions button,
.split-actions button {
  min-height: 40px;
  background: var(--accent);
  color: #06101f;
  font-weight: 800;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 280px;
  min-height: 100vh;
}

.nav,
.inspector {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #14171c;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

.inspector {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
  border-right: 0;
  border-left: 1px solid var(--line);
  padding: 18px;
}

.brand-lockup,
.identity-preview,
.member-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand-lockup strong,
.identity-preview strong,
.member-cell strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-lockup span,
.identity-preview span,
.member-cell span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-icon,
.preview-icon,
.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-3);
  color: var(--text);
  font-weight: 900;
  object-fit: cover;
}

.nav-icon {
  width: 44px;
  height: 44px;
}

.preview-icon {
  width: 68px;
  height: 68px;
}

.avatar {
  width: 36px;
  height: 36px;
}

.nav nav {
  display: grid;
  gap: 6px;
}

.nav nav button {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  text-align: left;
  background: transparent;
  color: var(--muted);
}

.nav nav button.active {
  background: var(--panel-3);
  color: var(--text);
}

.session-box {
  display: grid;
  gap: 8px;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.session-box span {
  color: var(--muted);
  font-size: 12px;
}

.session-box button {
  min-height: 34px;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar p,
.topbar h1 {
  margin: 0;
}

.topbar p {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.topbar h1 {
  margin-top: 4px;
  font-size: 30px;
  letter-spacing: 0;
}

.topbar-actions,
.row-actions,
.form-actions,
.split-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-actions button,
.topbar-actions a,
.row-actions button,
.row-actions a {
  min-height: 34px;
  padding: 0 11px;
}

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

.invites-layout {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.invites-catalog {
  grid-column: 1 / -1;
}

.invite-preview-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.panel-head-inline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.panel-head-inline h2 {
  margin: 0;
}

.muted-copy,
.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.field-hint {
  display: block;
  margin-top: 6px;
}

.invite-preview-shell {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0d0f12;
}

.invite-preview-chrome {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.invite-preview-chrome span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #4b5563;
}

.invite-preview-frame {
  min-height: 520px;
  overflow: hidden;
}

.invite-preview-frame .invite-landing-preview {
  min-height: 520px;
}

.panel,
.mini-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
}

.span-2 {
  grid-column: 1 / -1;
}

.panel h2,
.mini-panel h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.panel p,
.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.form-panel {
  display: grid;
  gap: 14px;
}

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

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

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #12151a;
  padding: 0 10px;
}

.check-row input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--accent);
}

.check-row span {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.checklist,
.table-list,
.mini-list {
  display: grid;
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #12151a;
  padding: 12px;
}

.check-item > span {
  display: grid;
  width: 36px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.check-item.done > span {
  background: rgba(103, 211, 145, 0.18);
  color: var(--success);
}

.check-item strong,
.check-item small {
  display: block;
}

.check-item small {
  margin-top: 2px;
  color: var(--muted);
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

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

.metric-row strong {
  color: var(--text);
}

.table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(150px, 0.8fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #12151a;
  padding: 12px;
}

.table-row strong,
.table-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.notice {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
}

.notice.danger {
  border-color: rgba(255, 107, 107, 0.45);
  background: rgba(255, 107, 107, 0.09);
  color: #ffb3b3;
}

.notice.success {
  border-color: rgba(103, 211, 145, 0.42);
  background: rgba(103, 211, 145, 0.09);
  color: #b7f5c9;
}

.score {
  margin-bottom: 12px;
  font-size: 42px;
  font-weight: 900;
}

.score span {
  color: var(--muted);
  font-size: 18px;
}

.mini-list div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--panel-3);
}

.dot.ok {
  background: var(--success);
}

@media (max-width: 1120px) {
  .admin-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .inspector {
    position: static;
    grid-column: 1 / -1;
    height: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 820px) {
  .admin-shell,
  .dashboard-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .nav nav button {
    text-align: center;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-row {
    grid-template-columns: 1fr;
  }

  .row-actions,
  .topbar-actions,
  .form-actions {
    justify-content: flex-start;
  }

  .span-2 {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .nav nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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