/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-primary:    #1a3a5c;   /* MesserSoft Dunkelblau */
  --c-accent:     #0078d4;   /* Helles Blau */
  --c-bg:         #f4f6f9;
  --c-surface:    #ffffff;
  --c-border:     #d8dde6;
  --c-text:       #1e2d3d;
  --c-muted:      #6b7a8d;
  --c-error:      #c0392b;
  --c-success:    #1e7e34;
  --radius:       8px;
  --shadow:       0 1px 4px rgba(0,0,0,.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.5;
}

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

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--c-primary);
  color: #fff;
  padding: 0 24px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.navbar-brand {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}
.navbar-brand:hover { text-decoration: none; }
.brand-dot { color: #5bc4f5; margin-right: 4px; }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar-links a {
  color: rgba(255,255,255,.8);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
}
.navbar-links a:hover, .navbar-links a.active {
  color: #fff;
  background: rgba(255,255,255,.15);
  text-decoration: none;
}
.navbar-user {
  color: rgba(255,255,255,.6);
  font-size: 12px;
  padding: 0 8px;
}
.btn-logout {
  color: rgba(255,255,255,.7) !important;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--radius);
  padding: 4px 10px !important;
}
.btn-logout:hover { background: rgba(255,255,255,.1) !important; }

/* ── Container ─────────────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
}

/* ── Page header ───────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--c-primary);
}
.page-sub {
  color: var(--c-muted);
  font-size: 13px;
}
.back-link {
  font-size: 13px;
  color: var(--c-muted);
}

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 24px 28px;
  max-width: 900px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--c-text);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.form-row-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.label-inline {
  min-width: 200px;
  font-size: 13px;
  color: var(--c-text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--c-text);
  background: #fff;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(0,120,212,.12);
}
input.input-disabled, input[disabled] {
  background: var(--c-bg);
  color: var(--c-muted);
  cursor: not-allowed;
}
.has-error input, .has-error select, .has-error textarea {
  border-color: var(--c-error);
}
.field-error { color: var(--c-error); font-size: 12px; margin-top: 4px; }
.field-hint {
  background: #eef4ff;
  border-left: 3px solid var(--c-accent);
  padding: 8px 12px;
  font-size: 12px;
  color: #2c5282;
  border-radius: 0 4px 4px 0;
  margin-bottom: 8px;
}

.char-count {
  font-size: 11px;
  color: var(--c-muted);
  text-align: right;
  margin-top: 4px;
}

.required { color: var(--c-error); }

/* Radio Pills */
.radio-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill input[type="radio"] { display: none; }
.pill span {
  display: block;
  padding: 6px 16px;
  border: 1.5px solid var(--c-border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
}
.pill input:checked + span {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}
.pill span:hover { border-color: var(--c-accent); }

/* Checkboxes */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 24px 0 18px;
}
.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--c-muted);
  margin-bottom: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Decision form (right panel) */
.decision-form { max-width: 100%; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.btn-primary   { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: #14304f; text-decoration: none; color: #fff; }
.btn-secondary { background: #e0e7ef; color: var(--c-text); }
.btn-secondary:hover { background: #cdd6e2; text-decoration: none; }
.btn-full      { width: 100%; justify-content: center; }
.btn-sm        { padding: 5px 12px; font-size: 12px; }

/* ── Filter bar ────────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  align-items: center;
}
.filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--c-border);
  color: var(--c-text);
  background: #fff;
  cursor: pointer;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
  text-decoration: none;
}
.filter-sep { color: var(--c-border); padding: 0 4px; }

/* ── Badge ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
}
.badge-lg { font-size: 13px; padding: 4px 14px; }

.badge-pending    { background: #e9ecef; color: #495057; }
.badge-clarifying { background: #cce5ff; color: #004085; }
.badge-ready      { background: #fff3cd; color: #856404; }
.badge-decided    { background: #d4edda; color: #155724; }
.badge-bug        { background: #f8d7da; color: #721c24; }
.badge-feature    { background: #d1ecf1; color: #0c5460; }
.badge-custom     { background: #fde8d8; color: #8a3a00; }
.badge-unclear    { background: #e2e3e5; color: #41464b; }
.badge-low        { background: #e9ecef; color: #6c757d; }
.badge-normal     { background: #d1ecf1; color: #0c5460; }
.badge-high       { background: #fff3cd; color: #856404; }
.badge-critical   { background: #f8d7da; color: #721c24; }

/* ── Ticket cards ──────────────────────────────────────────────────────────── */
.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  display: block;
  color: inherit;
}
.ticket-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,.1);
  border-color: var(--c-accent);
  text-decoration: none;
}
.ticket-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.ticket-product { font-weight: 600; font-size: 13px; color: var(--c-primary); }
.ticket-desc { color: var(--c-muted); font-size: 13px; margin-bottom: 10px; }
.ticket-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--c-muted);
}

/* ── Board table ───────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.board-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 13px;
}
.board-table th {
  background: var(--c-primary);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.board-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
.board-row { cursor: pointer; transition: background .1s; }
.board-row:hover { background: #f0f4fa; }
.num-cell { text-align: right; font-variant-numeric: tabular-nums; }
.desc-cell { max-width: 280px; }
.muted { color: var(--c-muted); }

/* ── Detail view ───────────────────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.detail-card h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
}

.detail-list { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; }
.detail-list dt { font-weight: 600; font-size: 12px; color: var(--c-muted); padding-top: 2px; }
.detail-list dd { font-size: 13px; }
.detail-list-sm { margin-bottom: 16px; }
.description-text { white-space: pre-wrap; font-size: 13px; }

.totals-box {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 16px 0;
}
.total-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.compact-list { padding-left: 18px; font-size: 13px; }
.compact-list li { margin-bottom: 2px; }

/* ── Login page ────────────────────────────────────────────────────────────── */
.login-page {
  background: var(--c-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px 36px;
  width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.login-logo {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--c-primary);
  margin-bottom: 4px;
}
.login-brand { font-size: 24px; }
.login-sub {
  text-align: center;
  color: var(--c-muted);
  font-size: 12px;
  margin-bottom: 28px;
}

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--c-muted);
}
.empty-state p { margin-bottom: 16px; }
