/* Feedback beim Kopieren der Aktenzeile */
.preview-line.copied {
  background: var(--green-glow);
  transition: background .2s;
}
.preview-line .copied-text {
  color: var(--green);
  font-weight: 600;
  margin-left: 8px;
  font-size: 13px;
}
/* Systemwanteds im Summary-Style */
.systemwanteds-item {
  margin-top: 8px;
}
.systemwanteds-input {
  width: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
  padding: 2px 0 2px 0;
  outline: none;
  transition: border .15s;
}
.systemwanteds-input:focus {
  border: 1.5px solid var(--accent);
}

/* Rechte-Button als Link-Button */
.btn-rights-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  margin: 12px auto 0 auto;
  padding: 2px 0 2px 0;
  transition: color .15s;
}
.btn-rights-link:hover {
  color: var(--accent);
}
.btn-rights-link .btn-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}
.btn-rights-text {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
}
/* ============================================
   Strafkatalog MDT — Style v2
   Tabellarische Ansicht + Modifiers
   ============================================ */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2234;
  --bg-card-hover: #1f2a40;
  --bg-input: #0f1729;
  --bg-row-hover: #162033;
  --bg-row-selected: rgba(59,130,246,0.07);

  --accent: #3b82f6;
  --accent-glow: rgba(59,130,246,0.25);
  --accent-hover: #2563eb;
  --accent-dim: #1e40af;

  --red: #ef4444;
  --red-glow: rgba(239,68,68,0.2);
  --amber: #f59e0b;
  --amber-glow: rgba(245,158,11,0.15);
  --green: #22c55e;
  --green-glow: rgba(34,197,94,0.2);
  --purple: #a855f7;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border: #1e293b;
  --border-hover: #334155;

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius: 8px;
  --radius-lg: 12px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-ui);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   HEADER
   ============================================ */
.mdt-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-badge {
  background: var(--accent); color: #fff;
  font-family: var(--font-mono); font-weight: 700; font-size: 13px;
  letter-spacing: 2px; padding: 8px 14px;
  border-radius: var(--radius);
  box-shadow: 0 0 20px var(--accent-glow);
}
.header-title h1 { font-size: 18px; font-weight: 700; line-height: 1.2; }
.header-subtitle { font-size: 12px; color: var(--text-muted); }

/* Toggle */
.toggle-group { display: flex; align-items: center; gap: 10px; }
.toggle-label { font-size: 12px; color: var(--text-muted); font-weight: 500; transition: color .2s; user-select: none; }
.toggle-label.active { color: var(--accent); }

.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border-hover); border-radius: 12px; transition: background .25s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; bottom: 3px; background: var(--text-primary);
  border-radius: 50%; transition: transform .25s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.toggle-small { width: 38px; height: 20px; }
.toggle-small .toggle-slider::before { width: 14px; height: 14px; }
.toggle-small input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ============================================
   MAIN LAYOUT
   ============================================ */
.mdt-main {
  display: grid;
  grid-template-columns: 1fr 380px;
  flex: 1; min-height: 0;
}

.panel { padding: 16px; overflow-y: auto; }
.panel-left {
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 12px;
}
.panel-right {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--bg-secondary);
}

/* Toolbar */
.panel-toolbar { display: flex; align-items: center; gap: 12px; }
.panel-toolbar .search-box { flex: 1; }
.badge {
  background: var(--accent-dim); color: var(--accent);
  font-size: 11px; font-weight: 600; padding: 5px 12px;
  border-radius: 20px; white-space: nowrap;
}

/* Search */
.search-box { position: relative; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
}
.search-box input {
  width: 100%; padding: 9px 36px 9px 38px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary);
  font-family: var(--font-ui); font-size: 13px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-box input::placeholder { color: var(--text-muted); }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; padding: 4px 6px; line-height: 1;
  border-radius: 4px; display: none;
}
.search-clear:hover { color: var(--text-primary); background: var(--border); }
.search-box input:not(:placeholder-shown) ~ .search-clear { display: block; }

/* ============================================
   TABLE
   ============================================ */
.table-wrap { flex: 1; overflow: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }

.straf-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}

.straf-table thead { position: sticky; top: 0; z-index: 10; }

.straf-table th {
  background: var(--bg-card);
  color: var(--text-muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .4px;
  padding: 10px 12px; text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap; user-select: none;
}

.straf-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.straf-table tbody tr {
  background: var(--bg-primary);
  transition: background .1s;
  cursor: pointer;
}
.straf-table tbody tr:hover { background: var(--bg-row-hover); }
.straf-table tbody tr.selected { background: var(--bg-row-selected); }
.straf-table tbody tr.hidden { display: none; }

/* Columns */
.col-check { width: 40px; text-align: center; }
.col-para { width: 120px; }
.col-name { min-width: 160px; }
.col-fine { width: 100px; text-align: right; }
.col-stars { width: 110px; text-align: center; }
.col-icon { width: 40px; text-align: center; }

/* Cells */
.cell-para {
  font-family: var(--font-mono); font-weight: 600; font-size: 12px;
  color: var(--accent); white-space: nowrap;
}
.cell-name { color: var(--text-primary); font-weight: 500; }
.cell-fine {
  font-family: var(--font-mono); font-weight: 600; font-size: 12px;
  color: var(--green); text-align: right; white-space: nowrap;
}

/* Stars */
.cell-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
}
.star {
  font-size: 18px;
  line-height: 1;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  width: 22px;
  cursor: pointer;
  transition: color .15s, opacity .15s, transform .15s;
}
.star-fixed { color: var(--amber); cursor: default; }
.star-empty { color: var(--text-muted); opacity: .3; }
.star-empty.clickable { cursor: pointer; opacity: .5; }
.star-empty.clickable:hover { opacity: .8; color: var(--amber); transform: scale(1.15); }
.star-empty.activated { color: var(--amber); opacity: .85; }

