/* Press8 books — minimal utility styles.
   Deliberately unopinionated in v1; real design pass lands with the reports UI. */
:root {
  --p8-fg: #1a1d21;
  --p8-fg-soft: #4b5563;
  --p8-bg: #f7f8fa;
  --p8-card: #ffffff;
  --p8-border: #d9dfe6;
  --p8-brand: #0b4c8c;
  --p8-error: #b3261e;
  --p8-ok: #1a7f37;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--p8-fg);
  background: var(--p8-bg);
}
a { color: var(--p8-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.p8-nav {
  background: var(--p8-card);
  border-bottom: 1px solid var(--p8-border);
}
.p8-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.p8-brand { font-weight: 600; color: var(--p8-fg); font-size: 1.1rem; }
.p8-user { margin-left: auto; color: var(--p8-fg-soft); font-size: 0.9rem; }
.p8-logout button {
  padding: 6px 12px;
  border: 1px solid var(--p8-border);
  background: var(--p8-bg);
  border-radius: 6px;
  cursor: pointer;
}
.p8-main { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.p8-card {
  background: var(--p8-card);
  border: 1px solid var(--p8-border);
  border-radius: 8px;
  padding: 32px;
  max-width: 480px;
  margin: 40px auto;
}
.p8-card h1 { margin: 0 0 12px; font-size: 1.5rem; }
.p8-card h1 small { color: var(--p8-fg-soft); font-weight: 400; font-size: 0.7em; }
.p8-hint { color: var(--p8-fg-soft); font-size: 0.9rem; margin: 8px 0 16px; }
.p8-card label { display: block; margin-bottom: 14px; font-weight: 500; }
.p8-card input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--p8-border);
  border-radius: 6px;
  font-size: 1rem;
}
.p8-card button {
  padding: 10px 20px;
  border-radius: 6px;
  border: 0;
  background: var(--p8-brand);
  color: white;
  font-weight: 600;
  cursor: pointer;
}
.p8-alt { margin-top: 16px; font-size: 0.9rem; }
.p8-messages { list-style: none; padding: 0; margin: 0 0 16px; }
.p8-msg-error { color: var(--p8-error); }
.p8-msg-success { color: var(--p8-ok); }
code { background: #f0f2f5; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }

/* Home tiles */
.p8-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 24px; }
.p8-tile { display: block; padding: 20px; background: var(--p8-card); border: 1px solid var(--p8-border); border-radius: 8px; color: inherit; text-decoration: none; }
.p8-tile:hover { border-color: var(--p8-brand); text-decoration: none; }
.p8-tile h2 { margin: 0 0 4px; font-size: 1.05rem; color: var(--p8-brand); }
.p8-tile p { margin: 0; color: var(--p8-fg-soft); font-size: 0.9rem; }

/* Toolbars, tables, forms */
.p8-toolbar { display: flex; align-items: center; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.p8-toolbar .p8-spacer { flex: 1; }
.p8-btn { padding: 8px 14px; border-radius: 6px; background: var(--p8-card); border: 1px solid var(--p8-border); color: var(--p8-fg); cursor: pointer; font-size: 0.9rem; display: inline-block; }
.p8-btn:hover { border-color: var(--p8-brand); text-decoration: none; }
.p8-btn-primary { background: var(--p8-brand); border-color: var(--p8-brand); color: white; }
.p8-btn-primary:hover { color: white; }
.p8-inline-form { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; }

.p8-table { width: 100%; border-collapse: collapse; background: var(--p8-card); border: 1px solid var(--p8-border); border-radius: 8px; overflow: hidden; }
.p8-table th, .p8-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--p8-border); font-size: 0.9rem; }
.p8-table th { background: #eef2f7; font-weight: 600; }
.p8-table tr:last-child td { border-bottom: 0; }
.p8-right { text-align: right; font-variant-numeric: tabular-nums; }
.p8-empty { color: var(--p8-fg-soft); text-align: center; padding: 24px !important; }
.p8-total td { font-weight: 600; background: #fafbfc; }

.p8-status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: 500; background: #eef2f7; color: var(--p8-fg-soft); }
.p8-status-posted { background: #d4edda; color: #155724; }
.p8-status-pending_approval { background: #fff3cd; color: #856404; }
.p8-status-draft { background: #e2e3e5; color: #383d41; }
.p8-status-rejected { background: #f8d7da; color: #721c24; }
.p8-status-reversed { background: #d1ecf1; color: #0c5460; }

.p8-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 24px; margin: 16px 0; }
.p8-dl dt { color: var(--p8-fg-soft); font-size: 0.9rem; }
.p8-dl dd { margin: 0; font-size: 0.9rem; }
.p8-dl code { font-size: 0.85em; }

.p8-form { max-width: 900px; }
.p8-form-row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.p8-form-row label { flex: 1; min-width: 200px; font-size: 0.9rem; color: var(--p8-fg-soft); }
.p8-form-row input, .p8-form-row select { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--p8-border); border-radius: 6px; font-size: 0.95rem; }
.p8-error { color: var(--p8-error); font-size: 0.85em; }
.p8-filter select { padding: 6px 8px; border: 1px solid var(--p8-border); border-radius: 6px; }
details summary { list-style: none; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
