@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --black: #080808;
  --surface: #141414;
  --paper: #f5f3ee;
  --white: #fff;
  --ink: #171717;
  --muted: #747474;
  --line: #e4e0d8;
  --gold: #d4a53a;
  --gold-dark: #a97418;
  --success: #43805d;
  --danger: #a23c37;
  --radius: 8px;
  --shadow: 0 18px 60px rgb(0 0 0 / 14%);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.eyebrow {
  margin: 0;
  color: var(--gold-dark);
  font: 600 13px/1 "Barlow Condensed", sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }

.button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0 22px;
  cursor: pointer;
  font-weight: 600;
}

.button-primary {
  color: var(--black);
  background: var(--gold);
}

.button-primary:hover { background: #e0b75d; }

.message-list { display: grid; gap: 8px; }

.message {
  border-radius: 4px;
  padding: 12px 14px;
  background: #fff3da;
  color: #76500d;
  font-size: 13px;
}

.message-error { color: var(--danger); background: #fdeceb; }

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.login-page { min-height: 100vh; background: var(--black); }

.login-layout {
  display: grid;
  grid-template-columns: minmax(480px, 1.1fr) minmax(520px, .9fr);
  min-height: 100vh;
}

.login-art {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgb(8 8 8 / 20%), rgb(8 8 8 / 60%)),
    url("../images/hero-mold.webp") center/cover no-repeat;
}

.login-brand {
  position: absolute;
  top: 44px;
  left: 48px;
  width: 220px;
}

.representative-label {
  position: absolute;
  bottom: 40px;
  left: 48px;
  color: var(--gold);
  font: 600 12px/1 "Barlow Condensed", sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 48px;
  background: #101010;
}

.login-card {
  position: relative;
  display: grid;
  gap: 20px;
  width: min(520px, 100%);
  padding: 48px;
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -.03em;
}

.login-card p { margin-top: 0; }

.field { display: grid; gap: 8px; }
.field > span { font-size: 13px; font-weight: 600; }

.field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d8d3ca;
  border-radius: 4px;
  padding: 0 14px;
  color: var(--ink);
  background: #fbfaf7;
}

.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d8d3ca;
  border-radius: 4px;
  padding: 10px 14px;
  color: var(--ink);
  background: #fbfaf7;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

.dashboard-grid aside > form {
  display: grid;
  gap: 16px;
  padding: 0 22px 22px;
}

.field input:focus {
  outline: 2px solid rgb(212 165 58 / 28%);
  border-color: var(--gold);
}

.security-note {
  margin: 0;
  padding: 14px 16px;
  color: #686868;
  background: var(--paper);
  font-size: 12px;
  line-height: 1.6;
}

.dashboard-shell { min-height: 100vh; }

.dashboard-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: 248px;
  padding: 28px 20px 24px;
  color: #efefef;
  background: #0b0b0b;
  overflow-y: auto;
}

.dashboard-brand { display: block; padding: 0 6px 28px; }
.dashboard-brand img { width: 204px; }

.dashboard-nav { display: grid; gap: 6px; }

.dashboard-nav a,
.dashboard-nav > span {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border-radius: 4px;
  padding: 0 14px;
  font-size: 14px;
}

.dashboard-nav .is-active {
  color: #111;
  background: var(--gold);
  font-weight: 600;
}

