/* Platinum Food Chain Partners platform. Phone first; the desktop is the wide case. */
:root {
  --green: #046A38; --green-dark: #03522b; --green-lt: #E8F3EC; --green-mid: #C9E3D3;
  --ink: #1A1A1A; --ink-soft: #3a3a3a; --muted: #6b6b6b; --line: #D9D9D9; --line-soft: #ececec;
  --bg: #f6f7f6; --card: #fff; --warn: #9a6b00; --neg: #b3261e; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: Aptos, "Segoe UI", system-ui, -apple-system, Arial, sans-serif; font-size: 15px;
  color: var(--ink); background: var(--bg); line-height: 1.4; }
a { color: var(--green-dark); text-decoration: none; }
h1 { font-size: 24px; margin: 0 0 14px; }
h2 { font-size: 16px; margin: 0 0 10px; color: var(--green-dark); }
h2.mt { margin-top: 22px; }
code { font-family: Consolas, Menlo, monospace; font-size: 13px; background: #f0f2f0; padding: 1px 5px; border-radius: 4px; }
ul { padding-left: 20px; margin: 6px 0 12px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #fff;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); }
.mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 8px; background: var(--green); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .02em; }
.mark.big { width: 46px; height: 46px; font-size: 17px; border-radius: 11px; }
.brand-text { font-size: 15px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a, .who a { padding: 7px 11px; border-radius: 8px; color: var(--ink-soft); font-weight: 600; font-size: 14px; }
.nav a.on, .who a.on { background: var(--green-lt); color: var(--green-dark); }
.nav a:hover, .who a:hover { background: #f0f2f0; }
.who { display: flex; gap: 2px; align-items: center; }
.who .muted { font-weight: 500; }
@media (max-width: 640px) {
  .brand-text { display: none; }
  .nav { margin-left: 0; order: 3; width: 100%; justify-content: space-between; }
  .nav a { padding: 6px 8px; font-size: 13.5px; }
}

/* ---------- layout ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 18px 16px 40px; }
.bare { min-height: 100vh; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.card.narrow { max-width: 640px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.door { display: block; color: inherit; border-top: 4px solid var(--green); }
.door:hover { border-color: var(--green-dark); background: #fbfcfb; }
.door-title { font-size: 20px; font-weight: 700; color: var(--green-dark); margin-bottom: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.inline button { margin-left: 4px; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; margin: 4px 0 10px; }
.table th { text-align: left; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table.small td, .table.small th { padding: 5px 7px; font-size: 13px; }
.table .num, td.num, th.num { text-align: right; }
tr.muted td { color: var(--muted); }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: var(--green-lt); color: var(--green-dark); border: 1px solid var(--green-mid); }
.badge.building { background: #fdf3dc; color: var(--warn); border-color: #f0dfb2; }
.badge.closed { background: #fbe7e7; color: var(--neg); border-color: #f0c9c9; }
.badge.open { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- forms ---------- */
.stack { display: flex; flex-direction: column; gap: 11px; margin-top: 8px; }
.stack label, .auth-card label { display: flex; flex-direction: column; gap: 4px; font-size: 11px;
  color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
input, select, textarea { font: inherit; font-size: 15px; padding: 9px 11px; border: 1px solid #c7d1cb;
  border-radius: 9px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(4,106,56,.3); border-color: var(--green); }
input[type="checkbox"] { width: auto; }
label.check { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0;
  font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.btn { display: inline-block; background: #fff; color: var(--green-dark); border: 1px solid #c7d1cb; border-radius: 9px;
  padding: 9px 15px; cursor: pointer; font-size: 14px; font-weight: 600; }
.btn:hover { background: #f0f5f2; border-color: var(--green); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-dark); }
.btn.danger { color: var(--neg); border-color: #e5b8b8; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; }
.linklike { background: none; border: none; color: var(--green-dark); cursor: pointer; font: inherit; font-size: 13.5px; padding: 0; }
.error { background: #fbe7e7; color: var(--neg); padding: 10px 13px; border-radius: 9px; border: 1px solid #f0c9c9; }
.ok { background: var(--green-lt); color: var(--green-dark); padding: 10px 13px; border-radius: 9px; border: 1px solid var(--green-mid); }
.code-input { font-size: 26px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- auth screens ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(900px 500px at 85% -10%, rgba(4,106,56,.25), transparent 60%),
              linear-gradient(160deg, #0f2a1e 0%, #13382a 55%, #0d2419 100%); }
.auth-card { width: 390px; max-width: 100%; border: none; border-radius: 16px; padding: 32px 30px 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35); border-top: 4px solid #c9a227; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 10px; }
.auth-card h1 { text-align: center; font-size: 21px; margin: 0 0 4px; }
.tagline { text-align: center; color: var(--muted); font-size: 12.5px; margin: 0 0 18px; text-transform: uppercase; letter-spacing: .1em; }
.auth-links { display: flex; justify-content: center; gap: 16px; align-items: center; margin: 16px 0 0; font-size: 13.5px; }

/* ---------- owners area ---------- */
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--green); border-radius: var(--radius); padding: 12px 14px 10px; }
.tile.warn { border-top-color: var(--warn); }
.tile-num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.tile-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filters select, .filters input { width: auto; padding: 6px 10px; font-size: 13.5px; }
.chip { padding: 5px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.badge.pending { background: #fdf3dc; color: var(--warn); border-color: #f0dfb2; }
.badge.approved { background: var(--green-lt); color: var(--green-dark); border-color: var(--green-mid); }
.badge.rejected { background: #fbe7e7; color: var(--neg); border-color: #f0c9c9; }
.neg { color: var(--neg); } .pos { color: var(--green-dark); }
tr.tfoot td { border-top: 2px solid var(--ink); font-weight: 700; background: #f7f9f7; }
.table.kv th { width: 130px; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--muted); vertical-align: top; padding-top: 9px; }
.inline-form { display: flex; gap: 6px; align-items: center; margin: 10px 0 0; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; }
.ai-row { display: flex; gap: 10px; align-items: center; }
.receipt-item { margin-bottom: 10px; display: flex; flex-direction: column; gap: 3px; }
.receipt-thumb { display: block; max-width: 240px; max-height: 200px; border: 1px solid var(--line); border-radius: 8px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar-row { display: grid; grid-template-columns: 110px 1fr 110px; gap: 10px; align-items: center; }
.hbar-label { font-size: 13px; color: var(--ink-soft); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { background: var(--line-soft); border-radius: 4px; height: 14px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--green); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vbars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 150px; }
.vbar-col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.vbar-track { flex: 1; display: flex; align-items: flex-end; }
.vbar-fill { width: 100%; background: var(--green); border-radius: 3px 3px 0 0; min-height: 2px; }
.vbar-label { font-size: 10.5px; color: var(--muted); text-align: center; margin-top: 4px; }
.table.txns tr.done td { color: var(--muted); }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.actions-cell select { width: auto; padding: 4px 8px; font-size: 12.5px; }

/* wide tables scroll inside their card on phones; the page itself never scrolls sideways */
.card { overflow-x: auto; }
@media (max-width: 640px) {
  .table.txns, .table.small { font-size: 13px; }
  .table.txns td, .table.txns th { padding: 6px 5px; }
  .tile-num { font-size: 19px; }
  h1 { font-size: 21px; }
}

/* ---------- owners sub-navigation, capital ---------- */
.subnav { display: flex; gap: 4px; flex-wrap: wrap; margin: -4px 0 14px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.subnav a { padding: 6px 11px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.subnav a.on { background: var(--green); color: #fff; }
.subnav a:hover:not(.on) { background: #eef2ef; }
.card.mine { border-top: 4px solid #c9a227; }
th.wcol, td.wcol { width: 140px; }
.own-track { height: 8px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.own-fill { display: block; height: 100%; background: var(--green); border-radius: 0 3px 3px 0; min-width: 2px; }
tr.hl td { background: #f3f8f5; }
.mark-form select[hidden] { display: none; }
.badge.closed { background: #eceff0; color: var(--muted); border-color: var(--line); }
pre.bank { white-space: pre-wrap; font: inherit; background: #f7f9f7; border: 1px solid var(--line); border-radius: 8px; padding: 10px 13px; margin: 6px 0 4px; }
.card.slim { padding: 12px 18px; }
summary.btn { list-style: none; width: fit-content; cursor: pointer; }
summary.btn::-webkit-details-marker { display: none; }

/* ---------- announcements, report ---------- */
.news-item { border-bottom: 1px solid var(--line-soft); padding: 8px 0; }
.news-item:last-child { border-bottom: none; }
.report-summary textarea { min-height: 150px; line-height: 1.5; }
details summary.btn.small { display: inline-block; }
@media print {
  .topbar, .subnav, .actions, form, .btn { display: none !important; }
  body { background: #fff; } .card, .tile { border-color: #bbb; break-inside: avoid; }
}

/* ---------- operations ---------- */
.store-switch { margin-left: auto; }
.store-switch select { width: auto; padding: 5px 9px; font-size: 13px; }
.hbar-fill.warn { background: var(--warn); }
.table.tasks tr.done td { color: var(--muted); }
.table.tasks tr.done td:nth-child(3) { text-decoration: line-through; }
.edit-task { display: inline-block; position: relative; }
.edit-task[open] { display: block; }
.edit-task[open] form { margin-top: 8px; padding: 10px; background: #f7f9f7; border: 1px solid var(--line); border-radius: 9px; min-width: 300px; }
.edit-task summary { list-style: none; cursor: pointer; }
.edit-task summary::-webkit-details-marker { display: none; }
.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .board { grid-template-columns: 1fr; } }
.column h2 { text-transform: capitalize; }
.card.cand { padding: 10px 12px; margin-bottom: 8px; }
.card.cand form.inline select { width: auto; padding: 3px 6px; font-size: 12.5px; margin-top: 6px; }

/* ---------- audit log ---------- */
.table.audit td.wrap { white-space: normal; word-break: break-word; }
.table.audit { table-layout: fixed; }
.table.audit th:nth-child(1), .table.audit td:nth-child(1) { width: 92px; }
.table.audit th:nth-child(2), .table.audit td:nth-child(2) { width: 140px; }
.table.audit th:nth-child(3), .table.audit td:nth-child(3) { width: 200px; }
@media (max-width: 640px) { .table.audit { table-layout: auto; } }
