/* Office work ledger — refined editorial, warm paper + pine ink.
   Fraunces (display serif) / Hanken Grotesk (body) / IBM Plex Mono (administrative detail). */

:root {
  --paper:   #f4efe4;   /* warm cream page */
  --card:    #fcfaf3;   /* slightly lighter leaf */
  --ink:     #211d18;   /* warm near-black */
  --muted:   #6f6557;   /* warm grey for meta */
  --faint:   #9b9183;   /* fainter labels */
  --line:    #e3dbc9;   /* hairline */
  --line-2:  #d6cdb8;   /* stronger hairline */
  --pine:    #2e5a45;   /* primary accent */
  --pine-dk: #234838;
  --pine-sft:#e7eee9;   /* pine tint fill */
  --ochre:   #a96a13;   /* in progress */
  --grey:    #8a8071;   /* to do */

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shadow: 0 1px 2px rgba(33, 29, 24, 0.04), 0 8px 24px -16px rgba(33, 29, 24, 0.22);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* hairline accent at the very top of the page */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pine), #5c8a72 60%, var(--ochre));
  z-index: 50;
}

/* faint paper grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

::selection { background: var(--pine); color: #fff; }

.wrap { width: 100%; max-width: 660px; margin: 0 auto; padding: 0 22px; }

/* ---------- masthead ---------- */

.masthead { padding: 40px 0 0; }

.masthead-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-2);
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.eyebrow {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pine);
}

.title {
  margin: 0;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(30px, 7vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.badge {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pine-dk);
  background: var(--pine-sft);
  border: 1px solid #cfdcd4;
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
  margin-bottom: 4px;
}

/* ---------- generic states ---------- */

#app { padding-top: 26px; padding-bottom: 80px; }
.loading, .error, .empty { font-family: var(--mono); font-size: 13px; color: var(--muted); padding: 28px 0; }
.error { color: #9a3328; }
.empty { padding: 16px 0 4px; color: var(--faint); }

/* ---------- assign panel ---------- */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: 0.05s;
}

.panel-title {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.field { margin-bottom: 15px; }

label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 7px;
}
label .opt { color: var(--line-2); margin-left: 4px; text-transform: none; letter-spacing: 0; }

input[type="text"], textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 15.5px;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 11px 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]::placeholder, textarea::placeholder { color: var(--faint); }
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(46, 90, 69, 0.12);
}
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }

input[type="file"] { font-family: var(--mono); font-size: 12.5px; color: var(--muted); max-width: 100%; }
input[type="file"]::file-selector-button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pine-dk);
  background: var(--pine-sft);
  border: 1px solid #cfdcd4;
  border-radius: 7px;
  padding: 7px 12px;
  margin-right: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
input[type="file"]::file-selector-button:hover { background: #dbe7e0; }

/* ---------- buttons ---------- */

.btn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; }

.btn-primary {
  color: #f6f2e8;
  background: var(--pine);
  border-color: var(--pine-dk);
  box-shadow: 0 6px 16px -10px rgba(46, 90, 69, 0.8);
}
.btn-primary:hover { background: var(--pine-dk); }

.btn-line { color: var(--pine-dk); background: transparent; border-color: var(--line-2); }
.btn-line:hover { border-color: var(--pine); }

.btn-ghost { color: var(--muted); background: transparent; border-color: var(--line); padding: 8px 14px; }
.btn-ghost:hover { color: var(--ink); border-color: var(--line-2); }

.form > .btn-primary { margin-top: 4px; }

/* ---------- ledger sections ---------- */

.ledger-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 34px 4px 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.ledger-head .count { color: var(--faint); }
.ledger-head::after { content: none; }

/* a hairline that trails the section label */
.ledger-head {
  position: relative;
}

/* ---------- task cards ---------- */

.task {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 18px 18px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.task::before {
  content: "";
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 2px;
  border-radius: 2px;
  background: var(--line-2);
  transition: background 0.16s;
}
.task:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(33,29,24,.05), 0 18px 36px -22px rgba(33,29,24,.4); border-color: var(--line-2); }
.task:hover::before { background: var(--pine); }

.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18.5px;
  line-height: 1.18;
  letter-spacing: -0.01em;
}
.task-note { margin: 7px 0 0; color: var(--muted); font-size: 14.5px; white-space: pre-wrap; }

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 13px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}
.task-meta .tl { color: var(--ochre); }

a.link { color: var(--pine); text-decoration: none; border-bottom: 1px solid rgba(46,90,69,0.3); transition: border-color 0.15s; }
a.link:hover { border-bottom-color: var(--pine); }

/* ---------- status tag ---------- */

.status {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px 3px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.todo { color: var(--grey); }
.status.in_progress { color: var(--ochre); }
.status.done { color: var(--pine); }

/* ---------- worker actions ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }

.close-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
}
.close-row .or { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* ---------- motion ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.task:nth-child(1) { animation-delay: 0.04s; }
.task:nth-child(2) { animation-delay: 0.09s; }
.task:nth-child(3) { animation-delay: 0.14s; }
.task:nth-child(4) { animation-delay: 0.19s; }
.task:nth-child(5) { animation-delay: 0.24s; }
.task:nth-child(n+6) { animation-delay: 0.28s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- small screens ---------- */

@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .masthead { padding-top: 30px; }
  .panel { padding: 18px; }
  .task-meta { gap: 5px 12px; }
}
