/* SN Scanner Dashboard — Styles (Dark + Light Theme, system-ui, keine externen Ressourcen) */

html, body { margin: 0; padding: 0; }
body { background: #101418; font-family: Roboto, system-ui, -apple-system, sans-serif; }

:root {
  --bg:#101418; --sc-low:#15191D; --sc:#1B1F24; --sc-high:#262A2F; --sc-highest:#31353B;
  --on-s:#E1E2E8; --on-sv:#C3C6CF; --outl:#8D9199; --outl-v:#3E434A;
  --pri:#A8C7FA; --on-pri:#0B305F; --pri-c:#0B4282; --on-pri-c:#D3E3FD;
  --grn:#6DD58C; --grn-c:#11522A; --on-grn-c:#C4EED0;
  --org:#FFB868; --org-c:#674300; --on-org-c:#FFDDB8;
  --red:#FFB4AB; --red-c:#7E2421; --on-red-c:#FFDAD6;
  --scrim:rgba(0,0,0,.55);
  --elev:0 1px 3px rgba(0,0,0,.45),0 4px 14px rgba(0,0,0,.3);
  --mono:"Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root:has([data-theme="light"]) {
  --bg:#F8F9FD; --sc-low:#F1F3F8; --sc:#FFFFFF; --sc-high:#E9EBF1; --sc-highest:#E0E3E9;
  --on-s:#191C20; --on-sv:#43474E; --outl:#73777F; --outl-v:#D5D8DF;
  --pri:#0B57D0; --on-pri:#FFFFFF; --pri-c:#D8E5FC; --on-pri-c:#0A3268;
  --grn:#146C2E; --grn-c:#CDEFD7; --on-grn-c:#0A3317;
  --org:#8F5400; --org-c:#FFE2C0; --on-org-c:#4A2B00;
  --red:#B3261E; --red-c:#F9DEDC; --on-red-c:#5E1512;
  --scrim:rgba(20,24,30,.35);
  --elev:0 1px 2px rgba(20,30,45,.07),0 4px 14px rgba(20,30,45,.09);
}

input, select, button { font-family: inherit; }
input::placeholder { color: var(--outl); }

@keyframes drawerIn { from { transform: translateX(48px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }

#app > div[data-theme] { min-height: 100vh; background: var(--bg); color: var(--on-s); font-size: 14px; }

.mono { font-family: var(--mono); }
.ic { display: inline-flex; flex: 0 0 auto; line-height: 1; vertical-align: middle; }
.ic svg { display: block; fill: currentColor; }

/* ============ LOGIN ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(900px 480px at 50% -12%, rgba(60,120,220,.16), transparent 70%), var(--bg);
  box-sizing: border-box;
}
.login-card {
  width: 380px; background: var(--sc); border: 1px solid var(--outl-v); border-radius: 16px;
  padding: 36px 32px 28px; box-shadow: var(--elev); display: flex; flex-direction: column; gap: 22px;
}
.login-head { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.login-logo {
  width: 52px; height: 52px; border-radius: 14px; background: var(--pri-c);
  display: flex; align-items: center; justify-content: center; color: var(--on-pri-c);
}
.login-title { font-size: 22px; font-weight: 500; letter-spacing: -.2px; }
.login-sub { font-size: 13px; color: var(--on-sv); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-err {
  display: flex; align-items: center; gap: 10px; background: var(--red-c); color: var(--on-red-c);
  border-radius: 8px; padding: 10px 12px; font-size: 13px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 500; color: var(--on-sv); }
.field input {
  height: 42px; border-radius: 8px; border: 1px solid var(--outl-v); background: var(--sc-low);
  color: var(--on-s); padding: 0 12px; font-size: 14px; outline: none; box-sizing: border-box;
}
.field input:focus { border-color: var(--pri); }
.btn-login {
  height: 42px; border-radius: 21px; border: none; background: var(--pri); color: var(--on-pri);
  font-size: 14px; font-weight: 500; cursor: pointer; margin-top: 4px;
}
.btn-login:hover { filter: brightness(1.08); }
.btn-login:disabled { opacity: .6; cursor: default; }
.login-foot { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.login-foot div { font-size: 11px; color: var(--outl); }

/* ============ SHELL ============ */
.shell { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: 244px; flex: 0 0 auto; background: var(--sc-low); border-right: 1px solid var(--outl-v);
  display: flex; flex-direction: column; transition: width .2s ease; overflow: hidden;
}
.shell.coll .sidebar { width: 64px; }
.sb-head { display: flex; align-items: center; gap: 12px; padding: 16px 14px 14px; }
.shell.coll .sb-head { justify-content: center; }
.sb-logo {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px; background: var(--pri);
  display: flex; align-items: center; justify-content: center; color: var(--on-pri);
}
.sb-name { white-space: nowrap; }
.shell.coll .sb-name { display: none; }
.sb-name .t1 { font-size: 15px; font-weight: 500; line-height: 1.2; }
.sb-name .t2 { font-size: 11px; color: var(--on-sv); }
.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 0 8px; }
.nav-grp {
  font-size: 11px; font-weight: 500; letter-spacing: .6px; text-transform: uppercase;
  color: var(--outl); padding: 14px 22px 4px; white-space: nowrap;
}
.shell.coll .nav-grp { display: none; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px;
  margin: 1px 8px; border-radius: 19px; cursor: pointer; background: transparent; color: var(--on-sv);
  white-space: nowrap; overflow: hidden;
}
.shell.coll .nav-item { justify-content: center; }
.nav-item:hover { background: var(--sc-high); }
.nav-item.active { background: var(--pri-c); color: var(--on-pri-c); }
.nav-item .lbl { font-size: 13.5px; font-weight: 400; }
.nav-item.active .lbl { font-weight: 500; }
.shell.coll .nav-item .lbl { display: none; }
.nav-badge {
  margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--org-c); color: var(--on-org-c); font-size: 11px; font-weight: 500; box-sizing: border-box;
}
.nav-badge.red { background: var(--red-c); color: var(--on-red-c); }
.shell.coll .nav-badge { display: none; }
.nav-dot { position: absolute; top: 7px; right: 9px; width: 7px; height: 7px; border-radius: 4px; background: var(--org); display: none; }
.nav-dot.red { background: var(--red); }
.shell.coll .nav-dot { display: block; }
.sb-foot { border-top: 1px solid var(--outl-v); padding: 10px 8px; display: flex; align-items: center; gap: 10px; }
.shell.coll .sb-foot { justify-content: center; }
.sb-foot .ver { font-size: 11px; color: var(--outl); white-space: nowrap; }
.shell.coll .sb-foot .ver { display: none; }

/* Main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; flex: 0 0 auto; border-bottom: 1px solid var(--outl-v); background: var(--sc-low);
  display: flex; align-items: center; gap: 8px; padding: 0 20px;
}
.page-title { font-size: 17px; font-weight: 500; }
.spacer { flex: 1; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 18px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; color: var(--on-sv); border: none; background: transparent; padding: 0;
}
.icon-btn:hover { background: var(--sc-high); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 17px; }
.icon-btn.xs { width: 30px; height: 30px; border-radius: 15px; }
.userbox { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 20px; margin-left: 4px; }
.avatar {
  width: 30px; height: 30px; border-radius: 15px; background: var(--pri-c); color: var(--on-pri-c);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500;
}
.userbox .uname { font-size: 13px; color: var(--on-sv); }
.w-narrow .userbox .uname { display: none; }

.content { flex: 1; overflow: auto; padding: 22px 24px 40px; }

/* ===== Karten / Allgemein ===== */
.card { background: var(--sc); border: 1px solid var(--outl-v); border-radius: 14px; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--outl-v);
}
.card-head .h { font-size: 14px; font-weight: 500; }
.card-head .s { font-size: 12px; color: var(--on-sv); }
.chip {
  display: inline-flex; align-items: center; height: 23px; padding: 0 10px; border-radius: 7px;
  font-size: 11.5px; font-weight: 500; background: var(--sc-highest); color: var(--on-sv); white-space: nowrap;
}
.chip.grn { background: var(--grn-c); color: var(--on-grn-c); }
.chip.org { background: var(--org-c); color: var(--on-org-c); }
.chip.pri { background: var(--pri-c); color: var(--on-pri-c); }
.chip.red { background: var(--red-c); color: var(--on-red-c); }
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 20px;
  color: var(--on-sv); border-top: 1px solid var(--outl-v);
}
.empty .ic { color: var(--outl); }
.empty span:not(.ic) { font-size: 13px; }
.empty.solo { background: var(--sc); border: 1px solid var(--outl-v); border-radius: 12px; border-top: 1px solid var(--outl-v); }

