/* =========================================================================
   Case-Widgets — "maipr look" (clean monochrome admin tool)
   Fully namespaced under .mpw so nothing collides with the site's styles.
   Neutral placeholder data only — no real brands or client data.
   ========================================================================= */

.mpw {
  --mpw-ink: #111111;
  --mpw-muted: #6b6b6b;
  --mpw-line: #e6e6e6;
  --mpw-soft: #f7f7f7;
  --mpw-accent: #1a1a1a;
  --mpw-ok: #2f9e44;   /* nur für den grünen Fortschritts-Flow in Case 02 */

  font-family: Arial, "Helvetica Neue", sans-serif;
  color: var(--mpw-ink);
  background: #ffffff;
  border: 1px solid var(--mpw-line);
  border-radius: 0;
  box-shadow: 0 18px 44px rgba(22, 22, 22, .12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
.mpw *,
.mpw *::before,
.mpw *::after { box-sizing: border-box; }
.mpw :focus-visible { outline: 2px solid #111111; outline-offset: 2px; }

/* ---------- Header ---------- */
.mpw-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--mpw-line);
}
.mpw-title {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.mpw-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .68rem;
  color: var(--mpw-muted);
  background: var(--mpw-soft);
  border: 1px solid var(--mpw-line);
  padding: 4px 10px;
  border-radius: 0;
  white-space: nowrap;
}
.mpw-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mpw-ok);
  animation: mpw-pulse 1.6s ease-in-out infinite;
}

