/* FRW-Technologies LLC ledger. Colors and type follow the light "Workshop" theme of frw-technologies.com. */
:root {
  --bg: #f5f0e7;
  --surface: #fcfaf5;
  --surface-2: #f0e9dd;
  --line: #ddd2c1;
  --line-strong: #b5a58a;
  --text: #26201a;
  --text-2: #463b30;
  --text-3: #5f5345;
  --accent: #8f5f22;
  --accent-hover: #764d19;
  --accent-ink: #fffaf2;
  --accent-soft: #f3e7d4;
  --ok: #2f6248;
  --ok-soft: #e9f1ea;
  --danger: #a63c2f;
  --danger-soft: #f7e8e4;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font-body);
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:is(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }
h2 { font-size: 22px; line-height: 1.2; margin-bottom: 14px; }
h3 { font-size: 17px; margin-bottom: 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 28px; padding-bottom: 56px; min-height: 60vh; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand img { border-radius: 7px; display: block; }
.brand-text { font: 600 19px/1.1 var(--font-display); display: flex; flex-direction: column; gap: 3px; }
.brand-text small { font: 500 10px var(--font-mono); letter-spacing: 0.14em; color: var(--accent); }
.header-user { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.header-user a { color: var(--text); text-decoration: none; font-weight: 500; }
.header-user form { margin: 0; }
.main-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  padding: 10px 12px 11px; white-space: nowrap; text-decoration: none; color: var(--text-2);
  font: 500 12px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--accent); }
.main-nav a[aria-current='page'] { color: var(--text); border-bottom-color: var(--accent); }
.site-footer { padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--line); color: var(--text-3); font: 500 11px var(--font-mono); letter-spacing: 0.06em; }

/* Page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.eyebrow { font: 600 11.5px var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Cards and grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 20px; }
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid .card { margin-bottom: 0; }
.stack { margin-bottom: 20px; }

.stat-label { font: 500 11px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.stat-value { font: 600 26px/1.2 var(--font-display); margin-top: 6px; }
.stat-value .money { font: inherit; }
.stat-sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.holder-card .person { font-weight: 600; margin-bottom: 12px; }

/* People and money */
.person { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); border: 1px solid var(--line); }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 600; color: var(--accent); background: var(--accent-soft); border-color: var(--line); }
.money { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.pos { color: var(--ok); font-weight: 600; }
.money.neg { color: var(--danger); font-weight: 600; }

/* Badges */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font: 600 10.5px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; border: 1px solid transparent; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: #c5dccb; }
.badge-bad { background: var(--danger-soft); color: var(--danger); border-color: #ecc9c1; }
.badge-wait { background: var(--accent-soft); color: var(--accent-hover); border-color: #e2cfae; }
.badge-off { background: var(--surface-2); color: var(--text-3); border-color: var(--line); }

/* Tables: dotted rules, like a printed spec sheet */
.table-scroll { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font: 600 10.5px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); padding: 0 12px 9px 0; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 11px 12px 11px 0; border-bottom: 1px dotted var(--line-strong); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th:last-child, td:last-child { padding-right: 0; }
.num { text-align: right; }
tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; font-weight: 600; }
td a.row-link { color: var(--text); font-weight: 500; text-decoration: none; }
td a.row-link:hover { color: var(--accent); text-decoration: underline; }
.empty { color: var(--text-3); padding: 8px 0; }

/* Definition rows */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 9px 22px; margin: 0; }
.facts dt { font: 500 11px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); padding-top: 3px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
  border-radius: var(--radius); border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  font: 600 14px var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--text); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #254f3a; border-color: #254f3a; color: #fff; }
.btn-danger { color: var(--danger); border-color: #dcb1a8; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--text-3); font: 500 13px var(--font-body); cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--accent); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Forms */
form { margin: 0; }
.field { margin-bottom: 16px; }
.field > label, .field > .label { display: block; font: 600 11px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); margin-bottom: 6px; }
.hint { font-size: 13px; color: var(--text-3); margin-top: 5px; }
input[type='text'], input[type='email'], input[type='date'], input[type='month'], input[type='file'], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: #fff; color: var(--text); font: 15px var(--font-body);
}
input[type='file'] { padding: 8px; background: var(--surface); }
textarea { min-height: 84px; resize: vertical; }
input.amount { font-family: var(--font-mono); max-width: 220px; }
input.pct { font-family: var(--font-mono); max-width: 110px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 18px; }
.narrow { max-width: 640px; }
.inline-form { display: inline; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14.5px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.filters .field { margin: 0; min-width: 150px; }

/* Notices */
.notice { padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 20px; font-size: 14.5px; }
.notice ul { margin: 0; padding-left: 18px; }
.notice-ok { background: var(--ok-soft); border-color: #c5dccb; color: var(--ok); }
.notice-bad { background: var(--danger-soft); border-color: #ecc9c1; color: var(--danger); }
.notice-wait { background: var(--accent-soft); border-color: #e2cfae; color: var(--text-2); }

/* Bills */
.bills { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.bill { display: block; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; text-decoration: none; color: var(--text-2); }
.bill:hover { border-color: var(--accent); }
.bill img { display: block; width: 100%; height: 190px; object-fit: cover; background: var(--surface-2); }
.bill .doc { height: 190px; display: flex; align-items: center; justify-content: center; font: 600 22px var(--font-mono); color: var(--accent); background: var(--surface-2); }
.bill figcaption, .bill .cap { padding: 8px 10px; font-size: 12px; border-top: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hash { font: 11px var(--font-mono); color: var(--text-3); overflow-wrap: anywhere; }

/* Votes and history */
.vote-list { list-style: none; margin: 0; padding: 0; }
.vote-list li { padding: 10px 0; border-bottom: 1px dotted var(--line-strong); display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: center; }
.vote-list li:last-child { border-bottom: 0; }
.vote-comment { flex-basis: 100%; color: var(--text-2); font-size: 14px; padding-left: 30px; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { padding: 12px 0; border-bottom: 1px dotted var(--line-strong); display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.todo-list li:last-child { border-bottom: 0; }
.log-time { font: 12px var(--font-mono); color: var(--text-3); white-space: nowrap; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; margin: 0; }
.login-card h1 { font-size: 26px; margin-bottom: 10px; }
.login-card .btn { width: 100%; }

.report-frame { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 8px; overflow-x: auto; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .header-user span { display: none; }
  .card { padding: 18px 16px; }
  .table-scroll { margin: 0 -16px; padding: 0 16px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
}

@media print {
  .site-header, .site-footer, .page-actions, .notice, .no-print { display: none !important; }
  body { background: #fff; }
  .card, .report-frame { border: 0; padding: 0; }
}
