/* Super Duper Ticket System by MetNet - modernes Design (UTF-8) */
:root {
  --bg: #eef2f8;
  --bg-soft: #f7f9fc;
  --card: #ffffff;
  --ink: #1c2733;
  --muted: #5f6b7a;
  --line: #dde5ef;
  --brand: #2456a6;
  --brand-2: #2f6fd6;
  --brand-d: #1b4180;
  --navy: #14294d;
  --ok: #1e7d32;
  --warn: #b26a00;
  --bad: #c62828;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(20,41,77,.06), 0 8px 24px -12px rgba(20,41,77,.18);
  --shadow-hover: 0 12px 30px -12px rgba(36,86,166,.35);
  --font: "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(47,111,214,.10), transparent 60%),
    var(--bg);
  line-height: 1.5;
}
h1 { font-size: 1.55rem; margin: .2rem 0 .9rem; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; margin: 0 0 .6rem; }
h1, h2, h3 { color: var(--ink); }
a { color: var(--brand); }
code { background: var(--bg-soft); border: 1px solid var(--line); padding: .1rem .4rem;
  border-radius: 5px; font-size: .92em; }

/* ---------------- Markenleiste (rechts oben, außerhalb Header) ---------------- */
.brandarea {
  display: flex; justify-content: flex-end; align-items: center; gap: 14px;
  padding: 12px 24px 8px; background: #fff;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(180deg, #ffffff, #f5f8fd);
}
.brand { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.brandtext { font-weight: 800; color: var(--brand); font-size: 1.12rem; letter-spacing: -.01em; }
.brand .logo { height: 62px; width: auto; border-radius: 8px; box-shadow: var(--shadow); }
.brand:hover .logo { transform: translateY(-1px); }
.brand .logo { transition: transform .15s ease; }

/* ---------------- Navigationsleiste ---------------- */
.topbar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: linear-gradient(90deg, var(--navy), var(--brand) 60%, var(--brand-2));
  color: #fff; padding: .55rem 24px;
  box-shadow: 0 3px 12px -6px rgba(20,41,77,.4);
  position: sticky; top: 0; z-index: 30;
}
.topbar nav { display: flex; flex-wrap: wrap; gap: .15rem; }
.topbar nav a {
  color: rgba(255,255,255,.92); text-decoration: none; font-weight: 500;
  padding: .42rem .8rem; border-radius: 8px; font-size: .94rem;
  transition: background .12s ease, color .12s ease;
}
.topbar nav a:hover { background: rgba(255,255,255,.16); color: #fff; }
.topbar .navgroup { border-left: 1px solid rgba(255,255,255,.35); margin-left: .35rem;
  padding-left: .35rem; }
.topbar .user {
  margin-left: auto; display: flex; align-items: center; gap: .7rem;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2);
  padding: .28rem .55rem .28rem .9rem; border-radius: 999px; font-size: .9rem;
  backdrop-filter: blur(4px);
}
.topbar .user .logout-btn {
  background: #fff; color: var(--brand); border: none; border-radius: 999px;
  padding: .3rem .9rem; font-weight: 700; cursor: pointer; font: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.topbar .user .logout-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.2); }

/* ---------------- Inhalt ---------------- */
main { max-width: 1120px; margin: 1.4rem auto 3rem; padding: 0 1.2rem; }
.desc, .help { color: var(--muted); }
.help { font-size: .92rem; }

/* ---------------- Karten ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; margin: .9rem 0; box-shadow: var(--shadow);
}
.card.inset { background: var(--bg-soft); border-style: dashed; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.cards .card { margin: 0; }
.areacard, .subcard {
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 150px; padding: 1.35rem 1.5rem; text-decoration: none; color: inherit;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  position: relative; overflow: hidden;
}
.areacard::after, .subcard::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px;
  border-radius: 50%; background: radial-gradient(circle, rgba(47,111,214,.10), transparent 70%);
}
.areacard:hover, .subcard:hover {
  border-color: var(--brand-2); transform: translateY(-3px); box-shadow: var(--shadow-hover);
}
.areacard h2 { color: var(--brand); margin: 0 0 .4rem; }
.carddesc { font-size: 1.02rem; color: var(--muted); margin: 0; }
.toolbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .4rem; }
.toolbar h1 { flex: 1; }
.narrow { max-width: 460px; margin: 3rem auto; }

/* ---------------- Buttons & Formulare ---------------- */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: .52rem 1.05rem; cursor: pointer;
  font: inherit; font-weight: 600; text-decoration: none;
  transition: transform .1s ease, box-shadow .1s ease, background .12s ease, border-color .12s ease;
  box-shadow: 0 1px 2px rgba(20,41,77,.08);
}
.btn:hover { border-color: var(--brand-2); transform: translateY(-1px); box-shadow: 0 6px 14px -6px rgba(36,86,166,.3); }
.btn.primary {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  border-color: transparent; color: #fff;
}
.btn.primary:hover { box-shadow: 0 8px 18px -6px rgba(36,86,166,.55); }
.linkbtn { background: none; border: none; color: var(--brand); cursor: pointer;
  text-decoration: underline; padding: 0; font: inherit; font-size: .95rem; }
