/* L-A-R-A SYSTEM MEDIENPRODUKTION – Block 14 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── HEADER ── */
header {
  background: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(15,23,42,.05);
}

/* Logo-Zone links oben */
.header-logo-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  border-right: 1px solid #e2e8f0;
  padding-right: 16px;
  margin-right: 4px;
}
.header-logo-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800; color: #fff; letter-spacing: -.5px;
  flex-shrink: 0;
}
.header-logo-text {
  font-size: .78rem; font-weight: 700; color: #0f172a; line-height: 1.2;
  white-space: nowrap;
}
.header-logo-text small {
  display: block; font-size: .65rem; font-weight: 400; color: #64748b;
}

.header-brand { font-size: 1rem; font-weight: 700; letter-spacing: .05em; color: #0f172a; white-space: nowrap; }
.header-brand span { color: #6366f1; }
.sep { color: #cbd5e1 !important; font-weight: 300; margin: 0 6px; }
.header-job { font-size: .82rem; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.header-mode { font-size: .7rem; background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; padding: 2px 9px; border-radius: 12px; font-weight: 600; white-space: nowrap; }
.header-dev-badge { font-size: .7rem; background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; padding: 2px 9px; border-radius: 12px; font-weight: 600; white-space: nowrap; }

/* ── LAYOUT ── */
.main-layout { display: flex; flex: 1; overflow: hidden; }

/* ── STORYBOARD ── */
.storyboard-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.storyboard-toolbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.toolbar-label { font-size: .78rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .05em; }
.toolbar-info  { font-size: .78rem; color: #94a3b8; margin-left: auto; }
.job-status-badge { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 12px; background: #dbeafe; color: #1d4ed8; }

.storyboard-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; padding: 28px 20px; display: flex; align-items: flex-start; }
.storyboard-track  { display: flex; align-items: stretch; gap: 0; min-height: 300px; }

/* ── EINFÜGEZONE ── */
.insert-zone { width: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.insert-zone .iz-line { width: 2px; height: 70%; background: #6366f1; border-radius: 2px; position: relative; opacity: 0; transition: opacity .2s; }
.insert-zone:hover .iz-line { opacity: 1; }
.insert-zone .iz-line::before {
  content: '+'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  background: #6366f1; color: #fff; width: 18px; height: 18px;
  border-radius: 50%; font-size: 13px; line-height: 18px; text-align: center;
}

/* ── KACHEL ── */
.kachel {
  width: 210px; flex-shrink: 0; background: #fff;
  border: 2px solid #e2e8f0; border-radius: 10px;
  padding: 14px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  display: flex; flex-direction: column; gap: 9px;
  margin: 0 6px;
}
.kachel:hover { border-color: #6366f1; box-shadow: 0 4px 16px rgba(99,102,241,.12); transform: translateY(-2px); }
.kachel.active { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.kachel.aenderung { border-color: #f97316; }

.kachel-pos    { font-size: .68rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .07em; }
.kachel-titel  { font-size: .88rem; font-weight: 600; color: #0f172a; line-height: 1.3; }
.kachel-status { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 600; padding: 3px 9px; border-radius: 8px; background: #f1f5f9; align-self: flex-start; }
.status-dot    { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.kachel-assets { font-size: .7rem; color: #64748b; margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.asset-row     { display: flex; justify-content: space-between; }
.asset-ok      { color: #16a34a; font-weight: 700; }
.asset-miss    { color: #dc2626; font-weight: 700; }
.aenderung-badge { font-size: .65rem; background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; border-radius: 6px; padding: 1px 6px; font-weight: 700; align-self: flex-start; }

/* Kachel Buttons */
.kachel-actions { display: flex; gap: 4px; margin-top: 4px; }
.btn-move { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 5px; font-size: .7rem; padding: 2px 7px; cursor: pointer; color: #475569; }
.btn-move:hover { background: #e2e8f0; }

/* Neue Kachel Placeholder */
.kachel-new { background: #f8fafc; border: 2px dashed #cbd5e1; cursor: pointer; }
.kachel-new:hover { border-color: #6366f1; background: #f5f3ff; }
.kachel-new-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 4px; color: #94a3b8; min-height: 120px; }

/* ── BUTTONS ── */
.btn-primary { background: #6366f1; color: #fff; border: none; padding: 6px 14px; border-radius: 7px; font-size: .8rem; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: #4f46e5; }
.btn-save   { background: #16a34a; color: #fff; border: none; padding: 7px 16px; border-radius: 7px; font-size: .82rem; font-weight: 600; cursor: pointer; }
.btn-save:hover { background: #15803d; }
.btn-cancel { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; padding: 7px 14px; border-radius: 7px; font-size: .82rem; cursor: pointer; }
.btn-cancel:hover { background: #e2e8f0; }
.btn-icon   { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: .9rem; color: #475569; }
.btn-icon:hover { background: #e2e8f0; }
.btn-danger { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; padding: 5px 12px; border-radius: 6px; font-size: .78rem; cursor: pointer; margin-top: 8px; }
.btn-danger:hover { background: #fecaca; }

/* ── DETAIL PANEL ── */
.detail-panel { width: 0; min-width: 0; background: #fff; border-left: 2px solid #e2e8f0; overflow: hidden; transition: width .22s ease, min-width .22s ease; display: flex; flex-direction: column; flex-shrink: 0; }
.detail-panel.open { width: 360px; min-width: 360px; }
.detail-header { padding: 16px 18px 12px; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.detail-header h3 { font-size: .92rem; font-weight: 700; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-close { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: #94a3b8; padding: 2px 6px; border-radius: 4px; }
.detail-close:hover { background: #f1f5f9; color: #475569; }
.detail-body { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 14px; }
.detail-footer { padding: 12px 18px; border-top: 1px solid #f1f5f9; display: flex; gap: 8px; }

.detail-section { border-bottom: 1px solid #f1f5f9; padding-bottom: 12px; }
.detail-section:last-child { border-bottom: none; }
.detail-section-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #94a3b8; margin-bottom: 5px; }
.detail-section-value { font-size: .83rem; color: #334155; line-height: 1.5; }

.placeholder-box { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 6px; padding: 9px 12px; font-size: .78rem; color: #94a3b8; font-style: italic; }
.asset-tag { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; margin: 2px 3px 2px 0; }
.asset-tag.ok      { background: #dcfce7; color: #16a34a; }
.asset-tag.missing { background: #fee2e2; color: #dc2626; }
.asset-tag.neutral { background: #ede9fe; color: #7c3aed; }

/* ── FORMFELDER ── */
.form-label { font-size: .75rem; font-weight: 600; color: #475569; display: block; margin-bottom: 4px; }
.form-input { width: 100%; padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 7px; font-size: .83rem; font-family: inherit; color: #1e293b; background: #fff; }
.form-input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.1); }
textarea.form-input { resize: vertical; min-height: 60px; }
.form-error { font-size: .78rem; color: #dc2626; margin-top: 8px; padding: 6px 10px; background: #fee2e2; border-radius: 6px; }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-box { background: #fff; border-radius: 12px; width: 420px; max-width: 95vw; box-shadow: 0 20px 60px rgba(15,23,42,.2); }
.modal-header { padding: 18px 20px 14px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: .95rem; font-weight: 700; color: #0f172a; }
.modal-body   { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid #f1f5f9; display: flex; gap: 8px; justify-content: flex-end; }

/* ── STATUS BAR ── */
.statusbar { background: #fff; border-top: 1px solid #e2e8f0; padding: 5px 20px; font-size: .73rem; color: #64748b; display: flex; gap: 20px; flex-shrink: 0; }
.statusbar span strong { color: #1e293b; }

/* ── FREIGABELOGIK ── */
.freigabe-box { display: flex; flex-direction: column; gap: 8px; }
.freigabe-status-badge { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 10px; display: inline-block; }
.freigabe-neutral { font-size: .75rem; color: #94a3b8; font-style: italic; }
.freigabe-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-freigabe { font-size: .72rem; font-weight: 600; padding: 4px 10px; border-radius: 6px; border: 1px solid; cursor: pointer; transition: opacity .15s; }
.btn-freigabe:hover { opacity: .8; }
.btn-freigabe.zur-pruefung { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.btn-freigabe.freigeben    { background: #dcfce7; color: #166534; border-color: #86efac; }
.btn-freigabe.zurueck      { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* ── UPLOAD BOX ── */
.upload-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }

/* ── ASSET ITEMS ── */
.asset-item { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 7px; padding: 8px 10px; margin-bottom: 5px; }
.asset-item-rolle { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #16a34a; margin-bottom: 2px; }
.asset-item-name  { font-size: .79rem; font-family: monospace; color: #1e293b; word-break: break-all; }
.asset-item-meta  { font-size: .7rem; color: #64748b; margin-top: 3px; }

/* ── HISTORIE ── */
.historie-item { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; font-size: .76rem; padding: 5px 0; border-bottom: 1px solid #f1f5f9; }
.historie-item:last-child { border-bottom: none; }
.historie-typ  { font-weight: 700; font-size: .66rem; color: #6366f1; white-space: nowrap; background: #ede9fe; padding: 1px 6px; border-radius: 4px; }
.historie-desc { color: #334155; }
.historie-time { font-size: .67rem; color: #94a3b8; white-space: nowrap; }

/* ── SCROLLBAR ── */
.storyboard-scroll::-webkit-scrollbar { height: 5px; }
.storyboard-scroll::-webkit-scrollbar-track { background: #f1f5f9; }
.storyboard-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.detail-body::-webkit-scrollbar { width: 4px; }
.detail-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }
