/* ============================================================
   Bewerbungs-Tracker – Stylesheet
   Identität: Petrol / Bernstein, Schrift: Manrope
   Mobile-first, Light & Dark über prefers-color-scheme
   ============================================================ */

:root {
  /* Farbtokens (Light) */
  --bg: #f4f6f7;
  --bg-elevated: #ffffff;
  --bg-sunken: #e8edee;
  --text: #16262b;
  --text-muted: #5b6d72;
  --border: #d5dee0;
  --primary: #0f4c5c;
  --primary-hover: #0c3f4c;
  --primary-contrast: #ffffff;
  --accent: #e3a72f;
  --accent-soft: #fdf3dd;
  --danger: #b3402f;
  --danger-soft: #fbe9e5;
  --success: #2f7d4f;
  --success-soft: #e3f2e9;
  --badge-warn-bg: #fdeeda;
  --badge-warn-text: #8a5a12;
  --shadow: 0 1px 3px rgba(22, 38, 43, 0.10), 0 4px 14px rgba(22, 38, 43, 0.06);
  --radius: 10px;
  --radius-small: 6px;
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101b1f;
    --bg-elevated: #18272c;
    --bg-sunken: #0b1417;
    --text: #e5ecee;
    --text-muted: #94a7ac;
    --border: #2b3d43;
    --primary: #4fa3b8;
    --primary-hover: #66b4c7;
    --primary-contrast: #0b1417;
    --accent: #e3a72f;
    --accent-soft: #33290f;
    --danger: #e0705d;
    --danger-soft: #3a1f1a;
    --success: #5cb883;
    --success-soft: #16301f;
    --badge-warn-bg: #3a2c10;
    --badge-warn-text: #ecc26a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; }

/* ---------- Header ---------- */

.app-header {
  background: var(--primary);
  color: var(--primary-contrast);
  padding: 0.65rem 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.brand { display: flex; align-items: center; gap: 0.55rem; }
.brand-icon { border-radius: 8px; background: rgba(255, 255, 255, 0.12); padding: 3px; }
.brand h1 { font-size: 1.15rem; font-weight: 800; margin: 0; letter-spacing: 0.01em; }
.brand h1 span { font-weight: 500; opacity: 0.85; }

.main-nav { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

.nav-btn {
  font: inherit;
  font-weight: 600;
  background: transparent;
  color: var(--primary-contrast);
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  opacity: 0.8;
}
.nav-btn:hover { opacity: 1; }
.nav-btn.is-active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  opacity: 1;
}

.premium-btn {
  font: inherit;
  font-weight: 700;
  background: var(--accent);
  color: #2b2005;
  border: none;
  border-radius: var(--radius-small);
  padding: 0.38rem 0.85rem;
  cursor: pointer;
}
.premium-btn:hover { filter: brightness(1.06); }

/* ---------- Layout ---------- */

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---------- Dashboard ---------- */

.dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.dash-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  box-shadow: var(--shadow);
}

.dash-value { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.dash-value--text { font-size: 1rem; font-weight: 700; }
.dash-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

/* ---------- Toolbar ---------- */

.toolbar { display: flex; flex-direction: column; gap: 0.55rem; }
.toolbar-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.input {
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 0.45rem 0.6rem;
  min-width: 0;
}
.input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.input--search { flex: 1 1 200px; }

.btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-small);
  padding: 0.48rem 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-small { font-size: 0.8rem; padding: 0.35rem 0.65rem; }

/* ---------- Board ---------- */

.board {
  display: flex;
  gap: 0.7rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.column {
  flex: 0 0 265px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: 72vh;
}

.column.is-dragover { outline: 2px dashed var(--primary); outline-offset: -3px; }

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem 0.4rem;
}
.column-header h2 { font-size: 0.9rem; margin: 0; }
.column-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}

.column-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.35rem 0.55rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 60px;
}

.column-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.8rem 0.4rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-small);
}

/* ---------- Karten ---------- */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 0.6rem 0.65rem;
  box-shadow: var(--shadow);
  cursor: grab;
}
.card:active { cursor: grabbing; }
.card.is-dragging { opacity: 0.5; }

.card-title { font-size: 0.92rem; font-weight: 800; margin: 0; }
.card-sub { font-size: 0.82rem; color: var(--text-muted); margin: 0.1rem 0 0.35rem; }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.card-meta span {
  background: var(--bg-sunken);
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  margin-bottom: 0.4rem;
}
.badge--warn { background: var(--badge-warn-bg); color: var(--badge-warn-text); }

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
}

.card-move {
  font: inherit;
  font-size: 0.85rem;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  color: var(--text);
  padding: 0.15rem 0.55rem;
  cursor: pointer;
}
.card-move:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.card-move:disabled { opacity: 0.35; cursor: default; }

