/* ServicePoint — internes Bearbeitungs-UI */
:root {
  --bg: #F5F4F1;
  --surface: #FFFFFF;
  --ink: #23201B;
  --muted: #6F6961;
  --hairline: #E4E0D9;
  --accent: #F58220;
  --accent-ink: #AD5C0F;
  --accent-soft: #FDEEDD;
  --info: #1F6FB2;    --info-soft: #E3EFF9;
  --progress: #7A5EA8; --progress-soft: #EFEAF7;
  --wait: #9A7B0A;    --wait-soft: #FAF3D9;
  --done: #2E7D46;    --done-soft: #E4F2E9;
  --danger: #B3261E;  --danger-soft: #FBE7E5;
  --radius: 8px;
  --sidebar: 232px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Shell ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: #221E19;
  color: #D8D2C9;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  padding: 1.15rem 1.25rem 1rem;
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.sidebar .brand span { color: var(--accent); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 0 0.6rem; }
.sidebar nav a {
  color: #C9C2B8;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  font-weight: 500;
}
.sidebar nav a:hover { background: #322C25; color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--accent); color: #1D1812; }
.sidebar .nav-group {
  margin-top: 1.1rem;
  padding: 0 0.7rem 0.25rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7E766B;
}
.sidebar .foot { margin-top: auto; padding: 1rem 1.25rem; font-size: 0.8rem; color: #8B8377; border-top: 1px solid #37312A; }
.sidebar .foot form { margin-top: 0.35rem; }

.main { flex: 1; min-width: 0; padding: 1.5rem 2rem 4rem; }
.page-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.35rem; margin: 0; letter-spacing: -0.01em; }
.page-head .spacer { flex: 1; }

/* ---- Components ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.1rem;
}
.card h2 { font-size: 1rem; margin: 0 0 0.8rem; }
.card h2 small { color: var(--muted); font-weight: 400; }

.btn {
  display: inline-block;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #1D1812;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.42rem 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn.secondary { background: var(--surface); border-color: var(--hairline); color: var(--ink); }
.btn.small { font-size: 0.8rem; padding: 0.25rem 0.6rem; }
.btn.danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 0.55rem 0.8rem; border-top: 1px solid var(--hairline); vertical-align: top; }
table.list thead th { border-top: none; background: #FAF8F5; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }
table.list tbody tr:hover { background: #FCFAF7; }
.tablewrap { overflow-x: auto; }

.badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.08rem 0.55rem;
  border-radius: 99px;
  white-space: nowrap;
}
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.progress { background: var(--progress-soft); color: var(--progress); }
.badge.wait { background: var(--wait-soft); color: var(--wait); }
.badge.done { background: var(--done-soft); color: var(--done); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.neutral { background: #EFECE7; color: var(--muted); }

.flash { border-radius: var(--radius); padding: 0.7rem 1rem; margin-bottom: 1rem; font-weight: 500; }
.flash.success { background: var(--done-soft); color: var(--done); }
.flash.error { background: var(--danger-soft); color: var(--danger); }
.errors { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius); padding: 0.7rem 1rem 0.7rem 2rem; margin-bottom: 1rem; }

/* ---- Forms ---- */
form .row { display: flex; gap: 0.9rem; flex-wrap: wrap; }
form .row > .field { flex: 1 1 200px; }
.field { margin-bottom: 0.8rem; }
.field label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 0.2rem; }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="date"], .field input[type="datetime-local"], .field input[type="number"],
.field input[type="url"], .field input[type="file"], .field select, .field textarea {
  width: 100%;
  padding: 0.42rem 0.6rem;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
.field .hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.checkbox { display: flex; align-items: center; gap: 0.45rem; font-weight: 500; }

/* Tabs */
.tabs { display: flex; gap: 0.35rem; margin-bottom: 1rem; border-bottom: 1px solid var(--hairline); }
.tab {
  padding: 0.45rem 0.9rem;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active {
  background: var(--surface);
  border-color: var(--hairline);
  color: var(--ink);
  position: relative;
  top: 1px;
  border-bottom: 1px solid var(--surface);
}

/* Filterleiste */
.filters { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.filters .field { margin: 0; }
.filters .field input, .filters .field select { width: auto; min-width: 130px; }

/* ---- Ticket-Detail ---- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1.1rem; align-items: start; }
@media (max-width: 1000px) { .detail-grid { grid-template-columns: 1fr; } }
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0; }
dl.meta dt { color: var(--muted); font-size: 0.82rem; }
dl.meta dd { margin: 0; word-break: break-word; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid var(--hairline); margin-left: 0.4rem; }
.timeline li:last-child { padding-bottom: 0.2rem; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px; top: 0.3rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
}
.timeline .when { font-size: 0.78rem; color: var(--muted); }
.timeline .what { font-weight: 600; font-size: 0.88rem; }
.timeline .body { white-space: pre-wrap; margin-top: 0.15rem; }

.status-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.6rem 0; }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: #221E19; }
.login-card { background: var(--surface); border-radius: 12px; padding: 2.2rem 2.4rem; width: min(400px, 92vw); }
.login-card h1 { margin: 0 0 0.2rem; font-size: 1.4rem; }
.login-card h1 span { color: var(--accent); }
.login-card p.sub { color: var(--muted); margin: 0 0 1.4rem; font-size: 0.9rem; }

.pagination { display: flex; gap: 0.3rem; margin-top: 1rem; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 0.25rem 0.65rem; border: 1px solid var(--hairline); border-radius: 6px; background: var(--surface); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #1D1812; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  cursor: pointer;
}
.chip:hover { background: var(--accent); color: #1D1812; }

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; font-family: Consolas, monospace; font-size: 0.9em; }
