/* Additions on top of the CRM design system in styles.css. Same tokens only. */

.table-scroll { overflow-x: auto; }
.add-btn { width: 100%; height: var(--control-h-lg); }

.fab {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  font: inherit;
  font-size: 28px;
  font-weight: 600;
  color: var(--ink-invert);
  background: linear-gradient(150deg, var(--coral-500), var(--coral-600));
  box-shadow: var(--shadow-tint-coral), var(--shadow-pop);
  cursor: pointer;
  z-index: 40;
}


.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav strong { min-width: 128px; text-align: center; font-size: 14px; }

/* Category chips: one fixed hue per category, the same everywhere. */
.cat-google_reviews { background: var(--amber-50); color: var(--amber-700); }
.cat-staff_pay { background: var(--teal-50); color: var(--teal-700); }
.cat-office { background: var(--blue-50); color: var(--blue-700); }
.cat-subscription { background: var(--violet-50); color: var(--violet-700); }
.cat-backlinks { background: var(--green-50); color: var(--green-700); }
.cat-general { background: var(--surface-sunken); color: var(--ink-muted); }

.kind-staff { background: var(--teal-50); color: var(--teal-700); }
.kind-inspector { background: var(--blue-50); color: var(--blue-700); }
.kind-other { background: var(--surface-sunken); color: var(--ink-muted); }

/* Trend: six columns, the selected month in coral, the rest recessive. */
.trend { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 150px; }
.trend-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend-bar { width: 100%; max-width: 44px; border-radius: 8px 8px 3px 3px; background: var(--warm-200); min-height: 3px; }
.trend-col.is-current .trend-bar { background: var(--chart-spend); }
.trend-val { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--ink-soft); }
.trend-lbl { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); }

.due-list { display: flex; flex-direction: column; gap: 8px; }
.due-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-subtle);
}
.due-row strong { font-size: 13px; }
.due-row .small { display: block; }

.state-paid { background: var(--positive-bg); color: var(--positive-ink); }
.state-overdue { background: var(--danger-bg); color: var(--danger-ink); }
.state-soon { background: var(--warn-bg); color: var(--warn-ink); }
.state-upcoming { background: var(--info-bg); color: var(--info-ink); }

.balance-pos { color: var(--danger-ink) !important; }
.balance-zero { color: var(--positive-ink) !important; }

.pin-input {
  font-family: var(--font-mono);
  font-size: 22px !important;
  letter-spacing: 0.5em;
  text-align: center;
  height: 50px !important;
}

.person-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.person-pick button {
  border: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--ink-soft);
  cursor: pointer;
}
.person-pick button.is-active { background: var(--coral-500); color: var(--ink-invert); }
.person-pick .grp { width: 100%; font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; }

.cat-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cat-pick button {
  border: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 11px;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px transparent;
}
.cat-pick button.is-active { box-shadow: inset 0 0 0 2px currentColor; }

.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
td.actions { width: 1%; }

@media (max-width: 900px) {
  .sidebar-foot .add-btn { display: none; }
  .fab.show { display: block; }
  .month-nav strong { min-width: 100px; }
}
@media (max-width: 560px) {
  .cat-pick { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile-value { font-size: 19px; }
  .page-head { align-items: flex-start; }
  .hide-sm { display: none; }
  .due-row { grid-template-columns: 1fr auto; }
  .due-row .btn { grid-column: 1 / -1; }
}

input[type="month"], input[type="tel"], input[type="search"] {
  height: var(--control-h-md);
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  width: 100%;
}
@media (max-width: 900px) { .toast-stack { bottom: 86px; } }

.tile-coral-soft { background: var(--coral-50); box-shadow: var(--shadow-card), inset 0 0 0 2px var(--coral-100); }
.tile-coral-soft .tile-value { color: var(--coral-700); }
.nav-count { margin-left: auto; height: 20px; padding: 0 7px; }
.cat-fines { background: var(--danger-bg); color: var(--danger-ink); }
.click-row { cursor: pointer; }
.click-row:focus-visible { outline: none; box-shadow: inset 3px 0 0 var(--accent-500); }
tfoot tr { border-top: 1px solid var(--line); background: var(--surface-subtle); }
@media print {
  .fab, .toast-stack, #bq { display: none !important; }
  .main { padding: 0; }
  .tile-coral-soft { box-shadow: none; border: 1px solid var(--line); }
}
.mode-seg { display: flex; width: 100%; }
.mode-seg button { flex: 1; height: 34px; }
@media (max-width: 1180px) {
  .hide-md { display: none; }
  :root { --row-pad-x: 12px; }
}
