:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-soft: #ece7dc;
  --ink: #222222;
  --muted: #6c6a66;
  --line: #ddd7ca;
  --accent: #1f6f5b;
  --accent-ink: #ffffff;
  --danger: #a64032;
  --warning: #986b20;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

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

#app {
  min-height: 100vh;
  padding: 16px;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  margin: 0 0 2px;
  text-transform: uppercase;
}

h1 {
  font-size: 28px;
  line-height: 1;
  margin: 0;
}

.icon-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.tabs {
  background: var(--surface-soft);
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 16px;
  padding: 4px;
}

.tab {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  min-height: 40px;
  padding: 8px 6px;
}

.tab.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-title {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  margin: 16px 0 8px;
}

.section-title h2 {
  font-size: 18px;
  margin: 0;
}

.count {
  color: var(--muted);
  font-size: 13px;
}

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

.project-card,
.client-card,
.empty-state,
.error-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.project-card header,
.client-card header {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.project-title,
.client-title {
  font-size: 16px;
  font-weight: 750;
  line-height: 1.25;
  margin: 0;
}

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

.status {
  font-size: 14px;
  line-height: 1.4;
  margin: 10px 0 0;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  background: var(--surface-soft);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  padding: 5px 8px;
}

.pill.danger {
  background: #f4dedb;
  color: var(--danger);
}

.pill.warning {
  background: #f2e6d0;
  color: var(--warning);
}

.card-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}

.card-actions button,
.suggestions button,
.secondary,
.primary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 40px;
  padding: 9px 10px;
}

.card-actions button,
.secondary,
.suggestions button {
  background: var(--surface);
  color: var(--ink);
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.project-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  padding: 12px;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 13px;
}

input,
textarea,
select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  min-height: 42px;
  padding: 9px 10px;
  width: 100%;
}

textarea {
  resize: vertical;
}

.grid-two {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestions button {
  min-height: 34px;
}

.actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.empty-state,
.error-state {
  color: var(--muted);
  line-height: 1.45;
}

.error-state {
  color: var(--danger);
}

@media (min-width: 720px) {
  #app {
    margin: 0 auto;
    max-width: 920px;
  }

  .list.projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
