/* ============================================================
   Wildgaense.Shared — foundation
   Cross-cutting reset, icon sprite, forms, tables and utilities.
   Built on tokens.css. Served at _content/Wildgaense.Shared/css/foundation.css
   ============================================================ */

/* ---------- Blazor framework chrome ---------- */
#blazor-error-ui {
  color-scheme: light only;
  background: lightyellow; bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); box-sizing: border-box;
  display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
.blazor-error-boundary { background: #971b2f; padding: 1rem; color: white; border-radius: 14px; }
.blazor-error-boundary::after { content: "Ein Fehler ist aufgetreten." }

.valid.modified:not([type=checkbox]) { outline: 1px solid #00b74f; }
.invalid { outline: 1px solid #971b2f; }
.validation-message { color: #971b2f; font-size: 13px; font-weight: 700; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
button { font-family: inherit; color: inherit; }
input, select, textarea { font-family: inherit; }
/* Blazor's FocusOnNavigate focuses the page <h1> (tabindex=-1) — don't draw an outline on it. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

/* ---------- inline icon sprite ---------- */
.i { width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- shared building blocks ---------- */
.head-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.lead { color: var(--fg-muted); max-width: 64ch; margin: 10px 0 0; font-size: 16px; }
.kicker { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: var(--fw-strong); color: var(--accent); margin-bottom: 6px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.toolbar .spacer, .spacer { flex: 1; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.checkline { display: flex; align-items: center; gap: 9px; font-weight: var(--fw-strong); font-size: 14px; color: var(--bdp-pfadiblau); cursor: pointer; }
.checkline input { width: 17px; height: 17px; accent-color: var(--bdp-pfadiblau); }
.muted { color: var(--fg-muted); }
.text-small { font-size: 13px; }
.pos, .amount-pos { color: var(--bdp-waldgruen); }
.neg, .amount-neg { color: var(--accent); }
.zero, .amount-zero { color: var(--fg-subtle); }
.divline { height: 1px; background: var(--bdp-line); border: none; margin: 0; }

.crumb { display: inline-flex; align-items: center; gap: 7px; color: var(--bdp-pfadiblau); font-weight: var(--fw-strong); cursor: pointer; background: none; border: none; font-size: 14px; margin-bottom: 16px; padding: 0; text-decoration: none; }
.crumb .i { width: 16px; height: 16px; transform: rotate(180deg); }
.crumb:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.col-3 { grid-column: span 3; } .field.col-4 { grid-column: span 4; }
.field.col-6 { grid-column: span 6; } .field.col-8 { grid-column: span 8; } .field.col-12 { grid-column: span 12; }
.field > label, label.field-label { font-family: var(--font-display); font-weight: var(--fw-strong); font-size: 12px; color: var(--bdp-pfadiblau); letter-spacing: .01em; }
.field > label .opt, .field > label .req { color: var(--fg-subtle); font-weight: 400; margin-left: 5px; }
.field > label .req { color: var(--accent); }
.field .hint, .hint { font-size: 13px; color: var(--fg-muted); font-weight: 400; }
.input, .select, .textarea,
input[type=text], input[type=number], input[type=date], input[type=email], input[type=tel], select, textarea {
  width: 100%; padding: 10px 14px; border: 2px solid var(--bdp-line); border-radius: var(--radius-pill);
  background: #fff; color: var(--bdp-pfadiblau); font-size: 14px; font-family: var(--font-body); outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.textarea, textarea { border-radius: var(--radius-md); resize: vertical; min-height: 84px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus,
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--bdp-pfadiblau);
}
.input::placeholder, textarea::placeholder { color: var(--fg-subtle); }
.select, select { appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230e4278' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl thead th { text-align: left; font-weight: var(--fw-strong); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); padding: 11px 14px; border-bottom: 2px solid var(--bdp-line); white-space: nowrap; position: sticky; top: 0; background: #fff; z-index: 1; }
.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--bdp-line); vertical-align: middle; }
.tbl tbody tr { transition: background var(--dur-fast); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr:hover { background: var(--bdp-woelflingsgelb-hell); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cellsub { font-size: 12px; color: var(--fg-muted); }

/* ---------- card surface (global; Card component adds its own head) ---------- */
.card { background: #fff; border: 1px solid var(--card-line); border-radius: var(--radius-md); position: relative; }
.card.pad { padding: 20px; }
.card.paper { background: var(--bdp-paper); }

/* ---------- filter chips ---------- */
.chip { font-family: var(--font-display); font-weight: 700; font-size: 12.5px; padding: 6px 13px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--bdp-line); background: #fff; color: var(--fg-muted); cursor: pointer; transition: all var(--dur-fast); white-space: nowrap; }
.chip:hover { border-color: var(--bdp-pfadiblau); color: var(--bdp-pfadiblau); }
.chip.on { background: var(--bdp-pfadiblau); color: var(--bdp-woelflingsgelb); border-color: var(--bdp-pfadiblau); }

/* ---------- segmented control ---------- */
.seg { display: inline-flex; background: rgba(14, 66, 120, .08); border-radius: var(--radius-pill); padding: 3px; }
.seg button { border: none; background: none; font-family: var(--font-display); font-weight: 700; font-size: 13px;
  padding: 6px 14px; border-radius: var(--radius-pill); color: var(--fg-muted); cursor: pointer; transition: all var(--dur-fast); }
.seg button.on { background: #fff; color: var(--bdp-pfadiblau); box-shadow: var(--shadow-sm); }

.pill-meta { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--fg-muted); font-weight: 700; }

/* ---------- section title (in drawers / detail) ---------- */
.section-title { display: flex; align-items: flex-end; gap: 14px; margin: 0 0 14px; }
.section-title .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bdp-rrrot); }
.section-title h3 { font-size: 21px; }

/* ---------- detail rows ---------- */
.drow { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bdp-line); }
.drow .dk { width: 140px; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; color: var(--fg-muted); font-size: 12.5px; font-weight: 700; }
.drow .dv { font-size: 14px; font-weight: 700; color: var(--bdp-pfadiblau); min-width: 0; }
.drow .dv.empty-v { font-weight: 400; color: var(--fg-muted); }

/* ---------- bulk-select bar ---------- */
.bulkbar { display: flex; align-items: center; gap: 12px; background: var(--bdp-pfadiblau); color: #fff;
  border-radius: var(--radius-pill); padding: 8px 8px 8px 18px; margin-bottom: 14px; }

/* ---------- Empty state ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 54px 20px; color: var(--fg-muted); }
.empty img { width: 62px; height: 62px; opacity: .5; }
.empty b { display: block; color: var(--bdp-pfadiblau); font-family: var(--font-display); font-weight: var(--fw-superfett); font-size: 18px; }

/* ---------- scrollbars ---------- */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--bdp-pfadiblau-hell); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(14, 66, 120, .45); background-clip: padding-box; border: 3px solid transparent; }

/* ---------- animation helpers ---------- */
.fadein { animation: wg-fade var(--dur-base) var(--ease-out); }
@keyframes wg-fade { from { opacity: 0 } to { opacity: 1 } }
.spin { animation: wg-spin 1s linear infinite; }
@keyframes wg-spin { to { transform: rotate(360deg) } }
