:root {
    --ink: #363947;
    --green: #90BF4E;
    --bg: #f5f6f8;
    --card: #ffffff;
    --line: #e3e5ea;
    --muted: #7a7f8d;
}

* { box-sizing: border-box; }

/* verhindert iOS-Safari-Textvergroesserung im Querformat */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
}

.brand img { height: 42px; }

.nav { display: flex; align-items: center; gap: 1rem; margin-left: 1.5rem; }

.nav a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    padding: 0.3rem 0;
    border-bottom: 2px solid transparent;
}

.nav a.active, .nav a:hover { border-bottom-color: var(--green); }

.linklike {
    background: none;
    border: none;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.linklike:hover { color: var(--ink); }

.container {
    width: min(1100px, 100% - 2rem);
    margin: 2rem auto;
    flex: 1;
}

.auth-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.auth-card { width: 100%; max-width: 420px; }

h1 { font-size: 1.5rem; margin: 0 0 0.5rem; }

h2 { font-size: 1.15rem; margin: 0 0 1rem; }

.muted { color: var(--muted); }

label { display: block; font-weight: 600; margin: 1rem 0 0.35rem; font-size: 0.9rem; }

input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

input:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }

.btn {
    margin-top: 1.5rem;
    width: 100%;
    background: var(--green);
    color: #fff;
    font: inherit;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    cursor: pointer;
}

.btn:hover { filter: brightness(0.95); }

.alert {
    background: #fdecea;
    color: #b3261e;
    border: 1px solid #f5c6c2;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }

th {
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    padding: 0.4rem 0.6rem;
}

td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); }

tr:last-child td { border-bottom: none; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--line);
}

