/* ==========================================================================
 *  Service-Dispo (Webversion) — Samsung-HME-Design, moderne Ausbaustufe
 *  Hell, monochrom, Poppins — dunkle Sidebar als Kontrast, weiche Tiefe.
 * ========================================================================== */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../vendor/fonts/poppins-500.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../vendor/fonts/poppins-600.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../vendor/fonts/poppins-700.woff2") format("woff2");
}

:root {
  --brand: #000000;
  --brand-dark: #2a2a2a;
  --brand-light: #ededed;
  --ok: #111111;
  --ok-light: #e7e7e7;
  --danger: #c0392b;
  --bg: #f5f5f6;
  --card: #ffffff;
  --text: #101013;
  --muted: #71717a;
  --faint: #a6a6ae;
  --border: #ebebee;
  --radius: 20px;
  --radius-s: 12px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(16, 16, 19, 0.04), 0 8px 24px rgba(16, 16, 19, 0.05);
  --shadow-lift: 0 2px 6px rgba(16, 16, 19, 0.06), 0 16px 36px rgba(16, 16, 19, 0.10);
  --sidebar-w: 244px;
  --topbar-h: 66px;
  --font-display: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Ampel */
  --amp-rot: #e5493a;
  --amp-gelb: #f0a53b;
  --amp-gruen: #34a45c;
  /* Status-Töne (Donut / Kachel-Akzente) */
  --st-neu: #111111;
  --st-ersatzteil: #e5493a;
  --st-zugeordnet: #5b5b63;
  --st-geplant: #a3a3ab;
  --st-erledigt: #dcdce0;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(900px 420px at 85% -8%, rgba(255, 255, 255, 0.9), transparent 65%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
a { color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d6d6db; border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* Einblend-Animation der Inhalte (Tabelle ausgenommen: bleibt beim Tippen ruhig) */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
.content > * { animation: fadeUp 0.32s ease both; }
.content > *:nth-child(2) { animation-delay: 0.04s; }
.content > *:nth-child(3) { animation-delay: 0.08s; }
.content > *:nth-child(4) { animation-delay: 0.12s; }
.content > .table-card, .content > .toolbar { animation: none; }

/* ==========================================================================
 *  App-Shell: dunkle Sidebar + helle Hauptspalte
 * ========================================================================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
/* Anmeldeansicht: Sidebar/Topbar sind ausgeblendet — volle Breite fürs Login */
.app.anmeldung { grid-template-columns: 1fr; }
.app.anmeldung .content { max-width: none; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #0d0d10;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 20px; }
.brand-mark {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: #fff;
  color: #0d0d10;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  display: flex; align-items: center; justify-content: center;
}
.brand-txt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: #fff;
}
.brand-txt span { display: block; font-size: 0.72rem; font-weight: 500; color: #83838d; letter-spacing: 0.02em; }

.nav { flex: 1; overflow-y: auto; padding: 4px 0; }
.nav::-webkit-scrollbar-thumb { border-color: #0d0d10; background: #2c2c33; }
.nav-sec {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #55555f;
  margin: 18px 12px 7px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 13px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.89rem;
  color: #9d9da7;
  text-decoration: none;
  margin-bottom: 3px;
  transition: background 0.14s ease, color 0.14s ease, transform 0.14s ease;
}
.nav a svg { width: 19px; height: 19px; flex: 0 0 auto; opacity: 0.85; }
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a.on { background: #fff; color: #0d0d10; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.nav a.on svg { opacity: 1; }
.nav a[data-soon] { opacity: 0.45; }
.nav-count {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: var(--pill);
  padding: 1px 9px;
  font-variant-numeric: tabular-nums;
}
.nav a.on .nav-count { background: #0d0d10; color: #fff; }

.side-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  padding: 14px 10px 2px;
  font-size: 0.74rem;
  color: #83838d;
  font-weight: 600;
  line-height: 1.5;
}
.foot-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amp-gruen); box-shadow: 0 0 0 3px rgba(52, 164, 92, 0.25); margin-right: 5px; }
.foot-sub { font-weight: 400; color: #55555f; }

/* ---------- Topbar ---------- */
.maincol { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  background: rgba(245, 245, 246, 0.72);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid rgba(16, 16, 19, 0.05);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
}
.burger {
  display: none;
  background: #fff;
  border: none;
  width: 40px; height: 40px;
  border-radius: var(--pill);
  cursor: pointer;
  align-items: center; justify-content: center;
  color: var(--text);
  box-shadow: var(--shadow);
}
.burger svg { width: 20px; height: 20px; }
.tb-search {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: var(--pill);
  padding: 10px 18px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease;
}
.tb-search:focus-within { box-shadow: var(--shadow-lift), 0 0 0 1.5px #111; }
.tb-search svg { width: 16px; height: 16px; color: var(--faint); flex: 0 0 auto; }
.tb-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
}
.tb-search input::placeholder { color: var(--faint); }
.beta-pill {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--danger);
  background: rgba(192, 57, 43, 0.09);
  border-radius: var(--pill);
  padding: 5px 12px;
}
.bell {
  position: relative;
  background: #fff;
  border: none;
  width: 42px; height: 42px;
  border-radius: var(--pill);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.bell:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.bell svg { width: 19px; height: 19px; }
.bell-dot {
  position: absolute;
  top: 5px; right: 5px;
  min-width: 17px; height: 17px;
  border-radius: var(--pill);
  background: var(--amp-rot);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
}
.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(140deg, #2a2a2e, #0d0d10);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}

/* ---------- Content ---------- */
.content {
  flex: 1;
  padding: 26px 30px 70px;
  max-width: 1280px;
  width: 100%;
}

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head .ph-txt { flex: 1; min-width: 220px; }
.crumb {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--faint);
  margin-bottom: 4px;
}
.crumb a { text-decoration: none; color: var(--muted); }
.crumb a:hover { color: var(--text); }
.page-head h2 {
  font-family: var(--font-display);
  font-size: 1.72rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
}
.page-head .sub { color: var(--muted); font-size: 0.88rem; margin-top: 3px; }
.ph-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--pill);
  padding: 12px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  font-family: var(--font-display);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18); }
.btn-primary:hover { transform: translateY(-1.5px); box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24); }
.btn-primary:active { background: var(--brand-dark); transform: none; }
.btn-ghost { background: #ececef; color: var(--text); }
.btn-ghost:hover { background: #e2e2e6; }
.btn-outline { background: #fff; color: var(--text); border: 1.5px solid #111; }
.btn-outline:hover { background: #f5f5f6; transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 9px 16px; font-size: 0.84rem; }
.btn-row { display: flex; gap: 10px; }

/* ==========================================================================
 *  Karten & KPI-Kacheln
 * ========================================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.card h3 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h3 .h3-sub { font-family: var(--font-body); font-weight: 400; font-size: 0.76rem; color: var(--faint); margin-left: auto; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.tech-av.partner-av { background: #3d6de0; font-size: 0.85rem; }
.tile {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 15px 16px 14px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.tile.on { border-color: #111; box-shadow: 0 0 0 1.5px #111 inset, var(--shadow); }
.tile-top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.tile-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tc, var(--brand)); flex: 0 0 auto; }
.tile-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-num {
  font-family: var(--font-display);
  font-size: 2.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.tile-sub { font-size: 0.74rem; color: var(--faint); margin-top: 3px; min-height: 1.15em; }
.tile-sub b { color: var(--amp-rot); font-weight: 700; }
.tile-bar {
  margin-top: 10px;
  height: 4px;
  border-radius: var(--pill);
  background: #f0f0f3;
  overflow: hidden;
}
.tile-bar i {
  display: block;
  height: 100%;
  border-radius: var(--pill);
  background: var(--tc, var(--brand));
  transition: width 0.5s ease;
}

/* ---------- Dashboard-Raster ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.5fr;
  gap: 14px;
  margin-bottom: 14px;
}
.dash-grid2 {
  display: grid;
  grid-template-columns: 1.5fr 1.05fr;
  gap: 14px;
}

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { flex: 0 0 auto; }
.donut svg { display: block; }
.donut .dn-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  fill: var(--text);
}
.donut .dn-lbl { font-size: 0.6rem; font-weight: 700; fill: var(--faint); text-transform: uppercase; letter-spacing: 0.09em; }
.donut circle { cursor: pointer; transition: opacity 0.14s ease, stroke-width 0.14s ease; }
.donut circle:hover { opacity: 0.82; stroke-width: 19; }
.legend { flex: 1; min-width: 150px; }
.leg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 0.86rem;
  transition: background 0.12s ease;
}
.leg-row:hover { background: #f5f5f6; }
.leg-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.leg-lbl { flex: 1; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg-num { font-weight: 700; font-variant-numeric: tabular-nums; font-family: var(--font-display); }

/* Balken */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 150px;
  padding-top: 8px;
}
.bar-g { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bar-pair { display: flex; align-items: flex-end; gap: 4px; height: 100%; }
.bar-pair i {
  display: block;
  width: 14px;
  border-radius: 6px;
  min-height: 3px;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.bar-pair i:hover { opacity: 0.75; transform: scaleY(1.02); transform-origin: bottom; }
.bar-pair .b-neu { background: linear-gradient(180deg, #2a2a2e, #0d0d10); }
.bar-pair .b-erl { background: #d9d9de; }
.bar-lbl { font-size: 0.7rem; color: var(--faint); font-weight: 700; }
.bars-leg { display: flex; gap: 18px; margin-top: 12px; font-size: 0.76rem; color: var(--muted); }
.bars-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }

/* Terminliste / Feed */
.mini-list { display: flex; flex-direction: column; gap: 4px; }
.mini-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 11px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}
.mini-row:hover { background: #f5f5f6; transform: translateX(2px); }
.mini-date {
  flex: 0 0 auto;
  width: 48px;
  text-align: center;
  background: #0d0d10;
  color: #fff;
  border-radius: 13px;
  padding: 6px 0 7px;
  font-family: var(--font-display);
  line-height: 1.1;
}
.mini-date b { display: block; font-size: 1.08rem; font-weight: 700; }
.mini-date span { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #9d9da7; }
.mini-main { flex: 1; min-width: 0; }
.mini-t { font-weight: 600; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-display); }
.mini-s { font-size: 0.76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 8px 4px; font-size: 0.84rem; align-items: flex-start; }
.feed li + li { border-top: 1px solid #f2f2f4; }
.feed .f-dot { width: 7px; height: 7px; border-radius: 50%; background: #0d0d10; margin-top: 7px; flex: 0 0 auto; }
.feed .f-txt { flex: 1; min-width: 0; }
.feed .f-id { font-weight: 700; font-size: 0.76rem; color: var(--muted); cursor: pointer; font-variant-numeric: tabular-nums; }
.feed .f-id:hover { color: var(--text); text-decoration: underline; }
.feed .f-ts { flex: 0 0 auto; font-size: 0.72rem; color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 2px; }

/* ==========================================================================
 *  Auftragsliste (Tabelle)
 * ========================================================================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.seg {
  display: inline-flex;
  background: #fff;
  border-radius: var(--pill);
  padding: 4px;
  box-shadow: var(--shadow);
}
.seg button {
  border: none;
  background: none;
  border-radius: var(--pill);
  padding: 9px 18px;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s ease;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22); }

.fchips { display: flex; gap: 7px; flex-wrap: wrap; }
.fbtn {
  border: none;
  background: #fff;
  color: var(--muted);
  border-radius: var(--pill);
  padding: 8px 15px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow);
  transition: all 0.12s ease;
}
.fbtn:hover { color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.fbtn.on { background: var(--ok); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22); }
.fbtn .fb-n { opacity: 0.65; font-variant-numeric: tabular-nums; margin-left: 2px; }

.table-card { padding: 6px 6px 0; overflow: hidden; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.orders {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
.orders thead th {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--faint);
  text-align: left;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.orders thead th.sortable { cursor: pointer; transition: color 0.12s ease; }
.orders thead th.sortable:hover { color: var(--text); }
.orders thead th .arr { font-size: 0.7rem; margin-left: 3px; }
.orders tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid #f3f3f5;
  vertical-align: middle;
  font-size: 0.88rem;
}
.orders tbody tr { cursor: pointer; transition: background 0.1s ease; }
.orders tbody tr:hover { background: #f7f7f9; }
.orders tbody tr:last-child td { border-bottom: none; }

.td-id { font-weight: 700; font-size: 0.78rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.td-main b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; letter-spacing: -0.01em; }
.td-main span { font-size: 0.75rem; color: var(--faint); }
.td-prob { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.td-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.td-date .dl { display: block; font-size: 0.64rem; color: var(--faint); text-transform: uppercase; font-weight: 700; letter-spacing: 0.07em; }
.td-date.over { color: var(--amp-rot); font-weight: 700; }

.typ-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text);
  background: #f0f0f3;
  padding: 4px 11px 4px 8px;
  border-radius: var(--pill);
  white-space: nowrap;
}
.typ-tag svg { width: 14px; height: 14px; flex: 0 0 auto; }

.tech-cell { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.tech-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(140deg, #2a2a2e, #0d0d10);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.tech-cell.leer { color: var(--faint); font-style: italic; }

/* Status-Badges — weiche Tönungen */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--pill);
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.neu { background: #111; color: #fff; }
.badge.ersatzteil { background: rgba(229, 73, 58, 0.1); color: #c53a2c; }
.badge.zugeordnet { background: #ececef; color: #3c3c43; }
.badge.geplant { background: #fff; color: var(--text); box-shadow: inset 0 0 0 1.5px #111; }
.badge.inarbeit { background: rgba(240, 165, 59, 0.14); color: #a86a12; }
.badge.erledigt { background: rgba(52, 164, 92, 0.1); color: #2a7c48; }

/* Ampel */
.ampel {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.ampel.rot { background: var(--amp-rot); box-shadow: 0 0 0 4px rgba(229, 73, 58, 0.16); }
.ampel.gelb { background: var(--amp-gelb); box-shadow: 0 0 0 4px rgba(240, 165, 59, 0.16); }
.ampel.gruen { background: var(--amp-gruen); box-shadow: 0 0 0 4px rgba(52, 164, 92, 0.14); }
.ampel.grau { background: #cfcfd4; box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.04); }

/* Pagination */
.pager {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 13px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.pager .pg-info { margin-right: auto; }
.pager button {
  min-width: 32px; height: 32px;
  border: none;
  background: #f0f0f3;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease;
}
.pager button:hover { background: #e4e4e8; }
.pager button.on { background: var(--brand); color: #fff; }
.pager button:disabled { opacity: 0.35; cursor: default; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 58px 20px;
}
.empty svg { width: 44px; height: 44px; color: #d3d3d8; margin-bottom: 10px; }
.empty b { display: block; font-family: var(--font-display); margin-bottom: 3px; color: var(--text); }

/* ==========================================================================
 *  Detailansicht
 * ========================================================================== */
.detail-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 14px;
  align-items: start;
}
.detail-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 0.88rem;
  border-bottom: 1px solid #f3f3f5;
}
.kv-row:last-child { border-bottom: none; }
.kv-row .k { color: var(--muted); flex: 0 0 auto; }
.kv-row .v { font-weight: 600; text-align: right; word-break: break-word; }
.kv-row .v a { text-decoration: none; border-bottom: 1px solid #d6d6db; transition: border-color 0.12s ease; }
.kv-row .v a:hover { border-color: #111; }
.kv-row .v.leer { color: var(--faint); font-weight: 400; font-style: italic; }

.problem-text { margin: 0; white-space: pre-wrap; font-size: 0.92rem; }

/* Status-Pills */
.status-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.st-tog {
  border: none;
  background: #f0f0f3;
  color: var(--muted);
  border-radius: var(--pill);
  padding: 9px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}
.st-tog:hover { color: var(--text); transform: translateY(-1px); }
.st-tog.on { background: var(--ok); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22); }

.field-lbl { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.85rem; }
.sel, .inp {
  width: 100%;
  font-size: 15px;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-s);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.sel:focus, .inp:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06); }
textarea.inp { resize: vertical; min-height: 74px; }
select.sel {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23a6a6ae' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}

/* Ausfallstufen */
.flag-tag {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--pill);
  padding: 2px 9px;
  margin-right: 7px;
  vertical-align: 1px;
  white-space: nowrap;
}
.flag-tag.total { background: var(--amp-rot); color: #fff; box-shadow: 0 2px 8px rgba(229, 73, 58, 0.35); }
.flag-tag.krit { color: var(--amp-rot); box-shadow: inset 0 0 0 1.5px var(--amp-rot); background: rgba(229, 73, 58, 0.06); }

.ck-wrap { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ckline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-s);
  padding: 10px 13px;
  transition: all 0.12s ease;
}
.ckline input { width: 17px; height: 17px; accent-color: var(--amp-rot); flex: 0 0 auto; cursor: pointer; }
.ckline:hover { border-color: #c9c9ce; }
.ckline.krit:has(input:checked) { border-color: var(--amp-rot); background: rgba(229, 73, 58, 0.05); color: #c53a2c; }
.ckline.total:has(input:checked) { border-color: var(--amp-rot); background: var(--amp-rot); color: #fff; }
.ckline.total:has(input:checked) input { accent-color: #fff; }

/* Kundensuche (Combobox im Auftrags-Modal) */
.combo { position: relative; }
.sug {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 5px);
  z-index: 20;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}
.sug-row {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f3f3f5;
}
.sug-row:last-child { border-bottom: none; }
.sug-row:hover { background: #f5f5f6; }
.sug-row b { display: block; font-size: 0.88rem; font-family: var(--font-display); font-weight: 600; }
.sug-row span { font-size: 0.76rem; color: var(--muted); }
.sug-row.sug-neu b { color: var(--text); }
.sug-row.sug-neu { background: #fafafb; }

.pick-info {
  position: relative;
  background: #f5f5f6;
  border-radius: var(--radius-s);
  padding: 12px 40px 12px 15px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.pick-info span { color: var(--muted); font-size: 0.8rem; }
.pick-x {
  position: absolute;
  top: 10px; right: 10px;
  background: #fff;
  border: none;
  width: 26px; height: 26px;
  border-radius: var(--pill);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  box-shadow: var(--shadow);
}

/* Kundenstamm */
.such-inp {
  max-width: 440px;
  border-radius: var(--pill);
  padding: 11px 18px;
  border: none;
  box-shadow: var(--shadow);
}
.such-inp:focus { box-shadow: var(--shadow-lift), 0 0 0 1.5px #111; }
.hlink { font-size: 0.78rem; font-weight: 600; color: var(--muted); cursor: pointer; text-decoration: none; }
.hlink:hover { color: var(--text); }
.order-go { color: #c9c9ce; font-size: 1.5rem; line-height: 1; }

.geraet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid #f3f3f5;
}
.geraet-ic {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: #0d0d10;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.geraet-ic svg { width: 20px; height: 20px; }
.geraet-main { flex: 1; min-width: 0; }
.geraet-t { font-weight: 600; font-size: 0.9rem; font-family: var(--font-display); }
.geraet-s { font-size: 0.76rem; color: var(--muted); }
.geraet-inst { flex: 0 0 auto; text-align: right; }
.geraet-inst .dl { display: block; font-size: 0.62rem; color: var(--faint); text-transform: uppercase; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 3px; }
.inst-inp { width: 150px; padding: 7px 9px; font-size: 0.84rem; }
.add-geraet { margin-top: 14px; padding-top: 4px; }
.section-mini {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--faint);
  margin: 6px 0 2px;
}

/* Revisions- / Folge-Kennzeichnung */
.rev-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #f0f0f3;
  border-radius: var(--pill);
  padding: 2px 8px;
  vertical-align: 1px;
}

/* Historie / Revisionen (Detailansicht) */
.hist-list { display: flex; flex-direction: column; gap: 4px; }
.hist-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}
.hist-row:hover { background: #f5f5f6; transform: translateX(2px); }
.hist-row.cur { background: #f5f5f6; box-shadow: inset 0 0 0 1.5px #111; cursor: default; }
.hist-row.cur:hover { transform: none; }
.hist-id {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: #0d0d10;
  color: #fff;
  border-radius: 9px;
  padding: 4px 9px;
  white-space: nowrap;
}
.hist-main { flex: 1; min-width: 0; }
.hist-t { font-weight: 600; font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-s { font-size: 0.74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-row .badge { flex: 0 0 auto; }
.hist-leer { color: var(--faint); font-size: 0.86rem; font-style: italic; padding: 4px 2px; }

/* Ersatzteile am Auftrag */
.teil-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 2px;
  border-bottom: 1px solid #f3f3f5;
  flex-wrap: wrap;
}
.teil-row:last-of-type { border-bottom: none; }
.teil-main { flex: 1; min-width: 140px; }
.teil-t { font-weight: 600; font-size: 0.86rem; font-family: var(--font-display); }
.teil-s { font-size: 0.74rem; color: var(--muted); }
.teil-tag {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #f0f0f3;
  border-radius: var(--pill);
  padding: 3px 9px;
  white-space: nowrap;
}
.teil-tag.ok { background: rgba(52, 164, 92, 0.12); color: #2a7c48; }
.teil-x {
  border: none;
  background: #f0f0f3;
  color: var(--muted);
  width: 24px; height: 24px;
  border-radius: var(--pill);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}
.teil-x:hover { background: #e4e4e8; color: var(--danger); }
.teil-form {
  display: grid;
  grid-template-columns: 1.6fr 1fr 0.6fr;
  gap: 8px;
  margin-top: 10px;
}
.teil-form .btn { grid-column: 1 / -1; }

/* Servicebericht (aus der Techniker-App) */
.bericht-karte { border-color: rgba(52, 164, 92, 0.4); }
.bericht-text {
  font-size: 0.88rem;
  white-space: pre-wrap;
  background: #fafafb;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0;
}
.bericht-text b {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
  margin-bottom: 3px;
}
.bericht-text.intern { background: #fdf6ec; }
.sig-bild {
  max-width: 220px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 8px;
  background: #fff;
}

/* Folgeauftrag-Hinweis im Modal */
.folge-info {
  background: #f5f5f6;
  border-radius: var(--radius-s);
  padding: 13px 15px;
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 4px;
}
.folge-info span { color: var(--muted); font-size: 0.82rem; }

/* Status-Zeile + Timeline-Badges */
.status-akt {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f3f5;
  margin-bottom: 2px;
}
.zu-zeile .field-lbl { margin: 12px 0 6px; }

/* Partner-Dropdown in der Dashboard-Kachel */
.tile-sel {
  width: 100%;
  margin-top: 3px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}
.tl-badge { font-size: 0.62rem; padding: 2px 8px; margin-right: 7px; vertical-align: 1px; }

/* Nummerierte Timeline */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; display: flex; gap: 14px; padding-bottom: 17px; }
.tl li::before {
  content: "";
  position: absolute;
  left: 13px; top: 30px; bottom: 3px;
  width: 2px;
  border-radius: 2px;
  background: #ececef;
}
.tl li:last-child { padding-bottom: 2px; }
.tl li:last-child::before { display: none; }
.tl-num {
  flex: 0 0 auto;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: #f0f0f3;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
  font-variant-numeric: tabular-nums;
}
.tl li.cur .tl-num { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
.tl-body { flex: 1; min-width: 0; padding-top: 2px; }
.tl-ts { font-size: 0.72rem; color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; }
.tl-tx { font-size: 0.88rem; }

/* ==========================================================================
 *  Modal / Overlay / Toast
 * ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(13, 13, 16, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px 16px;
  overflow-y: auto;
  animation: fadeIn 0.16s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 620px;
  animation: popIn 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes popIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 24px 0;
}
.modal-head h3 { font-family: var(--font-display); font-size: 1.18rem; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.modal-x {
  background: #f0f0f3;
  border: none;
  width: 36px; height: 36px;
  border-radius: var(--pill);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.12s ease;
}
.modal-x:hover { background: #e4e4e8; }
.modal-body { padding: 8px 24px 4px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 24px 22px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 120;
  background: #16161a;
  color: #fff;
  padding: 13px 20px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 88%;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.3);
  animation: toastIn 0.2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }
.toast.err { background: var(--danger); }
.toast.ok { background: #16161a; }

/* ==========================================================================
 *  Anmeldung
 * ========================================================================== */
.login-wrap {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lift);
  padding: 30px 28px 24px;
  text-align: center;
}
.login-logo {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: #0d0d10;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.login-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.login-sub { color: var(--muted); font-size: 0.86rem; margin-bottom: 18px; }
.login-card .field-lbl { text-align: left; }
.login-hinweis {
  background: #f5f5f6;
  border-radius: var(--radius-s);
  padding: 9px 12px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.login-rollen { font-size: 0.74rem; color: var(--faint); margin-top: 14px; }

/* ==========================================================================
 *  Responsive
 * ========================================================================== */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .dash-grid, .dash-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 940px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: min(280px, 84vw);
    height: 100vh;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.45);
  }
  .sidebar.open { transform: none; }
  .burger { display: flex; }
  .side-veil {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(13, 13, 16, 0.4);
    backdrop-filter: blur(3px);
  }
  .detail-grid { grid-template-columns: 1fr; }
  .content { padding: 18px 14px 56px; }
  .beta-pill { display: none; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tb-search input { font-size: 16px; }
}
