/* =========================================
   asset_github – Modern Industrial UI
   Drop-in replacement for src/css/main.css
   ========================================= */

:root{
  --bg: #f3f6f9;
  --bg2:#f6f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --muted2:#94a3b8;
  --border: rgba(148,163,184,0.35);
  --border2: rgba(226,232,240,0.95);

  --primary:#1e3a8a;
  --primary2:#2563eb;
  --primarySoft: rgba(59,130,246,0.18);

  --success:#059669;
  --warning:#d97706;
  --danger:#dc2626;
  --info:#2563eb;

  --sidebar-bg:#0f172a;
  --sidebar-2:#111c33;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(59,130,246,0.22);

  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

/* ===== Reset / Base ===== */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a{ color: var(--primary2); text-decoration:none; }
a:hover{ text-decoration:underline; }

img{ max-width:100%; height:auto; }

:focus{ outline:none; }

/* ===== Accessibility: Skip link only on focus ===== */
.skip-link{
  position:absolute;
  left:-9999px;
  top:12px;
  z-index:9999;
  background:#111827;
  color:#fff;
  padding:10px 14px;
  border-radius: 10px;
  text-decoration:none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.skip-link:focus{ left:12px; }

/* ===== Layout ===== */
.app{
  display:flex;
  min-height:100vh;
}

/* ===== Sidebar ===== */
.sidebar{
  width: 268px;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-2) 100%);
  color:#fff;
  padding: 18px 16px;
  display:flex;
  flex-direction:column;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar a{ color:#fff; text-decoration:none; }

.sidebar__brand{
  margin-bottom: 16px;
}
.sidebar__brand a{
  display:inline-block;
  padding: 10px 10px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.sidebar__brand a:hover{
  background: rgba(255,255,255,0.06);
}

.sidebar__user{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px;
  margin: 6px 8px 14px 8px;
}
.sidebar__user-name{
  font-size: 13.5px;
  opacity: 0.95;
  font-weight: 600;
  margin-bottom: 10px;
}
.sidebar__logout{
  display:inline-flex;
  justify-content:center;
  width: 100%;
}

/* Nav */
.sidebar__nav{ margin-top: 6px; padding: 0 8px; }

.navgroup{
  margin-top: 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.55;
  padding: 0 8px;
}

.navsub{ margin-top: 6px; }

.navitem{
  display:block;
  padding: 9px 10px;
  border-radius: 10px;
  margin: 4px 0;
  transition: background .2s, transform .15s, border-color .2s;
  border: 1px solid transparent;
  font-size: 13.5px;
  opacity: 0.95;
}
.navitem:hover{
  background: var(--sidebar-hover);
  transform: translateY(-1px);
}
.navitem--active,
.navitem[aria-current="page"]{
  background: var(--sidebar-active);
  border-color: rgba(59,130,246,0.25);
}

/* ===== Content ===== */
.content{
  flex:1;
  padding: 28px 34px;
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
}
.content__top{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.content__top h1{
  margin:0;
  font-size: 26px;
  letter-spacing: -0.01em;
}
.content__body{
  max-width: 1120px;
}

/* ===== Card ===== */
.card{
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border2);
}
.card h1{
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.card h2{
  font-size: 18px;
  letter-spacing: -0.01em;
  margin: 0 0 10px 0;
}

/* ===== Typography helpers ===== */
.small{
  font-size: 13.5px;
  color: var(--muted);
}
hr{
  border:0;
  border-top: 1px solid var(--border2);
  margin: 16px 0;
}

/* ===== Badges ===== */
.badge{
  display:inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: #e5e7eb;
  color: #111827;
  border: 1px solid rgba(0,0,0,0.04);
}
.badge--y{ background:#ffedd5; color:#7c2d12; border: 1px solid rgba(124,45,18,0.12); }
.badge--g{ background:#dcfce7; color:#166534; border: 1px solid rgba(22,101,52,0.12); }
.badge--r{ background:#fee2e2; color:#7f1d1d; border: 1px solid rgba(127,29,29,0.12); }
.badge--b{ background:#dbeafe; color:#1e3a8a; border: 1px solid rgba(30,58,138,0.12); }

/* ===== Buttons ===== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  transition: transform .15s, background .2s, box-shadow .2s;
  box-shadow: 0 6px 14px rgba(30,58,138,0.18);
  text-decoration: none;
}
.btn:hover{
  background: var(--primary2);
  transform: translateY(-1px);
}
.btn:active{ transform: translateY(0); }
.btn:focus{
  box-shadow: 0 0 0 3px var(--primarySoft), 0 6px 14px rgba(30,58,138,0.18);
}

.btn--ghost{
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn--ghost:hover{
  background: #e2e8f0;
  transform: translateY(-1px);
}

/* ===== Forms ===== */
label{
  display:block;
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

input, select, textarea{
  width:100%;
  padding: 10px 12px;
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  color: #0f172a;
}
input::placeholder, textarea::placeholder{ color: var(--muted2); }

input:focus, select:focus, textarea:focus{
  border-color: rgba(59,130,246,0.7);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

textarea{ min-height: 110px; }

/* Checkbox spacing */
label > input[type="checkbox"]{
  width:auto;
  margin-right: 8px;
  transform: translateY(1px);
}

/* ===== Quick Status as pills (targets button[name="to"]) ===== */
form button[name="to"]{
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: #f1f5f9;
  box-shadow: none;
  font-weight: 800;
  color: #0f172a;
}
form button[name="to"]:hover{
  background: #e2e8f0;
  transform: translateY(-1px);
}

/* ===== Details / Accordions ===== */
details{
  border-radius: 14px;
}
details summary{
  list-style: none;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border2);
  font-weight: 800;
  cursor: pointer;
}
details summary::-webkit-details-marker{ display:none; }
details[open] summary{
  background: #eef2ff;
  border-color: rgba(99,102,241,0.18);
}
details > div{ margin-top: 12px; }

/* ===== Tables ===== */
.table{
  width:100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
}
.table th{
  text-align:left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border2);
}
.table td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border2);
  font-size: 14px;
  color: #0f172a;
}
.table tbody tr:nth-child(even) td{
  background: rgba(241,245,249,0.6);
}

/* ===== Utility wrappers ===== */
.tablewrap{
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border2);
}

/* ===== Small visual tweaks ===== */
.card form{ margin-top: 8px; }
.card .badge + .badge{ margin-left: 6px; }

/* ===== Responsive ===== */
@media (max-width: 1100px){
  .content{ padding: 20px; }
  .content__body{ max-width: 100%; }
}

@media (max-width: 900px){
  .sidebar{ width: 210px; }
  .sidebar__brand a{ font-size: 16px; }
  .navitem{ font-size: 13px; }
}




/* =========================================
   Premium Upgrades: Ticket Header + Timeline
   (Append to main.css)
   ========================================= */

/* 1) Ticket Header: bessere Struktur ohne HTML-Änderung
   Wir stylen die "erste .card" im Content etwas stärker.
   (Falls das bei anderen Seiten stört, sag Bescheid, dann machen wir es selektiver.)
*/
.content__body > .card:first-child {
  position: relative;
  padding-top: 28px;
}

/* Ticket title row spacing */
.content__body > .card:first-child > div[style*="justify-content:space-between"] {
  align-items: flex-start !important;
  gap: 16px !important;
}

/* "Ticket #123" */
.content__body > .card:first-child h1 {
  font-size: 32px;
}

/* Backlink kleiner und sauberer */
.content__body > .card:first-child .small a {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
  color: #1d4ed8;
}
.content__body > .card:first-child .small a:hover {
  text-decoration: none;
  opacity: 0.9;
}

/* Badges oben rechts als “chip cluster” */
.content__body > .card:first-child > div[style*="justify-content:space-between"] > div:last-child {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

/* Titel + Beschreibung Block: schönerer Abstand */
.content__body > .card:first-child div[style*="margin:18px"] {
  margin-top: 16px !important;
  padding: 14px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--border2);
}

/* Beschreibung lesbarer */
.content__body > .card:first-child div[style*="white-space:pre-line"] {
  color: #0f172a !important;
  line-height: 1.55;
}

/* Meta-Zeile (Anlage/Typ/Fach/...) als Chips statt Fließtext */
.content__body > .card:first-child .small[style*="margin-top:10px"] {
  margin-top: 14px !important;
  padding-top: 10px;
  border-top: 1px solid var(--border2);
  color: var(--muted);
  line-height: 1.7;
}
.content__body > .card:first-child .small[style*="margin-top:10px"] b {
  color: #0f172a;
}

/* Quick Status Bereich: Button-Leiste wirkt kompakter */
.content__body > .card:first-child form[style*="display:flex"] {
  gap: 10px !important;
}

/* 2) Timeline: moderne “vertical timeline” (ohne HTML-Änderung)
   Deine Timeline hat aktuell: <div style="border-left:3px solid #ccc; padding-left:16px;">
   Wir greifen genau darauf zu.
*/
details[open] summary + div[style*="border-left:3px solid"] {
  border-left: 2px solid rgba(148,163,184,0.55) !important;
  padding-left: 18px !important;
  margin-left: 6px;
}

/* Timeline items: erkenne die direkten child-divs mit margin-bottom */
details[open] summary + div[style*="border-left:3px solid"] > div[style*="margin-bottom"] {
  position: relative;
  margin-bottom: 14px !important;
  padding: 12px 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--border2);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

/* Timeline dot */
details[open] summary + div[style*="border-left:3px solid"] > div[style*="margin-bottom"]::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 3px solid rgba(59,130,246,0.85);
  box-shadow: 0 8px 18px rgba(59,130,246,0.18);
}

/* Timeline meta line (date/actor/status) weniger grau, mehr Struktur */
details[open] summary + div[style*="border-left:3px solid"] .small {
  color: #475569 !important;
  font-weight: 600;
}

details[open] summary + div[style*="border-left:3px solid"] .small b {
  color: #0f172a;
}

/* Timeline text */
details[open] summary + div[style*="border-left:3px solid"] > div[style*="margin-bottom"] > div:last-child {
  margin-top: 6px !important;
  color: #0f172a;
}

/* 3) Optional: Details/Summary Pfeil schöner (kein Marker, eigenes Icon über CSS)
   (Nur visuell – funktional bleibt alles gleich.)
*/
details summary {
  position: relative;
  padding-left: 38px !important;
}
details summary::before {
  content: "▸";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #334155;
  transition: transform 0.15s ease;
}
details[open] summary::before {
  transform: translateY(-50%) rotate(90deg);
}

/* 4) Kleine “Pro” Touches */
.card:has(details) {
  padding-top: 18px;
}/* =========================================
   Ticket Detail – Fine Tuning (stoerung.ticket)
   ========================================= */

.ticket-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom: 14px;
}
.ticket-header__left h1{ margin:0; }
.ticket-header__right{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
}

.ticket-summary{
  background:#f8fafc;
  border:1px solid var(--border2);
  border-radius: 14px;
  padding: 14px 14px;
  margin-top: 10px;
  color: var(--text);
  font-weight: 750;
}
.ticket-summary__title {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 2px;
}
.ticket-summary__desc {
  color: #333;
  font-size: 1em;
  white-space: pre-line;
  margin-bottom: 2px;
}

.ticket-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top: 12px;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 7px 10px;
  border-radius: 999px;
  background:#f1f5f9;
  border:1px solid var(--border);
  font-size: 12.5px;
  color: #0f172a;
  white-space: nowrap;
}
.chip b{ font-weight: 800; }

.ticket-quickstatus{
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border2);
}
.ticket-quickstatus h2{ margin: 0 0 10px 0; }

.btn--pill{
  border-radius: 999px !important;
  padding: 8px 12px !important;
  border: 1px solid var(--border) !important;
  background: #f1f5f9 !important;
  box-shadow: none !important;
  color: var(--text) !important;
  font-weight: 800 !important;
}
.btn--pill:hover{
  background:#e2e8f0 !important;
  transform: translateY(-1px);
}
.btn--pill-active{
  background:#0f172a !important;
  border-color: rgba(15,23,42,0.25) !important;
  color: #fff !important;
}

.accordion__summary{
  list-style:none;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border2);
  font-weight: 850;
  cursor:pointer;
  position: relative;
  padding-left: 40px;
}
.accordion__summary::-webkit-details-marker{ display:none; }
.accordion__summary::before{
  content:"▸";
  position:absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color:#334155;
  transition: transform .15s ease;
}
details[open] .accordion__summary{
  background:#eef2ff;
  border-color: rgba(99,102,241,0.18);
}
details[open] .accordion__summary::before{
  transform: translateY(-50%) rotate(90deg);
}
.accordion__body{ margin-top: 12px; }

