/* Caledonia Books — own identity. Not Caledonia Direct. */

:root {
  --cb-forest: #1a3329;
  --cb-forest-deep: #10201a;
  --cb-copper: #c46a2b;
  --cb-copper-hover: #a85720;
  --cb-copper-soft: rgba(196, 106, 43, 0.14);
  --cb-cream: #f3ead8;
  --cb-paper: #fbf7ef;
  --cb-ink: #1f241f;
  --cb-muted: #6b6458;
  --cb-line: #e4d9c4;
  --cb-line-strong: #cfc0a4;

  --cd-primary: var(--cb-copper);
  --cd-primary-hover: var(--cb-copper-hover);
  --cd-primary-soft: var(--cb-copper-soft);
  --cd-navy: var(--cb-forest);
  --cd-navy-deep: var(--cb-forest-deep);
  --cd-gold: #e0c48a;
  --cd-gold-soft: rgba(224, 196, 138, 0.28);
  --cd-ink: var(--cb-ink);
  --cd-ink-soft: #4a453c;
  --cd-muted: var(--cb-muted);
  --cd-line: var(--cb-line);
  --cd-line-strong: var(--cb-line-strong);
  --cd-paper: var(--cb-paper);
  --cd-paper-2: var(--cb-cream);
  --cd-paper-3: #ebe3d1;
  --cd-sidebar: 248px;
  --cd-font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --cd-display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --cd-shadow-sm: 0 1px 2px rgba(16, 32, 26, 0.06);
  --cd-shadow: 0 8px 24px rgba(16, 32, 26, 0.08);
}

body.app-body,
body {
  background: var(--cb-cream);
  color: var(--cb-ink);
}

h1, h2, h3 {
  font-family: var(--cd-display);
  color: var(--cb-forest);
}

.btn-primary {
  background: var(--cb-copper);
  border-color: var(--cb-copper);
  color: #fff !important;
}
.btn-primary:hover {
  background: var(--cb-copper-hover);
  border-color: var(--cb-copper-hover);
  color: #fff !important;
}

.app-sidebar {
  background: var(--cb-forest-deep);
  overflow-x: hidden;
}

.sidebar-top {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.books-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.15rem 0.15rem 0.35rem;
  text-decoration: none !important;
  color: #fff !important;
}

.books-brand .mark {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: block;
}

.books-brand .brand-mark {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.books-brand .brand-mark strong {
  color: #f6edd8;
  font-family: var(--cd-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.books-brand .brand-mark span {
  color: var(--cd-gold);
  font-family: var(--cd-display);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: none;
  white-space: nowrap;
}

.app-sidebar .brand img,
.books-brand img {
  height: auto;
  max-width: none;
}

.side-nav a.active {
  background: var(--cb-copper);
  color: #fff;
}

.side-footer a { color: var(--cd-gold); }

.app-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.topbar-filters { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.period-form label { flex-direction: row; align-items: center; gap: 0.4rem; font-size: 0.8rem; }
.period-form input[type="month"] { padding: 0.25rem 0.4rem; }

.unit-switch, .filter-bar { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.85rem; }
.chip {
  display: inline-flex; align-items: center;
  padding: 0.28rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--cb-line-strong);
  color: var(--cd-ink-soft); font-size: 0.82rem; font-weight: 600;
  text-decoration: none !important; background: #fff;
}
.chip:hover { border-color: var(--cb-copper); color: var(--cb-forest); }
.chip.on { background: var(--cb-forest); color: #fff !important; border-color: var(--cb-forest); }

.amt { font-variant-numeric: tabular-nums; }
.amt-neg { color: var(--cd-danger); }
.amt-pos { color: var(--cb-forest); }
.amt-zero { color: var(--cb-muted); }

.muted, .note { color: var(--cb-muted); font-size: 0.88rem; }
tr.total td { font-weight: 700; border-top: 1px solid var(--cb-line-strong); }
.gross, .net { font-weight: 700; color: var(--cb-forest); }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.pl-col h2 { font-size: 1.05rem; }

.cat-form { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.cat-form select { min-width: 8rem; max-width: 12rem; }
.inline { display: inline-block; margin: 0; }

label.check { flex-direction: row; align-items: center; font-weight: 500; }
label.check input { width: auto; }
.filter-bar { margin: 0 0 1rem; }

.auth-hero {
  background:
    linear-gradient(165deg, #10201a 0%, #1a3329 55%, #3d4a28 100%) !important;
}
.auth-hero h1 {
  font-family: var(--cd-display);
  font-weight: 700;
}
.auth-hero .books-brand { margin-bottom: 1.5rem; }
.auth-hero .books-brand .brand-mark strong { font-size: 1.35rem; }

.invite-banner {
  background: #fff;
  border: 1px solid var(--cb-copper);
  border-left: 4px solid var(--cb-copper);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.1rem;
}
.invite-banner h2 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.invite-link {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}
.invite-link input {
  flex: 1 1 16rem;
  min-width: 12rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  padding: 0.4rem 0.5rem;
}
.invite-link-lg input { font-size: 0.85rem; padding: 0.55rem 0.65rem; }
tr.invite-new { background: var(--cb-copper-soft); }

@media (max-width: 800px) {
  .pl-grid { grid-template-columns: 1fr; }
}