.badge-active, .badge-paid { background: #e6f2d5; color: #4a7220; }

.badge-unpaid { background: #fdecea; color: #b3261e; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    padding: 1.5rem;
}

/* --- Phase 1 --- */

.card-head { display: flex; justify-content: space-between; align-items: baseline; }

.tablelink { color: #5a8f23; font-weight: 600; text-decoration: none; }

.tablelink:hover { text-decoration: underline; }

.backlink { color: var(--muted); text-decoration: none; font-size: 0.9rem; }

.backlink:hover { color: var(--ink); }

.num { text-align: right; }

.strong { font-weight: 700; }

tfoot td { border-bottom: none; padding-top: 0.6rem; }

.meta-grid { display: flex; gap: 3rem; flex-wrap: wrap; }

.kv th { text-align: left; width: 130px; color: var(--muted); font-size: 0.9rem; text-transform: none; letter-spacing: 0; vertical-align: top; }

.badge-overdue, .badge-suspended, .badge-terminated { background: #fdecea; color: #b3261e; }

.badge-open, .badge-customer-reply { background: #e8f0fe; color: #1a56b8; }

.badge-answered { background: #e6f2d5; color: #4a7220; }

.badge-closed { background: var(--line); color: var(--muted); }

.thread { display: flex; flex-direction: column; gap: 1rem; margin: 1.5rem 0; }

.msg { border: 1px solid var(--line); border-radius: 10px; background: var(--card); max-width: 85%; }

.msg-admin { align-self: flex-start; margin-right: auto; border-left: 3px solid var(--ink); }

.msg-client { align-self: flex-end; margin-left: auto; border-right: 3px solid var(--green); background: #f7fbf1; }

.msg-head { padding: 0.5rem 1rem; font-size: 0.8rem; color: var(--muted); border-bottom: 1px solid var(--line); }

.msg-body { padding: 0.9rem 1rem; font-size: 0.92rem; line-height: 1.5; }

/* --- Phase 2: Ticketing --- */

textarea, select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: var(--card);
}

textarea:focus, select:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }

textarea { resize: vertical; }

.btn-inline { width: auto; margin-top: 0; padding: 0.5rem 1.1rem; display: inline-block; text-decoration: none; text-align: center; font-size: 0.9rem; }

.alert-ok {
    background: #e6f2d5;
    color: #4a7220;
    border: 1px solid #cde3ab;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}

/* --- Phase 2b: Anhaenge, Profil, Header-Feinschliff --- */

/* Baseline-buendig wie im Inline-Layout: die Unterkante des Logos (= loadit-
   Grundlinie) sitzt auf der Baseline von "Kundenportal" */
.brand { align-items: baseline; }

.brand span { line-height: 1; font-size: 1.3rem; }

.hint { color: var(--muted); font-size: 0.8rem; margin: 0.35rem 0 0; }

input[type="file"] {
    padding: 0.45rem;
    background: var(--bg);
    border: 1px dashed var(--line);
}

.msg-files {
    padding: 0.5rem 1rem 0.8rem;
    border-top: 1px dashed var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.msg-files a { color: #5a8f23; text-decoration: none; font-size: 0.85rem; font-weight: 600; }

.msg-files a:hover { text-decoration: underline; }

.form-row { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; }

/* --- 2FA --- */

.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 10px; display: inline-block; padding: 0.6rem; margin: 0.5rem 0; }

.qr-box svg { display: block; }

code { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 0.1rem 0.4rem; font-size: 0.85rem; }

/* --- Swiss QR Zahlteil --- */

.qr-pay { display: flex; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }

.qr-wrap { position: relative; width: 220px; height: 220px; flex: 0 0 auto; }

.qr-wrap svg { display: block; width: 220px; height: 220px; }

/* Schweizerkreuz-Overlay: 7/46 der Codebreite, wie auf dem Papier-Zahlteil */
.qr-cross {
    position: absolute;
    top: 50%; left: 50%;
    width: 33px; height: 33px;
    transform: translate(-50%, -50%);
    background: #000;
    box-shadow: 0 0 0 2px #fff;
}

.qr-cross::before, .qr-cross::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
}

.qr-cross::before { width: 6px; height: 20px; }

.qr-cross::after { width: 20px; height: 6px; }

.qr-pay-info { flex: 1; min-width: 260px; }

/* --- KPI-Reihe (Stat-Tiles) --- */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 0 0 1.5rem;
}

@media (max-width: 900px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }


.kpi {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    text-decoration: none;
    color: var(--ink);
}

.kpi:hover { border-color: var(--green); }

.kpi-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}

.kpi-value {
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1.2;
}

.kpi-sub { font-size: 0.8rem; color: var(--muted); }

/* --- Mobile --- */

/* Tabellen scrollen innerhalb der Karte statt die Seite zu sprengen */
.card { overflow-x: auto; }

.burger {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}

@media (max-width: 1024px) {
    .topbar { position: relative; }

    .burger { display: block; }

    .nav { display: none; }

    .topbar.open .nav {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
        position: absolute;
        top: calc(100% + 6px);
        right: 0.9rem;
        left: auto;
        min-width: 190px;
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 10px;
        box-shadow: 0 10px 22px rgba(54, 57, 71, 0.14);
        padding: 0.8rem 1.1rem 0.9rem;
        z-index: 20;
    }

    /* aktiver Punkt: gleiche gruene Unterstreichung wie in der horizontalen Nav */
    .topbar.open .nav a { padding: 0.35rem 0 0.15rem; }

    .brand img { height: 36px; }

    .brand span { font-size: 1.2rem; }

    .container { margin: 1.2rem auto; }

    h1 { font-size: 1.3rem; }
}

/* Admin-Nav ist kurz (4 Punkte) - inline lassen, Burger erst auf schmalen Fenstern */
@media (min-width: 721px) and (max-width: 1024px) {
    .admin-bar .burger { display: none; }
    .admin-bar .nav { display: flex; }
}

@media (max-width: 400px) {
    .brand span { display: none; }
}

/* --- Responsive Tabellen: Zeilen werden auf Mobile zu Karten --- */

.rt-mobile-only { display: none; }

@media (max-width: 700px) {
    .rtable thead { display: none; }

    .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }

    .rtable tr {
        padding: 0.65rem 0;
        border-bottom: 1px solid var(--line);
    }

    .rtable tr:last-child { border-bottom: none; padding-bottom: 0; }

    .rtable tr:first-child { padding-top: 0; }

    .rtable td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 1rem;
        border-bottom: none;
        padding: 0.18rem 0;
        text-align: right;
    }

    .rtable td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.78rem;
        color: var(--muted);
        text-align: left;
        flex: 0 0 auto;
    }

    .rtable td.rt-title {
        display: block;
        font-weight: 700;
        text-align: left;
        padding-bottom: 0.3rem;
    }

    .rtable td.rt-title::before { content: none; }

    .rtable td.rt-actions { justify-content: flex-end; padding-top: 0.45rem; }

    .rtable td.rt-actions::before { content: none; }

    .rt-hide-mobile { display: none !important; }

    .rt-mobile-only { display: inline; font-weight: 600; }
}