.timeline{
  border-left: 2px solid rgba(148,163,184,0.55);
  padding-left: 18px;
  margin-left: 6px;
}
.timeline__item{
  position: relative;
  margin: 0 0 14px 0;
  padding: 12px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border2);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}
.timeline__item::before{
  content:"";
  position:absolute;
  left: -27px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background:#fff;
  border: 3px solid rgba(59,130,246,0.85);
  box-shadow: 0 8px 18px rgba(59,130,246,0.18);
}

/* dot colors by status */
.timeline__item[data-status="angenommen"]::before{ border-color:#2563eb; box-shadow:0 8px 18px rgba(37,99,235,0.18); }
.timeline__item[data-status="in_arbeit"]::before{ border-color:#1e40af; box-shadow:0 8px 18px rgba(30,64,175,0.18); }
.timeline__item[data-status="bestellt"]::before{ border-color:#f59e0b; box-shadow:0 8px 18px rgba(245,158,11,0.18); }
.timeline__item[data-status="erledigt"]::before{ border-color:#16a34a; box-shadow:0 8px 18px rgba(22,163,74,0.18); }
.timeline__item[data-status="geschlossen"]::before{ border-color:#64748b; box-shadow:0 8px 18px rgba(100,116,139,0.18); }

.timeline__meta{
  color:#475569;
  font-weight: 650;
  font-size: 13px;
}
.timeline__meta b{ color: var(--text); }
.timeline__text{
  margin-top: 6px;
  color: var(--text);
}
/* =========================================
   Sticky Ticket Action Bar
   ========================================= */

.ticket-actions {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card, #fff);
  box-shadow: 0 2px 16px rgba(15,23,42,0.08);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border, #94a3b8);
  padding: 12px 0 8px 0;
  margin-bottom: 18px;
}

.ticket-actions__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ticket-actions__left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ticket-actions__right {
  display: flex;
  gap: 8px;
}
.ticket-actions__title {
  font-size: 1.1em;
  font-weight: 600;
  margin-right: 8px;
}
.ticket-actions__quickstatus {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn--mini {
  font-size: 0.95em;
  padding: 4px 12px;
  border-radius: 16px;
}
.btn--jump {
  background: var(--bg2, #f6f8fb);
  color: var(--primary2, #2563eb);
  border: 1px solid var(--border, #94a3b8);
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.btn--jump:hover {
  background: var(--primarySoft, #e0e7ff);
  color: var(--primary, #1e3a8a);
}

html { scroll-behavior: smooth; }

@media (max-width: 720px) {
  .ticket-actions { top: 8px; }
  .ticket-actions__inner { padding: 10px; }
}