/* Continuity Hub - palette matches the Invoice Tracker */
:root {
  --bg: #f5f5f0; --card: #ffffff; --accent: #2d6a4f; --accent-light: #d8f3dc; --accent-dark: #1b4332;
  --text: #2d2d2d; --text-light: #6b6b6b; --border: #e0e0d8;
  --warning: #e76f51; --warning-light: #fde8e2; --due-soon: #f4a261; --due-soon-light: #fef3e2; --overdue: #e63946;
}
[hidden] { display: none !important; }
[hidden] { display: none !important; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); }
a.btn { text-decoration: none; display: inline-block; }
main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; }
h1 { font-size: 22px; color: var(--accent-dark); }
h2 { font-size: 17px; color: var(--accent-dark); margin: 4px 0 12px; }
h3 { font-size: 14px; color: var(--accent); margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .4px; }
.muted { color: var(--text-light); }
.small { font-size: 12px; }
.loading { padding: 60px; text-align: center; color: var(--text-light); }

/* top bar */
.topbar { display: flex; align-items: center; gap: 24px; background: var(--accent-dark); color: #fff; padding: 10px 20px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.brand-mark { background: var(--accent-light); color: var(--accent-dark); border-radius: 6px; padding: 2px 6px; font-size: 12px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: #d8f3dc; text-decoration: none; padding: 6px 12px; border-radius: 6px; }
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.who { font-size: 13px; }
.who .btn-link { color: #d8f3dc; }
.emergency-bar { background: var(--overdue); color: #fff; padding: 10px 20px; font-weight: 600; text-align: center; }

/* cards, buttons, forms */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.btn { border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 6px; padding: 8px 14px; font-size: 13px; cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--accent-dark); }
.btn-secondary { background: #fff; color: var(--accent); }
.btn-secondary:hover { background: var(--accent-light); }
.btn-danger { background: var(--overdue); border-color: var(--overdue); }
.btn-danger:hover { background: #b32631; }
.btn-link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0 4px; font-size: 13px; text-decoration: underline; font-family: inherit; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: inherit; background: #fff; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--text-light); margin-bottom: 4px; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.grid .wide { grid-column: 1 / -1; }
.field-value { font-size: 14px; min-height: 20px; white-space: pre-wrap; }

/* tables */
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th { text-align: left; font-size: 12px; color: var(--text-light); font-weight: 600; padding: 8px 10px; border-bottom: 2px solid var(--border); background: #fafaf7; white-space: nowrap; }
table.list td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover td { background: #f8faf6; }
table.list td input, table.list td select { padding: 6px 8px; font-size: 13px; }
.num { text-align: right; white-space: nowrap; }

/* chips */
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eee; color: var(--text); white-space: nowrap; }
.chip.good { background: var(--accent-light); color: var(--accent-dark); }
.chip.warn { background: var(--due-soon-light); color: #9a5a12; }
.chip.bad { background: var(--warning-light); color: #a3261d; }
.chip.stale { background: var(--overdue); color: #fff; }
.chip.neutral { background: #ecebe4; color: #555; }

/* progress */
.bar { height: 8px; background: #ecebe4; border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.bar.over > span { background: var(--overdue); }

/* project page */
.proj-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.proj-head .title { flex: 1; min-width: 260px; }
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: none; padding: 9px 14px; font-size: 13px; cursor: pointer; color: var(--text-light); border-bottom: 2px solid transparent; margin-bottom: -2px; font-family: inherit; }
.tabs button.active { color: var(--accent-dark); border-bottom-color: var(--accent); font-weight: 600; }
.steps { list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.steps li::before { content: counter(s); flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.steps li.done::before { content: "\2713"; background: var(--accent-light); color: var(--accent-dark); }
.steps li.done .step-text { text-decoration: line-through; color: var(--text-light); }
.steps .step-body { flex: 1; }
.steps .notes { font-size: 12px; color: var(--text-light); white-space: pre-wrap; margin-top: 4px; }
.log-entry { border-left: 3px solid var(--accent-light); padding: 6px 12px; margin-bottom: 12px; }
.log-entry .meta { font-size: 12px; color: var(--text-light); margin-bottom: 2px; }
.log-entry .text { white-space: pre-wrap; }
.callout { background: #f0f7e6; border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; }
.callout.red { background: var(--warning-light); border-left-color: var(--overdue); }

/* login */
.login { max-width: 380px; margin: 80px auto; }
.login .card { padding: 28px; }
.login h1 { margin-bottom: 4px; }
.login .field { margin-top: 14px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--accent-dark); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 50; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.toast.error { background: var(--overdue); }

@media (max-width: 700px) {
  main { padding: 16px 10px 60px; }
  .hide-sm { display: none; }
  table.list th, table.list td { padding: 7px 6px; }
}
@media print {
  .topbar, .tabs, .btn, .btn-link, .emergency-bar { display: none !important; }
}
