/* AWEKAS Support – gemeinsames Stylesheet für Admin-Bereich und Kundenportal (Farben wie AWEKAS Newsletter) */
:root {
  --bg: #f6f7f9; --card: #fff; --text: #191919; --muted: #6b7280; --line: #e5e7eb;
  --primary: #0089e3; --primary-dark: #006fb8; --primary-soft: #e6f3fc;
  --green: #16a34a; --red: #dc2626; --orange: #f59e0b; --grey: #9ca3af; --blue: #0089e3; --purple: #7c3aed; --teal: #0d9488;
  --radius: 14px;
  /* Logo-Original (380 × 116 px): Die AWEKAS-Buchstaben enden 41 px über dem unteren Bildrand */
  --logo-baseline: calc(41 / 116);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f1f3f5; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
h1 { font-size: 26px; margin: 0 0 16px; }
h2 { font-size: 19px; margin: 0 0 14px; }
h3 { font-size: 16px; margin: 16px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.ok-text { color: var(--green); }
.warn-text { color: #9a5b00; }
.err-text { color: var(--red); }

/* ---------- Kopfzeile ---------- */
.top { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 60px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: block; flex-shrink: 0; white-space: nowrap; line-height: 1; color: #000; text-decoration: none !important; }
.brand img { --h: 44px; height: var(--h); width: auto; max-width: none; display: inline-block; vertical-align: calc(var(--h) * var(--logo-baseline) * -1); }
.brand span { color: var(--primary); font-weight: 600; font-size: 19px; letter-spacing: .3px; margin-left: 6px; }
.top nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a { color: var(--text); padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.top nav a.active, .top nav a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.who { display: flex; gap: 8px; align-items: center; font-size: 14px; white-space: nowrap; }
.lang { font-weight: 600; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; }
.pill { background: var(--primary); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 6px; }

main { max-width: 1320px; margin: 0 auto; padding: 28px 24px 80px; }
main.narrow { max-width: 860px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 16px 40px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; overflow-x: auto; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.head h1 { margin: 0; }
.back { display: inline-block; margin-bottom: 10px; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 18px; }

/* ---------- Formulare ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 14px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--text); padding: 9px 11px; border: 1px solid #cfd4da; border-radius: 8px; background: #fff; min-width: 0; width: 100%; }
input[type=checkbox] { width: auto; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.row > * { flex: 1; min-width: 180px; }
.row.two > * { flex: 1 1 280px; }
.form.wide { max-width: none; }
.narrow-form { max-width: 520px; margin: 0 auto; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 0 0 14px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.search, .filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.search input { flex: 1; min-width: 220px; }
.filters input, .filters select { width: auto; }
form.inline { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
form.inline select { width: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 8px; border: 1px solid #cfd4da; background: #fff; color: var(--text); cursor: pointer; text-decoration: none !important; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); color: #fff; }
.btn.note { background: #fff8e1; border-color: #f3d27a; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; margin-bottom: 8px; }
.btn.danger { color: var(--red); border-color: #f3b4b4; }
button.link { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 2px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 500; }
.flash.ok { background: #e8f7ee; color: #14532d; }
.flash.err { background: #fdecec; color: #7f1d1d; }
.flash.info { background: var(--primary-soft); color: #0b4a75; }

/* ---------- Badges, Kategorien, Balken ---------- */
.badge, .cat { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.blue { background: #e0f0fc; color: #075985; }
.badge.orange { background: #fff1d6; color: #92400e; }
.badge.purple { background: #efe7fe; color: #5b21b6; }
.badge.green { background: #dcfce7; color: #166534; }
.badge.grey { background: #eef0f3; color: #4b5563; }
.badge.red { background: #fde2e2; color: #991b1b; }
.cat { font-weight: 500; border: 1px solid; background: #fff; }
.cat.grey { color: #4b5563; border-color: #d1d5db; }
.cat.blue { color: #075985; border-color: #9fd2f5; }
.cat.green { color: #166534; border-color: #9ddfb3; }
.cat.orange { color: #92400e; border-color: #f6cf86; }
.cat.red { color: #991b1b; border-color: #f4a9a9; }
.cat.purple { color: #5b21b6; border-color: #cdb6fb; }
.cat.teal { color: #115e59; border-color: #92dcd3; }
.bar { display: inline-block; min-width: 2.2em; padding: 0 8px; border-radius: 6px; font-weight: 600; font-size: 13px; background: linear-gradient(90deg, var(--c, var(--primary-soft)) var(--w, 0%), #f3f4f6 var(--w, 0%)); }
.bar.blue { --c: #bfe2fa; } .bar.orange { --c: #fde3a7; } .bar.purple { --c: #ddd0fd; } .bar.green { --c: #bbf0cd; } .bar.grey { --c: #e5e7eb; } .bar.red { --c: #fbc6c6; } .bar.teal { --c: #b3ece5; }

/* ---------- Kacheln ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); display: flex; flex-direction: column; border-top: 4px solid var(--grey); }
.tile:hover { text-decoration: none; border-color: var(--primary); }
.tile b { font-size: 28px; line-height: 1.1; }
.tile span { color: var(--muted); font-size: 13px; }
.tile.blue { border-top-color: var(--blue); } .tile.orange { border-top-color: var(--orange); } .tile.purple { border-top-color: var(--purple); } .tile.green { border-top-color: var(--green); }

/* ---------- Tabellen ---------- */
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.list td { padding: 9px 8px; border-bottom: 1px solid #f0f1f3; vertical-align: top; }
table.list tr.prio-high td:first-child { border-left: 3px solid var(--red); }
table.list .subject { font-weight: 600; color: var(--text); }
.scroll { overflow-x: auto; }
table.matrix th.rot { height: 150px; vertical-align: bottom; padding: 0 4px; }
table.matrix th.rot span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; text-transform: none; }
table.matrix td { text-align: center; }
table.matrix td:first-child { text-align: left; }
table.matrix input:not([type=checkbox]) { width: 130px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--text); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }

/* ---------- Ticketansicht ---------- */
.ticket-head h1 { margin-bottom: 6px; }
.ticket { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.msg header { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; margin-bottom: 8px; }
.msg header time { color: var(--muted); font-size: 13px; margin-left: auto; }
.msg .tag { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.msg .body { overflow-wrap: anywhere; font-size: 14.5px; }
.msg.out { border-left: 4px solid var(--primary); background: #fbfdff; }
.msg.in { border-left: 4px solid var(--grey); }
.msg.note { background: #fffbea; border-color: #f3e2a0; border-left: 4px solid var(--orange); }
.msg.system { background: #f6f7f9; font-size: 13px; color: var(--muted); }
.thread.customer .msg.out { margin-left: 32px; }
.thread.customer .msg.in { margin-right: 32px; }
.send { font-size: 12px; color: var(--muted); }
.send.failed { color: var(--red); font-weight: 600; }
.files { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
details.quoted { margin-top: 8px; color: var(--muted); font-size: 13px; }
details.quoted summary { cursor: pointer; }
.reply textarea { font-size: 14.5px; }
.side .card { padding: 16px 18px; }
.side h2 { font-size: 16px; margin-bottom: 10px; }
.side ul { padding-left: 18px; margin: 0; }
.side li { margin-bottom: 4px; }
.props label { margin-bottom: 10px; }
.station .links { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
ul.diag { list-style: none; padding: 0; margin: 10px 0 0; }
ul.diag li { padding: 7px 10px 7px 30px; border-radius: 8px; margin-bottom: 6px; position: relative; font-size: 14px; }
ul.diag li::before { position: absolute; left: 10px; top: 7px; font-weight: 700; }
ul.diag li.ok { background: #e8f7ee; } ul.diag li.ok::before { content: "✓"; color: var(--green); }
ul.diag li.warn { background: #fff4dc; } ul.diag li.warn::before { content: "!"; color: #b45309; }
ul.diag li.error { background: #fdecec; } ul.diag li.error::before { content: "✕"; color: var(--red); }
ul.diag li.info { background: #eef4fb; } ul.diag li.info::before { content: "i"; color: var(--primary); }
ul.sol details summary { cursor: pointer; font-weight: 600; }
ol.timeline { list-style: none; padding: 0; margin: 0; font-size: 13px; }
ol.timeline li { padding: 4px 0 4px 14px; border-left: 2px solid var(--line); }
ol.timeline time { color: var(--muted); display: block; font-size: 12px; }

/* ---------- Kundenportal ---------- */
.hero { text-align: center; padding: 12px 0 20px; }
.hero h1 { font-size: 30px; margin-bottom: 6px; }
.hero p { color: var(--muted); margin: 0; }
.suggestions { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 16px; }
details.solution { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; background: #fbfdff; }
details.solution summary { cursor: pointer; font-weight: 600; color: var(--primary-dark); }
details.solution .body { margin: 10px 0; font-size: 14.5px; }
.privacy { color: var(--muted); }
.progress { display: flex; list-style: none; padding: 0; margin: 18px 0; counter-reset: s; }
.progress li { flex: 1; text-align: center; position: relative; font-size: 13px; color: var(--muted); }
.progress li span { display: flex; width: 30px; height: 30px; margin: 0 auto 6px; border-radius: 50%; align-items: center; justify-content: center; background: #eef0f3; font-weight: 700; position: relative; z-index: 1; }
.progress li::after { content: ""; position: absolute; top: 15px; left: 50%; width: 100%; height: 3px; background: #eef0f3; }
.progress li:last-child::after { display: none; }
.progress li.done span { background: var(--green); color: #fff; }
.progress li.done::after { background: var(--green); }
.progress li.current span { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-soft); }
.progress li.current { color: var(--text); font-weight: 600; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.timeline-box { margin-top: 14px; font-size: 14px; }
.timeline-box summary { cursor: pointer; color: var(--muted); }

/* ---------- Anmeldung Admin ---------- */
.login { max-width: 400px; margin: 60px auto; }
.login-brand { text-align: center; margin-bottom: 20px; }
.login-brand img { height: 64px; width: auto; vertical-align: calc(64px * var(--logo-baseline) * -1); }
.login-brand span { color: var(--primary); font-weight: 600; font-size: 24px; margin-left: 6px; }

@media (max-width: 980px) {
  .ticket { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top { gap: 10px; padding: 0 12px; height: auto; min-height: 56px; flex-wrap: wrap; }
  .brand img { --h: 34px; }
  main { padding: 18px 12px 60px; }
  .thread.customer .msg.out, .thread.customer .msg.in { margin: 0; }
  .progress li { font-size: 11px; }
  table.list { font-size: 13px; }
}

/* ---------- Signatur ---------- */
.signature-box { margin: 10px 0 4px; padding: 10px 14px; background: #f8fafc; border: 1px dashed #cfd4da; border-radius: 10px; }
.signature-box label.check { margin-bottom: 6px; }
pre.signature-preview { font: 13px/1.45 inherit; font-family: inherit; white-space: pre-wrap; color: #4b5563; margin: 4px 0 6px; }
.signature-box:has(input[name=signature]:not(:checked)) pre.signature-preview { opacity: .35; text-decoration: line-through; }
