:root {
  --ink: #f0f0ef;
  --paper: #0a0b0c;
  --card: #26282c;
  --line: #3a3c40;
  --accent: #c47a4f;
  --accent-dark: #050606;
  --warn: #e07452;
  --muted: #9a9d9f;
  --radius: 10px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  color: #fff;
}

.topbar .brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.3rem;
  display: flex;
  align-items: baseline;
  gap: 0;
}

.topbar .logo-mark { display: flex; align-items: baseline; gap: 2px; font-size: 1.55rem; line-height: 1; }
.topbar .logo-mark .bold { font-weight: 800; color: #f4f4f3; }
.topbar .logo-mark .slash { color: var(--accent); font-weight: 400; margin: 0 2px; transform: skewX(-15deg); display: inline-block; }
.topbar .logo-mark .thin { font-weight: 300; color: #9a9d9f; }
.topbar .brand .topbar-sub {
  font-weight: 400;
  opacity: 0.75;
  margin-left: 12px;
  font-size: 1.05rem;
}

.topbar .brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #c47a4f;
  display: inline-block;
}

.topbar .who {
  font-size: 0.85rem;
  opacity: 0.9;
  display: flex;
  gap: 14px;
  align-items: center;
}

.topbar button.logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
}
.topbar button.logout:hover { background: rgba(255,255,255,0.12); }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 12px; }
p.lead { color: var(--muted); margin-top: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--ink);
}

input, select, textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.95rem;
  margin-bottom: 14px;
  background: #fdf6d8;
  color: #1c1a10;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196,122,79,0.2);
}
input::placeholder, textarea::placeholder { color: #8a8365; }
select option { background: #fdf6d8; color: #1c1a10; }
input[readonly] { background: #eee5c0; color: #4a4530; cursor: default; }

/* Verhindert, dass der Browser seine eigene Autofill-Farbe reindrückt */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fdf6d8 inset;
  -webkit-text-fill-color: #1c1a10;
}

button.primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: 7px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
button.primary:hover { background: #8f512f; }
button.primary:disabled { opacity: 0.5; cursor: default; }

button.secondary {
  background: transparent;
  border: 1px solid var(--line);
  padding: 9px 16px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ink);
}

.readout {
  background: #1f1a16;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.9rem;
  margin-bottom: 14px;
  color: var(--ink);
}
.readout b { color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge.offen { background: #3a2a1c; color: #e8a978; }
.badge.erledigt { background: #22301f; color: #9bcf8a; }
.badge.storniert { background: #33201f; color: #d98a80; text-decoration: line-through; }

.checkbox-list {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  margin-bottom: 14px;
  max-height: 160px;
  overflow-y: auto;
  background: #0f1113;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 400;
  padding: 5px 0;
  margin-bottom: 0;
  color: var(--ink);
  cursor: pointer;
}
.checkbox-item input { width: auto; margin: 0; }

.auftrag-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  background: var(--card);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.auftrag-item:hover { border-color: var(--accent); box-shadow: 0 3px 12px rgba(0,0,0,0.4); }
.auftrag-item h3 { margin: 0 0 6px; font-size: 1rem; }
.auftrag-item .meta { color: var(--muted); font-size: 0.85rem; }

canvas.sigpad {
  border: 1px dashed var(--accent);
  border-radius: 8px;
  width: 100%;
  height: 160px;
  touch-action: none;
  background: #fff;
}

.msg { padding: 10px 14px; border-radius: 7px; font-size: 0.88rem; margin-bottom: 14px; }
.msg.error { background: #3a1f18; color: #f0937a; }
.msg.success { background: #22301f; color: #9bcf8a; }

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #0a0b0c;
}
.login-box {
  width: 100%;
  max-width: 400px;
  background: #16181b;
  border: 1px solid #2a2d30;
  border-radius: var(--radius);
  padding: 40px 34px;
}
.login-logo {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: 1.7rem;
  margin-bottom: 6px;
  line-height: 1;
}
.login-logo .bold { font-weight: 800; color: #f4f4f3; letter-spacing: -0.01em; }
.login-logo .slash { color: var(--accent); font-weight: 400; margin: 0 1px; transform: skewX(-15deg); display: inline-block; }
.login-logo .thin { font-weight: 300; color: #9a9d9f; }
.login-box .eyebrow {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.login-box p.lead { margin-bottom: 22px; color: #9a9d9f; }
.login-box label { color: #c7c8c9; }
.login-box input {
  background: #fdf6d8;
  border: 1px solid #2a2d30;
  color: #1c1a10;
}
.login-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168,98,60,0.25);
}
.login-box input::placeholder { color: #8a8365; }
.login-box .small { color: #75787a; }
.login-box .small a.link { color: #c7c8c9; }

.hidden { display: none !important; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px 4px;
  margin-right: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab-btn.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 960px) { .stats-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .stats-row { grid-template-columns: 1fr; } }
.stat-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.stat-sub {
  font-size: 0.82rem;
  color: var(--accent);
  margin-top: 2px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.dashboard-tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, transform 0.15s;
}
.dashboard-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.dashboard-tile-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}
.dashboard-tile h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}
.dashboard-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}
.small { font-size: 0.8rem; color: var(--muted); }
a.link { color: var(--ink); text-decoration: underline; cursor: pointer; }
