/* ===========================
   derTechniker — Brand-aligned with horoscode.de
   Purple #6c63ff · Cyan #00d4ff
   =========================== */

:root {
  --primary: #6c63ff;
  --primary-dark: #4f46e5;
  --accent: #00d4ff;
  --bg: #0a0a0f;
  --panel: #111118;
  --panel-2: #16161f;
  --field: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e8e8f0;
  --muted: #8888a8;
  --gradient: linear-gradient(135deg, var(--primary), var(--accent));
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(108, 99, 255, 0.15);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100%; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(108, 99, 255, 0.16), transparent 60%),
    radial-gradient(800px 480px at 100% 0%, rgba(0, 212, 255, 0.1), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  padding: 28px 16px 56px;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(680px, 100%); margin: 0 auto; }
.wrap--wide { width: min(960px, 100%); }
.wrap--admin { width: min(780px, 100%); }

/* Back link */
.site-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}
.site-back:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateX(-2px);
}

/* Headings */
h1 {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 6px;
}
h1::after {
  content: "";
  display: block;
  width: 52px;
  height: 4px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--gradient);
}
h1.h1-compact { font-size: 1.55rem; }
h1.h1-compact::after { width: 40px; height: 3px; margin-top: 10px; }

.sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 24px; }
.sub a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}
.sub a:hover { border-bottom-color: currentColor; }
.sub--compact { font-size: 0.88rem; margin-top: 6px; margin-bottom: 0; }

/* Forms & panels */
form { display: grid; gap: 16px; }
form.form-admin { gap: 14px; }

section {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color var(--transition);
}
section:focus-within { border-color: rgba(108, 99, 255, 0.35); }
section.section-admin { padding: 18px; }

.label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 11px;
}
.label-tight { margin-bottom: 6px; }
.label-spaced { margin-top: 16px; }

/* Inputs */
input[type="text"],
input[type="number"],
input[type="datetime-local"],
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  background: rgba(2, 2, 8, 0.5);
  color: inherit;
  font: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input::placeholder, textarea::placeholder { color: rgba(136, 136, 168, 0.7); }
input:focus, textarea:focus {
  border-color: rgba(108, 99, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.16);
}
input:disabled { opacity: 0.5; cursor: not-allowed; }
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
textarea.textarea-admin { min-height: 120px; line-height: 1.45; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row input[type="text"] { flex: 1; min-width: 150px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 0.87rem;
  font-weight: 500;
  background: var(--field);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}
.chip:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.06); }
.chip.on {
  border-color: transparent;
  background: rgba(108, 99, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(108, 99, 255, 0.55);
  color: #fff;
}
.chip-dashed {
  margin-top: 12px;
  border-style: dashed;
  border-color: var(--border-strong);
  color: var(--muted);
}
.chip-dashed:hover { color: var(--text); }
.chip input { display: none; }

/* Goods lines */
.goods-list { display: grid; gap: 8px; margin-top: 12px; }
.good-line {
  display: grid;
  grid-template-columns: 1fr 96px auto;
  gap: 8px;
  align-items: center;
}
.good-line button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.good-line button:hover { color: #fca5a5; border-color: rgba(252, 165, 165, 0.4); }

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 520px) { .time-grid { grid-template-columns: 1fr; } }

/* Submit */
.submit {
  border: 0;
  border-radius: 12px;
  padding: 15px 20px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  color: #fff;
  background: var(--gradient);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.submit:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(108, 99, 255, 0.3); }
.submit:active { transform: translateY(0); }
.submit:disabled { opacity: 0.6; cursor: progress; transform: none; box-shadow: none; }

.ok {
  color: #6ee7b7;
  font-size: 0.9rem;
  font-weight: 600;
  display: none;
  text-align: center;
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.22);
}

/* ===== Inbox ===== */
header.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  min-width: 72px;
}
.stat strong {
  display: block;
  font-size: 1.4rem;
  color: var(--text);
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
}

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar--admin { margin-bottom: 20px; }

button, .link-btn, .toolbar a {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  font: inherit;
  font-size: 0.87rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  transition: var(--transition);
}
button:hover, .link-btn:hover, .toolbar a:hover {
  border-color: var(--border-strong);
  background: var(--panel);
  transform: translateY(-1px);
}
button.primary {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow);
}
button.primary:hover { box-shadow: 0 12px 36px rgba(108, 99, 255, 0.3); }
button.danger { color: #fca5a5; }
button.danger:hover { border-color: rgba(252, 165, 165, 0.4); }

/* Cards */
.list { display: grid; gap: 14px; }
.card {
  position: relative;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: var(--transition);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--gradient);
  opacity: 0.9;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card.done { opacity: 0.6; }
.card.done::before { background: var(--muted); opacity: 0.5; }

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.meta { color: var(--muted); font-size: 0.82rem; }

.badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.neu {
  color: #c7d2fe;
  background: rgba(108, 99, 255, 0.16);
  border: 1px solid rgba(108, 99, 255, 0.4);
}
.badge.erledigt {
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.kv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.kv div {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 0.85rem;
  background: rgba(2, 2, 8, 0.35);
}
.kv .k {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.goods { margin: 8px 0; font-size: 0.9rem; }
.goods li { margin-left: 18px; color: #cbd5e1; padding: 2px 0; }

.message {
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  background: rgba(2, 2, 8, 0.4);
  border: 1px solid var(--border);
  line-height: 1.55;
  white-space: pre-wrap;
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
}
.empty-link { color: var(--accent); }

/* ===== Admin ===== */
.hint { color: var(--muted); font-size: 0.8rem; margin-top: 7px; line-height: 1.45; }
.hint code {
  background: rgba(108, 99, 255, 0.14);
  color: #c7d2fe;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.85em;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

header.page-header-admin { margin-bottom: 22px; }

/* Accessibility */
a:focus-visible,
button:focus-visible,
.chip:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .site-back:hover,
  .submit:hover,
  .card:hover,
  button:hover { transform: none; }
}
