:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f0f3f7;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #e95f78;
  --accent-2: #1f9d8a;
  --accent-3: #f2a93b;
  --danger: #d92d20;
  --ok: #14866d;
  font-family: Inter, "MiSans", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.admin-loading,
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
}

.login-card h1,
.view-head h1 {
  margin: 0;
  font-size: 30px;
}

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

.form-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field textarea,
.field select,
.editor {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

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

.admin-shell {
  display: grid;
  grid-template-columns: 274px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 18px 14px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 18px;
  font-size: 18px;
  font-weight: 900;
}

.admin-brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  font-size: 15px;
}

.nav-group-title {
  margin: 18px 10px 8px;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 900;
}

.side-nav {
  display: grid;
  gap: 4px;
}

.side-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: #475467;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  text-align: left;
}

.side-nav button.active,
.side-nav button:hover {
  color: #fff;
  background: var(--ink);
}

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

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 28px;
  background: rgba(245, 247, 250, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.content {
  width: min(1280px, calc(100% - 48px));
  margin: 28px auto 60px;
}

.view-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
}

.button.primary {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

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

.button.ok {
  color: #fff;
  background: var(--ok);
  border-color: var(--ok);
}

.button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.stats-grid,
.work-grid,
.cards-grid {
  display: grid;
  gap: 16px;
}

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

.work-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

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

.card,
.table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.04);
}

.card {
  padding: 18px;
}

.stat-label {
  color: var(--muted);
  font-weight: 800;
}

.stat-value {
  margin-top: 8px;
  font-size: 34px;
  font-weight: 950;
}

.table-card {
  overflow: hidden;
}

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

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

th {
  color: #475467;
  background: #f9fafb;
  font-size: 13px;
}

td {
  color: #344054;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: #475467;
  font-size: 13px;
  font-weight: 900;
}

.status.published,
.status.approved {
  color: #067647;
  background: #ecfdf3;
}

.status.pending {
  color: #b54708;
  background: #fffaeb;
}

.status.draft {
  color: #475467;
  background: #f2f4f7;
}

.editor-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.editor-toolbar button {
  min-width: 38px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
}

.editor {
  min-height: 420px;
  line-height: 1.8;
  overflow: auto;
}

.editor:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid rgba(233, 95, 120, 0.22);
  border-color: var(--accent);
}

.preview-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.photo-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.message-content {
  max-width: 620px;
  line-height: 1.6;
}

@media (max-width: 1040px) {
  .admin-shell,
  .editor-layout,
  .work-grid,
  .stats-grid,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .content {
    width: min(100% - 28px, 1280px);
  }
}

