/* Part of the design system, loaded after app.css (see templates/base.html). Tokens live in app.css. */

/* ===========================================================================
   Accounting -> Finance: one block per declaration (facts + price fields)
   =========================================================================== */
.fin-decl {
  padding: 1rem 1.25rem 1.15rem;
  border-top: 1px solid var(--app-border);
}
.fin-decl:first-child { border-top: 0; }
.fin-decl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.85rem;
}
.fin-decl-title { min-width: 12rem; }
.fin-decl-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fin-decl-facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
}
.fin-decl-facts li.fin-decl-warn {
  background: var(--app-warning-soft);
  border-color: var(--app-warning);
  color: var(--app-warning-text);
  font-weight: 600;
}

/* Attendance tab (event page, staff) */
.att-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .75rem; }
.att-state { margin: 0; font-weight: 600; }
.att-list { list-style: none; margin: 0; padding: 0; }
.att-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .75rem; padding: .45rem 0; border-bottom: 1px solid var(--bs-border-color); }
.att-waived { color: var(--bs-warning-text-emphasis); font-weight: 600; }
.att-main { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.att-initial { flex: none; width: 2.25rem; height: 2.25rem; display: inline-grid; place-items: center; border-radius: 50%; background: var(--app-surface-2); border: 1px solid var(--app-border); font-size: .85rem; font-weight: 700; text-transform: uppercase; }
.att-who { display: flex; flex-direction: column; min-width: 0; }
.att-name { font-weight: 600; overflow-wrap: anywhere; }
.att-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .5rem; font-size: .78rem; color: var(--bs-secondary-color); }
.att-answer--yes { color: var(--bs-success-text-emphasis); }
.att-answer--no { color: var(--bs-danger-text-emphasis); }
.att-toggle { display: inline-flex; }
.att-toggle > .btn:not(:first-child) { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.att-toggle > .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.att-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
.att-add { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--bs-border-color); }
.att-add-select { flex: 1 1 14rem; max-width: 24rem; }
.fin-month-prices th:first-child { min-width: 11rem; }
.fin-month-prices td { min-width: 6.5rem; }
.fin-month-prices input::placeholder { color: var(--app-text-muted); opacity: 0.55; font-style: italic; }
.fin-month-prices input:not(:placeholder-shown) {
  background: var(--app-warning-soft, var(--app-surface-2));
  border-color: var(--app-warning, var(--app-border-strong));
  font-weight: 600;
}

/* Prepay packages: one row on wide screens; on phones the fields share a line and the buttons take their own. */
.fin-prepay-field { display: flex; flex: 1 1 0; align-items: center; gap: .5rem; min-width: 0; }
.fin-prepay-field .form-label { margin: 0; white-space: nowrap; }
.fin-prepay-offered .form-check { margin: 0; white-space: nowrap; }
.fin-prepay-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
@media (max-width: 575.98px) {
  .fin-prepay .ui-form-inline { flex-wrap: wrap; align-items: flex-end; }
  .fin-prepay-field { flex-direction: column; align-items: stretch; gap: .25rem; }
  .fin-prepay-field .form-label { white-space: normal; }
  .fin-prepay-offered { padding-bottom: .4rem; }
  .fin-prepay-actions { flex: 1 1 100%; }
  .fin-prepay-actions > .btn:first-child { flex: 1 1 auto; }
}

/* Accounting: Payments and History are not per season, so the header's season picker hides. */
body:has(.acc-all-seasons) .acc-season { display: none; }

/* Debt stats: one warm ramp for age and policy levels (validated: light on #fff, dark on #1e293b), money = info. */
:root { --ds-1: #eba66b; --ds-2: #e0813f; --ds-3: #cb5c25; --ds-4: #a8431c; --ds-5: #7d2e14; --ds-money: var(--app-info); }
[data-bs-theme="dark"] { --ds-1: #8a4a26; --ds-2: #b5602f; --ds-3: #dc7b40; --ds-4: #f29a5c; --ds-5: #ffbb88; }
.ds-hero { font-size: 2.25rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ds-num { font-variant-numeric: tabular-nums; }
.ds-seg { display: flex; gap: 2px; height: 1.6rem; }
.ds-seg > * { display: block; min-width: 6px; border-radius: 3px; flex: var(--f, 1); background: var(--c); }
.ds-track { height: .5rem; border-radius: 3px; background: var(--app-border); overflow: hidden; position: relative; }
.ds-track > i { position: absolute; inset: 0 auto 0 0; width: var(--w, 0); border-radius: 3px; background: var(--c, var(--ds-money)); }
.ds-track > b { position: absolute; top: -2px; bottom: -2px; width: 2px; left: var(--l, 0); background: var(--app-text); }
.ds-glyphs { display: inline-flex; gap: .1rem; font-size: .8rem; color: var(--app-text-muted); }
.ds-glyphs > span { display: inline-flex; flex-direction: column; align-items: center; width: 1.6rem; line-height: 1.2; }
.ds-glyphs small { font-size: .62rem; color: var(--app-text-soft); }
.ds-key { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; vertical-align: -.05rem; background: var(--c); }
.ds-key--money { background: var(--ds-money); }
.ds-key--outline { background: none; border: 1.5px solid var(--ds-money); }
.ds-key--dashed { background: none; border-top: 2px dashed var(--app-text-soft); height: 0; vertical-align: .2rem; }
.ds-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border: 1px solid var(--app-border-strong); border-radius: 2rem; font-size: .82rem; color: var(--app-text); text-decoration: none; }
.ds-chip b { opacity: .7; }
.ds-chip.is-on { background: var(--app-primary); border-color: var(--app-primary); color: white; }
.ds-svg text { fill: var(--app-text-muted); font-size: 11px; }
.ds-svg .ds-hit { fill: transparent; }
.ds-svg .ds-grid { stroke: var(--app-border); }
.ds-svg .ds-area { fill: var(--ds-money); fill-opacity: .12; }
.ds-svg .ds-prev { stroke: var(--app-text-soft); }
.ds-svg .ds-line { stroke: var(--ds-money); }
.ds-svg .ds-dot, .ds-svg .ds-bar { fill: var(--ds-money); }
.ds-svg .ds-bar-out { fill: none; stroke: var(--ds-money); }
.ds-svg .ds-rate { fill: var(--app-text); font-weight: 600; }
.ds-c2 { color: var(--ds-2); }
.ds-c4 { color: var(--ds-4); }
.ds-min9 { min-width: 9rem; }
.ds-min5 { min-width: 5rem; }
.ds-svg .ds-hit:hover, .ds-svg .ds-hit:focus { fill: currentColor; fill-opacity: .07; }
.ds-tip { position: fixed; z-index: 1080; pointer-events: none; padding: .4rem .6rem; border-radius: .4rem; background: var(--app-text); color: var(--app-surface); font-size: .8rem; line-height: 1.35; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); max-width: 16rem; }