.card-open {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0.15rem 0.3rem;
}
.card-open:hover { text-decoration: underline; }

/* ---------- Statistik ---------- */

.stats h2 { font-size: 1.2rem; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.stats-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}
.stats-card h3 { font-size: 0.95rem; }

.stats-big { font-size: 1.7rem; font-weight: 800; color: var(--primary); margin: 0.2rem 0; }
.stats-hint { font-size: 0.8rem; color: var(--text-muted); margin: 0.3rem 0 0; }

.funnel { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.4rem; }

.funnel-row { display: flex; flex-direction: column; gap: 0.15rem; }
.funnel-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
}
.funnel-labels em { font-style: normal; color: var(--text-muted); font-weight: 600; }

.funnel-track {
  background: var(--bg-sunken);
  border-radius: 999px;
  height: 18px;
  overflow: hidden;
}
.funnel-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  min-width: 4px;
  transition: width 0.4s ease;
}
.funnel-bar--accent { background: var(--accent); }
.funnel-bar--success { background: var(--success); }

.funnel-conv {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-left: 0.2rem;
}

.table-wrap { overflow-x: auto; }

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 480px;
}
.stats-table th, .stats-table td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.stats-table th { color: var(--text-muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stats-table tr:last-child td { border-bottom: none; }

/* ---------- Werbeplatz ---------- */

.ad-slot {
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  text-align: center;
}
.ad-slot-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.ad-slot-text { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Footer ---------- */

.app-footer {
  border-top: 1px solid var(--border);
  padding: 0.9rem 1rem 1.4rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.app-footer p { margin: 0 0 0.4rem; }
.app-footer nav { display: flex; justify-content: center; gap: 1rem; }

.footer-link {
  font: inherit;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0.1rem;
  font-weight: 600;
}
.footer-link:hover { text-decoration: underline; }

/* ---------- Modals ---------- */

.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0;
  width: min(680px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.modal--small { width: min(460px, calc(100vw - 2rem)); }
.modal::backdrop { background: rgba(10, 20, 24, 0.55); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.5rem;
}
.modal-header h2 { font-size: 1.05rem; margin: 0; }

.modal-close {
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-small);
}
.modal-close:hover { color: var(--danger); background: var(--bg-sunken); }

.modal-body { padding: 0.4rem 1rem 0.8rem; overflow-y: auto; max-height: 62vh; }

.modal-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem 0.9rem;
  border-top: 1px solid var(--border);
}
.modal-footer-spacer { flex: 1; }

.premium-price { font-size: 1.05rem; margin: 0.2rem 0 0.6rem; }
.premium-list { margin: 0 0 0.6rem; padding-left: 1.2rem; font-size: 0.9rem; }
.premium-list li { margin-bottom: 0.25rem; }

/* ---------- Formular ---------- */

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.field { display: flex; flex-direction: column; gap: 0.2rem; }
.field span { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); }
.field textarea { resize: vertical; }

.form-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  margin: 0.9rem 0 0;
  padding: 0.6rem 0.75rem 0.75rem;
}
.form-section legend, .form-section h3 {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.3rem;
  margin: 0 0 0.4rem;
}

.interview-list, .history-list { list-style: none; margin: 0 0 0.5rem; padding: 0; }

.interview-list li, .history-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.3rem 0.2rem;
  border-bottom: 1px dashed var(--border);
}
.interview-list li:last-child, .history-list li:last-child { border-bottom: none; }

.iv-remove {
  font: inherit;
  font-size: 0.75rem;
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-weight: 700;
}
.iv-remove:hover { text-decoration: underline; }

.interview-add { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }

.history-list .h-status { font-weight: 700; }
.history-list .h-date { color: var(--text-muted); font-size: 0.78rem; }

.list-empty { color: var(--text-muted); font-size: 0.82rem; padding: 0.2rem; }

/* ---------- Responsive ---------- */

@media (min-width: 640px) {
  .dashboard { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .field--wide { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-card--wide { grid-column: 1 / -1; }
  .column { flex: 1 1 0; min-width: 220px; }
}

/* ============================================================
   Erste Schritte (Onboarding)
   ============================================================ */

.help-btn {
  inline-size: 2rem;
  block-size: 2rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: var(--primary-contrast);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  opacity: 0.85;
}
.help-btn:hover,
.help-btn:focus-visible { opacity: 1; background: rgba(255, 255, 255, 0.16); }

.tour-intro { color: var(--text-muted); margin: 0 0 0.9rem; }
.tour-steps { margin: 0 0 1rem; padding-left: 1.25rem; display: grid; gap: 0.6rem; }
.tour-steps li strong { color: var(--primary); }

.know-box {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 0.9rem 1rem;
  margin-bottom: 0.25rem;
}
.know-box h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.know-box ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.4rem; }
.know-box li { font-size: 0.9rem; color: var(--text-muted); }