/* KPI-Kacheln: im Hochformat 2x2 statt gestapelt */
@media (max-width: 480px) {
    .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }

    .kpi { padding: 0.75rem 0.9rem; }

    .kpi-value { font-size: 1.2rem; }

    .kpi-label { font-size: 0.74rem; }

    .kpi-sub { font-size: 0.7rem; }
}

/* --- Aufklappbare Produktgruppen (Dashboard) --- */

.pgroup { border-bottom: 1px solid var(--line); }

.pgroup:last-child { border-bottom: none; }

.pgroup summary {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.65rem 0 0.65rem 1.1rem;
    cursor: pointer;
    list-style: none;
    position: relative;
    font-size: 0.92rem;
}

.pgroup summary::-webkit-details-marker { display: none; }

.pgroup summary::before {
    content: '';
    position: absolute;
    left: 0.15rem;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-60%) rotate(-45deg);
    transition: transform 0.15s;
}

.pgroup[open] summary::before { transform: translateY(-70%) rotate(45deg); }

.pg-name { font-weight: 600; }

.pg-count {
    display: inline-block;
    background: #e6f2d5;
    color: #4a7220;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.05rem 0.5rem;
    margin-left: 0.3rem;
}

.pg-next { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }

.pg-items {
    list-style: none;
    margin: 0 0 0.6rem;
    padding: 0 0 0 1.1rem;
}

.pg-items li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.3rem 0;
    font-size: 0.88rem;
    border-top: 1px dashed var(--line);
}

.pg-items li:first-child { border-top: none; }

/* Ausrichtung: Kachel-Text auf gleicher Linie wie Karten-Inhalt */
.kpi { padding: 1rem 1.5rem; }

@media (max-width: 480px) {
    .card { padding: 1rem; }
    .kpi { padding: 0.75rem 1rem; }
}

.footer a { color: #5a8f23; text-decoration: none; font-weight: 600; }

.footer a:hover { text-decoration: underline; }

/* Datum in der Aktuelles-Karte: klein und im CI-Gruen */
.ann-date { font-size: 0.8rem; font-weight: 600; color: #5a8f23; white-space: nowrap; }

/* --- Rechnungsfilter, Pager, Announcements --- */

.filter-row { display: flex; gap: 0.8rem; margin-bottom: 1rem; }

.filter-row select { width: auto; min-width: 140px; }

.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 0.9rem;
    font-size: 0.88rem;
}

.ann-divide { border-bottom: 1px solid var(--line); margin-bottom: 0.9rem; padding-bottom: 0.9rem; }

.ann-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin-bottom: 0.3rem; }

.ann-body { font-size: 0.9rem; line-height: 1.55; }

.ann-body p { margin: 0.3rem 0; }

/* Ankuendigungen ueber den Kacheln: dezent mit gruenem Akzent.
   Innenabstand identisch zu .card; der 3px-Akzentbalken wird kompensiert,
   damit der Text buendig mit Kacheln und anderen Karten steht */
