:root{
  --bg:#061113;--bg2:#0a1b1e;--panel:#0c2023;--panel2:#102a2d;--panel3:#0b181a;
  --teal:#18b7aa;--teal2:#0d867e;--green:#18b97f;--text:#f7fbfb;--muted:#97afb2;
  --danger:#d85a5a;--danger2:#4a181b;--line:#204449;--shadow:0 18px 55px rgba(0,0,0,.28)
}
*{box-sizing:border-box}
html{color-scheme:dark}
body{margin:0;min-height:100vh;background:
  radial-gradient(circle at 12% 0%,rgba(24,183,170,.13),transparent 30%),
  linear-gradient(145deg,var(--bg),var(--bg2) 55%,#071416);color:var(--text);
  font-family:Inter,Segoe UI,Arial,sans-serif}
a{color:inherit}.wrap{max-width:1180px;margin:auto;padding:28px 20px 64px}.narrow{max-width:640px}.mobile{padding-top:20px}
.top{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:12px}
.brand{display:flex;align-items:center;gap:15px;margin:4px 0 22px}.brand h1{margin:0;font-size:30px;letter-spacing:-.5px}.brand p{margin:4px 0 0;color:var(--muted)}
.brand-icon{width:58px;height:58px;border-radius:16px;background:#091719;border:1px solid var(--line);padding:9px;object-fit:contain;box-shadow:0 12px 34px rgba(0,0,0,.32)}
.brand-logo-wide{height:64px;max-width:470px;object-fit:contain;object-position:left center;display:block}
.app-brand .brand-icon{width:68px;height:68px}.app-brand{margin-bottom:18px}
.card{background:linear-gradient(180deg,rgba(15,39,42,.97),rgba(10,29,32,.97));border:1px solid var(--line);border-radius:20px;padding:22px;margin:15px 0;box-shadow:var(--shadow)}
.hero{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px 22px;background:linear-gradient(135deg,rgba(18,67,62,.85),rgba(11,38,41,.96))}
.hero-left{display:flex;align-items:center;gap:15px}.hero h2{margin:0 0 4px;font-size:22px}.hero p{margin:0;color:var(--muted)}
.hero-icon{width:50px;height:50px;border-radius:50%;display:grid;place-items:center;font-size:26px;background:linear-gradient(135deg,var(--teal),var(--green));box-shadow:0 8px 24px rgba(24,183,170,.25)}
h2{margin:0 0 10px;font-size:20px}h3{margin:0 0 8px}.muted{color:var(--muted)}
.btn,.ghost,.danger,.delete-device{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:12px;padding:12px 17px;font-weight:750;text-decoration:none;cursor:pointer;font:inherit}
.btn{background:linear-gradient(135deg,#20c3b6,#13a99f);color:#03211f;box-shadow:0 8px 22px rgba(24,183,170,.17)}.btn:hover{filter:brightness(1.05)}.btn:disabled{opacity:.38;cursor:not-allowed;box-shadow:none}.big{width:100%;font-size:17px;padding:16px}.ghost{color:var(--text);border:1px solid var(--line);background:rgba(8,24,26,.55)}
.danger,.delete-device{background:var(--danger2);color:#ffbebe;padding:8px 11px}.delete-device{border:1px solid #7b3036}.danger:hover,.delete-device:hover{filter:brightness(1.15)}
.notice,.success{background:#10342f;border:1px solid #1c6b61;padding:13px 15px;border-radius:13px}.alert{background:#401b1e;border:1px solid #7a3439;padding:13px 15px;border-radius:13px}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.stat{background:linear-gradient(180deg,#0d2225,#0a1b1e);border:1px solid var(--line);border-radius:17px;padding:18px}.stat b{display:block;font-size:29px;line-height:1}.stat span{display:block;color:var(--muted);margin-top:8px}.stat small{display:block;color:#729194;margin-top:5px}.stat.online{border-color:#1c6d5c}.stat.offline{border-color:#65333a}
.status-pill{display:inline-flex;align-items:center;gap:7px;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:800}.status-pill::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor}.status-pill.online{color:#6be2b0;background:#0c3c2d}.status-pill.offline{color:#ff9c9c;background:#3b1a1d}.status-pill.active{color:#65dfad;background:#0c3c2d}.status-pill.revoked{color:#ffaaaa;background:#3d191c}.status-pill.pending{color:#f3cf79;background:#3b321a}.status-pill.delivered{color:#66e0ad;background:#0c3c2d}
.inline{display:flex;gap:10px;align-items:end}.inline input{margin:0}.enrollbox{display:grid;grid-template-columns:250px 1fr;gap:22px;align-items:center;margin-top:20px}.qr{background:#fff;border-radius:15px;padding:12px}.qr svg{width:100%;height:auto;display:block}
input,textarea{width:100%;margin-top:7px;padding:13px 14px;border-radius:11px;border:1px solid #2b5559;background:#071719;color:#fff;font:inherit;outline:none}input:focus,textarea:focus{border-color:var(--teal);box-shadow:0 0 0 3px rgba(24,183,170,.09)}textarea{min-height:82px}
.tablewrap{overflow:auto;border-radius:14px;border:1px solid rgba(32,68,73,.75)}table{border-collapse:collapse;width:100%;min-width:700px;background:rgba(5,18,20,.22)}th,td{padding:12px 11px;border-bottom:1px solid var(--line);text-align:left;font-size:14px}th{color:#a9c0c2;font-weight:700;background:rgba(255,255,255,.018)}tr:last-child td{border-bottom:0}.device-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.device-actions form{margin:0}
.picker{display:block;border:1px solid #28726e;border-radius:16px;padding:24px;text-align:center;color:var(--text);background:linear-gradient(135deg,#0c302e,#0c2629);cursor:pointer;font-weight:750;transition:.15s}.picker:hover{transform:translateY(-1px);border-color:var(--teal)}.picker input{display:none}.selected,.status{padding:14px 2px;min-height:24px}.upload-status.successbox{background:#0d352c;border:1px solid #1f6f5c;border-radius:13px;padding:13px}.device-chip{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0 0;padding:14px 15px;border-radius:15px;background:#0a2727;border:1px solid #1e5f5a}.device-chip strong{display:block}.device-chip small{color:var(--muted)}
.scanner-panel{margin-top:14px}#scannerVideo{width:100%;max-height:55vh;border-radius:15px;background:#000;object-fit:cover;border:1px solid var(--line)}.scannerActions{display:flex;gap:10px;margin-top:12px}.scannerStatus{margin-top:10px;min-height:24px}
.mobile .card{padding:20px}.mobile-intro{font-size:15px;line-height:1.55}.section-title{display:flex;align-items:center;justify-content:space-between;gap:10px}.section-kicker{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:#72cfc6;font-weight:800}
.footer-brand{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:20px;color:#6f8d90;font-size:12px}.footer-brand img{height:28px;max-width:220px;opacity:.72;object-fit:contain;object-position:left center}
footer{text-align:center;color:#6e898c;font-size:12px;margin-top:22px}.secret code{display:block;word-break:break-all;background:#061113;padding:12px;border-radius:10px;margin-top:6px}
@media(max-width:900px){.stats{grid-template-columns:repeat(2,1fr)}.brand-logo-wide{height:54px;max-width:360px}}
@media(max-width:700px){.wrap{padding:18px 14px 42px}.top{align-items:flex-start}.brand h1{font-size:25px}.brand-logo-wide{height:44px;max-width:270px}.enrollbox{grid-template-columns:1fr}.qr{max-width:320px;margin:auto}.stats{grid-template-columns:1fr 1fr}.inline{display:block}.inline .btn{width:100%;margin-top:8px}.hero{align-items:flex-start}.hero-icon{width:44px;height:44px}.footer-brand{flex-direction:column;align-items:flex-start}.app-brand .brand-icon{width:62px;height:62px}}
@media(max-width:430px){.stats{grid-template-columns:1fr}.mobile .card{border-radius:18px}.app-brand{align-items:flex-start}}

/* v2.1 visual polish */

.top > div:first-child {
    width:100%;
}

.brand-logo-wide {
    height:auto;
    width:min(100%,720px);
    max-height:145px;
    object-fit:contain;
    object-position:left center;
    background:rgba(255,255,255,.96);
    border-radius:18px;
    padding:18px 24px;
    box-shadow:0 14px 40px rgba(0,0,0,.24);
}

.top {
    align-items:flex-start;
}

.top .ghost {
    margin-top:18px;
    white-space:nowrap;
}

.stat {
    min-height:118px;
}

.stat b {
    margin-bottom:10px;
}

.stat span {
    margin-top:0;
    line-height:1.35;
}

.stat small {
    margin-top:8px;
    line-height:1.35;
}

.hero {
    margin-top:18px;
}

@media(max-width:700px) {
    .brand-logo-wide {
        max-height:100px;
        padding:14px 16px;
    }

    .top {
        gap:10px;
    }

    .top .ghost {
        margin-top:8px;
    }
}

/* v2.1.1 branding polish */

.app-mark,
.brand-mark {
    width:50px;
    height:50px;
    border-radius:14px;
    background:#0d2628;
    border:1px solid rgba(54,210,194,.24);
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    flex:0 0 auto;
}

.app-mark img,
.brand-mark img {
    width:36px;
    height:36px;
    object-fit:contain;
    display:block;
}

.brand-logo-wide {
    width:min(100%,500px);
    max-height:108px;
    padding:13px 18px;
}

.stat {
    min-height:108px;
}

.stat b {
    display:block;
    margin-bottom:8px;
}

.stat span,
.stat small {
    display:block;
}


/* Schichtfoto PWA polish v2.2 */

.mobile {
    padding-top:22px;
    padding-bottom:28px;
}

.app-brand {
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:20px;
}

.app-brand .brand-icon {
    width:58px;
    height:58px;
    border-radius:16px;
    padding:8px;
    background:#0d2628;
    border:1px solid rgba(54,210,194,.24);
    object-fit:contain;
    flex:0 0 auto;
    box-shadow:0 10px 28px rgba(0,0,0,.22);
}

.app-brand h1 {
    margin:0;
    font-size:30px;
    line-height:1.05;
}

.app-brand p {
    margin:4px 0 0;
    opacity:.72;
}

.mobile .card {
    border-radius:20px;
    padding:22px;
    box-shadow:0 14px 36px rgba(0,0,0,.18);
}

.section-title {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    margin-bottom:8px;
}

.section-kicker {
    text-transform:uppercase;
    letter-spacing:.08em;
    font-size:12px;
    font-weight:700;
    opacity:.58;
    margin-bottom:4px;
}

.mobile-intro {
    line-height:1.55;
    margin-bottom:18px;
}

.status-pill {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:66px;
    padding:7px 11px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    letter-spacing:.02em;
    border:1px solid rgba(255,255,255,.08);
}

.status-pill.active {
    background:rgba(42,190,148,.14);
    color:#73e3ba;
    border-color:rgba(78,219,177,.22);
}

.picker {
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:128px;
    padding:18px;
    border:1.5px dashed rgba(94,224,207,.34);
    border-radius:18px;
    background:
        linear-gradient(
            180deg,
            rgba(21,79,76,.18),
            rgba(10,30,31,.14)
        );
    text-align:center;
    cursor:pointer;
    font-size:16px;
    font-weight:700;
    transition:.18s ease;
}

.picker:active {
    transform:scale(.99);
}

.picker input {
    position:absolute;
    opacity:0;
    pointer-events:none;
}

.selected {
    margin-top:10px;
    min-height:22px;
    text-align:center;
    font-size:14px;
}

.mobile .btn.big {
    width:100%;
    min-height:52px;
    margin-top:12px;
    border-radius:14px;
    font-weight:800;
    font-size:16px;
}

.mobile .btn.big:disabled {
    opacity:.45;
    cursor:not-allowed;
}

.device-chip {
    margin-top:20px;
    padding:14px 15px;
    border-radius:16px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    background:rgba(255,255,255,.035);
    border:1px solid rgba(255,255,255,.07);
}

.device-chip strong,
.device-chip small {
    display:block;
}

.device-chip small {
    margin-top:3px;
    opacity:.65;
}

.upload-status {
    margin-top:16px;
}

.successbox {
    padding:14px;
    border-radius:14px;
    background:rgba(34,166,122,.12);
    border:1px solid rgba(67,213,164,.22);
    line-height:1.45;
}

.scanner-panel {
    margin-top:16px;
}

.scanner-panel video {
    width:100%;
    max-height:55vh;
    display:block;
    object-fit:cover;
    background:#000;
    border-radius:16px;
}

.scannerActions {
    margin-top:12px;
}

.scannerStatus {
    margin-top:10px;
    min-height:22px;
    font-size:14px;
}

.footer-brand {
    margin-top:20px;
    padding:14px 16px;
    border-radius:16px;
    background:rgba(255,255,255,.035);
    border:1px solid rgba(255,255,255,.06);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
}

.footer-brand img {
    width:170px;
    max-width:62%;
    height:auto;
    display:block;
    background:#fff;
    border-radius:10px;
    padding:6px 9px;
}

.footer-brand span {
    font-size:12px;
    opacity:.55;
    white-space:nowrap;
}

@media(max-width:520px) {
    .mobile {
        padding-left:14px;
        padding-right:14px;
    }

    .app-brand .brand-icon {
        width:54px;
        height:54px;
    }

    .app-brand h1 {
        font-size:27px;
    }

    .mobile .card {
        padding:18px;
        border-radius:18px;
    }

    .picker {
        min-height:116px;
    }

    .footer-brand {
        align-items:flex-end;
    }

    .footer-brand img {
        width:150px;
    }
}

/* Scrollbare Übertragungshistorie */
.history-scroll {
    max-height: 360px;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 14px;
}

.history-scroll table {
    margin: 0;
}

.history-scroll th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #0c292b;
}

/* dezente Scrollbar */
.history-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(54,210,194,.35) rgba(255,255,255,.04);
}

.history-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.history-scroll::-webkit-scrollbar-track {
    background: rgba(255,255,255,.04);
}

.history-scroll::-webkit-scrollbar-thumb {
    background: rgba(54,210,194,.35);
    border-radius: 999px;
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.history-actions p {
    margin: 0;
    font-size: .9rem;
}