/* ---------- Tabs ---------- */
.mpw-tabs {
  display: flex;
  gap: 7px;
  padding: 11px 14px 0;
  flex-wrap: wrap;
}
.mpw-tab {
  font-family: inherit;
  font-size: .72rem;
  font-weight: 600;
  color: var(--mpw-ink);
  background: #fff;
  border: 1px solid var(--mpw-line);
  border-radius: 0;
  padding: 6px 13px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
/* unselected tabs gently pulse so it's clear they're clickable */
.mpw-tab:not([aria-selected="true"]) {
  animation: mpw-attention 2.4s ease-in-out infinite;
}
.mpw-tab:nth-of-type(2):not([aria-selected="true"]) { animation-delay: .5s; }
.mpw-tab:nth-of-type(3):not([aria-selected="true"]) { animation-delay: 1s; }
.mpw-tab:hover { border-color: #111111; transform: translateY(-1px); }
/* once the user has clicked a tab, stop the "clickable" pulse */
.mpw.tabs-engaged .mpw-tab { animation: none; }
.mpw-tab[aria-selected="true"] {
  background: #111111;
  color: #fff;
  border-color: #111111;
}
.mpw-tab .mpw-count {
  font-size: .62rem;
  opacity: .6;
  margin-left: 4px;
}
.mpw-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  margin-left: 5px;
  font-size: .58rem;
  font-weight: 700;
  border-radius: 0;
  background: #111111;
  color: #ffffff;
  border: 1px solid #111111;
}
.mpw-badge-count[hidden] { display: none; }
.mpw-tab[aria-selected="true"] .mpw-badge-count {
  background: #ffffff;
  color: #111111;
  border-color: #ffffff;
}

/* ---------- Body / panels ---------- */
.mpw-body {
  padding: 12px 14px 14px;
  flex: 1;
  min-width: 0;
}
.mpw-view { min-width: 0; }
.mpw-body--fixed { min-height: 248px; }
.mpw-view[hidden] { display: none; }
.mpw-panel {
  background: var(--mpw-soft);
  border: 1px solid var(--mpw-line);
  border-radius: 0;
  padding: 10px;
}
/* review panel — neutral (monochrome, no amber) */
.mpw-panel--review {
  background: var(--mpw-soft);
  border-color: var(--mpw-line);
}
.mpw-label {
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-size: .62rem;
  color: var(--mpw-muted);
  margin: 0 0 9px;
  font-weight: 700;
}

/* ---------- Rows (inbox) ---------- */
.mpw-rows { display: grid; gap: 8px; }
.mpw-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  background: #fff;
  border: 1px solid var(--mpw-line);
  border-radius: 0;
  cursor: default;
  transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.mpw-row[data-review-row],
.mpw-row[data-goto-table] { cursor: pointer; }
.mpw-row[data-review-row]:hover,
.mpw-row[data-goto-table]:hover {
  border-color: #111;
  transform: translateX(1px);
  box-shadow: 0 3px 12px rgba(17, 17, 17, .06);
}
.mpw-row-main { display: flex; flex-direction: column; min-width: 0; }
.mpw-row-title {
  font-size: .8rem;
  color: var(--mpw-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mpw-row-meta { font-size: .68rem; color: var(--mpw-muted); margin-top: 1px; }
.mpw-row-time { font-size: .66rem; color: var(--mpw-muted); white-space: nowrap; }

/* action pill on the actionable inbox row (the clickable affordance) */
.mpw-pill {
  font-family: inherit;
  font-size: .68rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 0;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s ease, transform .12s ease;
  animation: mpw-attention 2.6s ease-in-out infinite;
}
.mpw-pill:hover { opacity: .88; transform: translateY(-1px); }

/* interactivity hint under the inbox list */
.mpw-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 11px 2px 0;
  font-size: .66rem;
  color: var(--mpw-muted);
}
.mpw-hint[hidden] { display: none; }
.mpw-hint-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #111;
  flex: none;
  animation: mpw-pulse 1.8s ease-in-out infinite;
}

/* monochrome status dots — no red/yellow/green/blue */
.mpw-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .15);
  background: #d1d1d1;
  transition: background .25s ease, border-color .25s ease;
}
.mpw-dot.warn { background: #ffffff; border: 1.6px solid #111111; }  /* offen · zu prüfen (leerer Ring) */
.mpw-dot.progress {                                                  /* wird verarbeitet */
  background: #b6b6b6;
  animation: mpw-pulse 1.6s ease-in-out infinite;
}
.mpw-dot.ok { background: var(--mpw-ok); border-color: var(--mpw-ok); } /* verarbeitet (grün) */
.mpw-dot.bad { background: #d1d1d1; border-color: rgba(0, 0, 0, .25); } /* abgelehnt */

/* ---------- Review card ---------- */
.mpw-review-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.mpw-review-head .mpw-row-title { font-weight: 700; }
.mpw-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .64rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 0;
  border: 1px solid var(--mpw-line);
  background: #fff;
  color: var(--mpw-muted);
  white-space: nowrap;
}

.mpw-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
}
.mpw-kv > div { min-width: 0; }
.mpw-kv dt {
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--mpw-muted);
  margin: 0 0 2px;
}
.mpw-kv dd {
  margin: 0;
  font-size: .78rem;
  color: var(--mpw-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpw-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.mpw-btn {
  font-family: inherit;
  font-size: .74rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 0;
  border: 1px solid #111111;
  background: #111111;
  color: #fff;
  cursor: pointer;
  transition: opacity .15s ease, background .15s ease;
}
.mpw-btn:hover { opacity: .88; }
.mpw-btn.ghost {
  background: #fff;
  color: #1a1a1a;
  border-color: var(--mpw-line);
}
.mpw-btn.ghost:hover { border-color: #bcbcbc; opacity: 1; }
.mpw-btn:disabled { opacity: .45; cursor: not-allowed; }
.mpw-btn svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 5px; }

/* ---------- Table (clippings) ---------- */
.mpw-tablewrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--mpw-line);
  border-radius: 0;
  -webkit-overflow-scrolling: touch;
}
.mpw-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: .68rem;
}
.mpw-table th,
.mpw-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--mpw-line);
  text-align: left;
  white-space: nowrap;
}
.mpw-table th {
  background: #f2f2f2;
  font-weight: 700;
  color: var(--mpw-ink);
  text-transform: uppercase;
  letter-spacing: .4px;
  font-size: .6rem;
}
.mpw-table tr:last-child td { border-bottom: none; }
.mpw-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.mpw-fmt {
  display: inline-block;
  font-size: .6rem;
  padding: 2px 7px;
  border-radius: 0;
  border: 1px solid var(--mpw-line);
  background: var(--mpw-soft);
  color: var(--mpw-muted);
}
.mpw-row-new { animation: mpw-rowin .5s ease; }
.mpw-row-new td { background: #ededed; }

/* ---------- Footer ---------- */
.mpw-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--mpw-line);
  font-size: .68rem;
  color: var(--mpw-muted);
}
.mpw-foot b { color: var(--mpw-ink); font-variant-numeric: tabular-nums; }