.dashboard-nav .is-disabled { color: #c8c8c8; }
.dashboard-nav a:not(.is-active):hover {
  color: var(--white);
  background: #1a1a1a;
}

.dashboard-account {
  display: grid;
  gap: 5px;
  margin-top: auto;
  font-size: 12px;
}

.dashboard-account strong { font-size: 13px; }
.dashboard-account span { color: #a0a0a0; }
.dashboard-account form { margin-top: 6px; }

.dashboard-account button {
  border: 0;
  padding: 0;
  color: var(--gold);
  background: transparent;
  cursor: pointer;
}

.dashboard-workspace { min-height: 100vh; margin-left: 248px; }

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  color: #777;
  background: var(--white);
  font-size: 13px;
}

.dashboard-topbar strong { color: var(--ink); }
.dashboard-main { padding: 34px 32px 64px; }

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-heading h1 {
  margin: 8px 0 0;
  font-size: 34px;
  letter-spacing: -.035em;
}

.page-heading-actions {
  gap: 24px;
}

.heading-note {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.action-row form { margin: 0; }

.button-secondary {
  border-color: #d7d1c6;
  color: var(--ink);
  background: var(--white);
}

.button-secondary:hover { border-color: var(--gold-dark); }

.button-danger {
  border-color: #e0b6b3;
  color: var(--danger);
  background: #fff8f7;
}

.summary-strip {
  display: flex;
  gap: 1px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}

.summary-strip > span {
  flex: 1;
  padding: 15px 18px;
  color: #686868;
  background: var(--white);
  font-size: 13px;
}

.summary-strip strong {
  margin-left: 7px;
  color: var(--ink);
  font: 700 22px/1 "Barlow Condensed", sans-serif;
}

.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  padding: 14px 18px;
  color: #777;
  background: #f7f4ee;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  min-height: 64px;
  border-top: 1px solid #eeeae3;
  padding: 16px 18px;
  vertical-align: middle;
}

.data-table td > strong,
.data-table td > small {
  display: block;
}

.data-table td > small {
  max-width: 260px;
  margin-top: 4px;
  color: #939393;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.table-actions a {
  color: var(--gold-dark);
  font-weight: 600;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 0 9px;
  color: #625a4d;
  background: #ebe6dc;
  font-size: 11px;
  font-weight: 700;
}

.status-published {
  color: #2b6647;
  background: #e2f1e8;
}

.status-draft {
  color: #76500d;
  background: #fff0cc;
}

.status-offline {
  color: #756e64;
  background: #e7e4de;
}

.category-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.category-admin-card {
  min-height: 178px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--white);
}

.category-admin-card h2 {
  margin: 18px 0 7px;
  font-size: 19px;
}

.category-admin-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.category-cover-preview {
  width: calc(100% - 44px);
  max-height: 360px;
  margin: 22px 22px 0;
  border-radius: 4px;
  object-fit: cover;
}

.editor-form {
  display: grid;
  gap: 20px;
}

.narrow-form { max-width: 820px; }

.editor-panel > header {
  border-bottom: 1px solid var(--line);
}

.editor-panel > header h2 { margin-bottom: 5px; }

.editor-panel > header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

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

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

.form-field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.form-field:has(textarea),
.form-field:has(input[type="file"]),
.form-errors {
  grid-column: 1 / -1;
}

.form-field > label {
  font-size: 12px;
  font-weight: 700;
}

.form-field small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.form-control {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d8d3ca;
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfaf7;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

input[type="file"].form-control { background: var(--white); }

.form-control:focus {
  outline: 2px solid rgb(212 165 58 / 28%);
  border-color: var(--gold);
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}

.checkbox-input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold-dark);
}

.errorlist,
.form-errors {
  margin: 0;
  padding: 10px 12px;
  color: var(--danger);
  background: #fdeceb;
  font-size: 12px;
  list-style: none;
}

.language-stack { display: grid; }

.language-editor {
  border-top: 1px solid var(--line);
}

.language-editor:first-child { border-top: 0; }

.language-editor summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  cursor: pointer;
}

.language-editor summary span {
  color: var(--muted);
  font: 600 12px/1 "Barlow Condensed", sans-serif;
  letter-spacing: .08em;
}

.language-editor[open] summary {
  color: #332609;
  background: #fbf3df;
}

.formset-stack {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.formset-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #faf8f3;
  overflow: hidden;
}

.formset-card:only-child { grid-template-columns: 1fr; }

