/* Kundenportal – Gestaltung angelehnt an den AS-Manager (Kopfleiste, Kacheln) */
:root {
  --navy: #354a5f; --green: #1a8c4d; --green-d: #147a42; --green-l: #e7f3ec;
  --orange: #e67e22; --blue: #0070f2; --danger: #d20a0a;
  --bg: #f5f6f7; --card: #fff; --border: #d9d9d9; --border2: #c2c2c2;
  --text: #1d2d3e; --text2: #556b82; --text3: #8a98a8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: 'Helvetica Neue', 'Segoe UI', Arial, sans-serif; font-size: 14px; background: var(--bg); color: var(--text); min-height: 100vh; }
button { font: inherit; cursor: pointer; }
a { color: var(--green-d); }

/* Anmeldung / Passwort */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 28px 28px 24px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.auth-logo { width: 190px; max-width: 70%; align-self: center; margin-bottom: 2px; }
.auth-sub { text-align: center; color: var(--text2); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.auth-title { font-size: 17px; font-weight: 600; margin-top: 6px; }
.auth-text { margin: 0; color: var(--text2); font-size: 13px; line-height: 1.5; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text2); }
input[type=text], input[type=password], input:not([type]) { height: 40px; border: 1px solid var(--border2); border-radius: 8px; padding: 0 12px; font-size: 15px; color: var(--text); background: #fff; outline: none; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(26,140,77,.15); }
.btn-primary { background: var(--green); color: #fff; border: 1px solid var(--green); border-radius: 8px; height: 42px; font-weight: 600; font-size: 15px; margin-top: 4px; }
.btn-primary:hover { background: var(--green-d); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-inline { height: 38px; padding: 0 18px; font-size: 14px; align-self: flex-start; }
.btn-link { background: none; border: none; color: var(--text2); font-size: 13px; text-decoration: underline; }
.err { color: var(--danger); font-size: 13px; min-height: 0; }
.err:empty, .ok:empty { display: none; }
.ok { color: var(--green-d); font-size: 13px; }
.legal { text-align: center; font-size: 12px; color: var(--text3); padding: 18px 16px 22px; }
.legal a { color: var(--text3); }

/* Kopfleiste */
.topbar { background: var(--navy); color: #fff; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 20px; position: sticky; top: 0; z-index: 5; }
.tb-logo { width: 30px; height: 30px; }
.tb-title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-space { flex: 1; }
.tb-firma { font-size: 13px; color: #c4ccd4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.tb-btn:hover { background: rgba(255,255,255,.22); }
.tb-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Inhalt */
.content { max-width: 1100px; margin: 0 auto; padding: 24px 20px 10px; }
.hello { font-size: 21px; font-weight: 600; margin: 4px 2px 2px; }
.sub { font-size: 13px; color: var(--text3); margin: 0 2px 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; }
.tile { all: unset; box-sizing: border-box; cursor: pointer; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; transition: border-color .15s, box-shadow .15s; }
.tile:hover { border-color: var(--green); box-shadow: 0 2px 8px rgba(26,140,77,.10); }
.tile:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.ic { width: 40px; height: 40px; border-radius: 10px; background: var(--green-l); color: var(--green-d); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ic svg, .doc-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile-name { font-size: 14px; font-weight: 600; line-height: 1.25; }
.tile-kpi { font-size: 12px; color: var(--text3); margin-top: 3px; }
.badge { display: inline-block; background: var(--orange); color: #fff; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 2px 8px; white-space: nowrap; }
.badge.chg { background: var(--blue); }
.empty { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 22px; color: var(--text2); }
.empty p { margin: 4px 0; }

/* Dokumentliste */
.list { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.doc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid #eaecee; }
.doc:first-child { border-top: none; }
.doc.is-new { background: #fff8f0; }
.doc-ic { color: #c0392b; flex-shrink: 0; display: flex; }
.doc-main { flex: 1; min-width: 0; }
.doc-title { font-weight: 600; line-height: 1.3; word-break: break-word; }
.doc-title .badge { margin-left: 6px; vertical-align: 1px; }
.doc-meta { font-size: 12px; color: var(--text3); margin-top: 2px; }
.doc-btns { display: flex; gap: 6px; flex-shrink: 0; }
.btn { background: #fff; border: 1px solid var(--border2); border-radius: 7px; padding: 6px 12px; font-size: 13px; color: var(--text); }
.btn:hover { border-color: var(--green); color: var(--green-d); }

/* Einstellungen */
.card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.card h2 { font-size: 16px; margin: 0; }
.muted { color: var(--text2); font-size: 13px; margin: 0; line-height: 1.5; }
.check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.check input { width: 18px; height: 18px; accent-color: var(--green); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.2); z-index: 20; max-width: calc(100vw - 32px); }

@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .tb-firma, .tb-logout span { display: none; }
  .content { padding: 16px 12px 6px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .doc { flex-wrap: wrap; }
  .doc-btns { width: 100%; padding-left: 34px; }
  .doc-btns .btn { flex: 1; }
}
