:root {
  --ink: #18211c;
  --muted: #66716a;
  --paper: #f6f3ed;
  --surface: #ffffff;
  --line: #ded8cd;
  --accent: #236a54;
  --accent-strong: #123e31;
  --danger: #a43d31;
  --gold: #bf8e33;
}

* {
  box-sizing: border-box;
}

[hidden],
.tab-panel[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f8faf7 0%, var(--paper) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  border: 0;
  border-radius: 8px;
  padding: 11px 15px;
  color: #fff;
  background: var(--accent);
  font-weight: 850;
  cursor: pointer;
}

button.secondary {
  color: var(--ink);
  background: #ece6dc;
}

button.danger {
  background: var(--danger);
}

a {
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}

.admin-shell {
  width: min(1320px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.login-panel {
  display: grid;
  max-width: 860px;
  grid-template-columns: 1fr 330px;
  gap: 28px;
  margin: 10vh auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 5vw, 44px);
  background: #fff;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 4.7vw, 4rem);
  line-height: 1;
}

h2 {
  margin-bottom: 15px;
  font-size: 1.24rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
}

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

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(35, 106, 84, 0.14);
}

#loginForm {
  display: grid;
  gap: 14px;
  align-content: start;
}

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

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

.editor-actions a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(246, 243, 237, 0.94);
  backdrop-filter: blur(12px);
}

.tabs button {
  color: var(--ink);
  background: #fff;
}

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

.notice {
  border: 1px solid rgba(191, 142, 51, 0.42);
  border-radius: 8px;
  margin: 14px 0;
  padding: 12px 14px;
  background: rgba(191, 142, 51, 0.12);
  color: #654c1d;
}

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

.panel {
  display: grid;
  gap: 14px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 16px;
  padding: 18px;
  background: #fff;
}

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

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stack {
  display: grid;
  gap: 12px;
}

.edit-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfaf7;
}

.edit-card.two-col {
  grid-template-columns: 190px 1fr;
}

.edit-card img,
.preview {
  width: 100%;
  max-height: 280px;
  border-radius: 8px;
  object-fit: cover;
  background: #e6ded0;
}

.preview {
  aspect-ratio: 16 / 9;
}

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

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

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

.status {
  min-height: 24px;
  margin: 12px 0 0;
  font-weight: 850;
}

.status.ok {
  color: var(--accent-strong);
}

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

.inquiry-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.inquiry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.inquiry-message {
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .login-panel,
  .panel-grid,
  .edit-card.two-col,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .editor-header,
  .editor-actions,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 620px) {
  .admin-shell {
    width: 100%;
    padding: 0 0 54px;
  }

  .login-panel {
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 28px 16px;
  }

  .editor {
    padding: 14px 12px 0;
  }

  .editor-header {
    margin-bottom: 10px;
  }

  .editor-actions {
    width: 100%;
  }

  .editor-actions a,
  .editor-actions button,
  .card-actions button {
    width: 100%;
    text-align: center;
  }

  .tabs {
    top: 0;
    margin: 0 -12px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 8px 12px;
  }

  .tabs button {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .notice,
  .panel {
    margin-top: 12px;
  }

  .panel {
    padding: 14px;
  }

  .panel-heading,
  .card-actions {
    width: 100%;
  }

  .edit-card {
    padding: 12px;
  }

  .edit-card img,
  .preview {
    max-height: none;
    aspect-ratio: 16 / 10;
  }

  .inquiry-card {
    padding: 12px;
  }

  .inquiry-meta {
    display: grid;
    gap: 5px;
  }
}
