/* PrepZone System-Tracker — Design */

:root {
  --bg: #0a0e15;
  --bg-2: #0d1320;
  --surface: #111827;
  --card: #151d2e;
  --card-2: #1a2438;
  --card-hover: #1d2942;
  --border: #223048;
  --border-2: #2d3f5e;
  --text: #e8eef7;
  --muted: #94a5bd;
  --dim: #5c6f8a;
  --accent: #f6a821;
  --accent-soft: rgba(246, 168, 33, 0.14);
  --blue: #3b82f6;
  --green: #22c55e;
  --red: #ef4444;
  --violet: #8b5cf6;
  --orange: #f97316;
  --teal: #14b8a6;
  --st-open: #7d8fa9;
  --st-progress: #f6a821;
  --st-testing: #8b5cf6;
  --st-done: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  min-height: 100vh;
}
::selection { background: rgba(246, 168, 33, 0.3); }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2b3a55; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a4d6f; }

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

#app { min-height: 100vh; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: transform 0.25s ease;
}
.main {
  flex: 1;
  margin-left: 248px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px 16px;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, #f6a821, #f97316);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #1a1200;
  letter-spacing: -0.5px;
  box-shadow: 0 4px 14px rgba(246, 168, 33, 0.35);
}
.brand-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: var(--dim); }

.nav { padding: 8px 12px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); padding: 14px 10px 6px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 9px;
  color: var(--muted); cursor: pointer;
  font-weight: 500; margin-bottom: 2px;
  border: 1px solid transparent;
  user-select: none;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); border-color: rgba(246, 168, 33, 0.25); }
.nav-item .nav-count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--card-2); color: var(--muted);
  border-radius: 20px; padding: 1px 8px;
}
.nav-item.active .nav-count { background: rgba(246, 168, 33, 0.2); color: var(--accent); }

.sidebar-report { padding: 10px 12px; }
.sidebar-footer { border-top: 1px solid var(--border); padding: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 6px 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12.5px; color: #fff; flex-shrink: 0;
}
.user-chip-name { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.user-chip-role { font-size: 11.5px; color: var(--dim); }
.sidebar-actions { display: flex; gap: 6px; }
.sidebar-actions .btn { flex: 1; font-size: 12px; padding: 6px 8px; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 21, 0.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 30;
  min-height: 66px;
}
.topbar h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.topbar .spacer { flex: 1; }
.hamburger { display: none; }

.content { padding: 24px 26px 60px; flex: 1; }

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--border-2);
  background: var(--card-2); color: var(--text);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:hover { background: var(--card-hover); border-color: #3d5379; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(135deg, #f6a821, #f08a12);
  border-color: transparent; color: #221600;
  box-shadow: 0 3px 12px rgba(246, 168, 33, 0.25);
}
.btn-primary:hover { background: linear-gradient(135deg, #ffb52e, #f6961b); border-color: transparent; }
.btn-danger { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.4); color: #f87171; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.6); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface); color: var(--text); border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- Forms */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(246, 168, 33, 0.15);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.textarea.mono { font-family: var(--mono); font-size: 12.5px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a5bd' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
.form-row { display: flex; gap: 12px; }
.form-row > .field { flex: 1; }
.form-hint { font-size: 12px; color: var(--dim); margin-top: 5px; }

.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot {
  width: 26px; height: 26px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform 0.1s;
}
.color-dot:hover { transform: scale(1.15); }
.color-dot.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--bg); }

