:root {
  --bg: #0b0d12;
  --surface: #141821;
  --border: #283142;
  --text: #eef3f8;
  --muted: #97a3b6;
  --accent: #20d982;
  --danger: #ff5570;
  --blue: #6aa8ff;
}

* { box-sizing: border-box; }
html {
  color-scheme: dark;
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: var(--accent); }
button, input, textarea {
  font: inherit;
}

.auth-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

.brand {
  color: var(--accent);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .04em;
}
.brand span { color: var(--danger); }
.eyebrow {
  margin: 4px 0 24px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
h1 { font-size: 30px; }
h2 { font-size: 18px; }
.muted { color: var(--muted); }
.error { min-height: 20px; color: var(--danger); }

.form, .grid-form {
  display: grid;
  gap: 16px;
}
label { display: grid; gap: 8px; }
label span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0d1118;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(32, 217, 130, .12);
}
textarea {
  width: 100%;
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0d1118;
  color: var(--text);
  padding: 12px;
  outline: none;
  resize: vertical;
}
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(32, 217, 130, .12);
}
button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #04120a;
  font-weight: 800;
  cursor: pointer;
  padding: 10px 16px;
}
button.ghost {
  width: 100%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}
.button-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent);
  color: #04120a;
  font-weight: 800;
  padding: 10px 16px;
  text-decoration: none;
}
.button-link.secondary {
  border: 1px solid #d2dae6;
  background: #ffffff;
  color: #325078;
}
.button-link.primary {
  background: #54d986;
  color: #07150d;
}

.redirect-body {
  min-height: 100vh;
  display: grid;
  align-items: start;
  justify-items: center;
  overflow-x: hidden;
  background: #ffffff;
  color: #142033;
  padding: 0;
}
.redirect-body,
.redirect-body * {
  color-scheme: light;
}
.redirect-shell {
  width: 100%;
  min-height: 100vh;
  position: relative;
  background: #ffffff;
}
.redirect-card {
  position: relative;
  z-index: 3;
  width: min(720px, calc(100vw - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 22px;
  align-items: center;
  background: #ffffff;
  border: 1px solid #d9e0e8;
  border-radius: 8px;
  padding: 22px 28px;
  box-shadow: 0 16px 38px rgba(24, 35, 52, .18);
}
.redirect-icon {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border: 1px solid #d5dfeb;
  background: #f6f9fd;
}
.redirect-icon span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid #2f6faa;
  color: #2f6faa;
  font-weight: 900;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.redirect-card .eyebrow {
  margin-bottom: 8px;
  color: #486380;
}
.redirect-card h1 {
  margin-bottom: 8px;
  color: #142033;
  font-size: 24px;
  line-height: 1.2;
}
.redirect-copy {
  margin-bottom: 18px;
  color: #3c4e64;
  line-height: 1.55;
}
.redirect-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}
.redirect-card-actions .button-link,
.redirect-card-actions button {
  min-width: 160px;
  min-height: 56px;
  border-radius: 4px;
  letter-spacing: .06em;
}
.redirect-card-actions .button-link.secondary {
  border-color: transparent;
  background: transparent;
  color: #1f5591;
}
.redirect-stage {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: grid;
  align-items: start;
  justify-items: center;
  overflow: visible;
  margin: 0;
  border-radius: 0;
  background: #ffffff;
  border: 0;
  padding: 78px 20px 42px;
}
.redirect-stage > * {
  max-width: calc(100vw - 32px);
}
.permission-panel {
  position: relative;
  z-index: 2;
  width: min(720px, calc(100vw - 40px));
  display: grid;
  gap: 14px;
  margin: 18px auto 0;
  border: 1px solid #d9e0e8;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px 18px;
}
.permission-title {
  margin: 0 0 6px;
  color: #1d344e;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.permission-copy {
  margin: 0;
  color: #3c4e64;
  font-size: 14px;
  line-height: 1.45;
}
.permission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.permission-button {
  min-height: 40px;
  border: 1px solid #bcd2e9;
  background: #ffffff;
  color: #1f5591;
  font-size: 13px;
}
.permission-button:hover {
  border-color: #54d986;
  color: #07150d;
}
.permission-status {
  min-height: 18px;
  margin: 0;
  color: #536478;
  font-size: 13px;
}
.redirect-illustration-img {
  width: min(680px, 88vw);
  height: auto;
  display: block;
  margin-top: 42px;
}
.redirect-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
}
.redirect-actions form {
  margin: 0;
}

.shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 22px;
}
.sidebar-main {
  display: grid;
  gap: 26px;
}
.sidebar-nav {
  display: grid;
  gap: 8px;
}
.nav-button {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.nav-button.active {
  border-color: rgba(32, 217, 130, .45);
  background: rgba(32, 217, 130, .12);
  color: var(--accent);
}
.content {
  padding: 34px;
}
.page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 16px;
}
.card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.card strong {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 34px;
}
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.tab-button {
  min-height: 38px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}
.tab-button.active {
  border-color: var(--accent);
  background: rgba(32, 217, 130, .12);
  color: var(--accent);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
.template-form {
  display: grid;
  gap: 16px;
}
.template-editor {
  min-height: 340px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}
.event-photo {
  width: 96px;
  height: 72px;
  display: block;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.grid-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.wide { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  border-bottom: 1px solid var(--border);
  padding: 12px 8px;
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
td {
  color: var(--text);
  font-size: 14px;
}
.small-button {
  min-height: 34px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.danger {
  color: var(--danger);
}

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
  }
  .stats, .grid-form { grid-template-columns: 1fr; }
  .content { padding: 20px; }
  .redirect-card {
    grid-template-columns: 1fr;
    width: 100%;
    margin: 0;
    padding: 22px;
  }
  .redirect-card-actions .button-link,
  .redirect-card-actions button {
    width: 100%;
  }
  .redirect-stage {
    min-height: 100vh;
    margin: 0;
    padding: 30px 14px 36px;
  }
  .redirect-card-actions {
    flex-direction: column;
  }
  .permission-actions {
    flex-direction: column;
  }
  .redirect-illustration-img {
    width: 100%;
    margin-top: 26px;
  }
  .redirect-actions {
    flex-direction: column-reverse;
  }
  .redirect-actions .button-link,
  .redirect-actions button {
    width: 100%;
  }
}
