:root {
  --bg: #f8f6f2;
  --ink: #161514;
  --muted: #6f6a63;
  --accent: #a57a53;
  --accent-strong: #7a5739;
  --accent-soft: #efe6dc;
  --line: rgba(22, 21, 20, 0.12);
  --card: #ffffff;
  --shadow: 0 18px 40px rgba(16, 15, 14, 0.08);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --tracking-body: 0.05em;
  --tracking-ui: 0.16em;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Sitka Heading", "Times New Roman", serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 15%, rgba(165, 122, 83, 0.08), transparent 55%),
    linear-gradient(180deg, #faf9f6 0%, #f6f1ea 60%, #f8f6f2 100%);
  min-height: 100vh;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: var(--tracking-body);
}

h1, h2, h3 {
  font-family: "Sitka Heading", "Times New Roman", serif;
  margin: 0 0 0.4rem;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

.admin-wide {
  width: min(1440px, 96vw);
  margin: 0 auto;
}

.page {
  padding: 60px 0 80px;
}

.bg-orbit {
  position: fixed;
  inset: -18% auto auto 65%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(165, 122, 83, 0.18), transparent 70%);
  filter: blur(40px);
  border-radius: 50%;
  z-index: -1;
  animation: float 16s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(18px); }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(248, 246, 242, 0.92);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.3em;
  font-size: 1.1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  margin-left: auto;
}

.btn {
  border: 1px solid transparent;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  min-height: 44px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border 0.2s ease;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: var(--tracking-ui);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 25px rgba(165, 122, 83, 0.2);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent-strong);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn.small {
  padding: 6px 12px;
  font-size: 0.8rem;
  min-height: 38px;
}

.btn:hover {
  transform: translateY(-1px);
}

.muted {
  color: var(--muted);
  letter-spacing: var(--tracking-body);
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 24px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.stack {
  display: grid;
  gap: 14px;
}

.stack.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  letter-spacing: var(--tracking-body);
}

input,
select,
textarea {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: var(--tracking-ui);
}

.notice {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.85rem;
  border: 1px solid var(--line);
  background: #f7f4ef;
}

.notice-ok {
  border-color: rgba(90, 120, 90, 0.3);
  color: #3b5b3b;
}

.notice-error {
  border-color: rgba(140, 84, 51, 0.35);
  color: #7a5739;
}

.notice-detail {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-word;
}

.is-hidden {
  display: none;
}

.auth-shell {
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(520px, 92vw);
  display: grid;
  gap: 24px;
}

.auth-head {
  text-align: left;
}

.auth-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.catalog {
  padding: 10px 0 60px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.product-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid;
  gap: 16px;
}

.product-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.product-head h2 {
  font-size: 1.1rem;
}

.product-notes,
.product-meta {
  display: grid;
  gap: 8px;
}

.product-notes div,
.product-meta div {
  display: grid;
  gap: 4px;
}

.label {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: var(--tracking-ui);
}

.product-actions {
  display: grid;
  gap: 10px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid transparent;
  align-self: flex-start;
}

.badge-neu { background: rgba(165, 122, 83, 0.12); color: var(--accent-strong); border-color: rgba(165, 122, 83, 0.3); }
.badge-coming { background: rgba(22, 21, 20, 0.06); color: var(--muted); border-color: rgba(22, 21, 20, 0.15); }
.badge-eol { background: rgba(140, 84, 51, 0.12); color: #7a5739; border-color: rgba(140, 84, 51, 0.25); }
.badge-core { background: rgba(22, 21, 20, 0.04); color: var(--ink); border-color: rgba(22, 21, 20, 0.12); }

.admin-section {
  padding: 10px 0 60px;
}

.admin-filters {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin: 10px 0 8px;
}

.admin-summary {
  margin-bottom: 10px;
}

.admin-table {
  margin-top: 14px;
  width: 100%;
  overflow-x: auto;
  padding: 12px;
  background: #f6f2ed;
  border-radius: var(--radius-md);
}

.admin-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  table-layout: fixed;
}

.admin-table col.action-col {
  width: 320px;
}

.admin-table thead th {
  text-align: left;
  font-weight: 600;
  padding: 12px 18px;
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.admin-table thead th:first-child {
  border-left: 1px solid var(--line);
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

.admin-table thead th:last-child {
  border-right: 1px solid var(--line);
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.admin-table thead th:first-child {
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

.admin-table thead th:last-child {
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.admin-table tbody td {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 0.9rem;
  vertical-align: middle;
}

.admin-table tbody tr td:first-child {
  border-left: 1px solid var(--line);
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

.admin-table tbody tr td:last-child {
  border-right: 1px solid var(--line);
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.admin-table tbody tr {
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
  clip-path: inset(0 round var(--radius-sm));
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.admin-actions .btn {
  box-shadow: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--line);
}

.status-pending { background: #f6f2ed; }
.status-active { background: rgba(70, 120, 80, 0.12); border-color: rgba(70, 120, 80, 0.25); }
.status-blocked { background: rgba(140, 84, 51, 0.12); border-color: rgba(140, 84, 51, 0.25); }
.status-approved { background: rgba(70, 120, 80, 0.12); border-color: rgba(70, 120, 80, 0.25); }
.status-rejected { background: rgba(140, 84, 51, 0.12); border-color: rgba(140, 84, 51, 0.25); }

.product-form {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .header-actions { flex-wrap: wrap; justify-content: flex-end; }
  .auth-footer { flex-direction: column; align-items: flex-start; }
  .form-grid.two,
  .form-grid.three,
  .stack.two,
  .stack.three,
  .admin-filters { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page { padding: 40px 0 60px; }
  .btn { width: 100%; }
  .admin-actions { grid-template-columns: 1fr; }
}
