:root {
  --oe-red: #C41212;
  --oe-red-dark: #9f0f0f;
  --oe-black: #111111;
  --oe-text: #222222;
  --oe-muted: #f6f6f6;
  --oe-line: #e7e7e7;
  --oe-white: #ffffff;
  --oe-shadow: 0 18px 45px rgba(0, 0, 0, .08);
  --oe-radius: 18px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: var(--oe-text);
}
a { color: var(--oe-red); text-decoration: none; }
a:hover { text-decoration: underline; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: radial-gradient(circle at top left, rgba(196,18,18,.14), transparent 32%), #f7f7f7;
}
.login-card {
  width: min(460px, 100%);
  background: var(--oe-white);
  border-radius: 28px;
  box-shadow: var(--oe-shadow);
  padding: 34px;
  border-top: 7px solid var(--oe-red);
}
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.brand-logo {
  width: 54px; height: 54px; border-radius: 14px;
  background: var(--oe-red); color: white; display: grid; place-items: center; font-weight: 800;
}
.brand img { max-height: 56px; max-width: 260px; }
.brand-title { font-weight: 800; color: var(--oe-black); font-size: 19px; line-height: 1.15; }
.brand-sub { color: #777; font-size: 13px; margin-top: 4px; }
.field { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; color: #333; }
input, select, textarea {
  width: 100%;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  padding: 12px 13px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(196,18,18,.18); border-color: var(--oe-red); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 11px 16px;
  background: var(--oe-red); color: #fff; font-weight: 800; cursor: pointer;
  box-shadow: 0 10px 25px rgba(196,18,18,.18);
}
.btn:hover { background: var(--oe-red-dark); text-decoration: none; }
.btn-secondary { background: #222; box-shadow: none; }
.btn-light { background: #f1f1f1; color: #222; box-shadow: none; }
.alert { padding: 12px 14px; border-radius: 12px; margin: 14px 0; font-weight: 650; }
.alert-error { background: #fff0f0; color: #8c1111; border: 1px solid #ffd1d1; }
.alert-success { background: #effaf1; color: #175d26; border: 1px solid #ccefd3; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 280px; background: #111; color: #fff; padding: 24px 18px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { margin-bottom: 28px; }
.sidebar .brand-title { color: #fff; }
.sidebar .brand-sub { color: #bbb; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  color: #f3f3f3; padding: 11px 12px; border-radius: 12px; margin-bottom: 6px; font-weight: 700;
}
.nav a:hover, .nav a.active { background: rgba(196,18,18,.9); text-decoration: none; }
.main { flex: 1; min-width: 0; }
.topbar {
  height: 74px; background: #fff; border-bottom: 1px solid var(--oe-line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
}
.content { padding: 28px; }
.page-title { margin: 0; font-size: 28px; color: #111; }
.muted { color: #777; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 16px; margin-bottom: 22px; }
.card { background: #fff; border: 1px solid var(--oe-line); border-radius: var(--oe-radius); box-shadow: 0 10px 30px rgba(0,0,0,.04); padding: 18px; }
.card-kpi { font-size: 30px; font-weight: 900; color: #111; }
.card-label { color: #777; font-weight: 700; margin-top: 3px; }
.filterbar { background: #fff; border: 1px solid var(--oe-line); border-radius: var(--oe-radius); padding: 16px; margin-bottom: 18px; }
.filter-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--oe-line); border-radius: var(--oe-radius); overflow: hidden; }
th, td { text-align: left; padding: 14px 14px; border-bottom: 1px solid #eee; vertical-align: top; }
th { background: #fafafa; color: #555; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
tr.ticket-new { background: #fffafa; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-new { background: #fff0f0; color: #9f0f0f; }
.status-open { background: #fff7e6; color: #8a5a00; }
.status-pending { background: #eef5ff; color: #1f4f8f; }
.status-waiting_customer { background: #f3efff; color: #4b2c91; }
.status-solved { background: #edf9ef; color: #17602b; }
.status-closed { background: #eeeeee; color: #555; }
.priority-normal { background: #f0f0f0; color: #333; }
.priority-urgent { background: #fff1d8; color: #8a4a00; }
.priority-outage { background: #ffe3e3; color: #a00000; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) 380px; gap: 20px; align-items: start; }
.meta-list { display: grid; gap: 10px; }
.meta-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; }
.meta-label { color: #777; font-weight: 700; }
.message-box { white-space: pre-wrap; line-height: 1.55; }
.timeline { display: grid; gap: 12px; }
.event { border-left: 4px solid var(--oe-red); background: #fff; border-radius: 14px; padding: 13px 15px; border: 1px solid #eee; }
.event-head { display:flex; justify-content:space-between; gap:12px; font-weight:800; color:#111; margin-bottom:6px; }
.event-body { color:#444; white-space:pre-wrap; }
.actions { display: grid; gap: 16px; }
.footer-note { margin-top: 26px; color: #888; font-size: 12px; }
@media (max-width: 980px) {
  .shell { display: block; }
  .sidebar { position: relative; width: auto; height: auto; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .cards, .filter-grid { grid-template-columns: 1fr; }
  .content { padding: 18px; }
  .topbar { padding: 0 18px; }
  table { font-size: 14px; }
}


/* Branding Hotfix v1.0.3 -------------------------------------------------- */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}
.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(196,18,18,.18);
  box-shadow: 0 10px 26px rgba(196,18,18,.12);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}
.brand-mark img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}
.brand-mark span {
  color: var(--oe-red);
  font-weight: 900;
  letter-spacing: -.04em;
}
.brand-text { min-width: 0; }
.brand-full-logo {
  max-height: 42px;
  max-width: 235px;
  object-fit: contain;
  display: block;
}
.sidebar .brand-mark {
  background: rgba(255,255,255,.98);
  border-color: rgba(255,255,255,.18);
}
.sidebar {
  position: sticky;
  overflow: hidden;
}
.sidebar::after {
  content: "";
  position: absolute;
  right: -74px;
  bottom: 72px;
  width: 220px;
  height: 220px;
  background: url('/assets/img/ornament-oeschgers-edv.png?v=official') center/contain no-repeat;
  opacity: .10;
  pointer-events: none;
  transform: rotate(-8deg);
}
.sidebar .nav,
.sidebar .footer-note {
  position: relative;
  z-index: 1;
}
.login-card {
  position: relative;
  overflow: hidden;
}
.login-card::after {
  content: "";
  position: absolute;
  right: -48px;
  top: -44px;
  width: 180px;
  height: 180px;
  background: url('/assets/img/ornament-oeschgers-edv.png?v=official') center/contain no-repeat;
  opacity: .075;
  pointer-events: none;
}
.login-card > * {
  position: relative;
  z-index: 1;
}
@media (max-width: 620px) {
  .brand-full-logo { max-width: 200px; }
  .brand-mark { width: 52px; height: 52px; }
}

/* Hotfix v1.2.0 – Kundenportal und Global Account ------------------------ */
.customer-page {
  background: radial-gradient(circle at top left, rgba(196,18,18,.10), transparent 34%), #f3f4f6;
}
.customer-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 18px 56px;
}
.customer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: #fff;
  border: 1px solid var(--oe-line);
  border-top: 7px solid var(--oe-red);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--oe-shadow);
  margin-bottom: 24px;
}
.customer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #111;
}
.customer-brand:hover { text-decoration: none; }
.customer-brand small { display: block; color: #6b7280; margin-top: 3px; }
.customer-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.customer-nav a {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f6f6f6;
  color: #111;
  font-weight: 800;
}
.customer-nav a:hover { background: var(--oe-red); color: #fff; text-decoration: none; }
.customer-main { display: grid; gap: 18px; }
.customer-card {
  background: #fff;
  border: 1px solid var(--oe-line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 12px 35px rgba(0,0,0,.05);
}
.customer-card-narrow { max-width: 520px; }
.customer-actions { display: flex; justify-content: flex-end; }
.checkline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 650;
  color: #333;
  margin: 16px 0;
}
.checkline input { width: auto; margin-top: 3px; }
@media (max-width: 760px) {
  .customer-header { align-items: flex-start; flex-direction: column; }
  .customer-nav { width: 100%; }
  .customer-nav a { flex: 1 1 auto; text-align: center; }
}

/* Hotfix v1.2.1 – Kundenportal sauber im Portal darstellen ------------- */
.customer-page-v121 {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(196,18,18,.10), transparent 32%),
    linear-gradient(180deg, #f7f7f8 0%, #f1f2f4 100%);
}
.customer-header-v121 {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}
.customer-brand-mark {
  background: #fff !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.customer-brand-mark img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.customer-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin: 2px 0 2px;
}
.eyebrow {
  color: var(--oe-red);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 900;
  margin-bottom: 8px;
}
.customer-subtitle {
  margin: 8px 0 0;
  color: #596274;
  font-size: 17px;
  line-height: 1.45;
}
.customer-auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}
.customer-auth-card {
  border-top: 5px solid var(--oe-red);
}
.customer-info-card h2,
.customer-card h2,
.customer-card h3 {
  margin-top: 0;
  color: #111827;
}
.customer-info-card p {
  color: #4b5563;
  line-height: 1.55;
}
.clean-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}
.clean-list li {
  padding-left: 28px;
  position: relative;
  color: #374151;
  font-weight: 650;
}
.clean-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--oe-red);
  font-weight: 900;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}
.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  color: #6b7280;
  font-weight: 650;
}
.alert-info {
  background: #f4f7fb;
  color: #2b3f5c;
  border: 1px solid #d8e0ea;
}
.customer-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.success-illustration {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #effaf1;
  color: #1d7a35;
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 14px;
}
.empty-state {
  text-align: center;
  padding: 40px 24px;
}
.customer-ticket-list {
  display: grid;
  gap: 10px;
}
.customer-ticket-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--oe-line);
  border-radius: 18px;
  padding: 16px;
  color: #111827;
  box-shadow: 0 10px 26px rgba(0,0,0,.035);
}
.customer-ticket-row:hover {
  text-decoration: none;
  border-color: rgba(196,18,18,.35);
  box-shadow: 0 14px 34px rgba(196,18,18,.08);
}
.customer-ticket-row small {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-weight: 600;
}
.ticket-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}
.ticket-detail-head h2 {
  margin: 0 0 8px;
}
.ticket-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.customer-message-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
}
@media (max-width: 860px) {
  .customer-auth-grid,
  .customer-ticket-row,
  .customer-form-grid {
    grid-template-columns: 1fr !important;
  }
  .ticket-detail-head {
    flex-direction: column;
  }
  .ticket-badges {
    justify-content: flex-start;
  }
}

/* Hotfix v1.2.3 – Freshdesk-ähnlicher HTML-Editor und Inline-Screenshots --- */
.rich-field { margin-bottom: 18px; }
.rich-editor-wrap { border: 1px solid #dcdcdc; border-radius: 16px; background: #fff; overflow: hidden; }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: #fafafa; border-bottom: 1px solid #e7e7e7; }
.rich-toolbar button { border: 1px solid #ddd; background: #fff; border-radius: 10px; padding: 7px 10px; font-weight: 800; cursor: pointer; color: #222; }
.rich-toolbar button:hover { border-color: var(--oe-red); color: var(--oe-red); }
.rich-editor { min-height: 190px; padding: 14px; line-height: 1.55; outline: none; background: #fff; }
.rich-editor:empty::before { content: attr(data-placeholder); color: #9ca3af; }
.rich-editor:focus { box-shadow: inset 0 0 0 2px rgba(196,18,18,.15); }
.rich-editor.dragover { background: #fff7f7; box-shadow: inset 0 0 0 2px rgba(196,18,18,.35); }
.rich-editor-error { box-shadow: inset 0 0 0 2px #C41212 !important; }
.rich-upload-note { display: inline-block; background: #fff4e5; color: #804800; border: 1px solid #ffd89b; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 800; }
.rich-help { padding: 8px 12px 12px; font-size: 12px; }
.inline-screenshot { display: block; max-width: 100%; height: auto; border: 1px solid #e5e7eb; border-radius: 14px; margin: 10px 0; box-shadow: 0 8px 22px rgba(15,23,42,.08); }
.rich-render { line-height: 1.6; word-break: break-word; }
.rich-render p { margin: 0 0 12px; }
.rich-render ul, .rich-render ol { margin: 0 0 12px 22px; padding: 0; }
.rich-render blockquote { margin: 12px 0; padding: 10px 14px; border-left: 4px solid var(--oe-red); background: #fff7f7; border-radius: 10px; }
.rich-render pre { white-space: pre-wrap; background: #111827; color: #f9fafb; padding: 12px; border-radius: 12px; overflow: auto; }
.message-box .rich-render, .event-body .rich-render, .customer-message-box .rich-render { white-space: normal; }

/* Hotfix v1.2.4 – Responsive Tickets, Mobile UX, Hell/Dunkel-Modus -------- */
:root {
  color-scheme: light;
  --oe-bg: #f5f5f5;
  --oe-surface: #ffffff;
  --oe-surface-2: #fafafa;
  --oe-text-main: #151821;
  --oe-text-soft: #667085;
  --oe-border: #e7e7e7;
  --oe-input-bg: #ffffff;
  --oe-input-border: #dcdcdc;
  --oe-sidebar-bg: #111111;
  --oe-sidebar-text: #f8fafc;
  --oe-sidebar-muted: #b8bec8;
  --oe-topbar-bg: #ffffff;
  --oe-card-shadow: 0 10px 30px rgba(0,0,0,.05);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --oe-bg: #0b0f17;
  --oe-surface: #141a24;
  --oe-surface-2: #101620;
  --oe-text-main: #f4f7fb;
  --oe-text-soft: #a8b1c2;
  --oe-border: #273142;
  --oe-input-bg: #0f1520;
  --oe-input-border: #344055;
  --oe-sidebar-bg: #070a0f;
  --oe-sidebar-text: #f9fafb;
  --oe-sidebar-muted: #9aa4b5;
  --oe-topbar-bg: #111722;
  --oe-card-shadow: 0 14px 38px rgba(0,0,0,.28);
}
html, body { max-width: 100%; overflow-x: hidden; }
body,
.customer-page,
.customer-page-v121 {
  background: var(--oe-bg) !important;
  color: var(--oe-text-main) !important;
}
.customer-page,
.customer-page-v121 {
  background:
    radial-gradient(circle at 8% 0%, rgba(196,18,18,.10), transparent 32%),
    var(--oe-bg) !important;
}
a { color: var(--oe-red); }
.card,
.filterbar,
.customer-card,
.customer-header,
.login-card,
table,
.event,
.rich-editor-wrap,
.customer-message-box,
.ticket-mobile-card {
  background: var(--oe-surface) !important;
  color: var(--oe-text-main) !important;
  border-color: var(--oe-border) !important;
  box-shadow: var(--oe-card-shadow);
}
.topbar {
  background: var(--oe-topbar-bg) !important;
  border-color: var(--oe-border) !important;
  min-width: 0;
}
.sidebar {
  background: var(--oe-sidebar-bg) !important;
  color: var(--oe-sidebar-text) !important;
}
.sidebar .brand-title,
.sidebar .nav a,
.page-title,
.card-kpi,
.event-head,
.customer-info-card h2,
.customer-card h2,
.customer-card h3,
.ticket-detail-head h2,
.customer-brand,
.customer-nav a,
.brand-title,
.customer-mobile-title,
th,
label {
  color: var(--oe-text-main);
}
.sidebar .brand-title,
.sidebar .nav a { color: var(--oe-sidebar-text) !important; }
.sidebar .brand-sub,
.sidebar .footer-note { color: var(--oe-sidebar-muted) !important; }
.muted,
.brand-sub,
.card-label,
.meta-label,
.customer-brand small,
.customer-subtitle,
.customer-ticket-row small,
.customer-info-card p,
.rich-help {
  color: var(--oe-text-soft) !important;
}
input, select, textarea,
.rich-editor {
  background: var(--oe-input-bg) !important;
  color: var(--oe-text-main) !important;
  border-color: var(--oe-input-border) !important;
}
input::placeholder, textarea::placeholder { color: var(--oe-text-soft); opacity: .8; }
th { background: var(--oe-surface-2) !important; }
td, th { border-color: var(--oe-border) !important; }
tr.ticket-new, tr.ticket-new td { background: rgba(196,18,18,.055) !important; }
html[data-theme="dark"] tr.ticket-new,
html[data-theme="dark"] tr.ticket-new td { background: rgba(196,18,18,.16) !important; }
.rich-toolbar { background: var(--oe-surface-2) !important; border-color: var(--oe-border) !important; }
.rich-toolbar button,
.btn-light,
.customer-nav a,
.theme-toggle,
.customer-theme-toggle,
.nav-button,
.mobile-nav-toggle {
  background: var(--oe-surface-2) !important;
  color: var(--oe-text-main) !important;
  border: 1px solid var(--oe-border) !important;
}
.rich-toolbar button:hover,
.theme-toggle:hover,
.customer-theme-toggle:hover,
.nav-button:hover,
.mobile-nav-toggle:hover,
.customer-nav a:hover {
  border-color: var(--oe-red) !important;
  color: var(--oe-red) !important;
  text-decoration: none;
}
.btn,
.btn-secondary:hover,
.nav a.active,
.nav a:hover {
  color: #fff !important;
}
.topbar-left,
.topbar-actions,
.page-actions,
.ticket-mobile-head,
.ticket-mobile-footer {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-left { min-width: 0; }
.topbar-actions { justify-content: flex-end; min-width: 0; }
.theme-toggle,
.customer-theme-toggle,
.nav-button,
.mobile-nav-toggle {
  border-radius: 12px;
  padding: 9px 11px;
  font-weight: 800;
  cursor: pointer;
  font: inherit;
}
.nav-button {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  display: flex;
  margin: 8px 0 6px;
}
.mobile-nav-toggle { display: none; font-size: 20px; line-height: 1; }
.user-pill { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.page-actions {
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--oe-radius);
}
.tickets-table { min-width: 940px; }
.ticket-list-mobile { display: none; }
.ticket-mobile-card {
  display: block;
  border: 1px solid var(--oe-border);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
  color: var(--oe-text-main);
  text-decoration: none;
}
.ticket-mobile-card:hover { text-decoration: none; border-color: rgba(196,18,18,.42) !important; }
.ticket-mobile-head,
.ticket-mobile-footer { justify-content: space-between; align-items: flex-start; }
.ticket-mobile-subject {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
  margin: 12px 0 8px;
  color: var(--oe-text-main);
}
.ticket-mobile-meta {
  display: grid;
  gap: 3px;
  color: var(--oe-text-soft);
  font-weight: 650;
  margin-bottom: 12px;
}
.ticket-mobile-date { margin-top: 8px; font-size: 12px; }
.kpi-cards .card { min-width: 0; }
.mobile-sidebar-backdrop { display: none; }
.customer-theme-toggle { min-height: 41px; }

/* Mobile and tablet layout */
@media (max-width: 1180px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0;
    width: min(86vw, 340px) !important;
    height: 100vh !important;
    z-index: 60;
    transform: translateX(-105%);
    transition: transform .22s ease;
    overflow-y: auto;
    padding-top: max(20px, env(safe-area-inset-top));
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.46);
    z-index: 50;
  }
  body.nav-open .mobile-sidebar-backdrop { display: block; }
  .mobile-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .topbar {
    min-height: 64px;
    height: auto;
    padding: 12px 14px;
    gap: 10px;
  }
  .page-title { font-size: 22px; line-height: 1.15; }
  .theme-toggle { display: none; }
  .user-pill { max-width: 120px; font-size: 12px; }
  .content { padding: 16px 12px 28px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 14px; border-radius: 16px; }
  .card-kpi { font-size: 25px; }
  .filterbar { padding: 12px; border-radius: 16px; }
  .filter-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .filter-grid .field:first-child { grid-column: 1 / -1; }
  .filter-grid .btn { grid-column: 1 / -1; width: 100%; }
  .actions { grid-template-columns: 1fr; }
  .meta-row { grid-template-columns: 110px minmax(0, 1fr); }
  .event-head { flex-direction: column; gap: 3px; }
  .rich-editor { min-height: 160px; }
  .customer-shell { padding: 14px 10px 34px; }
  .customer-header { border-radius: 18px; padding: 13px; }
  .customer-nav { gap: 8px; }
  .customer-nav a,
  .customer-theme-toggle { flex: 1 1 auto; text-align: center; justify-content: center; }
  .customer-hero { margin-top: 8px; }
}
@media (max-width: 700px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-kpi { font-size: 22px; }
  .card-label { font-size: 12px; }
  .ticket-list-desktop { display: none; }
  .ticket-list-mobile { display: block; }
  .page-actions .btn { width: 100%; }
  .filter-grid { grid-template-columns: 1fr; }
  .filter-grid .field:first-child { grid-column: auto; }
  .topbar-actions .user-pill { display: none; }
  .page-title { font-size: 20px; }
  .brand-full-logo { max-width: 190px; }
  .customer-auth-grid,
  .customer-ticket-row,
  .customer-form-grid { grid-template-columns: 1fr !important; }
  .ticket-detail-head { flex-direction: column; }
  .ticket-badges { justify-content: flex-start; }
}
@media (max-width: 460px) {
  .cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .content { padding: 12px 10px 24px; }
  .topbar { padding: 10px; }
  .card { padding: 12px; }
  .btn { width: 100%; min-height: 44px; }
  .button-row .btn { width: auto; flex: 1 1 auto; }
  .meta-row { grid-template-columns: 1fr; gap: 3px; }
  .rich-toolbar { gap: 5px; }
  .rich-toolbar button { padding: 7px 8px; }
  .customer-brand { align-items: flex-start; }
  .customer-brand strong { display: block; line-height: 1.2; }
  .customer-brand small { font-size: 12px; }
}

/* Hotfix v1.3.0 - Ticketworkflow, Agenten, Zeitprotokoll ---------------- */
.ticket-title-row,
.section-head-line,
.reply-actions-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ticket-badges { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.compact-fields { margin: 14px 0; }
.btn-ghost {
  background: transparent;
  color: var(--text, #111827);
  border: 1px solid var(--border, #e5e7eb);
  box-shadow: none;
}
.workflow-card { border-top: 4px solid #C41212; }
.time-list, .agent-list { display:grid; gap:10px; }
.time-item, .agent-item {
  padding: 12px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  background: var(--card-soft, rgba(0,0,0,.02));
}
.check-row { display:flex; align-items:center; gap:8px; margin: 10px 0; color: var(--muted, #667085); }
.alert-info { background:#f4f7fb; border-color:#d7e1f2; color:#26364d; }
[data-theme="dark"] .alert-info { background:#111827; border-color:#334155; color:#dbeafe; }
.status-in_progress, .status-with_developer, .status-waiting_partner { background: #fff7ed; color: #9a3412; }
.agent-page-grid { align-items:start; }
@media (max-width: 760px) {
  .form-grid-2 { grid-template-columns: 1fr; }
  .reply-actions-row .btn { width: 100%; justify-content:center; }
  .ticket-title-row { flex-direction: column; }
}

/* Hotfix v1.3.1 - Antwortvorschlag sichtbar im Editor ----------------- */
.rich-toolbar .ai-draft-toolbar-btn,
.ai-draft-toolbar-btn,
.btn-ghost[data-ai-draft] {
  border: 1px solid rgba(196, 18, 18, .28);
  background: rgba(196, 18, 18, .08);
  color: var(--accent, #C41212);
  font-weight: 800;
}

.rich-toolbar .ai-draft-toolbar-btn::before,
.ai-draft-toolbar-btn::before,
.btn-ghost[data-ai-draft]::before {
  content: "✦ ";
}

.rich-toolbar .ai-draft-toolbar-btn:hover,
.ai-draft-toolbar-btn:hover,
.btn-ghost[data-ai-draft]:hover {
  background: rgba(196, 18, 18, .14);
  border-color: rgba(196, 18, 18, .45);
}

[data-theme="dark"] .rich-toolbar .ai-draft-toolbar-btn,
[data-theme="dark"] .ai-draft-toolbar-btn,
[data-theme="dark"] .btn-ghost[data-ai-draft] {
  background: rgba(196, 18, 18, .18);
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, .35);
}
/* Hotfix v1.3.2 - OpenAI Antwortvorschläge ----------------------------- */
.rich-toolbar .ai-draft-toolbar-btn,
.ai-draft-toolbar-btn,
.btn-ghost[data-ai-draft] {
  border: 1px solid rgba(196, 18, 18, .28);
  background: rgba(196, 18, 18, .08);
  color: var(--accent, #C41212);
  font-weight: 800;
}

.rich-toolbar .ai-draft-toolbar-btn::before,
.ai-draft-toolbar-btn::before,
.btn-ghost[data-ai-draft]::before {
  content: "✦ ";
}

.rich-toolbar .ai-draft-toolbar-btn:hover,
.ai-draft-toolbar-btn:hover,
.btn-ghost[data-ai-draft]:hover {
  background: rgba(196, 18, 18, .14);
  border-color: rgba(196, 18, 18, .45);
}

.ai-draft-toolbar-btn.is-loading {
  opacity: .75;
  cursor: wait;
}

[data-theme="dark"] .rich-toolbar .ai-draft-toolbar-btn,
[data-theme="dark"] .ai-draft-toolbar-btn,
[data-theme="dark"] .btn-ghost[data-ai-draft] {
  background: rgba(196, 18, 18, .18);
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, .35);
}