.admin-thumb {
  width: 180px;
  height: 180px;
  margin: 22px 0 22px 22px;
  border-radius: 4px;
  object-fit: cover;
}

.sticky-actions {
  position: sticky;
  bottom: 16px;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 14px 44px rgb(0 0 0 / 10%);
  backdrop-filter: blur(12px);
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  border: 1px solid #ded8ce;
  border-radius: var(--radius);
  padding: 22px;
  background: #ece8df;
}

.danger-zone h2 { margin: 0 0 6px; font-size: 17px; }
.danger-zone p { margin: 0; color: var(--muted); font-size: 12px; }

.service-status {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  border: 1px solid #ebd59c;
  border-radius: var(--radius);
  padding: 16px 18px;
  color: #76500d;
  background: #fff4d9;
  font-size: 13px;
}

.service-status.is-ready {
  border-color: #b9d7c4;
  color: #2b6647;
  background: #e7f3eb;
}

.service-status a { font-weight: 700; text-decoration: underline; }
.translation-panel + .translation-panel { margin-top: 20px; }

.translation-list { display: grid; }

.translation-list > article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  border-top: 1px solid var(--line);
  padding: 12px 22px;
}

.translation-list > article > div:first-child {
  display: grid;
  gap: 5px;
}

.translation-list > article span {
  color: var(--muted);
  font-size: 11px;
}

.translation-list .action-row > a {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 700;
}

.spaced-panel { margin-top: 20px; }

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

.kpi-card {
  display: grid;
  gap: 8px;
  min-height: 148px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: var(--white);
}

.kpi-card span { color: #666; font-size: 13px; }
.kpi-card strong { font: 700 40px/1 "Barlow Condensed", sans-serif; }
.kpi-card small { color: var(--gold-dark); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  margin-top: 30px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}

.panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px;
}

.panel h2 { margin: 0; font-size: 18px; }
.panel header span { color: #888; font-size: 12px; }
.activity-list { padding: 0 22px 22px; }

.activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  border-top: 1px solid #eeeae3;
}

.activity-row > div { display: grid; gap: 4px; }
.activity-row span, .activity-row time { color: #888; font-size: 12px; }

.empty-state {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 260px;
  color: #777;
  text-align: center;
}

.empty-state span { font-size: 13px; }

.publish-panel {
  color: #eee;
  border-color: #111;
  padding-bottom: 20px;
  background: #111;
}

.publish-panel > header { border-bottom: 1px solid #242424; }

.publish-state {
  display: flex;
  justify-content: space-between;
  margin: 0 22px 12px;
  padding: 18px 16px;
  background: #1a1a1a;
}

.publish-state span { color: #aaa; font-size: 13px; }
.publish-state strong { color: var(--gold); font-size: 13px; }
.publish-panel > p { margin: 18px 22px 0; color: #888; font-size: 12px; }

@media (max-width: 960px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { min-height: 100vh; padding: 24px; }
  .login-card { padding: 32px 24px; }
  .dashboard-sidebar { position: static; width: 100%; min-height: auto; }
  .dashboard-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-account { margin-top: 28px; }
  .dashboard-workspace { margin-left: 0; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .category-admin-grid { grid-template-columns: 1fr; }
  .compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-heading-actions,
  .danger-zone { align-items: flex-start; flex-direction: column; }
  .service-status { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .dashboard-main { padding: 26px 18px 48px; }
  .dashboard-topbar { padding: 0 18px; }
  .dashboard-topbar span { display: none; }
  .dashboard-nav { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .form-grid,
  .compact-grid { grid-template-columns: 1fr; padding: 18px; }
  .formset-card { grid-template-columns: 1fr; }
  .admin-thumb { width: calc(100% - 36px); height: 220px; margin: 18px; }
  .summary-strip { flex-direction: column; }
  .translation-list > article { align-items: flex-start; flex-direction: column; }
  .sticky-actions { bottom: 8px; }
}
