/* Foreman Companion — v0 visual design. See ../DESIGN.md for rationale. */

:root {
  --bg: #0b0e14;
  --surface: #141924;
  --surface-2: #1b2230;
  --border: rgba(255,255,255,.06);
  --text: #e8eaf0;
  --text-dim: #8b93a7;
  --accent: #5b8cff;
  --accent-dim: rgba(91,140,255,.15);
  --amber: #e0a458;
  --amber-dim: rgba(224,164,88,.15);
  --red: #e5484d;
  --red-dim: rgba(229,72,77,.15);
  --green: #4bb679;
  --radius: 12px;
  --radius-sm: 8px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f8;
    --surface: #ffffff;
    --surface-2: #eef0f5;
    --border: rgba(0,0,0,.08);
    --text: #1a1d24;
    --text-dim: #616a7d;
    --accent-dim: rgba(91,140,255,.12);
    --amber-dim: rgba(224,164,88,.18);
    --red-dim: rgba(229,72,77,.12);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1;
  -webkit-tap-highlight-color: transparent;
}

.app { max-width: 480px; margin: 0 auto; height: 100dvh; display: flex; flex-direction: column; }

.view { display: flex; flex-direction: column; height: 100%; }
.hidden { display: none; }

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px calc(10px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 2;
}
.brand { font-size: 17px; font-weight: 600; flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; border: none;
  background: var(--surface); color: var(--text); font-size: 18px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn:active { transform: scale(.94); }

.scroll { flex: 1; overflow-y: auto; padding: 16px; padding-bottom: 24px; }

.page-title { font-size: 22px; margin: 4px 0 16px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); margin: 20px 0 10px; }

.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---- project card ---- */
.project-card {
  background: var(--surface); border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--border); cursor: pointer;
  transition: transform .15s var(--ease), background .15s var(--ease);
}
.project-card:active { transform: scale(.98); background: var(--surface-2); }
.project-card .row1 { display: flex; align-items: center; gap: 10px; }
.dot { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; }
.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-dim); }
.dot-grey { background: var(--text-dim); }
.project-name { font-weight: 600; font-size: 16px; flex: 1; }
.project-meta { color: var(--text-dim); font-size: 13px; margin-top: 6px; }
.budget-bar { height: 4px; border-radius: 999px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.budget-fill { height: 100%; background: var(--accent); border-radius: 999px; }

.pill {
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
}
.pill-amber { background: var(--amber-dim); color: var(--amber); }
.pill-green { background: rgba(75,182,121,.15); color: var(--green); }

.tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.tab {
  flex: 1; border: none; background: transparent; color: var(--text-dim);
  padding: 8px; border-radius: var(--radius-sm); font-size: 14px; cursor: pointer;
}
.tab.active { background: var(--surface); color: var(--text); font-weight: 600; }

/* ---- inbox card ---- */
.inbox-card {
  background: var(--surface); border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--border); margin-bottom: 12px;
  animation: slide-in .2s var(--ease);
}
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.inbox-card.resolved { opacity: .5; }
.kind-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.kind-question .kind-badge { color: var(--accent); }
.kind-handoff .kind-badge { color: var(--amber); }
.kind-spend .kind-badge, .kind-email .kind-badge { color: var(--red); }
.card-title { font-size: 15px; font-weight: 600; margin: 6px 0 4px; }
.card-detail { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.amount { font-size: 22px; font-weight: 700; margin: 4px 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; cursor: pointer;
  min-height: 44px; transition: background .12s var(--ease), transform .1s var(--ease);
}
.chip:active { transform: scale(.96); }
.chip-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.chip-danger { background: var(--red-dim); border-color: transparent; color: var(--red); font-weight: 600; }
.chip-ghost { background: transparent; }

.empty-state { text-align: center; color: var(--text-dim); padding: 40px 20px; font-size: 14px; }

.digest-section { margin-bottom: 18px; }
.digest-section h3 { font-size: 13px; text-transform: uppercase; color: var(--text-dim); margin: 0 0 6px; letter-spacing: .04em; }
.digest-section p { margin: 0; line-height: 1.5; font-size: 15px; white-space: pre-wrap; }
.log-link { display: inline-block; margin-top: 10px; color: var(--accent); font-size: 14px; cursor: pointer; }

.log-body {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px;
  white-space: pre-wrap; line-height: 1.5; color: var(--text-dim);
}

.chat { }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.4; }
.msg-you { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg-agent { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
#talk-history, #overseer-chat { display: flex; flex-direction: column; gap: 10px; }

.composer {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom,0px));
  border-top: 1px solid var(--border); background: var(--bg);
}
.composer input {
  flex: 1; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 12px 16px; font-size: 15px; outline: none;
}
.composer input:focus { border-color: var(--accent); }
.mic-btn, .send-btn {
  width: 44px; height: 44px; border-radius: 999px; border: none; font-size: 18px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.mic-btn { background: var(--surface-2); color: var(--text); }
.mic-btn.listening { background: var(--red-dim); color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--red-dim); } 50% { box-shadow: 0 0 0 8px transparent; } }
.send-btn { background: var(--accent); color: #fff; width: auto; padding: 0 16px; font-weight: 600; }

::-webkit-scrollbar { width: 0; height: 0; }