/* ---------------------------------------------------------------- Chips */

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 20px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.chip.st-open { background: rgba(125, 143, 169, 0.16); color: #a7b7cd; }
.chip.st-in_progress { background: rgba(246, 168, 33, 0.15); color: #fbbf4d; }
.chip.st-testing { background: rgba(139, 92, 246, 0.16); color: #b294f9; }
.chip.st-done { background: rgba(34, 197, 94, 0.15); color: #4ade80; }

.chip.pr-low { background: rgba(125, 143, 169, 0.16); color: #a7b7cd; }
.chip.pr-medium { background: rgba(59, 130, 246, 0.16); color: #7cadf8; }
.chip.pr-high { background: rgba(249, 115, 22, 0.16); color: #fb923c; }
.chip.pr-critical { background: rgba(239, 68, 68, 0.18); color: #f87171; }

.chip.ty-bug { background: rgba(239, 68, 68, 0.14); color: #f87171; }
.chip.ty-feature { background: rgba(59, 130, 246, 0.14); color: #7cadf8; }
.chip.ty-task { background: rgba(148, 165, 189, 0.14); color: #aebfd6; }
.chip.ty-improvement { background: rgba(20, 184, 166, 0.14); color: #2dd4bf; }

.chip.state-missing { background: rgba(239, 68, 68, 0.14); color: #f87171; }
.chip.state-not_started { background: rgba(125, 143, 169, 0.16); color: #a7b7cd; }
.chip.state-in_progress { background: rgba(246, 168, 33, 0.15); color: #fbbf4d; }
.chip.state-done { background: rgba(34, 197, 94, 0.15); color: #4ade80; }

.module-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
}
.module-tag .dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }

/* ---------------------------------------------------------------- Cards */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- Login */

.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(246, 168, 33, 0.09), transparent),
    radial-gradient(ellipse 50% 40% at 90% 100%, rgba(59, 130, 246, 0.09), transparent),
    var(--bg);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
}
.login-head { text-align: center; margin-bottom: 26px; }
.login-head .brand-mark { width: 54px; height: 54px; border-radius: 15px; font-size: 19px; margin: 0 auto 14px; }
.login-head h1 { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.login-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.login-error {
  background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171; border-radius: 9px; padding: 9px 12px;
  font-size: 13px; margin-bottom: 14px; display: none;
}
.login-error.show { display: block; animation: shake 0.35s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.login-footer { text-align: center; color: var(--dim); font-size: 12px; margin-top: 18px; }

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

.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.dash-hero { grid-column: span 4; display: flex; align-items: center; gap: 20px; }
.dash-stats { grid-column: span 8; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.dash-modules { grid-column: span 7; }
.dash-side { grid-column: span 5; display: flex; flex-direction: column; gap: 16px; }

.ring-wrap { position: relative; width: 118px; height: 118px; flex-shrink: 0; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { stroke: var(--card-2); }
.ring-fg { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-center .pct { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.ring-center .lbl { font-size: 10.5px; color: var(--dim); font-weight: 600; }
.hero-info h2 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.hero-info p { color: var(--muted); font-size: 13px; }

.stat-card { display: flex; flex-direction: column; justify-content: center; gap: 2px; position: relative; overflow: hidden; }
.stat-card .num { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.stat-card .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat-card .stat-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
}
.stat-card .stat-icon svg { width: 19px; height: 19px; }

.module-row {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent;
}
.module-row:hover { background: var(--card-2); border-color: var(--border); }
.module-row .dot { width: 10px; height: 10px; border-radius: 4px; flex-shrink: 0; }
.module-row .m-name { font-weight: 600; font-size: 13.5px; width: 170px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-row .m-counts { font-size: 11.5px; color: var(--dim); width: 120px; flex-shrink: 0; }
.module-row .m-pct { font-weight: 700; font-size: 13px; width: 44px; text-align: right; flex-shrink: 0; }

.pbar { flex: 1; height: 7px; background: var(--bg-2); border-radius: 5px; overflow: hidden; min-width: 60px; }
.pbar > div { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #f6a821, #22c55e); transition: width 0.6s ease; min-width: 0; }
.pbar.big { height: 9px; }

.missing-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.missing-item:hover { background: var(--card-2); }
.missing-item .dot { width: 9px; height: 9px; border-radius: 3px; }
.missing-item span { flex: 1; font-size: 13.5px; font-weight: 500; }

.empty-note { color: var(--dim); font-size: 13px; padding: 8px 10px; }

/* ---------------------------------------------------------------- Aktivität / Timeline */

.act-item { display: flex; gap: 12px; padding: 9px 4px; }
.act-icon {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-2); color: var(--muted);
}
.act-icon svg { width: 15px; height: 15px; }
.act-body { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.act-body b { color: var(--text); font-weight: 600; }
.act-body .act-link { color: var(--accent); cursor: pointer; font-weight: 600; }
.act-body .act-link:hover { text-decoration: underline; }
.act-time { font-size: 11.5px; color: var(--dim); margin-top: 1px; }

.timeline-day { margin-bottom: 22px; }
.timeline-day-label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 0 8px; position: sticky; top: 66px;
  background: var(--bg); z-index: 5;
}
.timeline-list { border-left: 2px solid var(--border); margin-left: 14px; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.timeline-list .act-item { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.timeline-list .act-item::before {
  content: ''; position: absolute; left: -25px; top: 18px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border-2); border: 2px solid var(--bg);
}

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

.board-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.board-toolbar .select, .board-toolbar .input { width: auto; min-width: 160px; }
.board-toolbar .input { min-width: 200px; }

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(265px, 1fr));
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 20px;
}
.board-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 180px;
  display: flex; flex-direction: column;
  transition: border-color 0.15s, background 0.15s;
}
.board-col.drag-over { border-color: var(--accent); background: #131b2c; }
.board-col-head {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 14px 11px;
  font-weight: 700; font-size: 13px;
}
.board-col-head .col-dot { width: 9px; height: 9px; border-radius: 50%; }
.board-col-head .col-count { margin-left: auto; font-size: 11.5px; color: var(--dim); background: var(--card-2); padding: 1px 8px; border-radius: 12px; font-weight: 700; }
.board-col-body { padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; flex: 1; }
.board-col-add { margin: 0 10px 10px; border: 1px dashed var(--border-2); background: transparent; color: var(--dim); }
.board-col-add:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

.task-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
}
.task-card:hover { border-color: var(--border-2); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
.task-card.dragging { opacity: 0.45; transform: rotate(2deg); }
.task-card .tc-top { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; flex-wrap: wrap; }
.task-card .tc-id { font-size: 10.5px; color: var(--dim); font-weight: 700; margin-left: auto; }
.task-card .tc-title { font-weight: 600; font-size: 13.5px; line-height: 1.35; margin-bottom: 9px; word-break: break-word; }
.task-card .tc-bottom { display: flex; align-items: center; gap: 10px; }
.task-card .tc-meta { display: flex; align-items: center; gap: 9px; margin-left: auto; color: var(--dim); font-size: 11.5px; }
.task-card .tc-meta span { display: inline-flex; align-items: center; gap: 3px; }
.task-card .tc-meta svg { width: 13px; height: 13px; }
.task-card .avatar { width: 22px; height: 22px; font-size: 9.5px; }
.drop-indicator { height: 3px; border-radius: 2px; background: var(--accent); margin: -2px 2px; box-shadow: 0 0 8px rgba(246,168,33,0.6); }

/* ---------------------------------------------------------------- Module-Seite */

.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.module-card { position: relative; overflow: hidden; cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.module-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.module-card .mc-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.module-card .mc-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.module-card h3 { font-size: 15.5px; font-weight: 700; flex: 1; word-break: break-word; }
.module-card .mc-desc { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 20px; }
.module-card .mc-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.module-card .mc-progress .m-pct { font-weight: 700; font-size: 13px; }
.module-card .mc-counts { display: flex; gap: 7px; flex-wrap: wrap; }
.mc-count { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--card-2); border-radius: 7px; padding: 3px 8px; display: inline-flex; align-items: center; gap: 5px; }
.mc-count .cdot { width: 7px; height: 7px; border-radius: 50%; }
.module-card .mc-actions { position: absolute; top: 12px; right: 12px; display: none; gap: 4px; }
.module-card:hover .mc-actions { display: flex; }

.module-new {
  border: 2px dashed var(--border-2); background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--dim); min-height: 160px; cursor: pointer; border-radius: var(--radius);
  font-weight: 600;
}
.module-new:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.module-new svg { width: 26px; height: 26px; }

.module-head-card { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.module-head-card .mh-info { flex: 1; min-width: 220px; }
.module-head-card h2 { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.module-head-card h2 .dot { width: 12px; height: 12px; border-radius: 4px; }
.module-head-card p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.module-head-card .mh-progress { display: flex; align-items: center; gap: 12px; min-width: 220px; flex: 1; }
.module-head-card .m-pct { font-weight: 800; font-size: 17px; }

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

.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  width: 100%; max-width: 560px;
  box-shadow: var(--shadow);
  animation: slideUp 0.2s ease;
  margin-bottom: 40px;
}
@keyframes slideUp { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.modal-lg { max-width: 1060px; }
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 16.5px; font-weight: 700; flex: 1; line-height: 1.3; }
.modal-close {
  background: transparent; border: none; color: var(--dim); cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--card-2); color: var(--text); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 20px 22px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
}

/* Task-Detail */
.task-detail { display: grid; grid-template-columns: 1fr 300px; gap: 0; }
.td-main { padding: 20px 24px; min-width: 0; border-right: 1px solid var(--border); }
.td-side { padding: 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.td-section { margin-bottom: 22px; }
.td-section-title {
  font-size: 11.5px; font-weight: 700; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 9px;
  display: flex; align-items: center; gap: 8px;
}
.td-section-title .btn { margin-left: auto; }
.td-text { font-size: 14px; line-height: 1.65; color: var(--text); word-break: break-word; white-space: normal; }
.td-text.empty { color: var(--dim); font-style: italic; }
.codeblock {
  background: #0a0f18; border: 1px solid var(--border);
  border-radius: 9px; padding: 12px 14px;
  font-family: var(--mono); font-size: 12px; line-height: 1.55;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
  color: #c3d4ea; max-height: 340px; overflow-y: auto;
}
.td-side .field { margin-bottom: 0; }
.td-side-info { font-size: 12.5px; color: var(--dim); line-height: 1.7; border-top: 1px solid var(--border); padding-top: 12px; }
.td-side-info b { color: var(--muted); font-weight: 600; }

/* ---------------------------------------------------------------- Anhänge & Dropzone */

.dropzone {
  border: 2px dashed var(--border-2);
  border-radius: 10px;
  padding: 18px 14px;
  text-align: center;
  color: var(--dim); font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone b { color: var(--muted); font-weight: 600; }
.dropzone.drag b { color: var(--accent); }
.dropzone svg { width: 20px; height: 20px; display: block; margin: 0 auto 6px; opacity: 0.7; }

.att-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.att-thumb {
  position: relative; width: 92px; height: 92px;
  border-radius: 9px; overflow: hidden;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  cursor: zoom-in;
}
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-file {
  display: flex; align-items: center; gap: 9px;
  background: var(--card-2); border: 1px solid var(--border-2);
  border-radius: 9px; padding: 8px 11px;
  font-size: 12.5px; max-width: 240px;
  position: relative;
}
.att-file svg { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; }
.att-file .af-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.att-file .af-size { color: var(--dim); font-size: 11px; }
.att-file a { color: inherit; min-width: 0; }
.att-remove {
  position: absolute; top: -7px; right: -7px;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--red); color: #fff; border: 2px solid var(--card);
  display: none; align-items: center; justify-content: center;
  cursor: pointer; font-size: 12px; line-height: 1; padding: 0;
}
.att-thumb:hover .att-remove, .att-file:hover .att-remove { display: flex; }
.att-uploading { display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 11px; }

/* ---------------------------------------------------------------- Kommentare */

.comment { display: flex; gap: 11px; padding: 12px 0; border-top: 1px solid var(--border); }
.comment:first-child { border-top: none; }
.comment .avatar { width: 30px; height: 30px; font-size: 11px; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.comment-head b { font-size: 13px; }
.comment-head time { font-size: 11.5px; color: var(--dim); }
.comment-head .btn { margin-left: auto; }
.comment-text { font-size: 13.5px; color: var(--text); line-height: 1.6; word-break: break-word; }
.comment-composer { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 16px; }

/* ---------------------------------------------------------------- Tabellen (Benutzer) */

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--dim); font-weight: 700; padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.tbl td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(255,255,255,0.015); }
.tbl .select { width: auto; padding: 6px 30px 6px 10px; font-size: 13px; }

.role-badge { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.role-admin { background: rgba(246, 168, 33, 0.15); color: #fbbf4d; }
.role-developer { background: rgba(59, 130, 246, 0.16); color: #7cadf8; }
.role-tester { background: rgba(20, 184, 166, 0.14); color: #2dd4bf; }

/* ---------------------------------------------------------------- Export */

.export-layout { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(400px, 1.2fr); gap: 18px; align-items: start; }
.export-task { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.export-task:hover { background: var(--card-2); }
.export-task input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.export-task .et-title { flex: 1; font-size: 13.5px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.export-module-head { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 13.5px; padding: 12px 4px 4px; }
.export-module-head .dot { width: 9px; height: 9px; border-radius: 3px; }
.export-options { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.check-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.check-label input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.export-output {
  width: 100%; min-height: 420px;
  font-family: var(--mono); font-size: 12px; line-height: 1.55;
}
.export-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Toasts */

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--card-2); border: 1px solid var(--border-2);
  border-radius: 11px; padding: 12px 16px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.25s ease;
  max-width: 380px;
}
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.success { border-color: rgba(34, 197, 94, 0.5); }
.toast.success svg { color: var(--green); }
.toast.error { border-color: rgba(239, 68, 68, 0.5); }
.toast.error svg { color: var(--red); }
.toast svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ---------------------------------------------------------------- Sonstiges */

.page-empty {
  text-align: center; padding: 70px 20px; color: var(--dim);
}
.page-empty svg { width: 44px; height: 44px; margin-bottom: 14px; opacity: 0.5; }
.page-empty h3 { color: var(--muted); font-size: 16px; margin-bottom: 6px; }
.page-empty p { font-size: 13.5px; max-width: 420px; margin: 0 auto 18px; }

.loading { display: flex; align-items: center; justify-content: center; padding: 60px; color: var(--dim); gap: 10px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--border-2); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }

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

@media (max-width: 1100px) {
  .dash-hero { grid-column: span 12; }
  .dash-stats { grid-column: span 12; grid-template-columns: repeat(2, 1fr); }
  .dash-modules { grid-column: span 12; }
  .dash-side { grid-column: span 12; }
  .task-detail { grid-template-columns: 1fr; }
  .td-main { border-right: none; border-bottom: 1px solid var(--border); }
  .export-layout { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, 280px); }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .hamburger { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px 14px 60px; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 39; }
  .form-row { flex-direction: column; gap: 0; }
  .module-row .m-name { width: auto; flex: 1; }
  .module-row .m-counts { display: none; }
  .modal-overlay { padding: 12px 8px; }
}
