:root {
  --ink: #202020;
  --muted: #666;
  --red: #ed1c24;
  --blue: #263a8f;
  --line: #ddd;
  --paper: #fff;
  --soft: #f5f5f5;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0, #fff 110px, #2d2d2d 110px, #2d2d2d 310px, #f3f3f3 310px);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

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

button {
  min-height: 42px;
  border: 0;
  color: #fff;
  background: var(--red);
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: #c91820;
}

button.ghost,
.dashboard-header button {
  color: var(--ink);
  background: #eee;
}

button.ghost:hover,
.dashboard-header button:hover {
  background: #ddd;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.login-panel {
  width: min(460px, 100%);
  margin: 78px auto 0;
  padding: 34px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.16);
}

.login-panel img {
  width: 310px;
  margin-bottom: 26px;
}

.login-panel h1,
.two-factor-login h2,
.editor-form h2,
.list-panel h2 {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 400;
}

.login-panel p {
  margin: 0 0 22px;
  color: var(--muted);
}

form {
  display: grid;
  gap: 15px;
}

label {
  display: grid;
  gap: 7px;
  color: #343434;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

textarea {
  resize: vertical;
}

output {
  min-height: 22px;
  color: var(--red);
  font-size: 13px;
}

.dashboard-header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
  padding: 18px 22px;
  background: #fff;
  border: 1px solid var(--line);
}

.dashboard-header img {
  width: min(390px, 100%);
}

.dashboard-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.dashboard-header a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  color: #fff;
  background: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

.password-panel,
.security-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.68fr) minmax(320px, 1fr);
  gap: 24px;
  margin-bottom: 22px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
}

.password-panel h2,
.security-panel h2 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 400;
}

.password-panel p,
.security-panel p {
  margin: 0;
  color: var(--muted);
}

.security-panel {
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1fr);
}

.security-panel form,
.two-factor-setup {
  align-self: start;
}

.two-factor-setup {
  display: grid;
  grid-column: 2;
  gap: 14px;
  padding-top: 4px;
}

.two-factor-setup input,
.two-factor-setup textarea {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.tabs button {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.tabs button.is-active {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.84fr) minmax(360px, 1.16fr);
  gap: 22px;
  align-items: start;
}

.editor-form,
.list-panel {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.event-list,
.user-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.admin-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.admin-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eee;
}

.admin-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 400;
}

.admin-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.admin-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  background: #eee;
  color: #333;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge--published {
  color: #fff;
  background: #13844c;
}

.badge--draft {
  color: #fff;
  background: #777;
}

.admin-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-card__actions button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.empty {
  padding: 24px;
  color: var(--muted);
  border: 1px dashed #aaa;
  text-align: center;
}

@media (max-width: 860px) {
  .dashboard-header,
  .dashboard-grid,
  .password-panel,
  .security-panel {
    grid-template-columns: 1fr;
  }

  .two-factor-setup {
    grid-column: 1;
  }

  .dashboard-header {
    display: grid;
  }

  .dashboard-header nav {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .admin-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .login-panel,
  .editor-form,
  .list-panel {
    padding: 18px;
  }

  .admin-card {
    grid-template-columns: 1fr;
  }

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