.ann-card { border-left: 3px solid var(--green); margin-bottom: 1rem; padding-left: calc(1.5rem - 2px); }

.ann-card h2 { margin-bottom: 0.6rem; }

@media (max-width: 480px) {
    .ann-card { padding-left: calc(1rem - 2px); }
}

/* Kopier-Icons auf der QR-Karte (CI-Gruen, wechseln kurz zum Haken) */
.copybtn {
    background: none;
    border: none;
    color: var(--green);
    padding: 0.1rem;
    margin-left: 0.3rem;
    cursor: pointer;
    vertical-align: middle;
    line-height: 0;
}

.copybtn:hover { color: #5a8f23; }

.copybtn .ic-check { display: none; }

.copybtn.copied .ic-copy { display: none; }

.copybtn.copied .ic-check { display: inline; }

/* --- Typo-Hierarchie: Inhalts-Titel deutlich unter Karten-Titeln --- */

.ann-head strong { font-size: 0.95rem; }

.ann-head { margin-bottom: 0.35rem; }

/* --- Logout: Icon in der horizontalen Nav, Text im Burger-Menue --- */

.logout { display: flex; align-items: center; }

.logout-icon { display: block; }

.logout-text { display: none; }

@media (max-width: 820px) {
    .topbar.open .nav .logout-icon { display: none; }

    .topbar.open .nav .logout-text { display: inline; }
}

/* --- Header: Nav auf gleicher Hoehe wie "Kundenportal", Logout in CI-Gruen --- */

.topbar { align-items: flex-end; }

.nav { align-items: flex-end; }

.nav a { line-height: 1; padding: 0 0 2px; }

.logout { color: var(--green); padding-bottom: 2px; }

.logout:hover { color: #5a8f23; }

.burger { align-self: center; }

/* QR-Code auf schmalen Screens horizontal zentrieren */
@media (max-width: 700px) {
    .qr-wrap { margin-left: auto; margin-right: auto; }
}

/* --- Admin-Bereich Doku-Verwaltung --- */

.admin-bar { border-bottom: 2px solid var(--green); }

.admin-flag {
    background: #fff8e6; border: 1px solid #f0d98a; color: #8a6d20;
    border-radius: 8px; padding: 0.5rem 0.9rem; font-size: 0.82rem; margin-bottom: 1.2rem;
}

.sec-actions { display: flex; gap: 0.6rem; align-items: center; }

.sec-actions form { display: inline; }

.linklike.danger { color: #b3261e; }

.hidden-form { display: none; }

.edit-tbl { width: 100%; margin: 0.6rem 0; }

.edit-tbl th { padding: 0.3rem 0.4rem; }

.edit-tbl td { padding: 0.2rem 0.3rem; border-bottom: none; }

.edit-tbl input { padding: 0.4rem 0.5rem; }

.cols-wrap { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.4rem 0; }

.col-input { width: auto; min-width: 130px; }

.btn.light { background: var(--bg); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }

.cred-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin: 0.3rem 0; }

.cred-row input { width: auto; flex: 1; min-width: 130px; }

.cred-add { border-top: 1px dashed var(--line); padding-top: 0.7rem; margin-top: 0.5rem; }

/* Gefahrenzone (Doku löschen im Admin) */
.danger-zone { border-color: #e4b6b2; }
.danger-zone h2 { color: #b3261e; }
.danger-btn { background: #b3261e; }
.danger-btn:hover { background: #921f19; }

/* Offerten: verbindliche Annahme */
.checkline { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.4rem 0 0.9rem; cursor: pointer; }
.checkline input[type=checkbox] { width: auto; margin-top: 0.2rem; flex: 0 0 auto; }

/* Spalten-Konfigurator (custom-Zugänge im Admin) */
.colcfg-row { display: flex; gap: 0.5rem; align-items: center; margin: 0.3rem 0; }
.colcfg-row select { width: auto; min-width: 220px; }
.colcfg-row input { width: auto; flex: 1; min-width: 160px; }

.cred-del { }

.cred-del td { display: flex; justify-content: space-between; align-items: center; padding: 0.1rem 0.3rem 0.6rem; border-bottom: 1px solid var(--line); }

.cred-del form { display: inline; }

.inline-title { display: flex; gap: 0.5rem; margin-bottom: 0.6rem; }

.inline-title input { flex: 1; }

.tbl-cols { margin: 0.6rem 0; }

/* --- Doku-Kundenansicht: Passwort-Reveal --- */

.revealbtn, .copybtn2 {
    background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
    font: inherit; font-size: 0.78rem; font-weight: 600; color: #5a8f23;
    padding: 0.1rem 0.55rem; cursor: pointer;
}

.revealbtn:hover, .copybtn2:hover { border-color: var(--green); }

code.revealed { font-family: monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 0.1rem 0.4rem; font-size: 0.85rem; }

.wifiqrbtn {
    background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
    font: inherit; font-size: 0.78rem; font-weight: 600; color: #5a8f23;
    padding: 0.1rem 0.55rem; cursor: pointer;
}
.wifiqrbtn:hover { border-color: var(--green); }

/* WLAN-QR-Modal */
.qr-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.qr-modal[hidden] { display: none; }
.qr-backdrop { position: absolute; inset: 0; background: rgba(54,57,71,.55); }
.wqr-box {
    position: relative; background: #fff; border-radius: 10px;
    box-shadow: 0 8px 30px rgba(54,57,71,.25);
    padding: 1.5rem 1.6rem 1.3rem; max-width: 300px; width: 90%; text-align: center;
}
.qr-close {
    position: absolute; top: 0.4rem; right: 0.6rem; background: none; border: none;
    font-size: 1.5rem; line-height: 1; color: var(--ink); cursor: pointer; padding: 0.2rem 0.4rem;
}
.qr-title { color: var(--green); margin: 0 0 0.2rem; }
.qr-ssid { font-weight: 600; margin-bottom: 0.9rem; word-break: break-word; }
.qr-svg { display: inline-block; }
.qr-svg svg { width: 200px; height: 200px; display: block; }
.qr-hint { font-size: 0.8rem; margin: 0.9rem 0 0; }

/* Untersektionen unter "Passwörter / Logins" (Doku-Kundenansicht) */
h3.cred-sub { font-size: 1rem; color: var(--ink); margin: 1.4rem 0 0.5rem; }
h3.cred-sub:first-of-type { margin-top: 0.3rem; }

/* --- Dokumentations-Ansicht im PDF-Look (weisses Blatt statt Boxen) --- */

.doc-sheet {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(54,57,71,.06);
    max-width: 900px;
    margin: 0 auto 1.5rem;
    padding: 3rem 3.2rem;
}

/* Kapitel wie im PDF in GROSSBUCHSTABEN, Unterkapitel im gleichen Grün;
   Schriftgrössen bleiben bildschirmtauglich (16pt/13pt sind Papiermasse) */
.doc-h2 {
    color: var(--green);
    font-weight: 600;
    font-size: 1.3rem;
    margin: 1.9rem 0 0.5rem;
    text-transform: uppercase;
}

.doc-h2:first-child { margin-top: 0; }

.doc-h3 {
    color: var(--green);
    font-weight: 600;
    font-size: 1.05rem;
    margin: 1.4rem 0 0.4rem;
}

.doc-num { display: inline-block; width: 2cm; }

.doc-body { margin-left: 2cm; }

.doc-body p { margin: 0.3rem 0 0.8rem; line-height: 1.55; }

.doc-tbl { overflow-x: auto; margin: 0.4rem 0 1rem; }

.doc-sheet table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

.doc-sheet th {
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink);
    border-bottom: 1px solid var(--green);
    padding: 0.35rem 0.55rem;
}

.doc-sheet td { padding: 0.4rem 0.55rem; border-bottom: none; vertical-align: top; }

.doc-sheet tr.z td { background: #deeccc; } /* gleicher Zebra-Ton wie im PDF */

.doc-sheet .revealbtn, .doc-sheet .copybtn2 {
    background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
    font: inherit; font-size: 0.78rem; font-weight: 600; color: #5a8f23;
    padding: 0.05rem 0.5rem; cursor: pointer;
}

@media (max-width: 700px) {
    .doc-sheet { padding: 1.4rem 1.1rem; }
    .doc-h2 { font-size: 1.15rem; }
    .doc-num { width: 11mm; }
    .doc-body { margin-left: 11mm; }
}

/* Spaltentrenner in den Passwörter/Logins-Tabellen (dezent grün) */
.doc-sheet td.cs { border-left: 1px solid #a3cc6e; }

/* Versionen-Tabelle wie im PDF: Kopf in GROSSBUCHSTABEN und schwarz, alle Spalten rechtsbündig */
.doc-sheet table.ver th { text-transform: uppercase; color: #000; font-weight: 700; }
.doc-sheet table.ver th, .doc-sheet table.ver td { text-align: right; }
.doc-sheet table.ver th:nth-child(1) { width: 12%; }
.doc-sheet table.ver th:nth-child(2) { width: 18%; }
.doc-sheet table.ver th:nth-child(3) { width: 17%; }

/* --- Einfacher Rich-Text-Editor (Admin) --- */
.rt-toolbar { display: flex; gap: 0.3rem; margin: 0.3rem 0; align-items: center; }
.rt-toolbar button { width: 2rem; height: 2rem; border: 1px solid var(--line); background: var(--bg); border-radius: 5px; cursor: pointer; font-size: 0.9rem; }
.rt-toolbar button:hover { border-color: var(--green); }
.rt-toolbar input[type=color] { width: 2.2rem; height: 2rem; border: 1px solid var(--line); border-radius: 5px; padding: 2px; cursor: pointer; background: #fff; }
.rt-edit { border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.75rem; min-height: 5rem; background: #fff; font-size: 0.95rem; line-height: 1.55; }
.rt-edit:focus { outline: 2px solid var(--green); }
.doc-body .rt { line-height: 1.55; }

/* Rechnungspositionen im PDF-Look (Name fett, Details, Tasks als kursive Bullets) */
.pos-cell { vertical-align: top; }
.pos-amount { vertical-align: top; white-space: nowrap; }
.pos-name { font-weight: 600; }
.pos-detail { font-size: 0.9rem; color: var(--ink); }
.pos-tasks { margin: 0.35rem 0 0.1rem 1.1rem; padding: 0; }
.pos-tasks li { font-style: italic; color: var(--muted); font-size: 0.9rem; margin: 0.1rem 0; }
.pos-spec { font-style: italic; color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; line-height: 1.5; }

/* Passwort-PDF-Karte in der IT-Dokumentation */
.pwpdf-card { margin-bottom: 1.2rem; }
.pwpdf-card h2 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.pwpdf-card p { margin: 0 0 0.7rem; }
.pwpdf-card form { margin: 0; }

/* „Als Kunde ansehen" (Admin): auffälliger Balken über dem Kopf, gleiche Gelbtöne wie .admin-flag */
.imp-bar {
    display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
    background: #ffe9a8; color: #5c4400; border-bottom: 2px solid #e0b640;
    padding: 0.5rem 1rem; font-size: 0.88rem; text-align: center;
}
.imp-bar form { margin: 0; }
.imp-back {
    background: var(--ink); color: #fff; border: 0; border-radius: 6px;
    padding: 0.3rem 0.8rem; font: inherit; font-size: 0.82rem; cursor: pointer;
}
.imp-back:hover { background: #20222b; }

/* Jährliche Kosten (Produkte-Seite): Total gross in Ink, Aufschlüsselung als Tabelle mit Summenzeile */
.cost-total { display: flex; align-items: baseline; justify-content: space-between; gap: 0.4rem 1.5rem; flex-wrap: wrap; margin: 0.2rem 0 1rem; }
.cost-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.cost-unit { font-size: 0.9rem; color: var(--muted); margin-left: 0.4rem; }
.cost-sub { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cost-table td.num, .cost-table th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-table tr.cost-sum td { font-weight: 700; border-top: 2px solid var(--green); border-bottom: none; }
@media (max-width: 700px) {
    .cost-table tfoot { display: block; }
    .cost-table tr.cost-sum { border-top: 2px solid var(--green); margin-top: 0.4rem; padding-top: 0.65rem; }
    .cost-table tr.cost-sum td { border-top: none; }
    .cost-value { font-size: 1.35rem; }
}
/* Jahreskosten nach Produktgruppe: Blockkopf mit Zwischensumme (Grün-Tint wie .ann-card/Boxen) */
.cost-table tr.cost-group td { background: #f1f7e8; font-weight: 600; color: var(--ink); border-top: 1px solid #d6e8bd; }
.cost-table tbody.cost-block tr:not(.cost-group) td.rt-title { padding-left: 1.4rem; }
@media (max-width: 700px) {
    .cost-table tbody.cost-block { display: block; margin-bottom: 0.9rem; }
    .cost-table tr.cost-group { background: #f1f7e8; border-radius: 6px; padding: 0.55rem 0.7rem; border-bottom: none; }
    .cost-table tr.cost-group td { background: none; border-top: none; }
    .cost-table tbody.cost-block tr:not(.cost-group) td.rt-title { padding-left: 0; }
}

/* Benutzer-Verwaltung (Profil des Hauptkontakts, Admin): Checkbox-Zeilen, Unterüberschriften, schlichte Listen */
label.check { display: flex; align-items: center; gap: 0.45rem; font-weight: normal; margin: 0.25rem 0; font-size: 0.9rem; }
label.check input { width: auto; margin: 0; }
.perm-form label.check { font-size: 0.85rem; margin: 0.1rem 0; }
.perm-form .linklike { margin-top: 0.25rem; }
h3.sub { font-size: 0.95rem; margin: 1.4rem 0 0.4rem; color: var(--ink); }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.plain-list li:last-child { border-bottom: none; }
.form-row.form-row-even { grid-template-columns: 1fr 1fr; }
.req-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.4rem; }
.req-actions input[type="text"] { width: 360px; max-width: 100%; margin: 0; }
@media (max-width: 700px) { .form-row.form-row-even { grid-template-columns: 1fr; } }
.inline-details { display: inline-block; margin-right: 0.6rem; }
.inline-details summary { list-style: none; cursor: pointer; display: inline; }
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details[open] .perm-form { text-align: left; margin-top: 0.3rem; }

/* IT-Doku: Einträge „nur Hauptkontakt" (Admin-Editor, Vorschau, Ansicht des Hauptkontakts) */
.badge-owneronly { background: #fff3cd; color: #7a5b00; }
.cred-row.is-owneronly { background: #fff8e1; border-radius: 6px; padding: 0.2rem 0.3rem; }
.doc-sheet tr.oo td:first-child::before { content: "🔒 "; }
.doc-h2 .badge-owneronly, .doc-h3 .badge-owneronly { text-transform: none; font-size: 0.7rem; vertical-align: middle; }

/* Admin: nach dem Speichern bleibt die Seite an der alten Stelle – die Meldung schwebt dann oben im Bild */
.scroll-restored .alert-flash { position: fixed; top: 0.8rem; left: 50%; transform: translateX(-50%); z-index: 100;
    width: max-content; max-width: min(92vw, 640px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); cursor: pointer; }
.scroll-restored .alert-flash.alert-ok { animation: flash-out 0.4s ease 3.5s forwards; }
@keyframes flash-out { to { opacity: 0; visibility: hidden; } }
