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

/* ── Icons (inline outline SVG, replaces emoji glyphs) ── */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex: none; }
button .icon, a .icon { pointer-events: none; }

:root {
  --bg: #f0f1f3;
  --surface: #ffffff;
  --column-bg: #e4e6ea;
  --card-bg: #ffffff;
  --primary: #0052cc;
  --primary-hover: #0041a0;
  --text: #172b4d;
  --text-muted: #6b778c;
  --border: #dfe1e6;
  --danger: #de350b;
  --danger-hover: #bf2600;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.1);
  --shadow-modal: 0 8px 32px rgba(0,0,0,.2);
}

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

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

/* ── Topbar ── */
.topbar {
  background: var(--primary);
  color: #fff;
  padding: 0 20px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.topbar-title { font-weight: 700; font-size: 16px; }
.topbar-logo-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; opacity: 1; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: transform .15s;
}
.topbar-logo-link:hover { opacity: 1; transform: scale(1.05); }
.topbar-logo { width: 28px; height: 28px; display: block; }
#btn-toggle-layout { color: #fff; opacity: .85; }
#btn-toggle-layout:hover { opacity: 1; background: rgba(255,255,255,.2); color: #fff; }
.topbar a { color: #fff; opacity: .85; }
.topbar a:hover { opacity: 1; text-decoration: none; }
.topbar-spacer { flex: 1; }

/* ── Search ── */
.search-input {
  padding: 6px 12px;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  width: 220px;
  background: rgba(255,255,255,.2);
  color: #fff;
}
.search-input::placeholder { color: rgba(255,255,255,.7); }
.search-input:focus { outline: none; background: rgba(255,255,255,.3); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--column-bg); color: var(--text); }
.btn-secondary:hover { background: #d0d3d8; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 4px 8px; }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── Forms ── */
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s;
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}
textarea { resize: vertical; min-height: 80px; }

/* ── Rich-text editor ── */
.editor-toolbar {
  display: flex; align-items: center; gap: 4px; padding: 6px 8px;
  background: var(--column-bg); border: 1px solid var(--border);
  border-bottom: none; border-radius: var(--radius) var(--radius) 0 0;
}
.editor-toolbar button {
  background: none; border: 1px solid transparent; padding: 4px 8px;
  cursor: pointer; border-radius: 3px; font-size: 13px; color: var(--text);
}
.editor-toolbar button:hover { background: var(--surface); border-color: var(--border); }
.editor-toolbar select {
  width: auto; padding: 3px 6px; font-size: 13px; border: 1px solid var(--border);
  border-radius: 3px; background: var(--surface);
}
.toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.editor-content {
  min-height: 250px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius); background: var(--surface);
  font-size: 14px; line-height: 1.6; color: var(--text); overflow-y: auto;
}
.editor-content:focus { outline: none; border-color: var(--primary); }
.editor-content:empty::before {
  content: attr(data-placeholder); color: var(--text-muted); pointer-events: none;
}
.editor-content h1, .editor-content h2, .editor-content h3, .editor-content h4 { margin: 8px 0 4px; }
.editor-content ul, .editor-content ol { padding-left: 24px; margin: 4px 0; }
.editor-content li { margin-bottom: 2px; }
.editor-raw {
  min-height: 250px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius); background: #1e1e1e;
  font-family: monospace; font-size: 13px; line-height: 1.5; color: #d4d4d4;
  resize: vertical; width: 100%;
}
.editor-toolbar button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Code formatting inside the description editor + comment bodies ── */
.editor-content code, .comment-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--column-bg);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.9em;
}
.editor-content pre, .comment-text pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--column-bg);
  padding: 10px 12px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.9em;
  line-height: 1.5;
}
.editor-content pre code, .comment-text pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 1em;
}

/* ── Comment rich-text editor (add + edit forms) ── */
.comment-editor-toolbar { padding: 4px 6px; }
.comment-editor.editor-content { min-height: 60px; font-size: 13px; line-height: 1.5; }
.comment-edit-form .editor-content { border-radius: 0 0 var(--radius) var(--radius); }
label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Index: Board Grid ── */
.page-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-header h1 { font-size: 20px; }

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.board-sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.board-sort-wrap label {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.board-sort-wrap select {
  width: auto;
  padding: 6px 10px;
  font-size: 13px;
}
.board-sort-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 24px;
}

