:root {
  --bg: #f2efe6;
  --paper: rgba(255, 252, 246, 0.92);
  --paper-strong: #fffdf8;
  --ink: #1e2a26;
  --muted: #5e6d65;
  --line: rgba(30, 42, 38, 0.12);
  --accent: #0d7a5f;
  --accent-strong: #095c48;
  --accent-soft: #d8f2ea;
  --shadow: 0 22px 50px rgba(30, 42, 38, 0.09);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(13, 122, 95, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(224, 159, 62, 0.16), transparent 22%),
    linear-gradient(180deg, #f7f3eb 0%, var(--bg) 100%);
  font-family: "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(247, 243, 235, 0.82);
  border-bottom: 1px solid var(--line);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0d7a5f, #0b5241);
  color: #fff;
  font-weight: 700;
}

.brand-icon-image {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(13, 122, 95, 0.14);
  background: #fff;
}

.brand-mark small,
.muted,
dt {
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.site-nav a,
.ghost-button,
.text-button {
  padding: 10px 14px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.site-nav a.active,
.site-nav a:hover,
.ghost-button:hover,
.text-button:hover {
  background: rgba(13, 122, 95, 0.1);
}

.page-stack,
.auth-shell {
  padding: 32px 0 56px;
}

.page-stack {
  display: grid;
  gap: 22px;
}

.hero-card,
.panel,
.auth-card,
.manual-card {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 30px;
  border-radius: var(--radius-lg);
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
}

.hero-meta {
  display: grid;
  gap: 12px;
  align-content: center;
  justify-items: start;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--accent-strong);
}

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

h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
}

h2 {
  font-size: 24px;
}

.hero-copy {
  margin-top: 14px;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.7;
}

.panel,
.auth-card {
  padding: 24px;
  border-radius: var(--radius-md);
}

.flash {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.flash-success {
  background: var(--accent-soft);
  border-color: rgba(13, 122, 95, 0.18);
}

.flash-error {
  background: rgba(167, 67, 47, 0.09);
  border-color: rgba(167, 67, 47, 0.2);
}

.filter-grid,
.form-grid,
.auth-form {
  display: grid;
  gap: 16px;
}

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

.split-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
}

label {
  display: grid;
  gap: 8px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: auto;
}

label span {
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-strong);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(13, 122, 95, 0.18);
  border-color: rgba(13, 122, 95, 0.28);
}

textarea {
  resize: vertical;
  min-height: 96px;
}

.action-row,
.card-actions,
.inline-actions,
.section-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-title-row {
  justify-content: space-between;
  margin-bottom: 16px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.secondary-button {
  background: transparent;
  border-color: rgba(13, 122, 95, 0.24);
  color: var(--accent-strong);
}

.text-link,
.text-button {
  color: var(--accent-strong);
}

.results-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.manual-card {
  border-radius: var(--radius-md);
  padding: 22px;
  display: grid;
  gap: 18px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(13, 122, 95, 0.12);
  color: var(--accent-strong);
  font-size: 14px;
}

.pill.subtle {
  background: rgba(30, 42, 38, 0.06);
  color: var(--muted);
}

.pill.accent {
  background: #ffe7b0;
  color: #835400;
}

.detail-list {
  display: grid;
  gap: 12px;
}

.detail-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

dd {
  margin: 0;
  text-align: right;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.version-list {
  display: grid;
  gap: 16px;
}

.version-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.55);
}

.version-item-latest {
  border-color: rgba(13, 122, 95, 0.28);
  background: rgba(216, 242, 234, 0.4);
}

.table-shell {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.centered {
  text-align: center;
}

.admin-note-cell {
  min-width: 220px;
  line-height: 1.5;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 132px);
}

.auth-card {
  width: min(480px, 100%);
}

.branding-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  border: 1px dashed rgba(13, 122, 95, 0.22);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  margin-bottom: 14px;
}

.branding-preview-image,
.branding-preview-fallback {
  width: 120px;
  height: 120px;
  border-radius: 24px;
}

.branding-preview-image {
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
}

.branding-preview-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0d7a5f, #0b5241);
  color: #fff;
  font-size: 40px;
  font-weight: 700;
}

.top-gap {
  margin-top: 18px;
}

.empty-state,
.error-panel {
  text-align: center;
}

.site-footer {
  padding: 0 0 36px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero-card,
  .split-grid,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .version-item,
  .pagination,
  .nav-row {
    display: grid;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 20px, 1120px);
  }

  .hero-card,
  .panel,
  .auth-card,
  .manual-card {
    padding: 18px;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav a,
  .ghost-button {
    width: 100%;
    text-align: center;
  }
}
