@import './static-preview.css';

body {
  background: #eef1ed;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100svh;
}

body.is-locked .admin-sidebar,
body.is-locked .admin-main {
  display: none;
}

.login-gate {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(23, 32, 27, 0.94), rgba(23, 63, 52, 0.9)),
    url('./public/assets/container-camp-exterior.png') center / cover;
  display: none;
  inset: 0;
  justify-content: center;
  min-height: 100svh;
  padding: 24px;
  position: fixed;
  z-index: 50;
}

body.is-locked .login-gate {
  display: flex;
}

.login-card {
  background: #fffdf7;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  display: grid;
  gap: 14px;
  max-width: 420px;
  padding: 28px;
  width: 100%;
}

.login-card h1 {
  font-size: 36px;
  margin-bottom: 0;
}

.login-card p {
  color: var(--muted);
}

.login-card label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.login-card input {
  border: 1px solid #cfd7d1;
  font: inherit;
  min-height: 46px;
  padding: 10px;
}

.login-card small {
  color: #8f2e1b;
  font-weight: 800;
  min-height: 18px;
}

.admin-sidebar {
  background: #17201b;
  color: #fffdf7;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
}

.admin-sidebar .brand {
  color: #fffdf7;
}

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

.nav-tab,
.ghost-btn,
.site-link,
.primary-btn,
.icon-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
}

.nav-tab {
  background: rgba(255, 253, 247, 0.08);
  color: rgba(255, 253, 247, 0.75);
  padding: 14px;
  text-align: left;
}

.nav-tab.active,
.nav-tab:hover {
  background: var(--accent);
  color: white;
}

.ghost-btn {
  background: transparent;
  border: 1px solid rgba(255, 253, 247, 0.24);
  color: inherit;
  margin-top: auto;
  padding: 13px 16px;
}

.ghost-btn.compact {
  margin-top: 0;
}

.admin-main {
  padding: clamp(24px, 4vw, 58px);
}

.admin-top,
.panel-head {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 26px;
}

.admin-top h1,
.panel-head h2 {
  margin-bottom: 0;
}

.site-link,
.primary-btn {
  background: var(--accent);
  color: white;
  display: inline-flex;
  padding: 13px 18px;
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
}

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

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

.record-card {
  background: #fffdf7;
  border: 1px solid #cfd7d1;
  padding: 22px;
}

.record-card h3 {
  margin-bottom: 8px;
}

.record-card p {
  color: var(--muted);
  line-height: 1.55;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.record-meta span {
  background: #e8ece7;
  color: #2c3d35;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
}

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

.record-actions button {
  background: #17201b;
  border: 0;
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 10px 12px;
}

.record-actions button:last-child {
  background: #8f2e1b;
}

dialog {
  border: 0;
  max-width: 760px;
  padding: 0;
  width: calc(100% - 28px);
}

dialog::backdrop {
  background: rgba(15, 24, 20, 0.62);
}

.editor-form {
  background: #fffdf7;
  padding: 24px;
}

.editor-head,
.editor-actions {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.icon-btn {
  background: #eef1ed;
  color: var(--ink);
  height: 36px;
  width: 36px;
}

.editor-fields {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 22px 0;
}

.editor-fields label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.editor-fields input,
.editor-fields textarea,
.editor-fields select {
  border: 1px solid #cfd7d1;
  font: inherit;
  min-height: 44px;
  padding: 10px;
}

.editor-fields textarea,
.editor-fields .wide {
  grid-column: 1 / -1;
}

.editor-fields textarea {
  min-height: 120px;
}

.settings-form {
  background: #fffdf7;
  border: 1px solid #cfd7d1;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 22px;
}

.settings-form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.settings-form input {
  border: 1px solid #cfd7d1;
  font: inherit;
  min-height: 44px;
  padding: 10px;
}

.settings-preview {
  background: #17201b;
  color: #fffdf7;
  margin-top: 16px;
  padding: 22px;
}

.config-export {
  background: #fffdf7;
  border: 1px solid #cfd7d1;
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 22px;
}

.config-export h3 {
  margin-bottom: 6px;
}

.config-export p {
  color: var(--muted);
}

.config-export .ghost-btn {
  border-color: #cfd7d1;
  color: var(--ink);
  justify-self: start;
  margin-top: 0;
}

.config-export textarea {
  border: 1px solid #cfd7d1;
  font: 13px/1.45 Consolas, monospace;
  min-height: 170px;
  padding: 12px;
  resize: vertical;
}

.settings-preview h3 {
  margin-bottom: 12px;
}

.editor-actions .ghost-btn {
  border-color: #cfd7d1;
  color: var(--ink);
  margin-top: 0;
}

@media (max-width: 860px) {
  body,
  .record-grid,
  .editor-fields,
  .settings-form {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }
}
