:root {
  --bg: #f4efe7;
  --bg-2: #e6dccb;
  --surface: rgba(255, 251, 245, 0.9);
  --surface-2: #fffaf2;
  --line: rgba(76, 57, 39, 0.12);
  --text: #261a11;
  --muted: #6f5e51;
  --accent: #bc5e37;
  --accent-2: #874122;
  --blue: #d8ebff;
  --green: #dff0c9;
  --yellow: #ffe8a7;
  --orange: #ffd3b4;
  --gray: #ece4d9;
  --shadow: 0 24px 60px rgba(53, 31, 15, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top left, rgba(188, 94, 55, 0.16), transparent 26%),
    radial-gradient(circle at bottom right, rgba(125, 86, 43, 0.12), transparent 30%),
    linear-gradient(135deg, var(--bg), #e6dccb);
}

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

.hidden {
  display: none;
}

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

.sidebar {
  padding: 26px;
  background: rgba(47, 35, 27, 0.95);
  color: #f7eee4;
}

.brand h1,
.hero h2,
.section-head h2,
.section-head h3 {
  margin: 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand .eyebrow {
  color: #f1c5a8;
}

.brand p {
  margin: 10px 0 0;
  color: rgba(247, 238, 228, 0.74);
  line-height: 1.5;
}

.sidebar-card,
.hero,
.panel,
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.sidebar-card {
  margin-top: 22px;
  padding: 18px;
  border-radius: 24px;
  color: var(--text);
}

.stats-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stats-list div {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--line);
}

.stats-list strong,
.stats-list span,
.project-chip strong,
.project-chip span,
.document-item strong,
.document-item span,
.person-card strong,
.person-card span,
.person-card small {
  display: block;
}

.stats-list strong {
  font-size: 30px;
}

.stats-list span,
.project-chip span,
.document-item span,
.person-card span,
.person-card small,
.empty-box,
.empty-cell,
.hero p,
.task-spec {
  color: var(--muted);
}

.project-list,
.document-list,
.people-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.project-chip,
.document-item,
.person-card,
.empty-box {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
  text-align: left;
  color: inherit;
  text-decoration: none;
}

.project-chip {
  cursor: pointer;
}

.project-chip-active {
  background: linear-gradient(135deg, rgba(188, 94, 55, 0.25), rgba(255, 230, 211, 0.5));
  border-color: rgba(188, 94, 55, 0.26);
}

.main-content {
  padding: 30px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px;
  border-radius: 28px;
}

.hero p {
  margin: 12px 0 0;
  max-width: 760px;
}

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

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 18px;
  margin-top: 20px;
}

.panel {
  padding: 22px;
  border-radius: 28px;
}

.panel-wide {
  grid-row: span 2;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.table-wrap {
  margin-top: 16px;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

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

thead th {
  color: var(--muted);
  font-size: 14px;
}

.task-spec {
  margin-top: 8px;
  line-height: 1.4;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
  font-size: 13px;
}

.badge-blue { background: var(--blue); }
.badge-green { background: var(--green); }
.badge-yellow { background: var(--yellow); }
.badge-orange { background: var(--orange); }
.badge-gray { background: var(--gray); }

.form-stack {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.form-stack label {
  display: grid;
  gap: 8px;
}

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

textarea {
  resize: vertical;
}

.primary-btn,
.ghost-btn {
  border-radius: 999px;
  padding: 11px 17px;
  cursor: pointer;
}

.primary-btn {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff8f0;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
  color: var(--text);
}

.full-btn {
  width: 100%;
}

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  display: grid;
  gap: 10px;
  z-index: 40;
}

.toast {
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(33, 24, 18, 0.92);
  color: #fff8f0;
  box-shadow: var(--shadow);
}

.toast-error {
  background: rgba(138, 43, 23, 0.94);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(25, 17, 12, 0.42);
  z-index: 30;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  border-radius: 28px;
}

@media (max-width: 1180px) {
  .app-shell,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sidebar,
  .main-content {
    padding: 18px;
  }

  .hero {
    padding: 20px;
    flex-direction: column;
  }

  .stats-list {
    grid-template-columns: 1fr 1fr;
  }
}
