/* Scooterride Helpdesk — Markenfarben: Blau #0d3358, Orange #cf3c10, BG #f4f2ee */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #f4f2ee;
  font-family: Arial, Helvetica, sans-serif;
  color: #1a1a1a;
  font-size: 15px;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 12px 24px;
}

/* ---------- Kopf ---------- */

.topbar {
  background: #0d3358;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
}

.topbar h1 {
  font-size: 17px;
  margin: 0;
  flex: 1;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar a, .topbar button.linklike {
  color: #cfe0f0;
  text-decoration: none;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.back-link { font-size: 22px; }

/* ---------- Stoerungs-Banner ---------- */

.health-banner {
  background: #b3261e;
  color: #fff;
  padding: 10px 12px;
  font-size: 14px;
  display: none;
}
.health-banner.visible { display: block; }

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 6px;
  margin: 14px 0 10px;
}

.tab {
  flex: 1;
  min-height: 44px;
  border: 1px solid #d6d2ca;
  background: #fff;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: #444;
  padding: 4px 2px;
}

.tab .count {
  display: block;
  font-size: 16px;
  font-weight: bold;
  color: #0d3358;
}

.tab.active {
  background: #0d3358;
  border-color: #0d3358;
  color: #fff;
}
.tab.active .count { color: #fff; }

/* ---------- Suche ---------- */

.search input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #d6d2ca;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

/* ---------- Ticketliste ---------- */

.ticket-list { margin-top: 12px; }

.ticket-card {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid #e2ded6;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: none;
}

.ticket-card:active { background: #f7f5f1; }

.ticket-card .row1 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #777;
  margin-bottom: 4px;
}

.ticket-card .subject {
  font-weight: bold;
  color: #0d3358;
  margin-bottom: 3px;
  word-break: break-word;
}

.ticket-card .contact {
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
}

.badges { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
}
.badge.orange { background: #cf3c10; }
.badge.blue { background: #0d3358; }
.badge.grey { background: #6b6b6b; }

.empty-hint {
  text-align: center;
  color: #888;
  padding: 30px 0;
}

/* ---------- Ticket-Detail ---------- */

.ticket-head {
  background: #fff;
  border: 1px solid #e2ded6;
  border-radius: 10px;
  padding: 12px;
  margin-top: 14px;
}

.ticket-head .num { font-size: 12px; color: #777; }
.ticket-head h2 {
  margin: 4px 0 8px;
  font-size: 17px;
  color: #0d3358;
  word-break: break-word;
}

.chip {
  display: inline-block;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8f0f7;
  color: #0d3358;
}
.chip.waiting { background: #fdeee8; color: #cf3c10; }
.chip.spam { background: #cf3c10; color: #fff; }
.chip.closed { background: #e4e4e4; color: #555; }

.contact-line { font-size: 12px; color: #666; margin-top: 8px; word-break: break-word; }

/* ---------- Thread ---------- */

.thread { margin: 14px 0 0; }

.bubble {
  max-width: 88%;
  background: #fff;
  border: 1px solid #e2ded6;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.bubble.in { margin-right: auto; border-bottom-left-radius: 4px; }
.bubble.out {
  margin-left: auto;
  background: #e8f0f7;
  border-color: #d3e1ee;
  border-bottom-right-radius: 4px;
}
.bubble.note {
  margin: 0 auto 10px;
  background: #fff8e6;
  border-color: #eadfba;
}

.bubble .meta {
  font-size: 11px;
  color: #888;
  margin-bottom: 6px;
  word-break: break-word;
}

.bubble .body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.45;
}

.bubble .quote-toggle {
  background: none;
  border: 0;
  color: #0d3358;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 0;
  min-height: 44px;
  font-family: inherit;
}

.bubble .attachments { margin-top: 8px; }
.bubble .attachments a {
  display: inline-block;
  font-size: 12px;
  color: #0d3358;
  background: #f4f2ee;
  border: 1px solid #ddd8cf;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 2px 4px 2px 0;
  text-decoration: none;
}

/* ---------- Aktionsleiste ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #0d3358;
  background: #fff;
  color: #0d3358;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}
.btn.primary { background: #0d3358; color: #fff; }
.btn.danger { border-color: #cf3c10; color: #cf3c10; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- Antwortbereich (sticky) ---------- */

.reply-box {
  position: sticky;
  bottom: 0;
  background: #f4f2ee;
  padding: 10px 0 12px;
  border-top: 1px solid #ddd8cf;
}

.reply-box select,
.reply-box textarea {
  width: 100%;
  border: 1px solid #d6d2ca;
  border-radius: 8px;
  font: inherit;
  background: #fff;
  padding: 10px 12px;
}

.reply-box select { min-height: 44px; margin-bottom: 8px; }
.reply-box textarea { min-height: 90px; resize: vertical; margin-bottom: 8px; }

.reply-box .send-row { display: flex; gap: 8px; align-items: center; }
.reply-box .send-row .btn { flex: 0 0 auto; }

.error-msg {
  color: #b3261e;
  font-size: 13px;
  display: none;
}
.error-msg.visible { display: block; }

/* ---------- Dialog „Warten auf…" ---------- */

dialog {
  border: 0;
  border-radius: 12px;
  padding: 16px;
  width: min(92vw, 420px);
}
dialog::backdrop { background: rgba(13, 51, 88, 0.5); }

dialog h3 { margin: 0 0 12px; color: #0d3358; font-size: 16px; }
dialog label { display: block; font-size: 13px; color: #555; margin: 10px 0 4px; }
dialog select, dialog input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d6d2ca;
  border-radius: 8px;
  font: inherit;
  padding: 0 12px;
  background: #fff;
}
dialog .dialog-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }

/* ---------- Login ---------- */

.login-card {
  background: #fff;
  border: 1px solid #e2ded6;
  border-radius: 12px;
  padding: 24px 16px;
  margin-top: 60px;
  text-align: center;
}
.login-card h2 { color: #0d3358; margin: 0 0 16px; }
.login-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d6d2ca;
  border-radius: 8px;
  font: inherit;
  padding: 0 12px;
  margin-bottom: 12px;
}
.login-card .btn { width: 100%; }
