:root {
  --bg: #eef2f1;
  --panel: #ffffff;
  --panel-soft: #f8faf9;
  --ink: #14211d;
  --muted: #67736e;
  --line: #d7dfdb;
  --primary: #0f766e;
  --primary-dark: #0b4f4a;
  --accent: #d97706;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(20, 33, 29, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  background: #10231f;
  color: #eaf2ef;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.brand {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px 12px;
  align-items: center;
}
.brand span {
  grid-row: span 2;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  font-weight: 800;
}
.brand strong { align-self: end; }
.brand small { color: #a8bbb4; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a, .logout {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  color: #c9d7d2;
}
.sidebar nav a.active, .sidebar nav a:hover, .logout:hover {
  background: rgba(255,255,255,.09);
  color: #fff;
}
.logout { margin-top: auto; }

.app {
  margin-left: 250px;
  padding: 24px;
}
.public {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.topline {
  height: 66px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.topline div { display: grid; }
.topline span, .eyebrow, .muted, label span, .empty, .hint { color: var(--muted); }
.primary, button.primary {
  border: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.primary:hover { background: var(--primary-dark); }
button, .button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 12px;
  cursor: pointer;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 20px;
}
h1 { margin: 0; font-size: 34px; letter-spacing: 0; }
h2 { margin: 0 0 14px; font-size: 19px; }
h3 { margin: 8px 0 6px; font-size: 16px; }
.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 750;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stats div, .surface, .column, .login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.stats div { padding: 18px; }
.stats strong { display: block; font-size: 31px; }
.stats span { color: var(--muted); }
.surface { padding: 20px; margin-bottom: 18px; }
.focus {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 18px;
  align-items: start;
}
.focus p { color: var(--muted); margin: 6px 0 0; }

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 6px;
}
.column { padding: 14px; min-height: 240px; }
.column header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.column header h2 { margin: 0; font-size: 16px; }
.column header span {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  min-width: 30px;
  text-align: center;
  padding: 3px 8px;
}
.cards { display: grid; gap: 10px; }
.wide-cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ticket-card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.ticket-card:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(20,33,29,.1); }
.ticket-card a { display: block; padding: 13px; }
.card-top, .ticket-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.ticket-card p { margin: 0 0 10px; color: var(--muted); }
.priority-hoch, .priority-dringend { border-left-color: var(--accent); }

.filter {
  display: grid;
  grid-template-columns: 1fr 190px auto;
  gap: 10px;
  margin-bottom: 16px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
label { display: grid; gap: 6px; }
.wide { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
}
textarea { min-height: 118px; resize: vertical; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.check input { width: 18px; min-height: 18px; margin-top: 3px; }

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px 9px;
  vertical-align: top;
}
th { color: var(--muted); font-size: 13px; font-weight: 700; }
td span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
tr[onclick] { cursor: pointer; }
tr[onclick]:hover { background: var(--panel-soft); }
mark {
  background: #e6f4f1;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 4px 8px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 12px;
}
.day {
  min-height: 170px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.day.today { outline: 2px solid var(--primary); }
.day header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.day a {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  background: var(--panel-soft);
}
.day p { color: var(--muted); margin: 0; }
.day small { color: var(--muted); }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.timeline li {
  border-left: 3px solid var(--primary);
  background: var(--panel-soft);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 2px;
}
.timeline span, .timeline small { color: var(--muted); }

.login-card {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1fr 430px;
  overflow: hidden;
}
.login-copy {
  background: #10231f;
  color: #fff;
  padding: 48px;
  display: grid;
  align-content: center;
  gap: 12px;
}
.login-copy p { color: #bdd0c9; margin: 0; max-width: 420px; }
.login-copy a { color: #7dd3c7; font-weight: 700; }
.login-form {
  padding: 34px;
  display: grid;
  gap: 14px;
  align-content: center;
}
.public-ticket { grid-template-columns: 380px 1fr; }
.toast {
  border-radius: 8px;
  border: 1px solid #b8ddd4;
  background: #edf8f5;
  color: #14534d;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.toast.error {
  border-color: #f1b8b4;
  background: #fff2f0;
  color: var(--danger);
}
.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  background: var(--panel-soft);
}

@media (max-width: 980px) {
  .sidebar { position: static; width: auto; min-height: auto; }
  .app { margin-left: 0; padding: 16px; }
  .stats, .focus, .form-grid, .login-card, .public-ticket { grid-template-columns: 1fr; }
  .filter { grid-template-columns: 1fr; }
  .calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-template-columns: repeat(5, 260px); }
}

@media (max-width: 620px) {
  .hero, .topline { align-items: stretch; flex-direction: column; height: auto; padding: 14px; }
  .stats, .calendar-grid { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
  .login-copy, .login-form { padding: 24px; }
}
