/* Project-specific CSS overrides on top of Pico. Keep tight. */

:root {
  --pico-font-family: system-ui, -apple-system, "Segoe UI", Roboto,
                       "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* Header band — slightly toned, sticks to top edge. */
.app-header {
  border-bottom: 1px solid var(--pico-muted-border-color);
  background: var(--pico-card-background-color);
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
.app-header nav { padding: 0; }

/* Card shim for templates still using <div class="card">.
   Functionally equivalent to Pico's <article>. Templates will migrate to
   <article> incrementally as they're touched. */
.card {
  background: var(--pico-card-background-color, #fff);
  border: 1px solid var(--pico-card-border-color, var(--pico-muted-border-color, #d8d4c8));
  border-radius: var(--pico-border-radius, 0.25rem);
  box-shadow: var(--pico-card-box-shadow, none);
  padding: var(--pico-block-spacing-vertical, 1rem) var(--pico-block-spacing-horizontal, 1rem);
  margin-bottom: var(--pico-block-spacing-vertical, 1rem);
}

/* Required-field asterisk and ? tooltip icon next to labels. */
.req {
  color: var(--pico-del-color, #b00);
  margin-left: 0.15em;
}
.hint,
label .hint,
label > .hint {
  /* Hard-reset anything Pico might apply (it styles [role=button], buttons,
     <a> inside labels, etc.). Make it a quiet superscript ? next to the label. */
  display: inline;
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 0 0 0.15em !important;
  width: auto !important;
  height: auto !important;
  font-size: 0.7em;
  font-weight: 700;
  line-height: 1;
  vertical-align: super;
  color: var(--pico-secondary, #6e7681);
  cursor: help;
  user-select: none;
  text-decoration: none;
  box-shadow: none !important;
}
.hint:hover, .hint:focus { color: var(--pico-primary, #2a4d6e); outline: none; }

/* Override Pico's default single-line tooltip for our hint icons:
   wrap text, cap width, soften look. Also widen the click/hover hit area. */
.hint[data-tooltip]::before {
  white-space: normal;
  width: max-content;
  max-width: min(320px, 80vw);
  text-align: left;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  border-radius: var(--pico-border-radius, 0.25rem);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Inline chip showing the active firm. */
.firm-chip {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  font-size: 0.85em;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  color: var(--pico-secondary);
}

/* Money columns: right-aligned, tabular figures. */
.num, td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Compact tables for line-item heavy forms. */
table.compact th, table.compact td {
  padding: 0.35rem 0.5rem;
}

/* Inline message banners (Django messages framework). */
.msg            { padding: 0.6rem 1rem; margin-bottom: 1rem; border-left: 4px solid var(--pico-secondary); }
.msg-success    { border-left-color: var(--pico-form-element-valid-border-color); }
.msg-error,
.msg-danger     { border-left-color: var(--pico-del-color); }
.msg-warning    { border-left-color: #e08c2a; }
.msg-info       { border-left-color: var(--pico-primary, #2a4d6e); }

/* Action row buttons spacing. */
.actions a, .actions button { margin-right: 0.5rem; }

/* Balance indicator card — coloured border in Β.5 form. */
.balance-ok    { border-color: var(--pico-form-element-valid-border-color) !important; }
.balance-fail  { border-color: var(--pico-del-color) !important; }

/* Form numeric inputs: don't take the full width of the cell. */
input[type="number"] { max-width: 14ch; text-align: right; }

/* Tone down the header on small screens. */
@media (max-width: 600px) {
  .app-header nav ul { flex-wrap: wrap; }
}
