/* Kunden-Portal (Phase 0, #869) - eigenstaendiges mobiles App-Design.
   Bewusst getrennt von der internen Toolbox-Optik. */

:root {
    --pt-blue: #274c90;
    --pt-blue-d: #1d3a6e;
    --pt-bg: #eef1f6;
    --pt-card: #ffffff;
    --pt-line: #e2e5ec;
    --pt-text: #23252f;
    --pt-muted: #8a8fa3;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

.pt-body {
    background: var(--pt-bg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--pt-text);
    min-height: 100vh;
}

/* Handy-artige Huelle, auf Desktop zentriert */
.pt-shell {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--pt-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,.06);
}

/* Header */
.pt-header {
    background: var(--pt-blue);
    color: #fff;
    padding: 1.3rem 1.1rem 1rem;
}
.pt-h-brand { font-size: .78rem; opacity: .85; display: block; }
.pt-h-title { font-size: 1.35rem; font-weight: 600; display: block; margin-top: .1rem; }

/* Main */
.pt-main { flex: 1; padding: 1rem; padding-bottom: 5rem; }

.pt-flash {
    background: #e2f4ec; color: #1f7a5a; border-radius: 10px;
    padding: .6rem .8rem; font-size: .85rem; margin-bottom: .8rem;
}

/* Kachel-Raster (Dashboard) */
.pt-tilegrid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.pt-tile {
    background: var(--pt-card); border: 1px solid var(--pt-line); border-radius: 14px;
    padding: 1.1rem .7rem; text-align: center; text-decoration: none; color: var(--pt-text);
    position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem;
    min-height: 96px; justify-content: center;
}
.pt-tile i { font-size: 1.7rem; color: var(--pt-blue); }
.pt-tile span { font-size: .85rem; font-weight: 500; }
.pt-tile-soon { color: var(--pt-muted); }
.pt-tile-soon i { color: #c4c8d4; }
.pt-tile-soon small { font-size: .62rem; text-transform: uppercase; letter-spacing: .5px; color: #b7bccb; }
.pt-tile-badge {
    position: absolute; top: .5rem; right: .5rem; background: #fdf0dd; color: #b5721a;
    font-size: .62rem; padding: .12rem .45rem; border-radius: 20px;
}

/* Listen (Rechnungen) */
.pt-listitem {
    background: var(--pt-card); border: 1px solid var(--pt-line); border-radius: 12px;
    padding: .75rem .85rem; margin-bottom: .6rem; display: flex; align-items: center; justify-content: space-between; gap: .6rem;
}
.pt-li-title { font-size: .92rem; font-weight: 600; display: block; }
.pt-li-sub { font-size: .76rem; color: var(--pt-muted); display: block; margin-top: .15rem; }
.pt-li-right { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.pt-pill { font-size: .68rem; padding: .18rem .5rem; border-radius: 20px; white-space: nowrap; }
.pt-pill-versendet, .pt-pill-erstellt { background: #e5ecf9; color: #274c90; }
.pt-pill-ueberfaellig { background: #fdf0dd; color: #b5721a; }
.pt-pill-bezahlt { background: #e2f4ec; color: #1f7a5a; }
.pt-pill-storniert { background: #edeef2; color: #8a8fa3; }
.pt-pdf { color: var(--pt-blue); font-size: 1.15rem; text-decoration: none; }

.pt-empty { text-align: center; color: var(--pt-muted); padding: 3rem 1rem; }
.pt-empty i { font-size: 2.2rem; display: block; margin-bottom: .5rem; opacity: .6; }
.pt-empty p { margin: 0; font-size: .9rem; }

/* Bottom-Nav */
.pt-bottomnav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px; background: #fff; border-top: 1px solid var(--pt-line);
    display: flex; padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom));
}
.pt-nav-form { flex: 1; margin: 0; }
.pt-nav-item {
    flex: 1; width: 100%; background: none; border: 0; cursor: pointer;
    text-align: center; text-decoration: none; color: var(--pt-muted);
    font-size: .62rem; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .3rem 0;
    font-family: inherit;
}
.pt-nav-item i { font-size: 1.25rem; }
.pt-nav-item.active { color: var(--pt-blue); }

/* Login */
.pt-login { display: flex; flex-direction: column; align-items: center; padding-top: 2.5rem; }
.pt-login-brand { text-align: center; margin-bottom: 1.5rem; }
.pt-login-logo {
    width: 64px; height: 64px; border-radius: 18px; background: var(--pt-blue); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.8rem; margin: 0 auto .7rem;
}
.pt-login-firm { font-size: .82rem; color: var(--pt-muted); display: block; }
.pt-login-title { font-size: 1.4rem; font-weight: 700; color: var(--pt-blue); display: block; }

.pt-card {
    background: var(--pt-card); border: 1px solid var(--pt-line); border-radius: 16px;
    padding: 1.3rem 1.2rem; width: 100%; box-shadow: 0 4px 18px rgba(0,0,0,.05);
}
.pt-login-card { max-width: 360px; }
.pt-label { font-size: .78rem; color: var(--pt-muted); display: block; margin: .6rem 0 .25rem; }
.pt-input {
    width: 100%; border: 1px solid var(--pt-line); border-radius: 10px; padding: .65rem .75rem;
    font-size: .95rem; color: var(--pt-text); background: #fbfcfe;
}
.pt-input:focus { outline: none; border-color: var(--pt-blue); background: #fff; }
.pt-check { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--pt-muted); margin: .8rem 0 0; }
.pt-btn {
    width: 100%; background: var(--pt-blue); color: #fff; border: 0; border-radius: 10px;
    padding: .75rem; font-size: .95rem; font-weight: 600; margin-top: 1rem; cursor: pointer;
}
.pt-btn:hover { background: var(--pt-blue-d); }
.pt-error { background: #fbe4e4; color: #b23b3b; border-radius: 10px; padding: .6rem .75rem; font-size: .82rem; margin-bottom: .3rem; }
.pt-login-foot { font-size: .74rem; color: var(--pt-muted); margin-top: 1.2rem; text-align: center; }

/* Helfer */
.mb-3 { margin-bottom: 1rem; }
.mb-0 { margin-bottom: 0; }

/* Dashboard-Kachel-Kennzahl */
.pt-tile-kpi { font-size: .68rem; color: var(--pt-blue); font-weight: 600; margin-top: .1rem; }

/* Hinweis-Box */
.pt-hint { font-size: .8rem; color: #46506a; background: #eef2f9; border-radius: 8px; padding: .5rem .7rem; margin-bottom: .8rem; }
.pt-hint a { color: var(--pt-blue); }

/* Formular */
.pt-form h3.pt-sec { font-size: .9rem; color: var(--pt-blue); margin: 0 0 .7rem; padding-bottom: .4rem; border-bottom: 1px solid var(--pt-line); }
.pt-sec small { color: var(--pt-muted); font-weight: 400; }
.pt-ro { background: #f5f6f9; border-radius: 8px; padding: .55rem .7rem; font-size: .88rem; color: #3b3f5c; margin-bottom: .6rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.pt-ro span { font-size: .66rem; color: var(--pt-muted); white-space: nowrap; }
.pt-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

/* Dokument-Darstellung (Impressum / Datenschutz) */
.pt-doc-actions { margin-bottom: .7rem; display: flex; gap: .5rem; }
.pt-btn-sm { background: var(--pt-blue); color: #fff; border: 0; border-radius: 8px; padding: .42rem .85rem; font-size: .8rem; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; }
.pt-btn-sm:hover { background: var(--pt-blue-d); }
.pt-doc { font-size: .85rem; line-height: 1.55; color: #23252f; }
.pt-doc h2 { font-size: 1.15rem; color: var(--pt-blue); margin: 0 0 .6rem; }
.pt-doc h3 { font-size: .92rem; margin: 1rem 0 .3rem; }
.pt-doc p { margin: 0 0 .6rem; }
.pt-disclaimer { background: #fdf6e9; border: 1px solid #f0d9a8; color: #8a6414; border-radius: 10px; padding: .7rem .8rem; font-size: .76rem; line-height: 1.45; margin-top: .8rem; }

/* Vorschau-/Testmodus-Banner (intern) */
.pt-vorschau {
    background: #b5721a; color: #fff; padding: .45rem .8rem;
    display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    font-size: .78rem;
}
.pt-vorschau form { margin: 0; }
.pt-vorschau button {
    background: rgba(255,255,255,.22); color: #fff; border: 0; border-radius: 6px;
    padding: .2rem .6rem; font-size: .72rem; cursor: pointer;
}
.pt-vorschau button:hover { background: rgba(255,255,255,.34); }