/* ===== Übersicht ===== */
.ov { display: flex; flex-direction: column; gap: 18px; max-width: 1180px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.stat-card {
  background: var(--sc); border: 1px solid var(--outl-v); border-radius: 14px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.stat-card .row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-card .lbl { font-size: 12.5px; color: var(--on-sv); }
.stat-card .val { font-size: 29px; font-weight: 500; letter-spacing: -.5px; line-height: 1.1; }
.stat-card .sub { font-size: 12px; color: var(--on-sv); }
.ov-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 14px; align-items: start; }
.w-narrow .ov-grid { grid-template-columns: 1fr; }
.feed-row { display: flex; align-items: center; gap: 12px; padding: 9px 18px; border-top: 1px solid var(--outl-v); }
.feed-ic {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 15px; background: var(--sc-high);
  display: flex; align-items: center; justify-content: center; color: var(--on-sv);
}
.feed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.feed-t1 { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-t1 .u { font-weight: 500; }
.feed-t1 .v { color: var(--on-sv); }
.feed-t2 { font-family: var(--mono); font-size: 11.5px; color: var(--on-sv); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-time { font-size: 11.5px; color: var(--outl); flex: 0 0 auto; }
.week-card {
  background: var(--sc); border: 1px solid var(--outl-v); border-radius: 14px;
  padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 14px;
}
.week-head { display: flex; align-items: center; justify-content: space-between; }
.week-head .h { font-size: 14px; font-weight: 500; }
.week-head .s { font-size: 12px; color: var(--on-sv); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.bar-col .v { font-size: 11px; color: var(--on-sv); }
.bar-col .bar { width: 68%; max-width: 30px; background: color-mix(in srgb, var(--pri) 38%, transparent); border-radius: 6px 6px 2px 2px; }
.bar-col.today .bar { background: var(--pri); }
.bar-col .d { font-size: 11px; color: var(--on-sv); font-weight: 400; }
.bar-col.today .d { color: var(--on-s); font-weight: 500; }

/* ===== Geräte ===== */
.dev-page { display: flex; flex-direction: column; gap: 12px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-box {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 19px;
  border: 1px solid var(--outl-v); background: var(--sc); min-width: 260px; flex: 0 1 320px;
  color: var(--on-sv); box-sizing: border-box;
}
.search-box input { flex: 1; border: none; background: transparent; color: var(--on-s); font-size: 13px; outline: none; min-width: 0; }
.sel {
  height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--outl-v);
  background: var(--sc); color: var(--on-s); font-size: 13px; cursor: pointer;
}
.count { font-size: 12.5px; color: var(--on-sv); }
.thead {
  display: grid; grid-template-columns: 150px 1.1fr 1fr 120px 180px 110px; align-items: center;
  height: 38px; padding: 0 16px; font-size: 11px; font-weight: 500; letter-spacing: .7px;
  text-transform: uppercase; color: var(--on-sv);
}
.trow {
  display: grid; grid-template-columns: 150px 1.1fr 1fr 120px 180px 110px; align-items: center;
  height: 40px; padding: 0 16px; border-top: 1px solid var(--outl-v); cursor: pointer; font-size: 13px;
  background: transparent;
}
.w-tablet .thead, .w-tablet .trow { grid-template-columns: 150px 1.1fr 1fr 120px; }
.w-narrow .thead, .w-narrow .trow { grid-template-columns: 140px 1fr 110px; }
.trow:hover, .trow.sel-row { background: var(--sc-high); }
.th-cell { display: flex; align-items: center; gap: 3px; cursor: pointer; user-select: none; }
.th-cell:hover { color: var(--on-s); }
.th-cell .ic { opacity: 0; }
.th-cell.sorted .ic { opacity: 1; }
.w-tablet .col-t { display: none; }
.w-narrow .col-n, .w-narrow .col-t { display: none; }
.cell-sn { font-family: var(--mono); font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-dim { color: var(--on-sv); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-mac { font-family: var(--mono); font-size: 11.5px; color: var(--on-sv); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-date { font-size: 12px; color: var(--on-sv); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 7px 16px; border-top: 1px solid var(--outl-v); }
.pager .info { font-size: 12px; color: var(--on-sv); }
.pager .ctl { display: flex; align-items: center; gap: 6px; }
.pager .pl { font-size: 12.5px; color: var(--on-sv); }
.pager .icon-btn.off { opacity: .35; pointer-events: none; }

/* ===== Aufgaben ===== */
.task-page { display: flex; flex-direction: column; gap: 12px; max-width: 980px; }
.chip-filter {
  display: flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--outl-v); background: transparent; color: var(--on-sv);
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.chip-filter:hover { border-color: var(--outl); }
.chip-filter.active { background: var(--pri-c); color: var(--on-pri-c); border-color: var(--pri-c); }
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-card {
  background: var(--sc); border: 1px solid var(--outl-v); border-radius: 12px; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px;
}
.task-card.done { opacity: .6; }
.task-cat { display: flex; align-items: center; gap: 7px; flex: 0 0 110px; }
.task-cat .dot { width: 8px; height: 8px; border-radius: 4px; flex: 0 0 auto; }
.task-cat .c { font-size: 12px; color: var(--on-sv); }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-title { font-size: 14px; font-weight: 500; }
.task-card.done .task-title { text-decoration: line-through; }
.task-meta { font-size: 12px; }
.task-meta .p { font-weight: 500; }
.task-meta .n { color: var(--on-sv); }
.prio-high { color: var(--red); }
.prio-normal { color: var(--org); }
.prio-low { color: var(--on-sv); }
.btn-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 13px; border-radius: 16px;
  background: var(--pri-c); color: var(--on-pri-c); font-size: 12.5px; font-weight: 500;
  cursor: pointer; flex: 0 0 auto; border: none;
}
.btn-pill:hover { filter: brightness(1.1); }
.btn-pill:disabled { opacity: .6; cursor: default; }
.btn-pill.outline { background: transparent; border: 1px solid var(--outl-v); color: var(--grn); }
.btn-pill.outline:hover { filter: none; background: var(--sc-high); }
.btn-pill.outline.neutral { color: var(--on-sv); }
.btn-pill.danger { background: var(--red-c); color: var(--on-red-c); }

/* Neue Aufgabe (Formular) */
.todo-form-card { padding: 16px 18px; }
.todo-form { display: flex; flex-direction: column; gap: 12px; }
.todo-form .row { display: flex; gap: 10px; flex-wrap: wrap; }
.todo-form .row .field { flex: 1; min-width: 150px; }
.todo-form .row.btns { gap: 8px; }
.todo-form .sel { width: 100%; box-sizing: border-box; }
.todo-form #ta-sn { font-family: var(--mono); }

/* ===== Abholungen ===== */
.pk-page { display: flex; flex-direction: column; gap: 14px; max-width: 840px; }
.pk-head { padding: 16px 20px 14px; display: flex; flex-direction: column; gap: 10px; }
.pk-head .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pk-head .t { font-size: 15px; font-weight: 500; }
.pk-head .l { font-size: 13px; color: var(--on-sv); }
.pk-head .n { font-size: 13px; font-weight: 500; font-family: var(--mono); }
.progress { height: 8px; border-radius: 4px; background: var(--sc-highest); overflow: hidden; }
.progress .fill { height: 100%; background: var(--pri); border-radius: 4px; transition: width .3s ease; }
.progress .fill.full { background: var(--grn); }
.pk-item { display: flex; align-items: center; gap: 12px; padding: 8px 20px; border-top: 1px solid var(--outl-v); }
.pk-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 15px; border: none; background: transparent; padding: 0; cursor: pointer;
  color: inherit; flex: 0 0 auto; margin-left: -6px;
}
.pk-toggle:hover { background: var(--sc-high); }
.pk-item .ic { color: var(--outl); }
.pk-item.done .ic, .pk-item.done .st { color: var(--grn); }
.pk-item.transit .ic, .pk-item.transit .st { color: var(--pri); }
.pk-item .sn { font-family: var(--mono); font-size: 12.5px; font-weight: 500; flex: 0 0 130px; overflow: hidden; text-overflow: ellipsis; }
.pk-item .ty { font-size: 13px; color: var(--on-sv); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-item .st { font-size: 12px; color: var(--outl); flex: 0 0 auto; }

/* ===== Austausche (Remedy-Nachpflege) ===== */
.sw-page { display: flex; flex-direction: column; gap: 12px; max-width: 1180px; }
.sw-thead {
  display: grid; grid-template-columns: 84px 1.15fr 1.15fr 1fr 1fr 84px 90px 124px; gap: 10px;
  align-items: center; height: 38px; padding: 0 16px; font-size: 11px; font-weight: 500;
  letter-spacing: .7px; text-transform: uppercase; color: var(--on-sv);
}
.sw-row {
  display: grid; grid-template-columns: 84px 1.15fr 1.15fr 1fr 1fr 84px 90px 124px; gap: 10px;
  align-items: center; min-height: 44px; padding: 4px 16px; border-top: 1px solid var(--outl-v);
  font-size: 13px;
}
.w-tablet .sw-thead, .w-tablet .sw-row { grid-template-columns: 84px 1.15fr 1.15fr 1fr 124px; }
.w-narrow .sw-thead, .w-narrow .sw-row { grid-template-columns: 1.15fr 1.15fr 1fr 124px; }
/* Erledigt: Zeile bleibt stehen, wird nur gedimmt (Button bleibt voll bedienbar) */
.sw-row.done > :not(.sw-act) { opacity: .5; }
.sw-sn { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sw-sn .v { font-family: var(--mono); font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-copy {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 13px; border: none; background: transparent; color: var(--on-sv); cursor: pointer;
  padding: 0; flex: 0 0 auto;
}
.sw-copy:hover { background: var(--sc-high); }
.sw-copy.ok { color: var(--grn); }
.sw-act { justify-self: end; }
.sw-note {
  display: flex; align-items: center; gap: 6px; padding: 0 16px 8px; margin-top: -3px;
  font-size: 12px; color: var(--on-sv);
}
.sw-note .ic { color: var(--outl); flex: 0 0 auto; }
.sw-note span:not(.ic) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Sektions-Kopf der Remedy-Seite (Icon + Titel + Offen-Zaehler + CSV-Export) */
.remedy-head .h { display: flex; align-items: center; gap: 8px; }
.remedy-head .h .ic { color: var(--on-sv); }
.remedy-head .h .count { margin-left: 4px; font-weight: 400; }
/* Abholungs-Nachpflege: Grid analog sw-row (Datum | SN | Bezeichnung | Standort | Auftrag | Status | Aktion) */
.rp-thead {
  display: grid; grid-template-columns: 84px 1.05fr 1.2fr 1fr 1fr 96px 124px; gap: 10px;
  align-items: center; height: 38px; padding: 0 16px; font-size: 11px; font-weight: 500;
  letter-spacing: .7px; text-transform: uppercase; color: var(--on-sv);
}
.rp-row {
  display: grid; grid-template-columns: 84px 1.05fr 1.2fr 1fr 1fr 96px 124px; gap: 10px;
  align-items: center; min-height: 44px; padding: 4px 16px; border-top: 1px solid var(--outl-v);
  font-size: 13px;
}
.w-tablet .rp-thead, .w-tablet .rp-row { grid-template-columns: 84px 1.05fr 1.2fr 96px 124px; }
.w-narrow .rp-thead, .w-narrow .rp-row { grid-template-columns: 1.05fr 1.2fr 96px 124px; }
/* Erledigt: Zeile bleibt stehen, wird nur gedimmt (Button bleibt voll bedienbar) */
.rp-row.done > :not(.sw-act) { opacity: .5; }

/* ===== Watchlist ===== */
.wl-page { display: grid; grid-template-columns: 1.45fr 1fr; gap: 14px; align-items: start; max-width: 1180px; }
.w-narrow .wl-page { grid-template-columns: 1fr; }
.wl-hit { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--outl-v); }
.wl-hit-ic {
  width: 32px; height: 32px; flex: 0 0 auto; border-radius: 16px; background: var(--red-c);
  display: flex; align-items: center; justify-content: center; color: var(--on-red-c);
}
.wl-hit-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wl-hit-t1 { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-hit-t1 .sn { font-family: var(--mono); font-weight: 500; font-size: 12.5px; }
.wl-hit-t1 .d { color: var(--on-sv); }
.wl-hit-t2 { font-size: 12px; color: var(--on-sv); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-hit-time { font-size: 11.5px; color: var(--outl); flex: 0 0 auto; }
.wl-form-wrap { padding: 14px 18px; border-bottom: 1px solid var(--outl-v); display: flex; flex-direction: column; gap: 10px; }
.wl-form-wrap .h { font-size: 14px; font-weight: 500; }
.wl-form { display: flex; gap: 8px; }
.wl-form input {
  flex: 1; height: 36px; border-radius: 8px; border: 1px solid var(--outl-v); background: var(--sc-low);
  color: var(--on-s); padding: 0 10px; font-size: 12.5px; font-family: var(--mono); outline: none;
  min-width: 0; box-sizing: border-box;
}
.wl-form input:focus { border-color: var(--pri); }
.wl-form button {
  height: 36px; padding: 0 14px; border-radius: 18px; border: none; background: var(--pri-c);
  color: var(--on-pri-c); font-size: 12.5px; font-weight: 500; cursor: pointer; flex: 0 0 auto;
}
.wl-form button:hover { filter: brightness(1.1); }
.wl-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--outl-v); }
.wl-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wl-row .pat { font-family: var(--mono); font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-row .lbl { font-size: 12px; color: var(--on-sv); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-chip {
  display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 7px;
  font-size: 11px; font-weight: 500; background: var(--sc-highest); color: var(--on-sv); flex: 0 0 auto;
}
.wl-chip.grn { background: var(--grn-c); color: var(--on-grn-c); }
.wl-chip.org { background: var(--org-c); color: var(--on-org-c); }
.wl-chip.pri { background: var(--pri-c); color: var(--on-pri-c); }
.wl-chip.red { background: var(--red-c); color: var(--on-red-c); }

/* ===== F-Droid / APK ===== */
.fd-page { display: flex; flex-direction: column; gap: 14px; max-width: 840px; }
.fd-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; align-items: stretch; }
.w-narrow .fd-grid { grid-template-columns: 1fr; }
.fd-card { background: var(--sc); border: 1px solid var(--outl-v); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.fd-card .h { font-size: 14px; font-weight: 500; }
.fd-app { display: flex; align-items: center; gap: 14px; }
.fd-app-logo {
  width: 54px; height: 54px; flex: 0 0 auto; border-radius: 14px; background: var(--pri-c);
  display: flex; align-items: center; justify-content: center; color: var(--on-pri-c);
}
.fd-app .t1 { font-size: 18px; font-weight: 500; }
.fd-app .t2 { font-size: 12.5px; color: var(--on-sv); }
.fd-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 13px; }
.fd-meta .k { color: var(--on-sv); }
.fd-meta .m { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-dl {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 18px;
  background: var(--pri-c); color: var(--on-pri-c); font-size: 13px; font-weight: 500; cursor: pointer;
  text-decoration: none; align-self: flex-start; margin-top: auto;
}
.btn-dl:hover { filter: brightness(1.1); }
.fd-qr-card { align-items: center; gap: 14px; }
.fd-qr-card .h { align-self: flex-start; }
.fd-qr { width: 150px; height: 150px; border-radius: 10px; background: #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.fd-qr img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fd-qr-empty {
  width: 150px; height: 150px; border-radius: 10px; border: 1px dashed var(--outl);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10px; color: var(--on-sv);
}
.url-box {
  display: flex; align-items: center; gap: 8px; width: 100%; background: var(--sc-low);
  border: 1px solid var(--outl-v); border-radius: 8px; padding: 8px 10px; box-sizing: border-box;
}
.url-box .u { font-family: var(--mono); font-size: 11px; color: var(--on-sv); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-box .copy { color: var(--on-sv); cursor: pointer; background: none; border: none; padding: 0; display: inline-flex; }
.url-box .copy.ok { color: var(--grn); }
.share-note { display: flex; align-items: flex-start; gap: 6px; font-size: 11.5px; color: var(--outl); }
.share-note .ic { color: var(--outl); margin-top: 1px; }

/* APK-Upload (Admin) */
.fd-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 30px 20px; border: 2px dashed var(--outl-v); border-radius: 12px; cursor: pointer;
  color: var(--on-sv); text-align: center; background: var(--sc-low); transition: border-color .15s ease, background .15s ease;
}
.fd-drop:hover, .fd-drop:focus-visible { border-color: var(--outl); }
.fd-drop.drag { border-color: var(--pri); background: var(--sc-high); color: var(--on-s); }
.fd-drop .ic { color: var(--outl); }
.fd-drop.drag .ic { color: var(--pri); }
.fd-drop .t1 { font-size: 13.5px; font-weight: 500; }
.fd-drop .t2 { font-family: var(--mono); font-size: 11px; color: var(--outl); }
.fd-up-busy { display: flex; align-items: center; gap: 12px; }
.fd-up-busy .n { font-family: var(--mono); font-size: 12px; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-up-busy .progress { flex: 1; min-width: 80px; }
.fd-up-busy .p { font-size: 12px; color: var(--on-sv); font-variant-numeric: tabular-nums; flex: 0 0 auto; }

/* ===== Drawer ===== */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; animation: fadeIn .15s ease; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 94vw); background: var(--sc);
  border-left: 1px solid var(--outl-v); z-index: 41; box-shadow: var(--elev);
  display: flex; flex-direction: column; animation: drawerIn .2s ease;
}
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--outl-v); }
.drawer-head .tt { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.drawer-head .sn { font-family: var(--mono); font-size: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.drawer-head .sub { font-size: 12.5px; color: var(--on-sv); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 22px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; font-size: 13px; }
.kv .k { color: var(--on-sv); }
.kv .m { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.sec { display: flex; flex-direction: column; gap: 8px; }
.sec-h { font-size: 12px; font-weight: 500; letter-spacing: .5px; text-transform: uppercase; color: var(--on-sv); }
.todo-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--sc-low);
  border: 1px solid var(--outl-v); border-radius: 8px;
}
.todo-row .ic { color: var(--outl); }
.todo-row.done .ic { color: var(--grn); }
.todo-row .t { font-size: 13px; }
.todo-row.done .t { text-decoration: line-through; color: var(--on-sv); }
.hist-row { display: flex; gap: 12px; }
.hist-rail { display: flex; flex-direction: column; align-items: center; width: 30px; flex: 0 0 auto; }
.hist-ic {
  width: 30px; height: 30px; border-radius: 15px; background: var(--sc-high);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--on-sv);
}
.hist-line { width: 2px; flex: 1; background: var(--outl-v); margin: 2px 0; }
.hist-row:last-child .hist-line { background: transparent; }
.hist-main { display: flex; flex-direction: column; gap: 1px; padding-bottom: 16px; }
.hist-main .a { font-size: 13px; font-weight: 500; }
.hist-main .m { font-size: 12px; color: var(--on-sv); }

/* ===== Standorte ===== */
.loc-page { display: flex; flex-direction: column; gap: 14px; max-width: 1180px; }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.loc-card {
  background: var(--sc); border: 1px solid var(--outl-v); border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.loc-card:hover { background: var(--sc-high); }
.loc-ic {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 19px; background: var(--pri-c);
  color: var(--on-pri-c); display: flex; align-items: center; justify-content: center;
}
.loc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.loc-main .t { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-main .a { font-size: 12px; color: var(--on-sv); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-chips { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.loc-arrow { color: var(--outl); }
.loc-head { display: flex; align-items: center; gap: 12px; }
.loc-head .tt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.loc-head .t { font-size: 17px; font-weight: 500; }
.loc-head .s { font-size: 12.5px; color: var(--on-sv); }
.loc-breakdown { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; }
.loc-dev {
  display: grid; grid-template-columns: 150px 1fr 110px 90px; align-items: center; gap: 10px;
  padding: 9px 18px; border-top: 1px solid var(--outl-v); cursor: pointer; font-size: 13px;
}
.loc-dev:hover { background: var(--sc-high); }
.loc-dev .ty { color: var(--on-sv); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-dev .by { font-size: 12px; color: var(--on-sv); }
.loc-dev .dt { font-size: 12px; color: var(--on-sv); text-align: right; }
.w-narrow .loc-dev { grid-template-columns: 140px 1fr 90px; }
.w-narrow .loc-dev .by { display: none; }

/* ===== Zugangsdaten ===== */
.cred-page { display: flex; flex-direction: column; gap: 14px; max-width: 880px; }
.cred-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--outl-v); }
.cred-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cred-main .t { font-size: 13.5px; font-weight: 500; }
.cred-content {
  font-family: var(--mono); font-size: 12.5px; margin: 0; white-space: pre-wrap; word-break: break-all;
  background: var(--sc-low); border: 1px solid var(--outl-v); border-radius: 8px; padding: 8px 10px;
}
.cred-hidden { font-family: var(--mono); font-size: 13px; letter-spacing: 2px; color: var(--outl); }
.cred-main .meta { font-size: 11.5px; color: var(--outl); }
.cred-btns { display: flex; gap: 2px; flex: 0 0 auto; }
.icon-btn.ok { color: var(--grn); }
.icon-btn.danger:hover { background: var(--red-c); color: var(--on-red-c); }
.cred-form { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.cred-form-card { padding: 16px 18px; }
.cred-form .row { display: flex; gap: 8px; flex-wrap: wrap; }
.cred-form input, .cred-form textarea {
  border-radius: 8px; border: 1px solid var(--outl-v); background: var(--sc-low); color: var(--on-s);
  font-size: 13px; outline: none; box-sizing: border-box;
}
.cred-form input { flex: 1; min-width: 160px; height: 36px; padding: 0 10px; }
.cred-form textarea { font-family: var(--mono); font-size: 12.5px; padding: 9px 10px; resize: vertical; min-height: 74px; }
.cred-form input:focus, .cred-form textarea:focus { border-color: var(--pri); }

/* ===== Benutzer ===== */
.usr-page { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; align-items: start; max-width: 980px; }
.w-narrow .usr-page { grid-template-columns: 1fr; }
.usr-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--outl-v); }
.usr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.usr-main .t { font-size: 13.5px; font-weight: 500; }
.usr-main .s { font-size: 12px; color: var(--on-sv); }
.usr-form { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; }
.usr-form .btn-pill { align-self: flex-start; }
.usr-form .sel { width: 100%; box-sizing: border-box; }
.pass-row { display: flex; gap: 6px; align-items: center; }
.pass-row input { flex: 1; min-width: 0; font-family: var(--mono); }
.form-ok {
  display: flex; align-items: center; gap: 8px; background: var(--grn-c); color: var(--on-grn-c);
  border-radius: 8px; padding: 8px 12px; font-size: 12.5px;
}

/* ===== Benachrichtigungen ===== */
.ntf-page { display: flex; flex-direction: column; gap: 14px; max-width: 880px; }
.ntf-page .feed-row .chip { flex: 0 0 auto; }

/* ===== Wartung ===== */
.rt-page { display: flex; flex-direction: column; gap: 12px; max-width: 880px; }
.rt-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; flex-wrap: wrap; }
.rt-head:hover { background: var(--sc-high); }
.rt-ic {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: 18px; background: var(--org-c);
  color: var(--on-org-c); display: flex; align-items: center; justify-content: center;
}
.rt-main { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.rt-main .t { font-size: 14px; font-weight: 500; }
.rt-main .dsc { font-size: 12.5px; color: var(--on-sv); }
.rt-main .s { font-size: 12px; color: var(--outl); }
.rt-arrow { color: var(--outl); }
.rt-matrix { border-top: 1px solid var(--outl-v); }
.rt-loc { display: flex; align-items: center; gap: 10px; padding: 8px 18px; border-top: 1px solid var(--outl-v); font-size: 13px; }
.rt-loc:first-child { border-top: none; }
.rt-loc .ic { color: var(--outl); }
.rt-loc.ok .ic { color: var(--grn); }
.rt-loc.due .ic { color: var(--org); }
.rt-loc .n { flex: 0 0 220px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-loc .d { flex: 1; color: var(--on-sv); font-size: 12.5px; }
.w-narrow .rt-loc .n { flex: 0 0 140px; }

/* ===== Nutzung (Usage-Tracking) ===== */
.us-page { display: flex; flex-direction: column; gap: 14px; max-width: 1180px; }
.us-page .stat-card .val { font-size: 22px; word-break: break-word; }
.us-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.w-narrow .us-grid { grid-template-columns: 1fr; }
.us-screens .bar-col .d { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.us-trow { display: flex; align-items: center; gap: 12px; padding: 8px 18px; border-top: 1px solid var(--outl-v); font-size: 13px; }
.us-trow .wk { flex: 0 0 90px; font-weight: 500; color: var(--on-sv); font-size: 12px; white-space: nowrap; }
.us-trow .an { flex: 0 0 220px; font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-narrow .us-trow .an { flex: 0 0 140px; }
.us-trow .ct { flex: 0 0 48px; text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.us-mini { flex: 1; height: 8px; border-radius: 4px; background: var(--sc-highest); overflow: hidden; }
.us-mini .fill { height: 100%; background: color-mix(in srgb, var(--pri) 55%, transparent); border-radius: 4px; }
.us-funnel-row { display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-top: 1px solid var(--outl-v); font-size: 13px; }
.us-funnel-row .wk { flex: 0 0 90px; font-weight: 500; color: var(--on-sv); font-size: 12px; white-space: nowrap; }
.us-funnel-row .n { flex: 1; color: var(--on-sv); font-size: 12.5px; }
.us-err-row { display: flex; align-items: center; gap: 10px; padding: 8px 18px; border-top: 1px solid var(--outl-v); font-size: 12.5px; }
.us-err-row .an { flex: 0 0 180px; font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.us-err-row .tx { flex: 1; color: var(--on-sv); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.us-err-row .ct { flex: 0 0 auto; font-weight: 500; font-variant-numeric: tabular-nums; }
.us-err-row .dt { flex: 0 0 auto; color: var(--outl); font-size: 11.5px; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 12px); z-index: 70;
  display: flex; align-items: center; gap: 9px; max-width: min(440px, 86vw);
  background: var(--sc-highest); color: var(--on-s); border: 1px solid var(--outl-v);
  border-radius: 10px; padding: 10px 16px; font-size: 13px; box-shadow: var(--elev);
  font-family: Roboto, system-ui, -apple-system, sans-serif;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .ic { color: var(--grn); flex: 0 0 auto; }
.toast.err .ic { color: var(--red); }

/* ===== Bestätigungs-Modal ===== */
.modal-scrim { z-index: 60; }
.modal {
  position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 61;
  width: min(400px, 90vw); background: var(--sc); border: 1px solid var(--outl-v); border-radius: 14px;
  padding: 22px 22px 18px; box-shadow: var(--elev); display: flex; flex-direction: column; gap: 10px;
  color: var(--on-s); font-size: 14px; font-family: Roboto, system-ui, -apple-system, sans-serif;
  animation: fadeIn .15s ease;
}
.modal .m-title { font-size: 16px; font-weight: 500; }
.modal .m-text { font-size: 13px; color: var(--on-sv); line-height: 1.5; }
.modal .m-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ===== Lade-Skeleton ===== */
.shimmer {
  background: linear-gradient(90deg, var(--sc-high) 25%, var(--sc-highest) 37%, var(--sc-high) 63%);
  background-size: 800px 100%; animation: shimmer 1.3s linear infinite; border-radius: 6px;
}
.skl-page { display: flex; flex-direction: column; gap: 18px; max-width: 1180px; }
.skl-card { background: var(--sc); border: 1px solid var(--outl-v); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 13px; }
.skl-list { background: var(--sc); border: 1px solid var(--outl-v); border-radius: 14px; padding: 6px 0; }
.skl-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; }