/* ---------- Flow stepper (Case 02) ---------- */
.mpw-flow { display: grid; gap: 0; }
.mpw-step {
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  padding: 7px 0;
  align-items: start;
}
/* connector: gray track (top of node → top of next node) */
.mpw-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 33px;
  bottom: -7px;
  width: 2px;
  background: var(--mpw-line);
  border-radius: 0;
}
/* connector: green fill, grows downward as the step completes */
.mpw-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 33px;
  bottom: -7px;
  width: 2px;
  background: var(--mpw-ok);
  border-radius: 0;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .45s ease;
  z-index: 1;
}
.mpw-step.filled::before { transform: scaleY(1); }

.mpw-node {
  position: relative;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--mpw-line);
  background: #fff;
  color: var(--mpw-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .3s ease, background .3s ease, color .3s ease;
}
/* the circle flex-centers the number; the check is dead-centered on top */
.mpw-node .mpw-num {
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  position: relative;
  top: 1px; /* optische Feinzentrierung — Arial-Ziffern sitzen minimal hoch */
  transition: opacity .2s ease;
}
.mpw-node svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 13px;
  height: 13px;
  opacity: 0;
  transition: opacity .2s ease;
}
.mpw-step.active .mpw-node { border-color: #111111; color: #111111; }
.mpw-step.done .mpw-node { border-color: var(--mpw-ok); background: var(--mpw-ok); color: #fff; }
.mpw-step.done .mpw-node svg { opacity: 1; }
.mpw-step.done .mpw-node .mpw-num { opacity: 0; }

.mpw-step-body { padding-top: 1px; min-width: 0; }
.mpw-step-title { font-size: .8rem; color: var(--mpw-muted); transition: color .3s ease; }
.mpw-step.active .mpw-step-title,
.mpw-step.done .mpw-step-title { color: var(--mpw-ink); }
.mpw-step-note { font-size: .66rem; color: var(--mpw-muted); margin-top: 1px; }

/* result reserves its space permanently and only fades in → the widget
   height never changes, so nothing below the widget shifts on the loop */
.mpw-result {
  margin-top: 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility 0s .35s;
}
.mpw-result.show {
  opacity: 1;
  visibility: visible;
  transition: opacity .35s ease;
}

/* footer live indicator (Case 02 auto-loop) */
.mpw-foot-live { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Motion ---------- */
@keyframes mpw-pulse {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.35); opacity: 1; }
}
@keyframes mpw-rowin {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@keyframes mpw-attention {
  0%, 100% { box-shadow: 0 0 0 0 rgba(17, 17, 17, 0); }
  50% { box-shadow: 0 0 0 4px rgba(17, 17, 17, .08); }
}
@media (prefers-reduced-motion: reduce) {
  .mpw *,
  .mpw *::before,
  .mpw *::after { animation: none !important; transition: none !important; }
}

/* ---------- Fit inside the case cards ---------- */
.case-widget { margin: 0; }
@media (max-width: 560px) {
  .mpw-body--fixed { min-height: 220px; }
  .mpw-kv { grid-template-columns: 1fr; }
}
