:root {
  --ink: #10231d;
  --muted: #5a6a61;
  --forest: #053f30;
  --paper: #fffaf1;
  --white: #ffffff;
  --gold: #c99341;
  --line: rgba(16, 35, 29, 0.14);
  --shadow: 0 24px 70px rgba(16, 35, 29, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 14px max(20px, calc((100vw - 1320px) / 2));
  background: rgba(255, 250, 241, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-brand img {
  width: 58px;
  max-height: 48px;
  object-fit: contain;
}

.link-button,
.primary,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-weight: 850;
  text-decoration: none;
}

.primary {
  color: var(--paper);
  background: var(--forest);
  border-color: var(--forest);
}

.ghost,
.link-button {
  color: var(--forest);
  background: var(--white);
}

.full {
  width: 100%;
}

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

.admin-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: 28px;
  color: var(--paper);
  background:
    radial-gradient(circle at 80% 20%, rgba(201, 147, 65, 0.18), transparent 18rem),
    linear-gradient(135deg, #052d23, var(--forest));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.admin-hero p,
.editor-top p {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.admin-hero h1,
.editor h2,
.asset-panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.admin-hero h1 {
  max-width: 760px;
  font-size: clamp(2.2rem, 4vw, 4.6rem);
  line-height: 0.98;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 112px);
  gap: 10px;
}

.stat-grid article {
  display: grid;
  gap: 4px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
}

.stat-grid b {
  font-size: 1.7rem;
}

.stat-grid span {
  color: rgba(255, 250, 241, 0.74);
  font-size: 0.78rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  gap: 20px;
  margin-top: 22px;
}

.sidebar,
.editor,
.asset-panel section {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 46px rgba(16, 35, 29, 0.06);
}

.asset-panel {
  display: grid;
  gap: 20px;
  align-content: start;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span,
.check-field span {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
}

textarea {
  padding-top: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 147, 65, 0.16);
}

.package-list {
  display: grid;
  gap: 8px;
  max-height: 70vh;
  overflow: auto;
  margin-top: 14px;
}

.package-list button {
  padding: 12px;
  text-align: left;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.package-list button.is-active {
  color: var(--paper);
  background: var(--forest);
}

.package-list strong {
  display: block;
  line-height: 1.25;
}

.package-list span {
  display: block;
  margin-top: 5px;
  color: currentColor;
  opacity: 0.72;
  font-size: 0.82rem;
}

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

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

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 14px;
  align-items: center;
}

.compact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-field {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.check-field input {
  width: auto;
  min-height: auto;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

#save-note,
.asset-result {
  color: var(--forest);
  font-weight: 850;
}

.asset-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.ai-builder {
  border-color: rgba(201, 147, 65, 0.34);
  background:
    radial-gradient(circle at 95% 0%, rgba(201, 147, 65, 0.14), transparent 12rem),
    var(--white);
}

.settings-panel {
  border-color: rgba(6, 63, 48, 0.22);
  background:
    radial-gradient(circle at 92% 6%, rgba(110, 141, 95, 0.16), transparent 12rem),
    var(--white);
}

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

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

.inquiry-card strong {
  display: block;
}

.inquiry-card span,
.inquiry-card p,
.inquiry-card a {
  display: block;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.inquiry-card-top,
.inquiry-contact {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.inquiry-contact {
  flex-wrap: wrap;
  margin-top: 10px;
}

.inquiry-contact a {
  color: var(--forest);
  font-weight: 800;
}

.status-badge {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: var(--radius);
  font-size: 0.68rem !important;
  font-weight: 900;
  text-transform: uppercase;
}

.status-sent {
  color: #125b39 !important;
  background: #dff5e8;
}

.status-failed {
  color: #8f2f27 !important;
  background: #fde6e1;
}

.status-not_configured,
.status-not_attempted {
  color: #765615 !important;
  background: #fff1c9;
}

.inquiry-card details {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.inquiry-card summary {
  padding: 10px 0 0;
  cursor: pointer;
  color: var(--forest);
  font-weight: 850;
}

.inquiry-facts {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 7px 10px;
  margin: 12px 0 0;
  font-size: 0.82rem;
}

.inquiry-facts dt {
  color: var(--gold);
  font-weight: 850;
}

.inquiry-facts dd {
  margin: 0;
  color: var(--muted);
}

.email-error {
  color: #8f2f27 !important;
}

.service-status {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 16px;
}

.service-status span {
  padding: 6px 8px;
  border-radius: var(--radius);
  font-size: 0.72rem;
  font-weight: 850;
}

.service-status .is-ready {
  color: #125b39;
  background: #dff5e8;
}

.service-status .is-missing {
  color: #765615;
  background: #fff1c9;
}

.asset-results,
.asset-library {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.asset-candidate,
.asset-card {
  overflow: hidden;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.asset-candidate img,
.asset-card img {
  width: 100%;
  aspect-ratio: 1.55;
  object-fit: cover;
}

.asset-candidate > div,
.asset-card > div {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.asset-candidate small,
.asset-card small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.asset-candidate button,
.asset-card button {
  min-height: 38px;
}

.asset-panel hr {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .admin-hero,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 700px) {
  .admin-header {
    display: grid;
  }

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