/* Alexium Flows Portal — minimales CSS, kein Studio-Overhead */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --p-bg:        #ffffff;
  --p-surface:   #f5f5f7;
  --p-border:    #e0e0e0;
  --p-text:      #1a1a2e;
  --p-muted:     #6b7280;
  --p-accent:    #334155;
  --p-accent-fg: #ffffff;
  --p-danger:    #dc2626;
  --p-radius:    10px;
  --p-font:      system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
  margin: 0;
  font-family: var(--p-font);
  background: var(--p-bg);
  color: var(--p-text);
  min-height: 100vh;
}

/* Topbar */
.p-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 56px;
  border-bottom: 1px solid var(--p-border);
  background: var(--p-bg);
}
.p-topbar__title { font-weight: 600; font-size: 15px; }
.p-topbar__spacer { flex: 1; }
.p-topbar__user { font-size: 13px; color: var(--p-muted); }
.p-topbar__link {
  font-size: 12px;
  color: var(--p-muted);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--p-border);
  border-radius: 6px;
}
.p-topbar__link:hover { background: var(--p-surface); }

/* Layout */
.p-main { max-width: 760px; margin: 0 auto; padding: 32px 24px; }

/* Karten */
.p-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 20px 24px;
  margin-bottom: 12px;
}
.p-card__title { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.p-card__meta  { font-size: 12px; color: var(--p-muted); margin: 0; }
.p-card--clickable { cursor: pointer; transition: border-color .15s; }
.p-card--clickable:hover { border-color: var(--p-accent); }

/* Buttons */
.p-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.p-btn--primary   { background: var(--p-accent); color: var(--p-accent-fg); }
.p-btn--secondary { background: var(--p-surface); color: var(--p-text); border: 1px solid var(--p-border); }
.p-btn--danger    { background: var(--p-danger); color: #fff; }

/* Login-Form */
.p-login { max-width: 380px; margin: 80px auto; }
.p-login__heading { font-size: 22px; font-weight: 700; margin-bottom: 24px; }
.p-field { margin-bottom: 14px; }
.p-label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--p-muted); }
.p-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--p-border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--p-bg);
  color: var(--p-text);
}
.p-input:focus { outline: none; border-color: var(--p-accent); }

/* Hinweis-Box */
.p-hint {
  padding: 14px 16px;
  border-radius: var(--p-radius);
  font-size: 13px;
  margin-bottom: 16px;
}
.p-hint--info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.p-hint--success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.p-hint--warn    { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.p-hint--error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Section-Header */
.p-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--p-muted); margin: 24px 0 10px; font-weight: 600; }

/* ── Navigation ── */
.p-topbar__nav          { display: flex; gap: 4px; align-items: center; }
.p-topbar__link--active { font-weight: 600; color: var(--p-accent); }

/* ── Card-Link ── */
.p-card--link           { display: block; text-decoration: none; color: inherit; }
.p-card--link:hover     { background: var(--p-surface); }

