:root {
  --gold: #c9a86a;
  --gold-light: #e4d4a8;
  --gold-dark: #a8884a;
  --gold-rgb: 201, 168, 106;
  --primary: var(--gold);
  --primary-light: var(--gold-light);
  --primary-dark: var(--gold-dark);
  --primary-rgb: var(--gold-rgb);
  --deep-rgb: 15, 28, 40;
  --mid-rgb: 26, 42, 58;
  --navy: #1a2a3a;
  --navy-deep: #0f1c28;
  --navy-soft: #2d4054;
  --cream: #f3f1ea;
  --paper: #faf9f5;
  --white: #fff;
  --ink: #1a2a3a;
  --muted: #6b7788;
  --line: rgba(26, 42, 58, 0.12);
  --line-light: rgba(255, 255, 255, 0.14);
  --shadow: 0 24px 60px rgba(15, 28, 40, 0.18);
  --shadow-soft: 0 12px 32px rgba(15, 28, 40, 0.1);
  --success: #2d6a4f;
  --danger: #9b3d32;
  --warn: #9a6b2e;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Manrope", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

a,
a:link,
a:visited,
a:hover,
a:active,
a:focus {
  text-decoration: none;
}

body.admin-body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

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

.adm-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, var(--navy-deep), var(--navy-soft));
}

.adm-login--banner {
  background:
    linear-gradient(160deg, rgba(var(--deep-rgb), 0.88) 0%, rgba(var(--mid-rgb), 0.72) 100%),
    url("assets/banner.png") center / cover no-repeat;
}

.adm-login.adm-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.adm-login.adm-loading::before {
  content: "";
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: adm-spin 0.75s linear infinite;
}

@keyframes adm-spin {
  to {
    transform: rotate(360deg);
  }
}

.adm-loading-text {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.adm-error-text {
  max-width: 420px;
  text-align: center;
  line-height: 1.6;
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 600;
}

.adm-login-card {
  width: min(420px, 100%);
  padding: 36px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.adm-login-card h1 {
  margin: 8px 0 6px;
  font-family: var(--font-serif);
  font-size: 2rem;
}

.adm-layout {
  display: flex;
  min-height: 100vh;
}

.adm-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
}

.adm-brand {
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.adm-brand strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: #fff;
}

.adm-brand small {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.adm-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.adm-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 4px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.adm-nav a:hover,
.adm-nav a.active {
  background: rgba(var(--primary-rgb), 0.16);
  color: var(--gold-light);
}

.adm-nav .ico {
  width: 22px;
  text-align: center;
  opacity: 0.9;
}

.adm-sidebar-foot {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
}

.adm-sidebar-foot p {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.55);
}

.adm-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.adm-topbar {
  height: var(--topbar-h);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.adm-topbar h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
}

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

.adm-content {
  flex: 1;
  padding: 24px 28px 40px;
}

.adm-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.adm-metric {
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.adm-metric strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: var(--navy);
  line-height: 1;
}

.adm-metric span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.adm-split {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 20px;
  align-items: start;
}

.adm-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.adm-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}

.adm-panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.adm-list {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.adm-list-item {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.adm-list-item:hover {
  background: var(--cream);
}

.adm-list-item.active {
  background: rgba(var(--primary-rgb), 0.14);
  border-left: 3px solid var(--gold);
}

.adm-list-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.adm-list-item small {
  color: var(--muted);
  font-size: 12px;
}

.adm-form {
  padding: 22px;
}

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

.adm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.adm-field label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-soft);
}

.adm-field input,
.adm-field select,
.adm-field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.adm-field input:focus,
.adm-field select:focus,
.adm-field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.adm-field textarea {
  min-height: 100px;
  resize: vertical;
}

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

.adm-preview {
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  max-height: 160px;
}

.adm-preview img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.adm-section-title {
  margin: 28px 0 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.adm-section-title:first-of-type {
  margin-top: 0;
}

.adm-section-desc {
  margin: -6px 0 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.adm-section-desc code {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--cream);
  color: var(--navy);
}

.adm-settings-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 8px;
}

.adm-image-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.adm-image-card--banner {
  grid-column: 1 / -1;
}

.adm-image-card-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--cream), var(--paper));
}

.adm-image-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.adm-image-card-body {
  display: flex;
  flex-direction: column;
}

.adm-image-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, var(--cream) 0%, var(--paper) 100%),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 8px,
      rgba(var(--primary-rgb), 0.04) 8px,
      rgba(var(--primary-rgb), 0.04) 16px
    );
  border-bottom: 1px solid var(--line);
}

.adm-image-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.adm-image-card--logo .adm-image-preview {
  aspect-ratio: 1;
  max-height: 200px;
  margin: 20px auto;
  width: min(168px, calc(100% - 40px));
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(var(--deep-rgb), 0.08);
}

.adm-image-card--logo .adm-image-preview img {
  object-fit: contain;
  padding: 12px;
  background: var(--white);
}

.adm-image-card--banner .adm-image-preview {
  aspect-ratio: 21 / 9;
  min-height: 160px;
}

.adm-image-card--about .adm-image-preview {
  aspect-ratio: 4 / 3;
  min-height: 180px;
}

.adm-image-preview.is-empty {
  border-style: dashed;
  border-width: 0 0 1px;
}

.adm-image-card--logo .adm-image-preview.is-empty {
  border-width: 1px;
  border-style: dashed;
}

.adm-image-preview-empty {
  position: relative;
  z-index: 0;
  display: none;
  padding: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.adm-image-preview.is-empty .adm-image-preview-empty {
  display: block;
}

.adm-image-card-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.adm-image-card-field label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-soft);
}

.adm-image-card-field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.adm-image-card-field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.adm-image-card-field .hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.adm-image-card-field .hint code {
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--cream);
}

.adm-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}

.adm-check input {
  width: 18px;
  height: 18px;
}

.adm-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.adm-btn:hover {
  transform: translateY(-1px);
}

.adm-btn.primary {
  background: var(--gold);
  color: var(--navy-deep);
  border-color: var(--gold);
}

.adm-btn.ghost {
  background: var(--white);
  border-color: var(--line);
  color: var(--navy);
}

.adm-btn.danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.adm-btn.link {
  background: transparent;
  color: var(--navy-soft);
  border-color: transparent;
  padding: 0;
  min-height: auto;
}

.adm-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.adm-badge.new {
  background: #e8f4ec;
  color: var(--success);
}

.adm-badge.warn {
  background: #faf0e4;
  color: var(--warn);
}

.adm-badge.muted {
  background: #eee;
  color: var(--muted);
}

.adm-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.adm-empty-detail {
  padding: 60px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.adm-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--navy-deep);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.adm-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.adm-toast.error {
  background: var(--danger);
}

.adm-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
}

@media (max-width: 960px) {
  .adm-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
  }

  .adm-sidebar.open {
    transform: translateX(0);
  }

  .adm-main {
    margin-left: 0;
  }

  .adm-menu-btn {
    display: grid;
    place-items: center;
  }

  .adm-split {
    grid-template-columns: 1fr;
  }

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

  .adm-form-grid {
    grid-template-columns: 1fr;
  }

  .adm-settings-images {
    grid-template-columns: 1fr;
  }

  .adm-image-card--banner {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .adm-metrics {
    grid-template-columns: 1fr;
  }

  .adm-content {
    padding: 16px;
  }
}
