/* TMS Kundenportal – Farben aus dem TMS-Auftritt (Navy, Petrol) */
:root {
  --navy: #1b2a50; --navy-2: #24366a; --teal: #5bbfcc; --teal-d: #2f8f9c; --teal-soft: #e6f5f7;
  --ink: #1d2733; --muted: #5d6b7c; --line: #dde3ea; --bg: #f4f6f9; --panel: #ffffff;
  --ok: #1f8a4c; --ok-soft: #e3f4ea; --warn: #b26a00; --warn-soft: #fff3dc; --bad: #c62828; --bad-soft: #fdeaea; --idle-soft: #eef1f5;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14.5px; line-height: 1.5; }
a { color: var(--teal-d); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; margin: 0 0 4px; color: var(--navy); }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .mono { font-family: ui-monospace, Consolas, monospace; } .nowrap { white-space: nowrap; } .right { text-align: right; } .grow { flex: 1; }

/* Rahmen */
.top { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 24px; height: 60px; position: sticky; top: 0; z-index: 5; }
.top img { height: 34px; background: #fff; border-radius: 6px; padding: 3px 6px; }
.top .brand { font-weight: 700; letter-spacing: 0.01em; } .top .brand small { display: block; font-weight: 500; color: #b9c6e4; font-size: 12px; }
.top .who { margin-left: auto; text-align: right; font-size: 13px; color: #dbe4f5; } .top .who b { color: #fff; }
.top .btn { background: transparent; color: #fff; border-color: #4a5c8f; }
.layout { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 60px); }
.nav { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.nav button:hover { background: var(--idle-soft); } .nav button.on { background: var(--teal-soft); color: var(--navy); font-weight: 650; box-shadow: inset 3px 0 0 var(--teal); }
.nav .count { background: var(--navy); color: #fff; border-radius: 10px; font-size: 11.5px; padding: 0 7px; font-weight: 600; }
.nav .sep { height: 1px; background: var(--line); margin: 10px 4px; }
.main { padding: 26px 30px 60px; max-width: 1240px; width: 100%; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } .nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; } .nav .sep { display: none; } .main { padding: 18px 14px 50px; } .top .who span { display: none; } }

/* Bausteine */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; } .grid .card { margin: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } @media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }
.big { font-size: 28px; font-weight: 700; color: var(--navy); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.btn:hover { border-color: var(--teal-d); } .btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; } .btn.primary:hover { background: var(--navy-2); }
.btn.danger { color: var(--bad); } .btn.small { padding: 4px 10px; font-size: 12.5px; } .btn:disabled { opacity: 0.5; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 13px; cursor: pointer; font-weight: 500; border-right: 1px solid var(--line); } .seg button:last-child { border-right: 0; }
.seg button.on { background: var(--navy); color: #fff; }
.f { display: block; margin-bottom: 12px; } .f > span { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fbfcfd; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; cursor: pointer; } .check input { width: auto; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.tablewrap { overflow-x: auto; } table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; } tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f8fafc; }
.empty { color: var(--muted); padding: 18px 4px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 12px; padding: 1px 9px; background: var(--idle-soft); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.portal { background: var(--teal-soft); color: var(--teal-d); } .pill.platform { background: #e8ebf7; color: var(--navy); }
.note { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; } .note.info { background: var(--teal-soft); } .note.warn { background: var(--warn-soft); color: #6b4300; } .note.bad { background: var(--bad-soft); color: var(--bad); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.linkbox { font-family: ui-monospace, Consolas, monospace; background: var(--idle-soft); border-radius: 8px; padding: 10px; word-break: break-all; margin-bottom: 10px; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--navy); color: #fff; border-radius: 8px; padding: 11px 16px; box-shadow: 0 6px 24px rgba(0,0,0,.2); z-index: 50; max-width: 420px; }
.toast.bad { background: var(--bad); }
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 14px; z-index: 40; overflow-y: auto; }
.modal .box { background: var(--panel); border-radius: 12px; padding: 22px 24px; width: min(560px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal .box.wide { width: min(760px, 100%); } .modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Anmeldung */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--navy) 0%, #23396e 55%, var(--teal-d) 140%); }
.auth .box { background: var(--panel); border-radius: 14px; padding: 30px 32px; width: min(430px, 100%); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.auth img { height: 54px; display: block; margin: 0 auto 14px; }
.auth h1 { text-align: center; } .auth .sub { text-align: center; }
.auth .btn.primary { width: 100%; justify-content: center; padding: 10px; }
.auth .foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 18px; }
.qr { display: flex; justify-content: center; margin: 6px 0 12px; } .qr svg { border: 1px solid var(--line); border-radius: 8px; }

/* Dokumente und Tickets */
.doc-ico { display: inline-grid; place-items: center; width: 34px; height: 40px; border-radius: 5px; background: var(--bad-soft); color: var(--bad); font-size: 10px; font-weight: 800; margin-right: 10px; vertical-align: middle; }
.doc-ico.img { background: var(--teal-soft); color: var(--teal-d); } .doc-ico.office { background: #e8ebf7; color: var(--navy); }
.docname { display: flex; align-items: center; } .docname a { font-weight: 600; text-decoration: none; color: var(--ink); } .docname a:hover { color: var(--teal-d); text-decoration: underline; }
.thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fff; max-width: 88%; }
.msg.tms { border-color: #c9e8ed; background: var(--teal-soft); align-self: flex-start; } .msg.customer { align-self: flex-end; background: #f3f5fa; }
.msg.internal { background: var(--warn-soft); border-color: #f1d9a6; align-self: stretch; max-width: none; } .msg.sys { border: 0; background: none; color: var(--muted); font-size: 12.5px; padding: 0 4px; align-self: center; }
.msg .meta { font-size: 12px; color: var(--muted); margin-bottom: 3px; } .msg .body { white-space: pre-wrap; word-break: break-word; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; } .files a { font-size: 13px; }
.ticket-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.prio-urgent { color: var(--bad); font-weight: 700; } .prio-high { color: var(--warn); font-weight: 650; }
.upload { border: 2px dashed var(--line); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; } .upload:hover, .upload.over { border-color: var(--teal); background: var(--teal-soft); }
.upload input { display: none; }
.upload { display: block; margin-top: 12px; }
.layout > *, .split > *, .grid > * { min-width: 0; }
.files { gap: 10px; }
@media (max-width: 860px) { .toolbar .seg { max-width: 100%; } .top { padding: 0 12px; gap: 10px; } .top .brand small { display: none; } .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .big { font-size: 22px; } .msg { max-width: 100%; } }