/* ── Dashboard ── */
.p-dashboard            { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.p-widget               { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: 16px; }
.p-widget__header       { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.p-widget__title        { font-size: 13px; font-weight: 600; color: var(--p-muted); text-transform: uppercase; letter-spacing: .04em; }
.p-widget__count        { font-size: 20px; font-weight: 700; color: var(--p-accent); }
.p-widget__more         { font-size: 12px; color: var(--p-accent); text-decoration: none; display: block; margin-top: 8px; }
.p-widget__more:hover   { text-decoration: underline; }
.p-widget--full         { grid-column: 1 / -1; }

/* ── Feed ── */
.p-feed                 { list-style: none; margin: 0; padding: 0; }
.p-feed__item           { padding: 8px 0; border-bottom: 1px solid var(--p-border); font-size: 13px; color: var(--p-muted); }
.p-feed__item:last-child{ border-bottom: none; }
.p-feed__actor          { font-weight: 600; color: var(--p-text); }

/* ── Schnellstart ── */
.p-quick                { display: flex; flex-direction: column; gap: 8px; }
.p-quick__btn           { background: var(--p-bg); border: 1px solid var(--p-border); border-radius: 6px; padding: 8px 12px; text-align: left; font-size: 13px; cursor: pointer; text-decoration: none; color: var(--p-text); transition: border-color .15s; }
.p-quick__btn:hover     { border-color: var(--p-accent); color: var(--p-accent); }

/* ── Prozessliste ── */
.p-process-list         { width: 100%; }
.p-filter-bar           { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.p-filter-bar select,
.p-filter-bar input     { font-size: 13px; border: 1px solid var(--p-border); border-radius: 6px; padding: 6px 10px; background: var(--p-bg); color: var(--p-text); }
.p-toggle               { display: inline-flex; border: 1px solid var(--p-border); border-radius: 6px; overflow: hidden; }
.p-toggle__btn          { padding: 6px 14px; font-size: 13px; background: var(--p-bg); border: none; cursor: pointer; color: var(--p-muted); }
.p-toggle__btn--active  { background: var(--p-accent); color: var(--p-accent-fg); font-weight: 600; }
.p-table                { width: 100%; border-collapse: collapse; font-size: 14px; }
.p-table th             { text-align: left; font-size: 12px; font-weight: 600; color: var(--p-muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 12px; border-bottom: 2px solid var(--p-border); }
.p-table td             { padding: 10px 12px; border-bottom: 1px solid var(--p-border); }
.p-table tr:hover td    { background: var(--p-surface); cursor: pointer; }

/* ── Badges ── */
.p-badge                { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 4px; padding: 2px 7px; }
.p-badge--active        { background: #dbeafe; color: #1d4ed8; }
.p-badge--completed     { background: #dcfce7; color: #166534; }
.p-badge--pending       { background: #f1f5f9; color: var(--p-muted); }
.p-badge--cancelled     { background: #fee2e2; color: #991b1b; }
.p-badge--paused        { background: #fef9c3; color: #854d0e; }

/* ── Prozessdetail ── */
.p-process-header       { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--p-border); }
.p-process-header h2    { margin: 0 0 6px; font-size: 20px; }
.p-process-meta         { font-size: 13px; color: var(--p-muted); display: flex; gap: 16px; flex-wrap: wrap; }
.p-step-list            { list-style: none; margin: 0; padding: 0; }
.p-step-item            { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--p-border); }
.p-step-item:last-child { border-bottom: none; }
.p-step-icon            { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.p-step-body            { flex: 1; }
.p-step-title           { font-size: 14px; font-weight: 500; }
.p-step-meta            { font-size: 12px; color: var(--p-muted); margin-top: 2px; }
.p-step-action          { font-size: 13px; color: var(--p-accent); text-decoration: none; }
.p-step-action:hover    { text-decoration: underline; }

/* ── Artefakt-Detail ── */
.p-artifact-header      { margin-bottom: 20px; }
.p-artifact-header h2   { margin: 0 0 4px; font-size: 18px; }
.p-artifact-dl          { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.p-artifact-dl dt       { color: var(--p-muted); font-weight: 500; }
.p-artifact-dl dd       { margin: 0; }

/* ── Back-Link ── */
.p-back                 { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--p-muted); text-decoration: none; margin-bottom: 20px; }
.p-back:hover           { color: var(--p-text); }
.p-back::before         { content: '←'; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .p-dashboard          { grid-template-columns: 1fr; }
  .p-widget--full       { grid-column: 1; }
  .p-main               { padding: 16px; }
  .p-filter-bar         { flex-direction: column; align-items: stretch; }
}

/* ── Start-Modal ── */
.p-modal                { display: none; position: fixed; inset: 0; z-index: 1000; align-items: center; justify-content: center; }
.p-modal--open          { display: flex; }
.p-modal__backdrop      { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.p-modal__box           { position: relative; background: var(--p-bg); border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,.18); width: 100%; max-width: 420px; margin: 16px; }
.p-modal__header        { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.p-modal__title         { font-size: 15px; font-weight: 600; }
.p-modal__close         { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--p-muted); line-height: 1; padding: 0 4px; }
.p-modal__close:hover   { color: var(--p-text); }
.p-modal__body          { padding: 16px 20px; }
.p-modal__footer        { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
