:root {
  --bg: #f4f7ef;
  --surface: #ffffff;
  --surface-soft: #eef5e7;
  --ink: #182015;
  --muted: #687260;
  --border: #d5decf;
  --accent: #2f8f5b;
  --accent-dark: #1f6f45;
  --danger: #c2414b;
  --warning: #ad7c1a;
  --shadow: 0 20px 50px rgba(35, 55, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(
      circle at top left,
      rgba(47, 143, 91, 0.18),
      transparent 28rem
    ),
    radial-gradient(
      circle at bottom right,
      rgba(173, 124, 26, 0.14),
      transparent 30rem
    ),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

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

button,
.import-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0.72rem 1rem;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

button:hover,
.import-label:hover {
  background: var(--accent-dark);
  box-shadow: 0 10px 24px rgba(47, 143, 91, 0.2);
  transform: translateY(-1px);
}

button.secondary,
.import-label {
  background: #e6efdd;
  color: var(--ink);
  border: 1px solid var(--border);
}

button.secondary:hover,
.import-label:hover {
  background: #dce9d2;
}

button.danger {
  background: rgba(194, 65, 75, 0.1);
  border: 1px solid rgba(194, 65, 75, 0.34);
  color: var(--danger);
}

button.danger:hover {
  background: rgba(194, 65, 75, 0.16);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
  gap: 24px;
  align-items: end;
  margin-bottom: 20px;
}

.back-link {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.eyebrow {
  margin: 22px 0 8px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 12px;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.22rem;
}

.subtitle,
.capture-header p,
.focus-card p,
.category-card p,
.board-header p {
  color: var(--muted);
  line-height: 1.65;
}

.subtitle {
  max-width: 720px;
  margin-bottom: 0;
  font-size: 1.04rem;
}

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

.stats article,
.capture-panel,
.controls,
.focus-card,
.category-card,
.board-section {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stats article {
  padding: 16px;
}

.stats span {
  display: block;
  font-size: 1.8rem;
  font-weight: 950;
}

.stats small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.capture-panel,
.controls,
.focus-card,
.category-card,
.board-section {
  padding: 20px;
  margin-bottom: 18px;
}

.capture-header,
.board-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdf8;
  color: var(--ink);
  padding: 0.78rem 0.86rem;
  outline: none;
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 143, 91, 0.16);
}

.capture-actions {
  display: grid;
  grid-template-columns: minmax(220px, 0.4fr) auto;
  gap: 12px;
  align-items: end;
}

.controls {
  display: grid;
  grid-template-columns:
    minmax(240px, 1fr) minmax(160px, 0.45fr) minmax(140px, 0.35fr)
    auto;
  gap: 12px;
  align-items: end;
}

.control-buttons,
.note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#importFile {
  display: none;
}

.insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
}

.focus-list,
.category-summary {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.focus-item,
.category-pill {
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.focus-item strong,
.category-pill strong {
  display: block;
  margin-bottom: 4px;
}

.focus-item small,
.category-pill span {
  color: var(--muted);
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.group-column {
  min-width: 0;
  background: #f8fbf4;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.group-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.group-header h3 {
  margin: 0;
  font-size: 1rem;
}

.group-header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.note-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.note-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.note-card.done {
  opacity: 0.7;
}

.note-card.pinned {
  border-color: rgba(173, 124, 26, 0.5);
  box-shadow: inset 4px 0 0 var(--warning);
}

.note-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.note-category {
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.note-text {
  margin-bottom: 0;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.done .note-text {
  text-decoration: line-through;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border-radius: 999px;
  padding: 0.24rem 0.54rem;
  background: #edf3e8;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.note-actions button {
  min-height: 36px;
  padding: 0.45rem 0.62rem;
  font-size: 0.8rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 32px 18px;
  background: #f8fbf4;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 920px) {
  .hero,
  .controls,
  .insights-grid,
  .capture-actions {
    grid-template-columns: 1fr;
  }

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

  .capture-header,
  .board-header {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

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

  .control-buttons,
  .note-actions {
    display: grid;
  }

  button,
  .import-label {
    width: 100%;
  }
}

/* Alert Container */
.alert-container {
  background: rgba(194, 65, 75, 0.1);
  border: 1px solid rgba(194, 65, 75, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}
.alert-container .alert-icon {
  flex-shrink: 0;
}
