:root {
  --bg: #f5f7f2;
  --panel: #ffffff;
  --ink: #17211e;
  --muted: #68736d;
  --line: #dfe6dd;
  --soft: #edf3ef;
  --accent: #236c63;
  --accent-dark: #174d46;
  --action: #2563eb;
  --action-dark: #1d4ed8;
  --action-soft: #eaf1ff;
  --gold: #b77918;
  --danger: #9f3030;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  border-color: var(--action);
}

button.primary {
  border-color: var(--action);
  background: var(--action);
  color: #ffffff;
}

button.primary:hover {
  border-color: var(--action-dark);
  background: var(--action-dark);
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgb(21 42 36 / 10%);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.brand-lockup h1,
.brand-lockup p {
  margin: 0;
}

.brand-lockup p {
  margin-top: 3px;
  color: var(--muted);
}

.brand-lockup.compact {
  padding-bottom: 22px;
  border-bottom: 1px solid rgb(255 255 255 / 14%);
}

.brand-lockup.compact p {
  color: #b9c9c3;
  font-size: 13px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #f1b24a;
  color: #142522;
  font-weight: 850;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 11px;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(35 108 99 / 12%);
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.sidebar {
  min-height: 100vh;
  padding: 22px 18px;
  background: #142522;
  color: #f6fbf8;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.nav-item {
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: #dce8e3;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: rgb(255 255 255 / 10%);
  color: #ffffff;
}

.panel-heading > button,
.item-actions button {
  border-color: #b7cdfd;
  background: var(--action-soft);
  color: var(--action-dark);
}

.panel-heading > button:hover,
.item-actions button:hover {
  border-color: var(--action);
  background: #dbe8ff;
}

.item-actions button.danger {
  border-color: #f0c2c2;
  background: #fff0f0;
  color: var(--danger);
}

.shell {
  min-width: 0;
  padding: 28px;
}

.topbar,
.panel-heading,
.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2,
h3,
h4,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.1;
}

h3 {
  margin-bottom: 0;
  font-size: 21px;
}

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

.metrics article,
.panel,
.list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metrics article {
  padding: 16px;
}

.metrics span,
.meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metrics strong {
  display: block;
  margin-top: 7px;
  font-size: 28px;
}

.panel {
  padding: 18px;
}

.panel + .panel,
.list {
  margin-top: 14px;
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

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

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  padding: 14px;
}

.item-title {
  display: flex;
  gap: 10px;
  align-items: center;
}

.code-badge {
  min-width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 850;
}

.thumb {
  width: 64px;
  height: 48px;
  flex: 0 0 64px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  object-fit: cover;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.image-preview {
  min-height: 150px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger {
  color: var(--danger);
}

.content-preview {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.preview-country {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.preview-country header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  background: #fbfcfa;
  border-bottom: 1px solid var(--line);
}

.preview-city {
  padding: 14px;
}

.preview-city + .preview-city {
  border-top: 1px solid var(--line);
}

.preview-wonders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.preview-wonder {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.preview-wonder p {
  color: var(--muted);
  line-height: 1.45;
}

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

@media (max-width: 980px) {
  .app-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

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

  .nav-item {
    justify-content: center;
    text-align: center;
  }

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

@media (max-width: 680px) {
  .shell {
    padding: 18px;
  }

  .topbar,
  .panel-heading,
  .item-head,
  .preview-country header {
    align-items: stretch;
    flex-direction: column;
  }

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

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