:root {
  --bg: #161412;
  --surface: #24201b;
  --surface-soft: #2e2923;
  --text: #f6f0e7;
  --muted: #cabca9;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #d89c27;
  --danger: #e15b5b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #181512 0%, #0f0d0c 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.admin-login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.login-shell {
  width: min(480px, calc(100vw - 32px));
}

.login-card,
.panel-card,
.table-card,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.login-card,
.stat-card,
.panel-card {
  padding: 24px;
}

.login-card form,
.admin-form {
  display: grid;
  gap: 16px;
}

.login-card label,
.admin-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.login-card input,
.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 16px;
  padding: 12px 14px;
}

.login-card button,
.primary-submit,
.button-link,
.logout-button,
.actions-cell button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.admin-brand {
  display: block;
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 800;
}

.admin-sidebar nav {
  display: grid;
  gap: 18px;
}

.admin-nav-group {
  display: grid;
  gap: 8px;
}

.admin-nav-group span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-sidebar nav a {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
}

.admin-sidebar nav a.active,
.admin-sidebar nav a:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.logout-button {
  width: 100%;
  margin-top: 28px;
  background: #4a4034;
}

.admin-main {
  padding: 28px;
}

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

.admin-kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.stats-grid,
.panel-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 24px;
}

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

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

.full {
  grid-column: 1 / -1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: auto;
}

.primary-submit {
  justify-self: start;
}

.image-field {
  display: grid;
  gap: 14px;
}

.image-preview {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.image-preview img {
  width: min(320px, 100%);
  max-height: 220px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.image-preview code {
  color: var(--muted);
  word-break: break-all;
}

.image-preview-empty {
  color: var(--muted);
}

.table-actions {
  margin-bottom: 16px;
}

.button-link {
  display: inline-flex;
}

.table-card {
  overflow: auto;
}

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

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.actions-cell {
  display: flex;
  gap: 12px;
  align-items: center;
}

.actions-cell form {
  margin: 0;
}

.actions-cell a {
  color: var(--accent);
  font-weight: 700;
}

.actions-cell button {
  background: var(--danger);
  padding: 8px 12px;
}

.flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.flash-success {
  border-left: 4px solid #2ecc71;
}

.flash-warning {
  border-left: 4px solid #f1c40f;
}

.flash-error {
  border-left: 4px solid #e74c3c;
}

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