:root {
  --orange: #EB7802;
  --orange-dark: #E65300;
  --orange-soft: #FFF1E3;
  --ink: #1C1C1C;
  --anthrazit: #33373D;
  --anthrazit-2: #3F444B;
  --text: #333333;
  --muted: #6B6F76;
  --line: #E4E4E4;
  --bg: #F3F3F3;
  --card: #FFFFFF;
  --ok: #23924A;
  --ok-soft: #E5F5EA;
  --bad: #D2301F;
  --bad-soft: #FDE8E5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --top: 60px;
  --bottom: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--orange-dark); }
img { max-width: 100%; }
[hidden] { display: none !important; }
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 30;
  background: #fff; border-bottom: 3px solid var(--orange);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { height: 34px; width: auto; display: block; }
.brand .appname { font-weight: 800; font-size: 19px; letter-spacing: -.2px; white-space: nowrap; }
.brand .appname span { color: var(--orange); }
.brand .sep { width: 1px; height: 26px; background: var(--line); }
.topbar .spacer { flex: 1; }
.userchip {
  display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer;
  padding: 6px 8px; border-radius: 10px; color: var(--anthrazit);
}
.userchip:hover { background: var(--bg); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--anthrazit); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none;
}
.role-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  background: var(--orange-soft); color: var(--orange-dark); padding: 2px 7px; border-radius: 999px; }

/* ---------- Navigation ---------- */
.layout { padding-top: var(--top); min-height: 100%; }
.sidenav { display: none; }
.bottomnav {
  position: fixed; inset: auto 0 0 0; z-index: 30; background: var(--anthrazit);
  height: calc(var(--bottom) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex;
}
.bottomnav a, .sidenav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #C9CCD1; text-decoration: none; font-size: 11.5px; font-weight: 600; position: relative;
}
.bottomnav a.active { color: #fff; }
.bottomnav a.active::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px;
  background: var(--orange); border-radius: 0 0 3px 3px; }
.nav-ico { width: 24px; height: 24px; }
.dot { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; }
main { padding: 16px 16px calc(var(--bottom) + var(--safe-b) + 24px); max-width: 1000px; margin: 0 auto; }

@media (min-width: 900px) {
  .sidenav {
    display: flex; flex-direction: column; gap: 4px; position: fixed; top: var(--top); bottom: 0; left: 0;
    width: 220px; background: var(--anthrazit); padding: 16px 10px;
  }
  .sidenav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px;
    border-radius: 10px; font-size: 15px; }
  .sidenav a:hover { background: var(--anthrazit-2); color: #fff; }
  .sidenav a.active { background: var(--orange); color: #fff; }
  .sidenav .dot { position: static; margin-left: auto; }
  .sidenav .navsep { height: 1px; background: rgba(255,255,255,.1); margin: 8px 6px; }
  .bottomnav { display: none; }
  .layout { padding-left: 220px; }
  main { padding: 24px 28px 40px; }
}

/* ---------- Grundelemente ---------- */
h1 { font-size: 24px; margin: 4px 0 16px; color: var(--ink); letter-spacing: -.3px; }
h2 { font-size: 18px; margin: 24px 0 10px; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.pagehead { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pagehead h1 { margin: 0; flex: 1; min-width: 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.stack > * + * { margin-top: 12px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 700; cursor: pointer;
  background: #E9EAEC; color: var(--anthrazit); min-height: 44px; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); filter: none; }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 36px; padding: 7px 12px; font-size: 14px; border-radius: 9px; }
.btn-icon { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 10px; }
.btn-block { width: 100%; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--anthrazit); }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid #D5D7DB; background: #fff; border-radius: 11px; padding: 11px 13px;
  min-height: 46px; outline: none;
}
.input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(235,120,2,.15); }
textarea.input { resize: vertical; min-height: 80px; }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--orange); }
.error-msg { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: 10px;
  margin-bottom: 14px; font-weight: 600; font-size: 14px; }

