/* =========================================================================
   styles.css — Studio editorial system
   Monochrome base, single accent, typography-led, generous whitespace.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --ink: #0d0d0d;
  --ink-2: #2a2a2a;
  --ink-3: #555;
  --ink-4: #8a8a8a;
  --line: #e6e6e6;
  --line-2: #d0d0d0;
  --paper: #fafaf7;
  --paper-2: #f2f2ec;
  --white: #ffffff;
  --accent: #ff4a1c;      /* Pixpil-flavored signal orange */
  --accent-soft: #fff0eb;
  --good: #1f7a4d;
  --good-soft: #e6f3ec;
  --warn: #b06a00;
  --warn-soft: #fff3df;
  --bad:  #b8351f;
  --bad-soft: #fce9e4;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --r-1: 4px;
  --r-2: 8px;
  --r-3: 14px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.04);
  --shadow-2: 0 6px 24px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- Layout ---------------------------------------------------- */

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px; border-bottom: 1px solid var(--line);
  background: var(--white);
  position: sticky; top: 0; z-index: 20;
}
.brand {
  display: flex; align-items: baseline; gap: 10px;
}
.brand-mark {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-3);
}
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 28px 40px 80px;
}

/* ---------- Typography ------------------------------------------------ */

h1, h2, h3, h4 { margin: 0; color: var(--ink); }
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  font-weight: 500;
}
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-4);
  font-weight: 500;
}
.muted { color: var(--ink-3); }

/* ---------- Buttons --------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .08s ease, background .2s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); background: var(--ink-2); }
.btn:active { transform: translateY(0); }
.btn-ghost {
  background: transparent; color: var(--ink);
}
.btn-ghost:hover { background: var(--paper-2); }
.btn-accent {
  background: var(--accent); border-color: var(--accent);
}
.btn-accent:hover { background: #e63d15; border-color: #e63d15; }
.btn-sm {
  padding: 6px 12px; font-size: 12px;
}
.btn-icon {
  padding: 6px 8px; border-radius: 6px; background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
}
.btn-icon:hover { background: var(--paper-2); color: var(--ink); }
.btn-danger {
  background: transparent; color: var(--bad); border-color: var(--bad-soft);
}
.btn-danger:hover { background: var(--bad-soft); }

/* ---------- Cards ----------------------------------------------------- */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-1);
  padding: 24px;
}
.card + .card { margin-top: 24px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}
.card-title { font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: -0.01em; }

/* ---------- Forms ----------------------------------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 20px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-3); font-weight: 500;
}
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 9px 12px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(13,13,13,.05);
}
.field textarea { resize: vertical; min-height: 72px; }
.field-inline { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }

/* ---------- Chips & tags --------------------------------------------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 500;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.chip-good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip-bad  { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip-muted { color: var(--ink-3); }
.chip-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- Status strip --------------------------------------------- */

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}
.stat {
  border-left: 2px solid var(--ink);
  padding: 4px 0 4px 16px;
}
.stat-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-3); font-weight: 500; margin-bottom: 6px;
}
.stat-value {
  font-family: var(--serif); font-size: 28px; font-weight: 400; letter-spacing: -0.01em;
  line-height: 1.1;
}
.stat-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.progress {
  height: 6px; background: var(--paper-2); border-radius: 999px; overflow: hidden; margin-top: 10px;
}
.progress > span { display: block; height: 100%; background: var(--ink); border-radius: 999px; transition: width .4s ease; }
.progress.accent > span { background: var(--accent); }

/* ---------- Timeline -------------------------------------------------- */

