/* ==========================================================================
   Base reset + utility primitives
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 15px; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
}
input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* ── Typography ── */
.h-eyebrow {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.h-title-lg { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.h-title    { font-size: 15px; font-weight: 700; color: var(--text); }
.text-mono  { font-family: var(--font-mono); }
.text-2     { color: var(--text-2); }
.text-3     { color: var(--text-3); }
.text-sm    { font-size: 12px; }
.text-xs    { font-size: 11px; }

/* ── Pill / Badge ── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.pill--green  { background: var(--green-tint);  color: var(--green);  border-color: transparent; }
.pill--amber  { background: var(--amber-tint);  color: var(--amber);  border-color: transparent; }
.pill--red    { background: var(--red-tint);    color: var(--red);    border-color: transparent; }
.pill--brand  { background: var(--brand-tint);  color: var(--brand);  border-color: transparent; }
.pill--violet { background: var(--violet-tint); color: var(--violet); border-color: transparent; }
.pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card--padded { padding: var(--space-4); }
.card--inset  { padding: var(--space-5); }

/* ── Button ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
  user-select: none;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { filter: brightness(1.05); }
.btn--ghost   { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--soft    { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.btn--danger  { background: var(--red); color: #fff; }
.btn--success { background: var(--green); color: #fff; }
.btn--lg      { padding: 10px 16px; font-size: 13px; }
.btn--sm      { padding: 5px 10px; font-size: 11px; }
.btn[disabled],
.btn--disabled { opacity: .5; cursor: not-allowed; }

/* ── Form controls ── */
.input {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.input--search {
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-3);
}

/* ── Toggle (switch) ── */
.toggle {
  --w: 42px;
  --h: 24px;
  position: relative;
  display: inline-block;
  width: var(--w);
  height: var(--h);
  flex-shrink: 0;
}
.toggle input { display: none; }
.toggle__slot {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  transition: background .15s;
  cursor: pointer;
}
.toggle__knob {
  position: absolute;
  top: 2px; left: 2px;
  width: calc(var(--h) - 4px);
  height: calc(var(--h) - 4px);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left .15s, background .15s;
}
.toggle input:checked + .toggle__slot { background: var(--green); }
.toggle input:checked + .toggle__slot .toggle__knob {
  left: calc(var(--w) - var(--h) + 2px);
}

/* ── Utility ── */
.flex      { display: flex; }
.flex-col  { display: flex; flex-direction: column; }
.gap-1     { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1    { flex: 1; }
.hidden    { display: none !important; }
.muted     { color: var(--text-3); }
.full      { width: 100%; }
.scroll    { overflow-y: auto; }

/* ── Scrollbar (subtle) ── */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ── Skeleton (loading) ── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--border) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Coming-soon overlay (Platzhalter für noch nicht gebaute Features) ── */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 60px 20px;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-3);
  min-height: 240px;
}
.coming-soon__icon { font-size: 32px; opacity: .5; }
.coming-soon__title { font-size: 15px; font-weight: 700; color: var(--text-2); }
.coming-soon__hint { font-size: 12px; max-width: 380px; line-height: 1.5; }
