:root {
  --color-primary:       #E63312;
  --color-primary-hover: #FF4422;

  /* Seite: weißer Hintergrund */
  --color-bg:            #FFFFFF;

  /* Karten & Panels: dunkel */
  --color-surface:       #141414;
  --color-surface-2:     #1E1E1E;
  --color-border:        #303030;
  --color-border-light:  #E5E7EB;

  /* Text auf weißem Hintergrund */
  --color-text:          #111111;
  --color-text-muted:    #6B7280;

  --status-offen:       #3B82F6;
  --status-bearbeitung: #F97316;
  --status-custom:      #A855F7;
  --status-erledigt:    #22C55E;

  --radius:    6px;
  --radius-lg: 10px;
  --shadow:    0 1px 4px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.14);
}

/* Dunkle Oberflächen: Text-Variablen lokal überschreiben */
.card, .stat-card, .modal, .table-dark, .app-header-dark {
  --color-text:       #FFFFFF;
  --color-text-muted: #A0A0A0;
  --color-border:     #303030;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
}

.hidden { display: none !important; }

/* ── Logo ──────────────────────────────────────────────────── */
.logo-img { height: 28px; width: auto; display: block; }
.logo-img-lg { height: 40px; width: auto; display: block; }

/* ── Login ─────────────────────────────────────────────────── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top, #1a0a08 0%, #141414 60%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem 2rem;
  background: #141414;
  border: 1px solid #303030;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.6rem;
}

.login-slogan {
  text-align: center;
  color: #A0A0A0;
  font-size: 0.8rem;
  margin-bottom: 1.8rem;
}

.login-title {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.5rem;
  color: #A0A0A0;
}

.login-form .form-group { margin-bottom: 1rem; }
.login-form label { color: #A0A0A0; font-size: 0.8rem; font-weight: 500; display: block; margin-bottom: 0.35rem; }
.login-form .input-field {
  background: #1C1C1C;
  border-color: #303030;
  color: #FFFFFF;
}
.login-form .input-field:focus { border-color: var(--color-primary); }
.login-form .input-field::placeholder { color: #555; }

/* ── App Header (weißer Hintergrund) ───────────────────────── */
.app-header {
  height: 60px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.header-left { display: flex; align-items: center; gap: 2rem; }
.header-right { display: flex; align-items: center; gap: 1rem; }

.header-nav { display: flex; gap: 0.25rem; }
.header-nav .nav-link {
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius);
  color: #6B7280;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
  border: none;
  background: none;
}
.header-nav .nav-link:hover  { color: #111111; background: #F3F4F6; }
.header-nav .nav-link.active { color: var(--color-primary); background: #FEF2F0; }

.header-user { font-size: 0.8rem; color: #6B7280; }

/* Logout-Button im Header */
#logout-btn { color: #6B7280; }
#logout-btn:hover { background: #F3F4F6; color: #111111; }

/* ── Main Area ─────────────────────────────────────────────── */
.app-main { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }

/* ── Page ──────────────────────────────────────────────────── */
.page { }
.page-narrow { max-width: 700px; margin: 0 auto; }

.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-title { font-size: 1.4rem; font-weight: 700; flex: 1; color: #111111; }

/* ── Karten (dunkel) ───────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid #303030;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  color: #FFFFFF;
}

.card-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #A0A0A0;
  margin-bottom: 1rem;
}

/* Inputs inside dark cards — clearly lighter than card bg #141414 */
.card .input-field,
.card .select-input,
.modal .input-field,
.modal .select-input,
.login-form .input-field {
  background-color: #272727;
  border-color: #404040;
  color: #E2E2E2;
}
.card .input-field::placeholder,
.modal .input-field::placeholder { color: #707070; }
.card .select-input option { background: #272727; color: #E2E2E2; }
.card .input-field:focus,
.card .select-input:focus,
.modal .input-field:focus,
.modal .select-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(230, 51, 18, 0.14);
  outline: none;
}

/* Select in dark context */
.card .select-input,
.modal .select-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  color-scheme: dark;
}

/* Labels inside dark cards */
.card .form-group label,
.comment-label { color: #909090; }
.modal .form-group label { color: #909090; }

/* Optional marker & hint text */
.label-optional {
  font-size: 0.68rem;
  font-weight: 500;
  color: #B0B0B0;
  background: #2C2C2C;
  border: 1px solid #3C3C3C;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  margin-left: 0.3rem;
  vertical-align: middle;
}
.field-hint {
  font-size: 0.72rem;
  color: #606060;
  margin-top: 0.28rem;
  line-height: 1.4;
}

/* btn-ghost in dark cards */
.card .btn-ghost { color: #A0A0A0; }
.card .btn-ghost:hover { background: #1C1C1C; color: #FFFFFF; }

/* btn-secondary in dark cards */
.card .btn-secondary,
.modal .btn-secondary { background: #1C1C1C; color: #FFFFFF; border-color: #303030; }
.card .btn-secondary:hover,
.modal .btn-secondary:hover { background: #2a2a2a; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }

.btn-secondary { background: #F3F4F6; color: #111111; border-color: #D1D5DB; }
.btn-secondary:hover { background: #E5E7EB; }

.btn-ghost { background: transparent; color: #6B7280; border-color: transparent; }
.btn-ghost:hover { background: #F3F4F6; color: #111111; }

.btn-danger { background: transparent; color: #EF4444; border-color: #EF4444; }
.btn-danger:hover { background: rgba(239,68,68,0.08); }

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ── Forms (auf weißem Hintergrund) ───────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.input-field, .select-input {
  width: 100%;
  background-color: #FFFFFF;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  color: #111111;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}
.input-field:focus, .select-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(230, 51, 18, 0.1);
  outline: none;
}

.select-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2rem;
}

.textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 0.75rem; }

/* ── Alerts & Toasts ───────────────────────────────────────── */
.alert { padding: 0.6rem 0.9rem; border-radius: var(--radius); font-size: 0.85rem; margin-top: 0.5rem; }
.alert-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.3);  color: #FCA5A5; }
.alert-success { background: rgba(34,197,94,0.1);  border: 1px solid rgba(34,197,94,0.3);  color: #86EFAC; }

.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 1000; }
.toast { padding: 0.75rem 1.1rem; border-radius: var(--radius); font-size: 0.875rem; box-shadow: var(--shadow-lg); animation: slideIn 0.2s ease; }
.toast-success { background: #166534; border: 1px solid #22C55E; color: #DCFCE7; }
.toast-error   { background: #7F1D1D; border: 1px solid #EF4444; color: #FEE2E2; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-offen       { background: rgba(59,130,246,0.18);  color: #93C5FD; border: 1px solid rgba(59,130,246,0.35); }
.badge-bearbeitung { background: rgba(249,115,22,0.18);  color: #FDBA74; border: 1px solid rgba(249,115,22,0.35); }
.badge-custom      { background: rgba(168,85,247,0.18);  color: #D8B4FE; border: 1px solid rgba(168,85,247,0.35); }
.badge-erledigt    { background: rgba(34,197,94,0.18);   color: #86EFAC; border: 1px solid rgba(34,197,94,0.35); }

.badge-niedrig  { background: rgba(107,114,128,0.18); color: #D1D5DB; border: 1px solid rgba(107,114,128,0.3); }
.badge-mittel   { background: rgba(234,179,8,0.18);   color: #FDE047; border: 1px solid rgba(234,179,8,0.3); }
.badge-hoch     { background: rgba(249,115,22,0.18);  color: #FDBA74; border: 1px solid rgba(249,115,22,0.3); }
.badge-kritisch { background: rgba(239,68,68,0.18);   color: #FCA5A5; border: 1px solid rgba(239,68,68,0.3); }

/* ── Filter Bar ────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar .select-input,
.filter-bar .input-field { width: auto; flex: 1; min-width: 140px; }
.filter-bar .input-field { max-width: 280px; }

/* ── Stats Row ─────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid #303030;
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.1rem;
  text-align: center;
  color: #FFFFFF;
}
.stat-card { cursor: pointer; transition: border-color 0.15s, transform 0.1s; }
.stat-offen:hover       { border-color: var(--status-offen); }
.stat-bearbeitung:hover { border-color: var(--status-bearbeitung); }
.stat-custom:hover      { border-color: var(--status-custom); }
.stat-erledigt:hover    { border-color: var(--status-erledigt); }
.stat-number { font-size: 1.8rem; font-weight: 700; }
.stat-label  { font-size: 0.75rem; color: #A0A0A0; margin-top: 0.2rem; }
.stat-offen       .stat-number { color: var(--status-offen); }
.stat-bearbeitung .stat-number { color: var(--status-bearbeitung); }
.stat-custom      .stat-number { color: var(--status-custom); }
.stat-erledigt    .stat-number { color: var(--status-erledigt); }

/* ── Tabelle (dunkler Container) ───────────────────────────── */
.table-wrapper {
  background: var(--color-surface);
  border: 1px solid #303030;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  text-align: left;
  padding: 0.65rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #A0A0A0;
  background: #0A0A0A;
  border-bottom: 1px solid #303030;
  white-space: nowrap;
}

.data-table td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid #1E1E1E;
  font-size: 0.875rem;
  vertical-align: middle;
  color: #FFFFFF;
}

.data-table tbody tr { cursor: pointer; transition: background 0.1s; }
.data-table tbody tr:hover { background: #1A1A1A; }
.data-table tbody tr:last-child td { border-bottom: none; }

.empty-state { text-align: center; padding: 3rem; color: #A0A0A0; }

/* ── Ticket Detail ─────────────────────────────────────────── */
.ticket-header-info { display: flex; align-items: center; gap: 0.75rem; flex: 1; flex-wrap: wrap; }
.ticket-nr-badge {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: #A0A0A0;
  background: #F3F4F6;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border-light);
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-sidebar { order: -1; }
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.meta-item { display: flex; flex-direction: column; gap: 0.25rem; }
.meta-label { font-size: 0.72rem; color: #A0A0A0; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.detail-description { padding-top: 1rem; border-top: 1px solid #303030; }
.detail-description p { margin-top: 0.4rem; color: #D1D5DB; white-space: pre-wrap; line-height: 1.7; }

/* Beschreibung bearbeiten */
.desc-edit-btn {
  background: none;
  border: none;
  color: #A0A0A0;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  margin-left: 0.4rem;
  transition: color 0.15s;
}
.desc-edit-btn:hover { color: var(--color-primary); }
.desc-edit-area { margin-top: 0.5rem; }
.desc-updated { font-size: 0.72rem; color: #A0A0A0; margin-top: 0.4rem; font-style: italic; }

/* ── Action Panel ──────────────────────────────────────────── */
.action-section {
  display: flex;
  flex-direction: column;
}
.action-section + .action-section {
  padding-top: 1rem;
  margin-top: 0.25rem;
  border-top: 1px solid #222;
}
.action-section .form-group { margin-bottom: 0.75rem; }
.action-section-footer {
  display: flex;
  justify-content: flex-end;
}

/* ── Kommentare ────────────────────────────────────────────── */
.comments-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }

.comment-card {
  background: #141414;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  border-left: 4px solid #303030;
}
.comment-card.status-Offen            { border-left-color: var(--status-offen); }
.comment-card.status-In-Bearbeitung   { border-left-color: var(--status-bearbeitung); }
.comment-card.status-Custom           { border-left-color: var(--status-custom); }
.comment-card.status-Erledigt         { border-left-color: var(--status-erledigt); }

.comment-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.comment-author { font-weight: 600; font-size: 0.85rem; color: #FFFFFF; }
.comment-role { font-size: 0.7rem; padding: 0.1rem 0.45rem; border-radius: 999px; font-weight: 500; }
.role-vertriebler   { background: rgba(59,130,246,0.18); color: #93C5FD; }
.role-projektleiter { background: rgba(249,115,22,0.18); color: #FDBA74; }
.role-admin         { background: rgba(239,68,68,0.18);  color: #FCA5A5; }

.comment-time { font-size: 0.75rem; color: #A0A0A0; margin-left: auto; }
.comment-body { font-size: 0.875rem; line-height: 1.6; white-space: pre-wrap; color: #D1D5DB; }
.comment-body .mention { color: #60A5FA; font-weight: 500; }

.comment-form-wrapper { border-top: 1px solid #303030; padding-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; position: relative; }
.comment-form-wrapper .btn { align-self: flex-end; }
.comment-label { display: block; font-size: 0.8rem; font-weight: 500; margin-bottom: 0.4rem; }

/* @mention Dropdown */
.mention-dropdown {
  position: absolute;
  background: #1C1C1C;
  border: 1px solid #404040;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 50;
  min-width: 200px;
  max-height: 180px;
  overflow-y: auto;
}
.mention-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.mention-item:hover,
.mention-item.active { background: #2a2a2a; }
.mention-item-role { font-size: 0.7rem; color: #A0A0A0; }

/* ── History ───────────────────────────────────────────────── */
.history-list { display: flex; flex-direction: column; }
.history-item { display: flex; gap: 0.75rem; padding-bottom: 1rem; position: relative; }
.history-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 16px;
  width: 2px;
  bottom: 0;
  background: #303030;
}
.history-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #303030;
  background: #141414;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  z-index: 1;
}
.history-dot.status-Offen            { border-color: var(--status-offen);       background: rgba(59,130,246,0.2); }
.history-dot.status-In-Bearbeitung   { border-color: var(--status-bearbeitung); background: rgba(249,115,22,0.2); }
.history-dot.status-Custom           { border-color: var(--status-custom);      background: rgba(168,85,247,0.2); }
.history-dot.status-Erledigt         { border-color: var(--status-erledigt);    background: rgba(34,197,94,0.2); }

.history-content { flex: 1; }
.history-status { font-size: 0.85rem; font-weight: 600; color: #FFFFFF; }
.history-meta   { font-size: 0.75rem; color: #A0A0A0; margin-top: 0.1rem; }
.history-note   { font-size: 0.75rem; color: #A0A0A0; font-style: italic; margin-top: 0.2rem; }

/* ── Tabs ──────────────────────────────────────────────────── */
.tab-bar { display: flex; border-bottom: 1px solid var(--color-border-light); margin-bottom: 1.25rem; }
.tab-btn {
  padding: 0.65rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6B7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: #111111; }
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-title { font-size: 1rem; font-weight: 600; color: #111111; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: #141414;
  border: 1px solid #303030;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  color: #FFFFFF;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #303030;
}
.modal-title { font-size: 1rem; font-weight: 600; color: #FFFFFF; }
.modal-close { background: none; border: none; color: #A0A0A0; font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 0.1rem 0.3rem; }
.modal-close:hover { color: #FFFFFF; }
.modal-body { padding: 1.25rem; }
.modal-body .form-actions { margin-top: 1rem; }
.modal--wide { max-width: min(90vw, 960px); width: 90vw; }

/* ── Tabellen-Sortierung ────────────────────────────────────── */
th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
th[data-sort]:hover { color: #FFFFFF; }
th[data-sort] .sort-icon { font-style: normal; opacity: 0.4; font-size: 0.7rem; }
th[data-sort].sort-asc  .sort-icon::after { content: ' ↑'; opacity: 1; }
th[data-sort].sort-desc .sort-icon::after { content: ' ↓'; opacity: 1; }
th[data-sort].sort-asc  .sort-icon,
th[data-sort].sort-desc .sort-icon { opacity: 1; color: var(--color-primary); }

/* ── Filter-Badges ──────────────────────────────────────────── */
.filter-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; padding: 0.4rem 0 0.6rem; }
.filter-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: #1C1C1C; border: 1px solid #383838;
  color: #D0D0D0; font-size: 0.75rem; font-weight: 500;
  padding: 0.2rem 0.5rem; border-radius: 20px;
}
.filter-badge-remove {
  background: none; border: none; color: #A0A0A0; cursor: pointer;
  font-size: 0.85rem; line-height: 1; padding: 0; margin-left: 0.1rem;
}
.filter-badge-remove:hover { color: var(--color-primary); }
.filter-reset { font-size: 0.72rem; color: #707070; background: none; border: none; cursor: pointer; text-decoration: underline; }
.filter-reset:hover { color: #A0A0A0; }

/* ── Anhänge ────────────────────────────────────────────────── */
.attachments-card { margin-bottom: 1rem; }
.attachments-grid { margin-bottom: 0.75rem; }
.attachments-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.attachment-thumb {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid #303030; background: #1A1A1A;
  aspect-ratio: 1; cursor: pointer;
  transition: border-color 0.15s;
}
.attachment-thumb:hover { border-color: var(--color-primary); }
.attachment-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attachment-thumb-del {
  position: absolute; top: 3px; right: 3px;
  background: rgba(0,0,0,0.7); border: none; border-radius: 50%;
  color: #ccc; cursor: pointer; width: 20px; height: 20px;
  font-size: 0.7rem; line-height: 20px; text-align: center; padding: 0;
  opacity: 0; transition: opacity 0.15s;
}
.attachment-thumb:hover .attachment-thumb-del { opacity: 1; }
.attachment-thumb-del:hover { color: var(--color-primary); }

.attachment-file {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.6rem; border-radius: var(--radius);
  border: 1px solid #303030; background: #1A1A1A;
  font-size: 0.78rem; color: #D0D0D0;
  margin-bottom: 0.4rem; cursor: pointer;
  transition: border-color 0.15s;
}
.attachment-file:hover { border-color: var(--color-primary); }
.attachment-file-icon { font-size: 1.2rem; flex-shrink: 0; }
.attachment-file-info { flex: 1; min-width: 0; }
.attachment-file-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-file-meta { font-size: 0.68rem; color: #707070; margin-top: 0.1rem; }
.attachment-file-del {
  background: none; border: none; color: #606060; cursor: pointer; font-size: 0.9rem;
  padding: 0.1rem 0.3rem; border-radius: 3px; flex-shrink: 0;
}
.attachment-file-del:hover { color: var(--color-primary); }

.upload-zone { margin-top: 0.5rem; }
.upload-zone-inner {
  border: 2px dashed #383838; border-radius: var(--radius);
  padding: 1.25rem 1rem; text-align: center;
  color: #707070; font-size: 0.82rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  transition: border-color 0.15s, background 0.15s;
  cursor: default;
}
.upload-zone-inner.drag-over {
  border-color: var(--color-primary);
  background: rgba(230, 51, 18, 0.06);
  color: #C0C0C0;
}
.upload-icon { font-size: 1.6rem; margin-bottom: 0.1rem; }
.btn-link {
  background: none; border: none; color: var(--color-primary);
  cursor: pointer; font-size: inherit; padding: 0; text-decoration: underline;
}
.btn-link:hover { color: var(--color-primary-hover); }

/* ── Lightbox ───────────────────────────────────────────────── */
.lightbox-img { max-width: 100%; max-height: 80vh; border-radius: var(--radius); display: block; margin: 0 auto; }
.lightbox-caption { text-align: center; color: #A0A0A0; font-size: 0.78rem; margin-top: 0.5rem; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .app-main { padding: 1rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .header-user { display: none; }
  .meta-grid { grid-template-columns: 1fr 1fr; }

  /* Ticket-Tabelle: auf Mobile nur wichtige Spalten */
  .data-table th:nth-child(6),
  .data-table td:nth-child(6),
  .data-table th:nth-child(7),
  .data-table td:nth-child(7),
  .data-table th:nth-child(8),
  .data-table td:nth-child(8) { display: none; }

  /* Textarea kleiner auf Mobile */
  .textarea { rows: 3; font-size: 1rem; }

  /* Filter-Bar auf Mobile umbrechen */
  .filter-bar { flex-wrap: wrap; }
  .filter-bar .select-input,
  .filter-bar .input-field { min-width: 0; flex: 1 1 140px; }
}