/* ---------- Login ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px;
  background: linear-gradient(160deg, var(--anthrazit) 0%, var(--ink) 100%); }
.auth .card { width: 100%; max-width: 400px; padding: 28px 24px; }
.auth .logo { display: block; max-height: 64px; margin: 0 auto 10px; }
.auth .title { text-align: center; font-size: 26px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.auth .title span { color: var(--orange); }
.auth .sub { text-align: center; color: var(--muted); margin-bottom: 22px; font-size: 14px; }

/* ---------- Fahrzeugkarten ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.vcard {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
  text-decoration: none; color: inherit; display: flex; gap: 14px; align-items: center;
  border-left: 5px solid var(--orange); transition: transform .08s;
}
.vcard:active { transform: scale(.985); }
.vcard .vico { width: 48px; height: 48px; border-radius: 12px; background: var(--orange-soft); color: var(--orange-dark);
  display: grid; place-items: center; flex: none; }
.vcard .vcode { font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: -.3px; }
.vcard .vname { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.gray { background: #ECEDEF; color: var(--muted); }

/* ---------- Fahrzeugseite ---------- */
.vhead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.vhead .back { flex: none; }
.vhead .t { flex: 1; min-width: 0; }
.vhead .t .code { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.vhead .t .sub { color: var(--muted); font-size: 14px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px 6px;
  scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 9px 15px; border-radius: 999px; background: #fff; color: var(--anthrazit);
  text-decoration: none; font-weight: 700; font-size: 14.5px; box-shadow: var(--shadow); display: flex; gap: 6px;
  align-items: center; border: 0; cursor: pointer; }
.tab.active { background: var(--anthrazit); color: #fff; }
.tab.add { background: var(--orange-soft); color: var(--orange-dark); box-shadow: none; }
.tab .cnt { background: var(--bad); color: #fff; border-radius: 9px; font-size: 11px; padding: 1px 6px; }

/* ---------- Material ---------- */
.items { display: flex; flex-direction: column; gap: 10px; }
.item { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px;
  display: flex; gap: 12px; align-items: center; border-left: 5px solid #D5D7DB; }
.item.vorhanden { border-left-color: var(--ok); }
.item.fehlt { border-left-color: var(--bad); background: #FFFAF9; }
.item .img { width: 72px; height: 72px; border-radius: 10px; background: #EEF0F2 center/cover no-repeat;
  flex: none; cursor: zoom-in; display: grid; place-items: center; color: #A3A7AD; }
.item .info { flex: 1; min-width: 0; }
.item .name { font-weight: 700; font-size: 16.5px; color: var(--ink); }
.item .note { font-size: 13.5px; color: var(--muted); }
.item .who { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.item .acts { display: flex; gap: 8px; flex: none; }
.sbtn { border: 2px solid transparent; border-radius: 11px; min-width: 52px; min-height: 48px; padding: 6px 10px;
  font-weight: 800; cursor: pointer; background: #F1F2F4; color: var(--muted); display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 11.5px; gap: 1px; }
.sbtn .s { font-size: 19px; line-height: 1; }
.sbtn.ok.on { background: var(--ok); color: #fff; }
.sbtn.bad.on { background: var(--bad); color: #fff; }
.sbtn.ok:not(.on):hover { border-color: var(--ok); color: var(--ok); }
.sbtn.bad:not(.on):hover { border-color: var(--bad); color: var(--bad); }
.adminrow { display: flex; gap: 6px; }
@media (max-width: 520px) {
  .item { flex-wrap: wrap; }
  .item .acts { width: 100%; }
  .item .acts .sbtn { flex: 1; flex-direction: row; gap: 8px; font-size: 14px; }
}

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  height: calc(100dvh - var(--top) - var(--bottom) - var(--safe-b) - 150px); min-height: 340px; overflow: hidden; }
@media (min-width: 900px) { .chat { height: calc(100dvh - var(--top) - 170px); } }
.msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px;
  background: #F7F7F8; }
.day { align-self: center; font-size: 12px; font-weight: 700; color: var(--muted); background: #E9EAEC;
  padding: 3px 10px; border-radius: 999px; margin: 8px 0; }
.msg { max-width: 82%; align-self: flex-start; background: #fff; border-radius: 14px 14px 14px 4px; padding: 8px 11px;
  box-shadow: 0 1px 1px rgba(0,0,0,.06); position: relative; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--orange-soft); border-radius: 14px 14px 4px 14px; }
.msg .from { font-size: 12.5px; font-weight: 800; color: var(--orange-dark); margin-bottom: 2px; }
.msg .text { white-space: pre-wrap; }
.msg .time { font-size: 11px; color: var(--muted); text-align: right; margin-top: 3px; }
.msg .pic { display: block; border-radius: 10px; max-height: 260px; max-width: 100%; cursor: zoom-in; margin: 2px 0 4px; }
.msg .filebox { display: flex; gap: 10px; align-items: center; background: rgba(0,0,0,.04); border-radius: 10px;
  padding: 8px 10px; text-decoration: none; color: var(--ink); margin-bottom: 4px; }
.msg .filebox .fi { width: 36px; height: 36px; border-radius: 8px; background: var(--anthrazit); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; }
.msg.deleted .text { font-style: italic; color: var(--muted); }
.msg .del { position: absolute; top: 4px; right: 4px; display: none; border: 0; background: rgba(0,0,0,.06);
  border-radius: 6px; width: 24px; height: 24px; cursor: pointer; color: var(--bad); }
.msg:hover .del { display: block; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; background: #fff; }
.composer textarea { flex: 1; resize: none; border: 1.5px solid #D5D7DB; border-radius: 22px; padding: 10px 15px;
  max-height: 140px; min-height: 44px; outline: none; }
.composer textarea:focus { border-color: var(--orange); }
.composer .btn-icon { border-radius: 50%; width: 44px; height: 44px; flex: none; }
.attach-preview { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--orange-soft);
  font-size: 14px; }
.attach-preview img { height: 48px; border-radius: 6px; }

/* ---------- Listen / Tabellen ---------- */
.list { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list .li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit; }
.list .li:last-child { border-bottom: 0; }
.list .li .thumb { width: 48px; height: 48px; border-radius: 9px; background: #EEF0F2 center/cover; flex: none; }
.group-title { font-weight: 800; color: var(--ink); margin: 18px 0 8px; display: flex; gap: 8px; align-items: center; }

/* ---------- Dialog ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,22,25,.55); z-index: 100; display: flex;
  align-items: flex-end; justify-content: center; }
.dialog { background: #fff; width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 20px 18px
  calc(18px + var(--safe-b)); max-height: 92dvh; overflow-y: auto; animation: up .18s ease-out; }
@media (min-width: 600px) { .overlay { align-items: center; } .dialog { border-radius: 18px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.dialog h3 { margin: 0 0 16px; font-size: 20px; color: var(--ink); }
.dialog .actions { display: flex; gap: 10px; margin-top: 6px; }
.dialog .actions .btn { flex: 1; }
.imgpick { display: flex; gap: 12px; align-items: center; }
.imgpick .prev { width: 84px; height: 84px; border-radius: 12px; background: #EEF0F2 center/cover; display: grid;
  place-items: center; color: #A3A7AD; flex: none; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 200; display: grid; place-items: center;
  cursor: zoom-out; padding: 12px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }
.menu { position: absolute; z-index: 50; background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.18);
  padding: 6px; min-width: 210px; }
.menu button { display: flex; width: 100%; text-align: left; border: 0; background: none; padding: 11px 12px;
  border-radius: 8px; cursor: pointer; gap: 10px; align-items: center; }
.menu button:hover { background: var(--bg); }
.menu button.danger { color: var(--bad); }

.toast { position: fixed; left: 50%; bottom: calc(var(--bottom) + var(--safe-b) + 16px); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 300; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

.hero { background: linear-gradient(120deg, var(--anthrazit), var(--ink)); color: #fff; border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  border: 18px solid rgba(235,120,2,.35); }
.hero .hi { font-size: 22px; font-weight: 800; }
.hero .d { color: #C9CCD1; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; text-decoration: none;
  color: inherit; }
.stat .n { font-size: 28px; font-weight: 800; color: var(--ink); }
.stat .l { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat.bad .n { color: var(--bad); }
.changes { margin: 6px 0 0; padding-left: 20px; }
.changes li { margin: 3px 0; }
.dropzone { border: 2px dashed #CFD2D6; border-radius: var(--radius); padding: 22px; text-align: center; background: #FAFAFA;
  cursor: pointer; }
.dropzone.drag { border-color: var(--orange); background: var(--orange-soft); }
.spin { width: 38px; height: 38px; border-radius: 50%; border: 4px solid #eee; border-top-color: var(--orange);
  animation: rot 1s linear infinite; margin: 0 auto 10px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- 1.1.0: Projekte, Chats ---------- */
.pill.new { background: var(--orange); color: #fff; }
.stat.new .n { color: var(--orange-dark); }
.vcard.pcard { border-left-color: var(--anthrazit); }
.vcard.pcard .vico { background: #E9EAEC; color: var(--anthrazit); }
.vcard.done { opacity: .75; }
.vcard .vcode { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.gimg { aspect-ratio: 1; border-radius: 10px; background: #EEF0F2 center/cover no-repeat; cursor: zoom-in; box-shadow: var(--shadow); }
.list .li .avatar svg { width: 18px; height: 18px; }
.bottomnav a span { white-space: nowrap; }

/* ---------- 1.2.0: Mitarbeiter-Startseite ---------- */
.staff-hero { background: linear-gradient(125deg, var(--orange) 0%, var(--orange-dark) 100%); color: #fff;
  border-radius: 18px; padding: 22px 20px; margin-bottom: 16px; position: relative; overflow: hidden;
  box-shadow: 0 8px 24px rgba(230,83,0,.25); }
.staff-hero::after { content: ""; position: absolute; right: -30px; bottom: -50px; width: 170px; height: 170px;
  border-radius: 50%; border: 20px solid rgba(255,255,255,.14); }
.staff-hero .hi { font-size: 24px; font-weight: 800; }
.staff-hero .d { opacity: .9; font-size: 14px; margin-top: 2px; }
.hero-badge { display: inline-block; margin-top: 12px; background: rgba(255,255,255,.2); padding: 6px 12px;
  border-radius: 999px; font-weight: 700; font-size: 14px; }
.hero-badge.on { background: #fff; color: var(--orange-dark); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 6px; }
.qa { background: #fff; border: 0; border-radius: 16px; box-shadow: var(--shadow); padding: 14px 8px; text-align: center;
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: 13.5px; cursor: pointer; display: flex;
  flex-direction: column; align-items: center; gap: 6px; line-height: 1.2; }
.qa:active { transform: scale(.97); }
.qa .qi { width: 46px; height: 46px; border-radius: 14px; background: var(--orange-soft); display: grid; place-items: center;
  font-size: 24px; }
.allread { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--muted); }
.site { background: #fff; border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; border-left: 5px solid var(--anthrazit); }
.site.car { border-left-color: var(--orange); }
.site-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 10px; text-decoration: none; color: inherit; }
.site-head .vico { width: 42px; height: 42px; border-radius: 12px; background: var(--orange-soft); color: var(--orange-dark);
  display: grid; place-items: center; flex: none; }
.site-name { font-weight: 800; font-size: 17px; color: var(--ink); }
.site-acts { display: flex; border-top: 1px solid var(--line); }
.sa { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 6px; text-decoration: none;
  color: var(--anthrazit); font-weight: 700; font-size: 14px; }
.sa + .sa { border-left: 1px solid var(--line); }
.sa:active { background: var(--bg); }
.sa svg { width: 18px; height: 18px; color: var(--orange-dark); }
.qp-prev { height: 180px; border-radius: 14px; border: 2px dashed #CFD2D6; background: #FAFAFA center/cover no-repeat;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted);
  font-weight: 600; cursor: pointer; }
.qp-prev.has { border-style: solid; border-color: var(--orange); }

/* ---------- 1.2.0: Dateiablage ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 700; }
.crumbs a { color: var(--anthrazit); text-decoration: none; }
.crumbs a:last-child { color: var(--orange-dark); }
.crumbs span { color: var(--muted); }
.ficon { width: 42px; height: 42px; border-radius: 10px; background: var(--anthrazit); color: #fff; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; flex: none; }
.ficon.folder { background: var(--orange-soft); font-size: 22px; }
.ficon.up { background: #ECEDEF; color: var(--muted); }
.progress { height: 12px; background: #ECEDEF; border-radius: 6px; overflow: hidden; }
.pfill { height: 100%; width: 0; background: var(--orange); transition: width .2s; }
.dragging { outline: 3px dashed var(--orange); outline-offset: 6px; border-radius: 12px; }
@media (max-width: 520px) { .hide-sm { display: none; } }

/* ---------- 1.3.0: Projektfarben ---------- */
.vcard.pcard.colored { border-left-color: var(--pc);
  background: linear-gradient(100deg, color-mix(in srgb, var(--pc) 10%, #fff) 0%, #fff 65%); }
.vcard.pcard.colored .vico { background: color-mix(in srgb, var(--pc) 16%, #fff); color: var(--pc); }
.site.colored { border-left-color: var(--pc); }
.site.colored .site-head { background: linear-gradient(100deg, color-mix(in srgb, var(--pc) 10%, #fff) 0%, #fff 70%); }
.vhead.colored { border-left: 5px solid var(--pc); padding-left: 10px; border-radius: 4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #D5D7DB; cursor: pointer;
  padding: 0; display: grid; place-items: center; font-size: 14px; color: var(--muted); background: #fff; position: relative; }
.sw.on { box-shadow: 0 0 0 3px var(--ink); }
.sw.custom { overflow: hidden; }
.sw .cpick { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }

/* ---------- 1.3.0: Google-Liste ---------- */
.sheetwrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  height: calc(100dvh - var(--top) - var(--bottom) - var(--safe-b) - 210px); min-height: 420px; }
@media (min-width: 900px) { .sheetwrap { height: calc(100dvh - var(--top) - 230px); } }
iframe.sheet { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- 1.3.0: Fehlmeldungen ---------- */
.report { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; text-decoration: none; color: inherit; border-left: 5px solid var(--bad); }
.report.new { background: linear-gradient(100deg, var(--bad-soft) 0%, #fff 60%); }
.rbadge { width: 58px; height: 58px; border-radius: 14px; background: var(--bad); color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; flex: none; line-height: 1; }
.rbadge .rn { font-size: 22px; font-weight: 800; }
.rbadge .rl { font-size: 11px; font-weight: 700; margin-top: 3px; opacity: .9; }
.rcode { font-size: 19px; font-weight: 800; color: var(--ink); }
.rtext { font-size: 14px; color: var(--text); margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .li .thumb { display: grid; place-items: center; color: #A3A7AD; }

/* ---------- 1.4.0: Offline, Suche, Einsatzplan, Ideen ---------- */
.netbanner { position: fixed; left: 0; right: 0; top: var(--top); z-index: 25; background: var(--anthrazit); color: #fff;
  padding: 6px 12px; font-size: 13px; font-weight: 700; text-align: center; }
@media (min-width: 900px) { .netbanner { left: 220px; } }
body.has-banner main { padding-top: 52px; }
.netbanner.off { background: #8A2A1C; }
.msg.pending { opacity: .7; border: 1.5px dashed var(--orange); }
.pushprompt { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; margin-bottom: 14px; border-left: 5px solid var(--orange); flex-wrap: wrap; }
.topsearch { color: var(--anthrazit); }
.topsearch.on { background: var(--orange-soft); color: var(--orange-dark); }
.search-input { font-size: 17px; margin-bottom: 8px; }
mark { background: #FFE2B8; color: inherit; border-radius: 3px; padding: 0 1px; }

.weeknav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.weeknav .wk { min-width: 150px; text-align: center; }
.week { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (min-width: 1600px) { .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; } }
@media (max-width: 520px) { .week { grid-template-columns: 1fr; } }
.wday { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 90px; }
.wday.weekend { background: #FAFAFB; }
.wday.today { outline: 2px solid var(--orange); }
.wdhead { font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.acard { border-radius: 10px; background: #F6F7F8; padding: 9px 10px; border-left: 4px solid var(--anthrazit); font-size: 14px; }
.acard.colored { border-left-color: var(--pc); background: color-mix(in srgb, var(--pc) 9%, #fff); }
.atime { font-weight: 800; color: var(--orange-dark); font-size: 13px; padding-top: 1px; }
.atitle { font-weight: 700; color: var(--ink); overflow-wrap: break-word; hyphens: auto; }
.anote { font-size: 12.5px; color: var(--muted); margin-top: 5px; white-space: pre-wrap; }
.acard .pill { font-size: 11.5px; padding: 2px 7px; }
.addbtn { border: 1.5px dashed #CFD2D6; background: none; border-radius: 10px; padding: 8px; color: var(--muted); font-weight: 700;
  cursor: pointer; margin-top: auto; }
.addbtn:hover { border-color: var(--orange); color: var(--orange-dark); }
.plan-today { background: linear-gradient(120deg, var(--anthrazit), var(--ink)); color: #fff; border-radius: 16px; padding: 16px;
  border-left: 6px solid var(--pc, var(--orange)); box-shadow: var(--shadow); }
.plan-today:not(.now) { background: #fff; color: var(--ink); }
.plan-today .pt-day { font-size: 12.5px; font-weight: 800; letter-spacing: .5px; color: var(--orange); }
.plan-today .pt-what { font-size: 19px; font-weight: 800; margin-top: 2px; }
.plan-today .pt-sub { font-size: 14px; opacity: .85; margin-top: 3px; white-space: pre-wrap; }
.plan-today.now .btn { background: rgba(255,255,255,.14); color: #fff; }
.plan-empty { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; }
.idea { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.idea.clickable { cursor: pointer; }
.idea .itext { white-space: pre-wrap; margin-top: 6px; color: var(--text); }
.ianswer { margin-top: 10px; background: var(--orange-soft); border-radius: 10px; padding: 9px 11px; white-space: pre-wrap; }

/* ---------- 1.4.1: Einsatzplan neu ---------- */
main.wide { max-width: 1400px; }
.seg { display: inline-flex; background: #E6E7EA; border-radius: 11px; padding: 3px; }
.seg a { padding: 8px 16px; border-radius: 9px; text-decoration: none; color: var(--anthrazit); font-weight: 700; font-size: 14.5px; }
.seg a.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.daystrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.dbtn { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 8px 4px; text-align: center; text-decoration: none;
  color: var(--anthrazit); border: 2px solid transparent; }
.dbtn .dw { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.dbtn .dd { font-size: 22px; font-weight: 800; line-height: 1.15; color: var(--ink); }
.dbtn .dn { font-size: 12px; font-weight: 800; color: #B8BBC0; }
.dbtn .dn.has { color: #fff; background: var(--orange); border-radius: 999px; display: inline-block; min-width: 20px; padding: 0 6px; }
.dbtn.we { background: #FAFAFB; }
.dbtn.today { border-color: var(--orange-soft); }
.dbtn.today .dw { color: var(--orange-dark); }
.dbtn.on { background: var(--anthrazit); border-color: var(--anthrazit); }
.dbtn.on .dw, .dbtn.on .dd { color: #fff; }
.dayhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dh-title { font-size: 24px; font-weight: 800; color: var(--ink); }
.planlayout { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .planlayout { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; } }
.bigcards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-content: start; }
@media (max-width: 520px) { .bigcards { grid-template-columns: 1fr; } }
.dayempty { padding: 50px 16px; }
.bigcard { background: #fff; border-radius: 18px; box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.07); overflow: hidden;
  display: flex; flex-direction: column; border: 2px solid transparent; transition: border-color .15s, transform .15s; --pc: var(--anthrazit); }
.bigcard.drop { border-color: var(--orange); transform: scale(1.01); }
.bc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px;
  background: var(--pc); color: #fff; }
.bc-time { font-size: 30px; font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.bc-time small { font-size: 14px; font-weight: 700; opacity: .85; }
.bc-veh { background: rgba(255,255,255,.95); color: var(--ink); font-weight: 800; font-size: 18px; padding: 7px 12px; border-radius: 12px;
  text-decoration: none; white-space: nowrap; }
.bc-body { padding: 14px 16px 6px; flex: 1; }
.bc-title { display: block; font-size: 20px; font-weight: 800; color: var(--ink); text-decoration: none; line-height: 1.2; overflow-wrap: break-word; }
.bc-sub { color: var(--muted); font-weight: 600; margin-top: 2px; }
.bc-addr { display: inline-flex; align-items: center; gap: 4px; color: var(--orange-dark); font-size: 14px; font-weight: 600;
  text-decoration: none; margin-top: 4px; }
.bc-addr svg { width: 16px; height: 16px; }
.bc-people { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.pchip { display: inline-flex; align-items: center; gap: 7px; background: #F1F2F4; border-radius: 999px; padding: 4px 6px 4px 4px;
  font-weight: 700; font-size: 15px; color: var(--ink); }
.pchip.me { background: var(--orange-soft); }
.pchip.warn { background: var(--bad-soft); color: var(--bad); }
.pav { width: 30px; height: 30px; border-radius: 50%; background: var(--anthrazit); color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; flex: none; }
.pav.adm { background: var(--orange); }
.px { border: 0; background: rgba(0,0,0,.08); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; color: var(--muted);
  font-size: 12px; margin-left: 2px; }
.px:hover { background: var(--bad); color: #fff; }
.addperson { border: 2px dashed #CFD2D6; background: none; border-radius: 999px; padding: 6px 14px; font-weight: 800; color: var(--muted);
  cursor: pointer; font-size: 14.5px; }
.addperson:hover { border-color: var(--orange); color: var(--orange-dark); }
.bc-note { background: #FAF6EF; border-radius: 10px; padding: 8px 10px; margin: 8px 0 6px; font-size: 14px; white-space: pre-wrap; }
.bc-acts { display: flex; gap: 4px; padding: 6px 8px; border-top: 1px solid var(--line); }
.peoplepanel { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 14px; }
@media (min-width: 1100px) { .peoplepanel { position: sticky; top: calc(var(--top) + 16px); max-height: calc(100dvh - var(--top) - 40px); overflow-y: auto; } }
.pp-head { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 17px; color: var(--ink); }
.pp-hint { margin: 2px 0 10px; }
.pp-list { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 1099px) {
  .pp-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .pp-list .pperson { min-width: 170px; }
}
.pperson { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--ok-soft); cursor: grab;
  user-select: none; border: 1.5px solid transparent; }
.pperson:hover { border-color: var(--orange); }
.pperson.busy { background: #F4F5F6; }
.pperson .pn { font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pperson .pi { font-size: 12.5px; color: var(--ok); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pperson.busy .pi { color: var(--muted); }

/* Dialog mit Kacheln */
.dialog.plandlg { max-width: 760px; }
.dsec { margin-bottom: 18px; }
.dsec-h { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; color: var(--ink); margin-bottom: 8px; }
.dnum { width: 24px; height: 24px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chipbtn { border: 2px solid #E1E3E6; background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 800; cursor: pointer; font-size: 15px; }
.chipbtn.on { border-color: var(--orange); background: var(--orange-soft); color: var(--orange-dark); }
.tiles { display: grid; gap: 8px; }
.tiles.pt { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); max-height: 300px; overflow-y: auto; padding: 2px; }
.tiles.vt { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.tile { border: 2px solid #E1E3E6; background: #fff; border-radius: 14px; padding: 11px 12px; text-align: left; cursor: pointer; position: relative; }
.tile.proj { border-left: 6px solid var(--pc, #C9CCD1); }
.tile.on { border-color: var(--orange); background: var(--orange-soft); box-shadow: 0 0 0 2px var(--orange) inset; }
.tile.proj.on { border-left-color: var(--pc, var(--orange)); }
.tile .tname { font-weight: 800; color: var(--ink); }
.tile .tcode { font-weight: 800; font-size: 19px; color: var(--ink); }
.tile .tsub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.veh { text-align: center; }
.ptiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ptile { border: 2px solid #E1E3E6; background: #fff; border-radius: 14px; padding: 12px 8px 10px; cursor: pointer; display: flex;
  flex-direction: column; align-items: center; gap: 4px; position: relative; }
.ptile .pav { width: 42px; height: 42px; font-size: 15px; }
.ptile .pname { font-weight: 800; color: var(--ink); text-align: center; line-height: 1.2; }
.ptile .pinfo { font-size: 12px; color: var(--ok); font-weight: 600; text-align: center; }
.ptile.busy .pinfo { color: var(--bad); }
.ptile .pcheck { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--orange); color: #fff;
  display: none; place-items: center; font-weight: 800; font-size: 13px; }
.ptile.on { border-color: var(--orange); background: var(--orange-soft); }
.ptile.on .pcheck { display: grid; }
.sticky-actions { position: sticky; bottom: calc(-18px - var(--safe-b)); background: #fff; padding: 12px 0 4px; margin-bottom: -4px; }
/* 1.4.1: Handy-Korrekturen */
.planlayout { grid-template-columns: minmax(0, 1fr); }
.peoplepanel, .bigcards { min-width: 0; }
@media (max-width: 1099px) {
  .peoplepanel { order: -1; padding: 12px; }
  .pp-hint { display: none; }
  .pp-head { margin-bottom: 8px; }
}
@media (max-width: 700px) {
  .dayhead .grow { flex-basis: 100%; }
  .dayhead .btn-primary { flex: 1; }
  .bc-time { font-size: 26px; }
}