.timeline-wrap {
  overflow-x: auto;
  padding: 8px 0 16px;
}
.timeline {
  min-width: 720px;
}
.tl-header {
  position: relative;
  height: 26px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 0 180px;
}
.tl-month {
  position: absolute;
  top: 0; bottom: 0;
  border-left: 1px solid var(--line);
  padding-left: 8px;
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex; align-items: center;
}
.tl-body { margin-top: 8px; }
.tl-row {
  display: flex; align-items: stretch;
  min-height: 44px;
  border-bottom: 1px dashed var(--line);
}
.tl-row:last-child { border-bottom: none; }
.tl-row-label {
  width: 180px; flex: none;
  padding: 8px 12px 8px 0;
  border-right: 1px solid var(--line);
}
.tl-row-name { font-weight: 500; font-size: 13px; color: var(--ink); }
.tl-row-meta { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.tl-track {
  position: relative; flex: 1; margin-left: 12px;
  min-height: 44px;
}
.tl-bar {
  position: absolute;
  top: 10px; bottom: 10px;
  background: var(--ink);
  color: var(--white);
  border-radius: 6px;
  padding: 0 10px;
  display: flex; align-items: center;
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 8px;
}
.tl-bar.is-done { background: var(--ink-3); }
.tl-bar.is-current { background: var(--accent); }
.tl-bar.is-upcoming { background: var(--white); color: var(--ink); border: 1px dashed var(--ink-3); }
.tl-bar-label { overflow: hidden; text-overflow: ellipsis; }
.tl-today-mark {
  position: absolute; top: 0; bottom: 0; width: 0;
  border-left: 1.5px dashed var(--accent);
  z-index: 2;
  pointer-events: none;
}
.tl-markers .tl-track { min-height: 44px; }
.tl-marker {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  font-size: 10px;
  color: var(--ink-3);
  max-width: 110px;
  text-align: center;
}
.tl-marker-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1.5px var(--ink);
  background: var(--ink);
}
.tl-marker-meeting .tl-marker-dot { background: var(--ink); box-shadow: 0 0 0 1.5px var(--ink); }
.tl-marker-delivery .tl-marker-dot { background: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.tl-marker-delivery { color: var(--accent); }
.tl-marker-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
  margin-top: 4px;
  font-weight: 500;
}
.tl-empty, .empty {
  padding: 28px 16px; text-align: center; color: var(--ink-3); font-style: italic;
  border: 1px dashed var(--line); border-radius: var(--r-2); background: var(--paper-2);
}

/* ---------- Lists / items --------------------------------------------- */

.items { display: flex; flex-direction: column; }
.item {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.item:first-child { border-top: none; }
.item-title { font-weight: 500; }
.item-meta { font-size: 12px; color: var(--ink-3); }
.item-actions { display: flex; gap: 6px; justify-content: flex-end; }

.inline-edit {
  border: 1px solid transparent;
  padding: 6px 8px;
  border-radius: var(--r-2);
  background: transparent;
  color: inherit;
  width: 100%;
}
.inline-edit:hover { background: var(--paper-2); }
.inline-edit:focus { background: var(--white); border-color: var(--line-2); outline: none; }

/* ---------- Team chips ------------------------------------------------ */

.team-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.team-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 6px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}
.team-chip .avatar {
  width: 24px; height: 24px;
  background: var(--ink);
  color: var(--white);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.team-chip button {
  background: none; border: none; color: var(--ink-4); cursor: pointer; padding: 0 4px;
  font-size: 14px;
}
.team-chip button:hover { color: var(--bad); }

/* ---------- Meetings / Feedback --------------------------------------- */

.meeting {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--white);
  margin-bottom: 10px;
}
.meeting-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.meeting-title { font-weight: 500; }
.meeting-date { font-size: 12px; color: var(--ink-3); }
.meeting-notes { margin-top: 10px; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; }
.meeting-feedback {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--paper-2);
  border-left: 2px solid var(--accent);
  font-size: 13px;
  white-space: pre-wrap;
  font-style: italic;
  color: var(--ink-2);
}
.meeting-feedback-label {
  display: block;
  font-style: normal;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 4px;
}

/* ---------- Modal ----------------------------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(13,13,13,.35);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--r-3);
  max-width: 560px; width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-2);
  max-height: 90vh; overflow-y: auto;
}
.modal h2 { margin-bottom: 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ---------- Share panel ---------------------------------------------- */

.share-output {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
  margin-top: 12px;
  max-height: 140px;
  overflow: auto;
}

/* ---------- View (read-only) page tweaks ----------------------------- */

.view-banner {
  background: var(--ink);
  color: var(--white);
  padding: 10px 40px;
  font-size: 12px;
  text-align: center;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.view-banner strong { font-weight: 600; }

/* ---------- Utilities ------------------------------------------------- */

.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.row-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.spaced { letter-spacing: 0.06em; }
hr.rule { border: none; border-top: 1px solid var(--line); margin: 24px 0; }

/* Scrollbar - subtle */
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* Responsive */
@media (max-width: 720px) {
  .container { padding: 20px; }
  .topbar { padding: 14px 20px; }
  h1 { font-size: 32px; }
  .item {
    grid-template-columns: 1fr 1fr;
  }
  .item-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .tl-row-label { width: 120px; }
  .tl-header { margin-left: 120px; }
}
