/**
 * Abrechnungsläufe workbench styles.
 *
 * Built on the authored design tokens in legacy-design.css, which redefine every
 * --legacy-* token for dark mode, so this sheet is theme-aware without a second
 * palette. Text colours were measured against their background: the lowest pair
 * is --legacy-ink-soft on --legacy-paper at 5.18:1, over the 4.5:1 WCAG AA floor.
 * The run status tone is a coloured dot plus a text label — colour never carries
 * meaning alone — and the label always reads in --legacy-ink.
 */

.aw-root {
  --aw-gap: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--aw-gap);
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 56px;
  color: var(--legacy-ink, #232323);
  font-family: inherit;
}

/* The shell lives in authored-shell.css and is shared with the other authored
   screens, so all of them carry identical navigation. */

/* ---------- header ---------- */

.aw-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--legacy-blue, #1300ff);
}

.aw-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.aw-lede {
  margin: 0;
  max-width: 68ch;
  font-size: 15px;
  line-height: 1.6;
  color: var(--legacy-ink-soft, #6b6560);
}

.aw-announce {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--legacy-ink-soft, #6b6560);
}

/* ---------- picker ---------- */

.aw-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
  align-items: end;
  background: var(--legacy-surface, #fff);
  border: 1px solid var(--legacy-line, #e7e4e0);
  border-radius: var(--legacy-radius-md, 16px);
  padding: 16px 18px;
}

.aw-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.aw-label {
  font-size: 13px;
  font-weight: 600;
}

.aw-select {
  min-height: 42px;
  padding: 8px 12px;
  font: inherit;
  color: var(--legacy-ink, #232323);
  background: var(--legacy-surface, #fff);
  border: 1px solid var(--legacy-line-strong, #d8d4cf);
  border-radius: var(--legacy-radius-sm, 10px);
}

/* One visible focus treatment for every interactive element and region. */
.aw-select:focus-visible,
.aw-button:focus-visible,
.aw-run__select:focus-visible,
.aw-runs-region:focus-visible,
.aw-section__title:focus-visible {
  outline: 3px solid var(--legacy-blue, #1300ff);
  outline-offset: 2px;
}

/* ---------- layout ---------- */

.aw-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 22px;
  align-items: start;
}

@media (max-width: 880px) {
  .aw-layout {
    grid-template-columns: 1fr;
  }
}

/* ---------- section ---------- */

.aw-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
  border-top: 1px solid var(--legacy-line, #e7e4e0);
}

.aw-section__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.aw-section__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
}

.aw-section__lede {
  margin: 0;
  font-size: 13.5px;
  color: var(--legacy-ink-soft, #6b6560);
  line-height: 1.5;
}

/* ---------- runs list ---------- */

.aw-totals {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--legacy-ink-soft, #6b6560);
  line-height: 1.5;
}

/* The region wrapper is the focusable scroll container, so a keyboard-only user
   can reach the list — and the <ul> keeps its implicit list role for the rows. */
.aw-runs-region {
  max-height: 620px;
  overflow-y: auto;
  padding: 4px;
  border-radius: var(--legacy-radius-sm, 10px);
}

.aw-runs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aw-run {
  margin: 0;
}

.aw-run__select {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--legacy-surface, #fff);
  border: 1px solid var(--legacy-line, #e7e4e0);
  border-radius: var(--legacy-radius-md, 16px);
  cursor: pointer;
  transition: border-color 120ms var(--legacy-ease, ease), box-shadow 120ms var(--legacy-ease, ease);
}

.aw-run__select:hover {
  border-color: var(--legacy-line-strong, #d8d4cf);
}

.aw-run--selected .aw-run__select {
  border-color: var(--legacy-blue, #1300ff);
  box-shadow: inset 0 0 0 1px var(--legacy-blue, #1300ff);
}

.aw-run__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.aw-run__year {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.aw-run__art {
  font-size: 14px;
  color: var(--legacy-ink-soft, #6b6560);
  flex: 1 1 auto;
}

.aw-run__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px 14px;
}

.aw-run__fact {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.aw-run__fact-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--legacy-ink-soft, #6b6560);
}

.aw-run__fact-value {
  font-size: 14.5px;
  font-weight: 600;
}

.aw-run__frist {
  font-size: 13px;
  color: var(--legacy-warning, #855000);
  font-weight: 600;
}

/* ---------- status badge (dot + text, never colour alone) ---------- */

.aw-badge {
  --aw-tone: var(--legacy-ink-soft, #6b6560);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--legacy-ink, #232323);
  background: var(--legacy-surface, #fff);
  border: 1px solid var(--legacy-line-strong, #d8d4cf);
  border-radius: 999px;
}

.aw-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--aw-tone);
}

.aw-badge--success {
  --aw-tone: var(--legacy-success, #087a55);
}

.aw-badge--info {
  --aw-tone: var(--legacy-blue, #1300ff);
}

.aw-badge--neutral {
  --aw-tone: var(--legacy-ink-soft, #6b6560);
}

/* ---------- detail ---------- */

.aw-next {
  margin: 0;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--legacy-ink, #232323);
  background: var(--legacy-blue-soft, #eceaff);
  border-radius: var(--legacy-radius-sm, 10px);
}

.aw-detail {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}

.aw-detail__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--legacy-line, #e7e4e0);
}

.aw-detail__row:last-child {
  border-bottom: 0;
}

.aw-detail__row dt {
  font-size: 13.5px;
  color: var(--legacy-ink-soft, #6b6560);
}

.aw-detail__row dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

/* ---------- states ---------- */

.aw-state {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--legacy-line, #e7e4e0);
  border-radius: var(--legacy-radius-md, 16px);
  background: var(--legacy-surface, #fff);
  color: var(--legacy-ink-soft, #6b6560);
  line-height: 1.55;
}

.aw-state--empty {
  background: var(--legacy-paper, #f6f4f1);
}

/* The error state colours the whole box, not one edge of it. */
.aw-state--error {
  border-color: #9b1c1c; /* 8.15:1 on white */
  background: #fdf5f5;
  color: var(--legacy-ink, #232323);
}

.aw-state__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--legacy-ink, #232323);
}

.aw-state__reason,
.aw-state__hint {
  margin: 0 0 8px;
  color: var(--legacy-ink-soft, #6b6560);
  line-height: 1.55;
}

.aw-state--error .aw-state__reason {
  color: #9b1c1c;
}

.aw-button {
  margin-top: 6px;
  min-height: 42px;
  padding: 10px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--legacy-blue, #1300ff);
  border: 1px solid transparent;
  border-radius: var(--legacy-radius-sm, 10px);
  cursor: pointer;
}

.aw-button:hover {
  background: var(--legacy-blue-hover, #0f00cc);
}

/* ---------- footnote ---------- */

.aw-page-footnote {
  border-top: 1px solid var(--legacy-line, #e7e4e0);
  padding-top: 14px;
}

.aw-page-footnote p {
  margin: 0;
  max-width: 72ch;
  font-size: 12.5px;
  color: var(--legacy-ink-soft, #6b6560);
  line-height: 1.55;
}

@media (prefers-reduced-motion: reduce) {
  .aw-root * {
    transition: none !important;
    animation: none !important;
  }
}

/* ==================================================================== */
/* Cockpit alignment: this console speaks the casework workbench's      */
/* visual language. The scoped token remap recolours every rule above;  */
/* the structural overrides below add the card panels, pill states and  */
/* lifted buttons. Selectors and markup are unchanged.                  */
/* ==================================================================== */

.aw-root {
  /* Brand tokens only. The console no longer overrides --legacy-* with a
     parallel purple palette; it inherits the native MeinZuhause colours so it
     reads as one product. Only the soft-paper alias and radii are local. */
  --legacy-paper-soft: #faf9f7;
  --legacy-radius-sm: 11px;
  --legacy-radius-md: 14px;
  max-width: 1240px;
  padding: 34px 30px 60px;
}

.aw-title {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.aw-eyebrow {
  font-weight: 800;
  letter-spacing: 0.09em;
}

.aw-section {
  padding: 22px 24px;
  background: var(--legacy-surface);
  border: 1px solid var(--legacy-line);
  border-top: 1px solid var(--legacy-line);
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(21, 24, 43, 0.05);
}

.aw-filters {
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(21, 24, 43, 0.05);
}

.aw-select:focus-visible,
.aw-button:focus-visible,
.aw-run__select:focus-visible,
.aw-runs-region:focus-visible,
.aw-section__title:focus-visible {
  outline-color: rgba(59, 54, 242, 0.28);
}

.aw-run__select:hover {
  border-color: var(--legacy-line-strong, #d8d4cf);
  box-shadow: 0 6px 18px rgba(21, 24, 43, 0.07);
}

.aw-run--selected .aw-run__select {
  background: #f4f3ff;
}

.aw-badge {
  gap: 0;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 700;
  border: 0;
  color: #526079;
  background: #eef0f5;
}

.aw-badge::before {
  display: none;
}

.aw-badge--success { color: var(--legacy-success); background: #e2f5ed; }
.aw-badge--info { color: var(--legacy-blue, #1300ff); background: var(--legacy-blue-soft, #eceaff); }
.aw-badge--neutral { color: #526079; background: #eef0f5; }

.aw-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-weight: 750;
  border-radius: 11px;
  box-shadow: 0 10px 24px rgba(59, 54, 242, 0.19);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.aw-button:hover {
  transform: translateY(-1px);
}

.aw-state--empty {
  background: var(--legacy-paper);
}

.aw-state--error {
  border-color: #f0c4c4;
}

.aw-page-footnote {
  border-top: 0;
  padding-top: 2px;
}