.linkbtn.danger { color: var(--bad); }

label { display: block; margin: .65rem 0; font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=date], input[type=search], select, textarea {
  display: block; width: 100%; padding: .55rem .7rem; margin-top: .25rem;
  border: 1px solid var(--line); border-radius: var(--radius-s); font: inherit;
  background: #fff; color: var(--ink); transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(47,111,214,.16);
}
textarea { resize: vertical; }
.field label { font-weight: 600; }
.reqmark { color: var(--bad); font-weight: 700; }
.fielderr { display: block; color: var(--bad); font-size: .85rem; font-weight: 500;
  margin-top: .3rem; }
.help, small { color: var(--muted); font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.1rem; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------------- Flash ---------------- */
.flash { padding: .7rem 1rem; border-radius: var(--radius-s); margin: .7rem 0;
  border-left: 4px solid transparent; box-shadow: var(--shadow); font-size: .95rem; }
.flash.success { background: #e9f7ec; border-color: #2e9b52; color: #155d2c; }
.flash.error { background: #fdeeec; border-color: #e5484d; color: #8f1d20; }
.flash.info { background: #e8f1fd; border-color: #2f6fd6; color: #123c7a; }

/* ---------------- Tabellen ---------------- */
table.data { border-collapse: separate; border-spacing: 0; width: 100%; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); }
table.data th, table.data td { border-bottom: 1px solid var(--line); padding: .62rem .8rem;
  text-align: left; vertical-align: top; font-size: .95rem; }
table.data thead th { background: var(--bg-soft); color: var(--muted); font-weight: 700;
  text-transform: none; letter-spacing: .01em; white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #f4f8fe; }
.meta th { width: 160px; color: var(--muted); font-weight: 600; }
.status { display: inline-block; border-radius: 999px; padding: .16rem .7rem;
  font-size: .82rem; font-weight: 700; white-space: nowrap; }
.s-open { background: #fff3e0; color: #8a5300; }
.s-in_progress { background: #e3efff; color: #174e9e; }
.s-done { background: #e6f6e9; color: #1a6b34; }
.s-rejected { background: #fdecec; color: #a12b2e; }
.status.ok { background: #e6f6e9; color: #1a6b34; }
.status.fail { background: #fdecec; color: #a12b2e; }
table.sortable th a { text-decoration: none; color: inherit; display: inline-flex; gap: .25rem; }
table.sortable th a:hover { color: var(--brand); }

/* ---------------- Tabs & Filter ---------------- */
.tabs { margin: .4rem 0 .9rem; display: flex; gap: .3rem; }
.tabs a { display: inline-block; padding: .45rem 1rem; border: 1px solid var(--line);
  background: #fff; color: var(--ink); text-decoration: none; border-radius: 999px;
  font-weight: 600; font-size: .93rem; transition: all .12s ease; }
.tabs a.active { background: var(--brand); color: #fff; border-color: var(--brand);
  box-shadow: 0 4px 10px -4px rgba(36,86,166,.5); }
.tabs a:hover:not(.active) { border-color: var(--brand-2); color: var(--brand); }
.filters { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; margin: .9rem 0; }
.filters label, .filters select { margin: 0; }
.filters select { width: auto; min-width: 180px; }

/* ---------------- Bereichs-Ueberschriften & Chips ---------------- */
.area { margin: 1.4rem 0 .6rem; color: var(--brand); font-size: 1.2rem;
  display: flex; align-items: center; gap: .6rem; }
.area::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.chips { display: flex; gap: .7rem; flex-wrap: wrap; margin: .6rem 0 1.1rem; }
.chip { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1.1rem;
  border-radius: 999px; text-decoration: none; color: var(--ink); background: #fff;
  border: 1px solid var(--line); font-weight: 700; box-shadow: var(--shadow);
  transition: transform .1s ease, border-color .12s ease; }
.chip:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.chip .chip-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.s-open .chip-dot { background: var(--warn); }
.s-in_progress .chip-dot { background: var(--brand-2); }
.s-done .chip-dot { background: var(--ok); }
.s-rejected .chip-dot { background: var(--bad); }

/* ---------------- Wizard ---------------- */
.progresswrap { margin: .5rem 0 .8rem; font-size: .92rem; color: var(--muted); }
.progressbar { background: #e2e8f2; height: 9px; border-radius: 999px; overflow: hidden; margin-top: .3rem; }
.progressfill { background: linear-gradient(90deg, var(--brand-2), var(--brand));
  height: 100%; transition: width .25s ease; }
.wizard-step { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem;
  background: #fff; box-shadow: var(--shadow); margin-top: .5rem; }
.wizard-step legend { font-weight: 800; font-size: 1.1rem; padding: 0 .2rem; color: var(--brand); }
.stepdesc { margin: .1rem 0 .9rem; color: var(--muted); }
.wizard-nav { display: flex; gap: .6rem; margin-top: 1.2rem; }
.summary-table td { padding: .25rem .9rem .25rem 0; vertical-align: top; }
.radio-group label { font-weight: 400; margin: .25rem 0; display: flex; align-items: center; gap: .5rem; }
label.check { font-weight: 500; display: flex; align-items: center; gap: .5rem; }
label.bigcheck { display: flex; gap: .6rem; align-items: center; font-weight: 600;
  padding: .45rem 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand-2); width: 17px; height: 17px; }

/* ---------------- Box-Pulldown ---------------- */
.boxpicker { position: relative; }
.boxpicker .boxsearch { width: 100%; }
.boxmenu { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 230px; overflow-y: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 28px -8px rgba(20,41,77,.35); padding: .25rem; }
.boxmenu .boxitem { display: flex; flex-direction: column; width: 100%; text-align: left;
  border: none; background: none; padding: .5rem .65rem; cursor: pointer; font: inherit;
  border-radius: 7px; }
.boxitem:hover { background: #eef4fd; }
.boxitem small { color: var(--muted); }
.noresult { margin: .3rem .5rem; color: var(--muted); }

/* ---------------- Timeline & Listen ---------------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 3px solid var(--line); padding: .1rem 0 .85rem 1.1rem;
  margin-bottom: .35rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .4rem; width: 11px;
  height: 11px; border-radius: 50%; background: var(--brand-2); border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line); }
.timeline .tl-when { color: var(--muted); font-size: .82rem; margin-right: .5rem; }
.tl-body { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem .7rem; margin-top: .4rem; white-space: pre-wrap; }
.attachlist { list-style: none; padding: 0; }
.attachlist li { margin-bottom: .3rem; }
.small { font-size: .82rem; margin-left: .4rem; }

/* ---------------- Flow-Editor ---------------- */
.stepblock { margin-bottom: 1rem; }
.stephead { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.stephead input[type=text] { width: auto; flex: 1; min-width: 150px; }
.rowactions { display: flex; gap: .5rem; align-items: center; }
.empty { color: var(--muted); font-style: italic; }

/* ---------------- Modal ---------------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,28,52,.5); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  backdrop-filter: blur(3px); }
.modal-overlay[hidden] { display: none; }
.modal { background: #fff; border-radius: 16px; box-shadow: 0 24px 60px -12px rgba(0,0,0,.4);
  padding: 1.3rem 1.5rem; width: min(560px, 94vw); animation: modalIn .16s ease; }
@keyframes modalIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { margin-top: 0; }
.modal-buttons { display: flex; gap: .6rem; margin-top: .9rem; }
.card.actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* ---------------- Responsive ---------------- */
@media (max-width: 720px) {
  main { padding: 0 .9rem; }
  .brandarea { padding: 10px 14px 6px; }
  .brandtext { font-size: .98rem; }
  .brand .logo { height: 48px; }
  .topbar { padding: .5rem 14px; }
  table.data { font-size: .88rem; }
  .cards { grid-template-columns: 1fr; }
}
@media print {
  .topbar, .brandarea, .flash, .wizard-nav, .card.actions { display: none !important; }
}
.hero { display: flex; align-items: center; gap: 1rem; background: linear-gradient(135deg,
  #fff 0%, #eef4fd 100%); border: 1px solid var(--line); border-radius: 18px;
  padding: 1.1rem 1.4rem; margin: .2rem 0 1.2rem; box-shadow: var(--shadow); }
.hero h1 { margin: 0; }
.hero-sub { margin: .1rem 0 0; color: var(--muted); }
.hero-avatar { width: 52px; height: 52px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff;
  font-size: 1.5rem; font-weight: 800; box-shadow: 0 6px 14px -4px rgba(36,86,166,.5); }

/* ===== Look A: hell, clean, modern (Refinement) ===== */
:root {
  --font: "Inter", "Segoe UI Variable", "Segoe UI", Roboto, Arial, sans-serif;
  --bg: #f4f6fb;
  --radius: 16px;
  --radius-s: 10px;
}
main { max-width: 1160px; }

/* Kennzahlen-Kacheln (Dashboard) */
.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .8rem; margin: .4rem 0 1.2rem; }
.chip { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem;
  padding: 1rem 1.1rem; border-radius: 14px; background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: .92rem; color: var(--muted); line-height: 1.2; transition: transform .12s ease, box-shadow .12s ease; }
.chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.chip strong { font-size: 1.55rem; color: var(--ink); line-height: 1; font-weight: 800; }
.chip .chip-dot { width: 12px; height: 12px; }
.chip .chip-label { margin-top: .15rem; }

/* Titel + Einheiten */
h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-weight: 700; }

/* Hero */
.hero { border-radius: 20px; padding: 1.4rem 1.6rem; margin-bottom: 1.4rem; }

/* Karten */
.card { border-radius: var(--radius); }
.areacard, .subcard { border-radius: 18px; }

/* Eingaben weicher */
input, select, textarea, .boxsearch { border-radius: 10px; }

/* Buttons */
.btn { border-radius: 10px; }
.btn.primary { box-shadow: 0 8px 18px -8px rgba(36,86,166,.6); }

/* Tabellen: rundere Kopfzeile + mehr Luft */
table.data th, table.data td { padding: .72rem .9rem; }
table.data thead th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }

/* Leerraum/leere Zustaende */
.empty { padding: .6rem 0; }

/* Flash als dezente Box */
.flash { border-radius: 12px; }

/* ===== Logo-Farbschema (Cyan / Schwarz / Gelb) + vereinter sticky Header ===== */
:root {
  --brand: #0089a6;
  --brand-2: #00b7d4;
  --brand-d: #00667e;
  --navy: #070f1a;
  --accent: #ffd500;
  --bg: #eef4f8;
}
.brandarea { display: none; }  /* wird nicht mehr separat genutzt */

/* Header: dunkler Grundton mit Cyan-Akzent, Logo+Name links, sticky */
.topbar {
  gap: 1rem; padding: .6rem 1.2rem;
  background:
    radial-gradient(900px 240px at 12% -60%, rgba(0,183,212,.35), transparent 60%),
    linear-gradient(100deg, #0a1626 0%, #0b2030 55%, #08323d 100%);
}
.brand { display: flex; flex-direction: row; align-items: center; gap: .6rem;
  text-decoration: none; min-width: 0; }
.brand .logo { height: 42px; width: auto; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.brandtext { color: #fff; font-weight: 800; font-size: 1rem; letter-spacing: -.01em;
  line-height: 1.1; white-space: normal; }
.brand:hover .brandtext { color: var(--accent); }
.topbar nav { margin-left: .2rem; }
.topbar nav a { color: #d9f3f7; }
.topbar nav a:hover { background: rgba(0,183,212,.22); color: #fff; }
.topbar .user { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.22); }
.topbar .user .logout-btn {
  background: linear-gradient(135deg, var(--accent), #ffc400); color: #0a1626; font-weight: 800;
}
.topbar .navgroup { border-left-color: rgba(255,255,255,.3); }

/* Akzente: Buttons/Primärfarben im Cyan-Schema */
.btn.primary { background: linear-gradient(135deg, #00b7d4, #0089a6); }
.btn.primary:hover { box-shadow: 0 8px 18px -6px rgba(0,160,190,.55); }
.hero-avatar { background: linear-gradient(135deg, #00b7d4, #0089a6); }
.area { color: var(--brand-d); }
.progressfill { background: linear-gradient(90deg, #00b7d4, #0089a6); }
a { color: var(--brand-d); }
.areacard h2 { color: var(--brand-d); }
input:focus, select:focus, textarea:focus { border-color: #00b7d4; box-shadow: 0 0 0 3px rgba(0,183,212,.18); }