/* Icon indicators */
.cell-icon { text-align: center; }
.icon-active {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 4px;
  font-size: 10px; font-weight: 700;
}
.icon-fs { background: var(--purple); color: #fff; font-size: 9px; }
.icon-ws { background: var(--red); color: #fff; font-size: 9px; }
.icon-fib { background: var(--red-glow); color: var(--red); border: 1px solid rgba(239,68,68,.3); font-size: 8px; }
.icon-sa { background: var(--amber-glow); color: var(--amber); border: 1px solid rgba(245,158,11,.3); font-size: 8px; }
.icon-inactive { color: var(--border); font-size: 14px; }

/* Custom Checkbox */
.row-checkbox { position: relative; width: 18px; height: 18px; display: inline-block; }
.row-checkbox input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; }
.row-checkbox .checkmark {
  width: 18px; height: 18px;
  border: 2px solid var(--border-hover); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-input); transition: all .15s;
}
.row-checkbox input:checked ~ .checkmark { background: var(--accent); border-color: var(--accent); }
.row-checkbox .checkmark svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3; fill: none; opacity: 0; transition: opacity .15s; }
.row-checkbox input:checked ~ .checkmark svg { opacity: 1; }

/* No results */
.no-results { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 13px; }

/* ============================================
   CARDS (Sidebar)
   ============================================ */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
}
.card h3 {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px;
}

/* Summary */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.summary-item {
  background: var(--bg-input); border-radius: var(--radius);
  padding: 12px; text-align: center;
}
.summary-label {
  display: block; font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .3px; margin-bottom: 6px;
}
.summary-value {
  font-family: var(--font-mono); font-size: 20px; font-weight: 700;
}
.stars-display { font-size: 18px; letter-spacing: 2px; }

/* Info badges (FS, WS) */
.info-badges {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
.info-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--radius);
  font-size: 11px; font-weight: 600;
}
.info-badge-fs {
  background: rgba(168,85,247,.12); color: var(--purple);
  border: 1px solid rgba(168,85,247,.25);
}
.info-badge-ws {
  background: var(--red-glow); color: var(--red);
  border: 1px solid rgba(239,68,68,.25);
}

/* Handover notices */
.handover-notices { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.notice {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius);
  font-size: 11px; font-weight: 600;
}
.notice-fib { background: var(--red-glow); color: var(--red); border: 1px solid rgba(239,68,68,.25); }
.notice-sa { background: var(--amber-glow); color: var(--amber); border: 1px solid rgba(245,158,11,.25); }

/* Modifiers */
.modifier-card { display: flex; flex-direction: column; gap: 0; }
.modifier-card h3 { margin-bottom: 8px; }
.modifier-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.modifier-row:first-of-type { border-top: none; }
.modifier-info { display: flex; flex-direction: column; gap: 2px; }
.modifier-title { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.modifier-desc { font-size: 10px; color: var(--text-muted); }

/* Transport */
.transport-header { display: flex; align-items: center; justify-content: space-between; }
.transport-header h3 { margin-bottom: 0; }
.transport-fields {
  display: none; flex-direction: column; gap: 10px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.transport-fields.active { display: flex; }
.field-group { display: flex; flex-direction: column; gap: 4px; }
.field-group label {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .3px;
}
.field-group select, .field-group input {
  padding: 8px 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-primary); font-family: var(--font-ui); font-size: 13px;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.field-group select:focus, .field-group input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.field-group select option { background: var(--bg-secondary); }

/* Preview */
.preview-line {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.6;
  word-break: break-word; min-height: 44px;
}
.preview-placeholder { color: var(--text-muted); font-style: italic; font-family: var(--font-ui); }

/* Copy */
.btn-copy {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-lg);
  font-family: var(--font-ui); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all .2s; margin-top: auto;
}
.btn-copy:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 0 30px var(--accent-glow); transform: translateY(-1px); }
.btn-copy:active:not(:disabled) { transform: translateY(0); }
.btn-copy:disabled { opacity: .35; cursor: not-allowed; }
.btn-copy.copied { background: var(--green); }
.btn-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1000px) {
  .mdt-main { grid-template-columns: 1fr; }
  .panel-left { border-right: none; border-bottom: 1px solid var(--border); max-height: 55vh; }
}
@media (max-width: 600px) {
  .mdt-header { flex-direction: column; gap: 10px; align-items: flex-start; }
  .header-right { align-self: flex-end; }
}

.hidden { display: none !important; }
