:root {
  --page: #f4efe3;
  --panel: rgba(255, 250, 239, 0.92);
  --panel-strong: #fbf6ea;
  --line: rgba(41, 49, 54, 0.16);
  --line-strong: rgba(41, 49, 54, 0.28);
  --ink: #202529;
  --muted: #5d635f;
  --accent: #8c4f2b;
  --accent-soft: rgba(140, 79, 43, 0.12);
  --confirm: #255e3f;
  --confirm-soft: rgba(37, 94, 63, 0.14);
  --reject: #8f3324;
  --reject-soft: rgba(143, 51, 36, 0.14);
  --pending: #7d6936;
  --pending-soft: rgba(125, 105, 54, 0.15);
  --shadow: 0 18px 50px rgba(31, 39, 41, 0.09);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(140, 79, 43, 0.12), transparent 32%),
    radial-gradient(circle at bottom right, rgba(37, 94, 63, 0.1), transparent 28%),
    linear-gradient(180deg, #f8f3e6 0%, var(--page) 100%);
  font-family: "Trebuchet MS", "PT Sans", sans-serif;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 250, 239, 0.96), rgba(246, 240, 227, 0.94));
  backdrop-filter: blur(10px);
}

.brand h1,
.panel h2,
.project-title,
.empty-state h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.02em;
}

.brand-kicker,
.empty-state-kicker,
.meta-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.brand-copy {
  margin: 12px 0 0;
  line-height: 1.5;
  color: var(--muted);
}

.panel,
.project-stage,
.project-table,
.empty-state,
.project-header {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.panel-header,
.header-main,
.header-actions,
.stats-row,
.filters-row,
.save-row,
.table-head,
.table-row,
.row-actions {
  display: flex;
  align-items: center;
}

.panel-header,
.header-main,
.filters-row,
.save-row {
  justify-content: space-between;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.field input,
.field select,
.inline-input,
.inline-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff8f0;
  background: linear-gradient(135deg, #7e4827, #9f6033);
}

.button-primary[disabled] {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
}

.button-save {
  padding-inline: 18px;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.project-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.52);
  cursor: pointer;
}

.project-card.is-active {
  border-color: rgba(140, 79, 43, 0.45);
  background: linear-gradient(180deg, rgba(140, 79, 43, 0.14), rgba(255, 255, 255, 0.7));
}

.project-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.project-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.project-badges,
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.pill {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.pill.pending,
.status-chip.pending {
  color: var(--pending);
  background: var(--pending-soft);
}

.pill.approved,
.status-chip.approved {
  color: var(--confirm);
  background: var(--confirm-soft);
}

.pill.rejected,
.status-chip.rejected {
  color: var(--reject);
  background: var(--reject-soft);
}

.workspace {
  padding: 28px;
}

.project-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.project-header,
.project-stage,
.project-table,
.empty-state {
  padding: 22px;
}

.project-title {
  font-size: clamp(30px, 3vw, 42px);
}

.header-copy {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.5;
}

.header-actions {
  gap: 12px;
}

.save-row {
  gap: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.save-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.filters-row {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  color: var(--muted);
  font-size: 13px;
}

.inline-field.search {
  min-width: min(340px, 100%);
  flex: 1 1 240px;
}

.project-table {
  overflow: hidden;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.table-head,
.table-row {
  min-width: 1080px;
  display: grid;
  grid-template-columns: 76px 120px 160px 180px minmax(320px, 1fr) 240px;
  gap: 14px;
  padding: 14px 16px;
}

.table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3ead8;
  border-bottom: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.table-row {
  border-top: 1px solid var(--line);
  align-items: start;
}

.table-row:first-child {
  border-top: 0;
}

.source-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.source-link {
  color: var(--accent);
  text-decoration: none;
}

.atom-type {
  max-width: max-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(32, 37, 41, 0.06);
  font-size: 12px;
  font-weight: 700;
}

.atom-text {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.row-actions {
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.row-action {
  min-height: 38px;
  min-width: 96px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.66);
  cursor: pointer;
}

.row-action.approve {
  color: var(--confirm);
  border-color: rgba(37, 94, 63, 0.18);
}

.row-action.approve.is-active {
  background: var(--confirm);
  color: #f5fbf7;
}

.row-action.reject {
  color: var(--reject);
  border-color: rgba(143, 51, 36, 0.18);
}

.row-action.reject.is-active {
  background: var(--reject);
  color: #fff7f5;
}

.row-action.reset {
  color: var(--pending);
  border-color: rgba(125, 105, 54, 0.18);
}

.row-action.reset.is-active {
  background: var(--pending);
  color: #fff8ea;
}

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

.message-banner {
  padding: 14px 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(143, 51, 36, 0.3);
  border-radius: 18px;
  background: rgba(143, 51, 36, 0.08);
  color: var(--reject);
}

.empty-state {
  min-height: 320px;
  display: grid;
  place-content: center;
  text-align: center;
}

@media (max-width: 1100px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .project-header,
  .project-stage,
  .project-table,
  .empty-state,
  .panel {
    padding: 16px;
    border-radius: 18px;
  }

  .header-actions,
  .save-row {
    flex-direction: column;
    align-items: stretch;
  }

  .table-head,
  .table-row {
    grid-template-columns: 60px 110px 132px 150px minmax(260px, 1fr) 220px;
    padding: 12px;
  }
}