.board-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  position: relative;
}
.board-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.15); transform: translateY(-1px); }
.board-card-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.board-card-meta { font-size: 12px; color: var(--text-muted); }
.board-card-actions { position: absolute; top: 10px; right: 10px; display: none; gap: 4px; }
.board-card:hover .board-card-actions { display: flex; }

.board-card-draggable { cursor: move; }
.board-card-dragging { opacity: .5; }
.boards-grid.drag-over { background: rgba(0,82,204,.06); border-radius: var(--radius); }

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.filter-bar select {
  width: auto;
  padding: 5px 8px;
  border: 1px solid var(--border);
  font-size: 13px;
}

/* ── Board Layout ── */
.board-wrap {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.board-canvas {
  display: flex;
  gap: 12px;
  padding: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

/* ── Columns ── */
.column {
  background: var(--column-bg);
  border-radius: var(--radius);
  width: 272px;
  min-width: 272px;
  display: flex;
  flex-direction: column;
}
.column-header {
  padding: 10px 12px;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.column-header-name { flex: 1; cursor: text; }
.column-header-name-input {
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13px;
  font-weight: 700;
}
.column-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
  min-height: 48px;
}
.column-body.drag-over { background: rgba(0,82,204,.08); border-radius: 4px; }
.column-footer { padding: 4px 8px 8px; flex-shrink: 0; }
.col-scroll-top { display: block; margin-left: auto; opacity: .5; font-size: 14px; }
.col-scroll-top:hover { opacity: 1; }

/* ── Ticket Cards ── */
.ticket-card {
  background: var(--card-bg);
  border: 2px solid transparent;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow .1s;
  position: relative;
}
.ticket-drag-handle {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  color: #6b7280;
  background: rgba(255,255,255,.85);
  border-radius: 4px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  opacity: .35;
  transition: opacity .15s, background .15s;
  z-index: 2;
}
.ticket-card:hover .ticket-drag-handle { opacity: .85; }
.ticket-drag-handle:hover  { opacity: 1 !important; background: #eef0f3; }
.ticket-drag-handle:active { cursor: grabbing; }
@media (hover: none) and (pointer: coarse) {
  .ticket-drag-handle { opacity: .85; }
}
.ticket-card.ticket-color-red    { border-color: #b85c5c; }
.ticket-card.ticket-color-yellow { border-color: #c4a452; }
.ticket-card.ticket-color-green  { border-color: #6f9c6f; }
.ticket-card.ticket-color-blue   { border-color: #6889a8; }
.ticket-card.ticket-color-purple { border-color: #8a6fa0; }

/* Color picker swatches in ticket modal */
.color-picker { display: inline-flex; gap: 4px; align-items: center; }
.color-swatch {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.2);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: transform .1s, box-shadow .1s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active {
  box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px #344563;
}
.color-swatch-none {
  background: linear-gradient(135deg, transparent 45%, #b0b0b0 45%, #b0b0b0 55%, transparent 55%);
}
.color-swatch.color-red    { background: #b85c5c; border-color: #b85c5c; }
.color-swatch.color-yellow { background: #c4a452; border-color: #c4a452; }
.color-swatch.color-green  { background: #6f9c6f; border-color: #6f9c6f; }
.color-swatch.color-blue   { background: #6889a8; border-color: #6889a8; }
.color-swatch.color-purple { background: #8a6fa0; border-color: #8a6fa0; }
.ticket-card:hover { box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.ticket-card.dragging { opacity: .5; }
.ticket-card.search-hidden { display: none; }
.ticket-card.ticket-heading {
  background: transparent;
  box-shadow: none;
  padding: 8px 4px 2px;
  border-bottom: 2px solid #344563;
  border-radius: 0;
}
.ticket-card.ticket-heading .ticket-card-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #172b4d;
}
.ticket-card.ticket-heading:hover { box-shadow: none; background: rgba(0,0,0,.03); }
#modal-ticket.heading-mode .modal-section:nth-of-type(n+2) { display: none; }
.col-drag-handle {
  display: inline-block;
  padding: 0 6px;
  cursor: grab;
  color: #5e6c84;
  user-select: none;
  font-size: 16px;
  line-height: 1;
}
.col-drag-handle:active { cursor: grabbing; }
.column.col-dragging { opacity: .5; }
.column.blurred .column-header-name,
.column.blurred .column-body,
.column.blurred .column-footer {
  filter: blur(7px);
  user-select: none;
  pointer-events: none;
  transition: filter .15s;
}
.col-blur-toggle.active { opacity: 1; }
.ticket-card-preview {
  display: block;
  width: calc(100% + 24px);
  margin: -10px -12px 10px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}
.ticket-card-title { font-weight: 500; font-size: 14px; line-height: 1.4; padding-right: 28px; }
.ticket-card-customer { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ticket-card-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: flex; gap: 8px; }

/* ── Add Column Button ── */
.add-column-btn {
  background: rgba(255,255,255,.25);
  border: none;
  border-radius: var(--radius);
  width: 272px;
  min-width: 272px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  transition: background .15s;
  flex-shrink: 0;
}
.add-column-btn:hover { background: rgba(255,255,255,.5); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  z-index: 1000;
  overflow-y: auto;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 680px;
  padding: 24px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 25px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--border); color: var(--text); }

input#ticket-title.modal-title {
  width: 95%;
}
.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-right: 32px;
  border: none;
  width: 100%;
  font-family: inherit;
  color: var(--text);
}
.modal-title:focus { outline: 2px solid var(--primary); border-radius: 4px; }

.modal-section { margin-bottom: 20px; }
.modal-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Ticket modal action bar */
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.modal-actions-primary {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
}
.heading-toggle {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .modal { padding: 16px; }
  .modal-actions { gap: 10px; }
  .modal-actions > #btn-delete-ticket,
  .modal-actions > #btn-duplicate-ticket {
    flex: 1;
    justify-content: center;
    padding: 8px 12px;
    font-size: 14px;
  }
  .color-picker { width: 100%; justify-content: flex-start; gap: 10px; }
  .color-swatch { width: 24px; height: 24px; }
  .modal-actions-primary {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }
  .heading-toggle { width: 100%; order: -1; font-size: 14px; }
  .modal-actions-primary .btn {
    flex: 1;
    justify-content: center;
    padding: 10px 12px;
  }
}

/* ── Image Gallery ── */
.image-gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.image-thumb {
  position: relative;
  width: 100px;
  height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.image-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--surface-alt, var(--border));
  color: var(--text-muted);
}
.file-thumb .icon { width: 28px; height: 28px; }
.file-thumb-ext {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.image-thumb-delete {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.image-thumb:hover .image-thumb-delete,
.image-thumb:hover .image-thumb-open { display: flex; }
.image-thumb-open {
  position: absolute;
  top: 3px;
  right: 28px;
  background: rgba(0,0,0,.6);
  color: #fff;
  text-decoration: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

/* ── Lightbox ── */
#lightbox {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.88); align-items: center; justify-content: center;
}
#lightbox.active { display: flex; }
#lightbox #lb-img {
  max-width: calc(100vw - 120px); max-height: calc(100vh - 80px);
  object-fit: contain; border-radius: var(--radius); box-shadow: var(--shadow-modal);
}
#lb-close {
  position: fixed; top: 16px; right: 20px;
  background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; line-height: 1;
}
#lb-download {
  position: fixed; top: 18px; right: 56px;
  color: #fff; font-size: 24px; line-height: 1; text-decoration: none;
}
#lb-download:hover { color: rgba(255,255,255,.7); }
#lb-prev, #lb-next {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: none; color: #fff;
  font-size: 36px; padding: 12px 16px; cursor: pointer; border-radius: var(--radius);
  line-height: 1;
}
#lb-prev { left: 12px; }
#lb-next { right: 12px; }
#lb-prev:hover, #lb-next:hover { background: rgba(255,255,255,.3); }
#lb-counter {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.7); font-size: 13px;
}

/* ── Links ── */
.links-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.link-item a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-add-form { display: flex; gap: 8px; flex-wrap: wrap; }
.link-add-form input { flex: 1; min-width: 140px; }

/* ── Comments ── */
.comments-list { display: flex; flex-direction: column; gap: 10px; }
.comment-item {
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.comment-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.comment-text { font-size: 13px; white-space: pre-wrap; }
.comment-actions { display: flex; gap: 2px; }
.comment-edit, .comment-delete { padding: 0 6px; opacity: .5; }
.comment-edit:hover, .comment-delete:hover { opacity: 1; }
.comment-edited { font-style: italic; opacity: .7; }
.comment-edit-form { display: flex; flex-direction: column; gap: 6px; }
.comment-edit-form textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
  box-sizing: border-box;
}
.comment-edit-actions { display: flex; gap: 6px; }
.comment-add-form { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.comment-add-form textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  box-sizing: border-box;
}
.comment-add-form button { align-self: flex-start; }

/* ── Inline add ticket form ── */
.inline-add-form {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
}
.inline-add-form textarea { min-height: 60px; margin-bottom: 8px; }
.inline-add-form-actions { display: flex; gap: 6px; align-items: center; }

/* ── Utility ── */
.hidden { display: none !important; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.mt-8 { margin-top: 8px; }

/* ─── Horizontales Raster-Board ─────────────────────────────── */
:root { --lane-label-w: 140px; --grid-cell-w: 200px; }
.board-grid {
  display: grid;
  gap: 6px;
  padding: 12px;
  align-items: start;
  align-content: start;      /* Zeilen oben kompakt halten, nicht über die Höhe strecken */
  grid-auto-rows: min-content;
  align-self: start;
  width: max-content;
  overflow-y: auto;
}
.grid-lane-label {
  position: sticky; left: 0; z-index: 2;
  display: flex; align-items: center; gap: 4px;
  padding: 6px 8px; font-weight: 600; font-size: 13px;
  background: var(--bg, #f4f5f7);
  border-right: 2px solid rgba(0,0,0,.08);
}
.grid-lane-label span { flex: 1; cursor: text; }
.grid-cell {
  min-height: 70px;
  border: 1px dashed transparent;
  border-radius: 6px;
}
.grid-cell.empty { border-color: rgba(0,0,0,.08); cursor: pointer; }
.grid-cell.empty:hover { background: rgba(0,82,204,.05); border-color: rgba(0,82,204,.35); }
.grid-cell.drag-over { background: rgba(0,82,204,.12); border-color: #0052cc; }
.grid-cell.filtered-out { border-color: rgba(0,0,0,.04); }
.board-grid .ticket-card { width: 100%; margin: 0; }
/* Horizontal-Modus: Canvas stapelt Grid + "Lane hinzufügen" untereinander,
   damit der Button als Zeile unter den Lanes erscheint (nicht als Spalte rechts). */
.board-canvas.grid-mode { flex-direction: column; align-items: flex-start; }
.add-lane-btn {
  margin: 0 12px 12px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  background: rgba(255,255,255,.35);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.add-lane-btn:hover { background: rgba(255,255,255,.6); }

/* ─── List-Layout (Tabellen-Ansicht aller Tickets) ─────────────────── */
.board-canvas.list-mode {
  display: block;
  overflow-y: auto;
  overflow-x: auto;
  align-items: initial;
}
.ticket-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ticket-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  background: var(--column-bg);
  border-bottom: 2px solid var(--border);
}
.ticket-table tbody td {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.ticket-table tbody tr:last-child td { border-bottom: none; }
.list-row { cursor: pointer; transition: background .12s; }
.list-row:hover { background: rgba(0,82,204,.06); }
.list-cell-title { font-weight: 600; }
.list-row-heading td {
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  background: var(--column-bg);
}
.list-row-empty td {
  padding: 28px 14px;
  text-align: center;
  color: var(--text-muted);
}

.ticket-meta { display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin-top:6px; }
.prio-badge { font-size:11px; font-weight:600; padding:2px 6px; border-radius:4px; color:#fff; }
.prio-dringend { background:#e5484d; }
.prio-normal { background:#6b7280; }
.prio-backlog { background:#9ca3af; }
.prio-angebotsphase { background:#8b5cf6; }
.ticket-deadline { font-size:11px; color:#4b5563; }
.ticket-deadline.overdue { color:#e5484d; font-weight:600; }
.ticket-assignee { width:22px; height:22px; border-radius:50%; background:#334155; color:#fff;
  font-size:10px; font-weight:600; display:inline-flex; align-items:center; justify-content:center; margin-left:auto; }
.ticket-assignee-img { width:22px; height:22px; border-radius:50%; object-fit:cover; margin-left:auto; flex-shrink:0; }
.topbar-avatar { width:28px; height:28px; border-radius:50%; object-fit:cover; margin-right:-8px; border:1px solid rgba(255,255,255,.5); }

/* ── Tags: card badges (clickable filter) + modal chip editor ── */
.ticket-card-tags { display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; }
.tag-badge {
  display:inline-flex; align-items:center;
  font-size:11px; font-weight:600; line-height:1.4;
  padding:2px 8px; border-radius:999px;
  background: var(--bg); color: var(--primary);
  border: 1px solid var(--border);
  cursor: pointer; user-select: none;
}
.tag-badge:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.tag-chip-list { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.tag-chip {
  display:inline-flex; align-items:center; gap:4px;
  font-size:12px; font-weight:600;
  padding:3px 4px 3px 10px; border-radius:999px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border);
}
.tag-chip-remove {
  display:inline-flex; align-items:center; justify-content:center;
  width:16px; height:16px; padding:0; border:none; border-radius:50%;
  background:transparent; color: var(--text-muted); cursor:pointer;
}
.tag-chip-remove:hover { background: var(--danger); color:#fff; }
.tag-chip-remove .icon { width:11px; height:11px; }

/* ── Inbox / Notifications ── */
.inbox-wrap { position: relative; display: flex; align-items: center; }
.inbox-bell { position: relative; font-size: 16px; line-height: 1; color: #fff; }
.inbox-bell:hover { background: rgba(255,255,255,.2); color: #fff; }
.inbox-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--primary);
}
.inbox-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 320px; max-height: 420px; overflow-y: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-modal); z-index: 100;
}
.inbox-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 600;
}
.inbox-list { display: flex; flex-direction: column; }
.inbox-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.inbox-item:last-child { border-bottom: none; }
.inbox-item:hover { background: var(--bg); }
.inbox-item.unread { background: #e6f0ff; }
.inbox-item.unread:hover { background: #d6e6ff; }
.inbox-item-text { font-size: 13px; }
.inbox-item.unread .inbox-item-text { font-weight: 600; }
.inbox-item-date { font-size: 11px; color: var(--text-muted); }
.inbox-empty { padding: 20px 12px; color: var(--text-muted); text-align: center; font-size: 13px; }
.auth-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; }
.auth-card { background:#fff; padding:32px; border-radius:10px; box-shadow:0 4px 24px rgba(0,0,0,.1);
  width:340px; display:flex; flex-direction:column; gap:8px; }
.auth-appname { font-weight:700; font-size:18px; color:var(--primary); margin-bottom:4px; }
.auth-card h1 { font-size:20px; margin-bottom:8px; }
.auth-card input, .auth-card button { width:100%; }
.auth-error { background:#fde8e8; color:#c81e1e; padding:8px 12px; border-radius:6px; font-size:13px; }
.user-list { padding:0 24px; } .user-row { display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid #eee; }
.invite-result { margin:12px 24px; padding:10px 14px; background:#eef6ff; border-radius:6px; font-size:13px; word-break:break-all; }
.topbar-user { color:#fff; opacity:.85; margin-right:12px; }
.member-list { margin-bottom:12px; }
.member-row { display:flex; justify-content:space-between; align-items:center; padding:6px 0; border-bottom:1px solid var(--border); font-size:14px; }
.member-row:last-child { border-bottom:none; }

/* ── Profile page ── */
.profile-wrap { max-width:480px; margin:0 auto; padding:24px; display:flex; flex-direction:column; gap:24px; }
.profile-section { background:var(--surface); border-radius:var(--radius); box-shadow:var(--shadow); padding:20px; }
.profile-section h2 { font-size:15px; margin-bottom:14px; }
.profile-section label { display:block; margin-top:10px; margin-bottom:4px; font-size:13px; color:var(--text-muted); }
.profile-section label:first-of-type { margin-top:0; }
.profile-avatar-row { display:flex; align-items:center; gap:16px; }
.profile-avatar-preview, .profile-avatar-placeholder {
  width:72px; height:72px; border-radius:50%; flex-shrink:0;
}
.profile-avatar-preview { object-fit:cover; }
.profile-avatar-placeholder {
  background:#334155; color:#fff; font-size:24px; font-weight:600;
  display:flex; align-items:center; justify-content:center;
}
.profile-avatar-actions { display:flex; flex-direction:column; gap:8px; }
.profile-success { background:#e6f4ea; color:#1e7e34; padding:8px 12px; border-radius:6px; font-size:13px; }

/* ── lexoffice sync badge (customers list) ── */
.lexoffice-badge {
  display:inline-flex; align-items:center; margin-left:6px;
  font-size:10px; font-weight:600; line-height:1.4; letter-spacing:.02em;
  padding:1px 7px; border-radius:999px;
  background:#fff3d6; color:#8a5a00; border:1px solid #f0d28f;
}
