:root {
  /* Markenfarben otto translate */
  --bg: #f4f6f9;
  --panel: #ffffff;
  --border: #d9dfe8;
  --text: #141B2E;
  --muted: #5d6b80;
  --accent: #FF8C42;          /* Orange: Flächen, Knöpfe, Markierungen */
  --accent-hover: #f47a2c;
  --accent-soft: #fff0e5;
  --on-accent: #1E3557;       /* Schrift auf Orange (Weiß wäre zu kontrastarm) */
  --link: #1E3557;            /* Text-Akzente in Nachtblau (Orange ist auf Weiß schwer lesbar) */
  --ok: #2f7d4f;
  --warn: #a86b00;
  --err: #b42318;
  --radius: 8px;
  --brand-navy: #1E3557;
  --brand-orange: #FF8C42;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
#root { height: 100vh; display: flex; }

/* Navigation */
.sidebar {
  width: 210px; flex-shrink: 0; background: var(--brand-navy); color: #dfe5ee;
  display: flex; flex-direction: column; padding: 18px 10px;
}
.brand { padding: 2px 10px 20px; }
.brand img { display: block; width: 100%; max-width: 180px; height: auto; }
.nav-btn {
  display: block; width: 100%; text-align: left; background: none; border: none; color: inherit;
  padding: 10px 12px; border-radius: 6px; font-size: 14px; cursor: pointer; margin-bottom: 2px;
}
.nav-btn:hover { background: rgba(255, 255, 255, 0.08); }
.nav-btn.active { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.sidebar .foot { margin-top: auto; font-size: 12px; color: #9fb0c8; padding: 0 10px; }

main { flex: 1; overflow: auto; padding: 22px 26px; }
h1 { font-size: 20px; margin: 0 0 16px; font-weight: 600; color: var(--brand-navy); }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 13px; margin: 14px 0 6px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 6px; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.spacer { height: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }

input[type='text'], input[type='password'], select, textarea {
  font: inherit; color: var(--text); background: #fff; border: 1px solid var(--border);
  border-radius: 6px; padding: 7px 9px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.25); }
textarea { resize: vertical; line-height: 1.5; }
textarea.doc { width: 100%; min-height: 360px; font-size: 14px; }

button {
  font: inherit; border-radius: 6px; border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 7px 13px; cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--brand-navy); background: #f7f9fc; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--err); }
button.link { border: none; background: none; color: var(--link); text-decoration: underline; text-underline-offset: 2px; padding: 2px 4px; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.seg button { border: none; border-radius: 0; padding: 8px 14px; }
.seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.seg button + button { border-left: 1px solid var(--border); }
.tempo { margin-left: 16px; }

.progress { height: 6px; background: #e3e8ef; border-radius: 3px; overflow: hidden; width: 220px; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s; }

.alert { padding: 10px 12px; border-radius: 6px; margin: 10px 0; }
.alert.err { background: #fdecea; color: var(--err); }
.alert.ok { background: #e8f5ee; color: var(--ok); }
.alert.info { background: #e9eef5; color: var(--brand-navy); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 14px;
  padding: 4px 10px; background: #fff; cursor: pointer; font-size: 13px; user-select: none;
}
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--brand-navy); font-weight: 600; }

table.terms { width: 100%; border-collapse: collapse; }
table.terms th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; }
table.terms td { padding: 3px 4px; border-bottom: 1px solid #f0f2f5; vertical-align: top; }
table.terms td input[type='text'] { width: 100%; padding: 5px 7px; }
table.terms tr.conflict td { background: #fff8e6; }
.table-wrap { max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }

.list-item { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.list-item:hover { background: #eef2f7; }
.list-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.list-group { font-size: 12px; color: var(--muted); margin: 12px 4px 4px; font-weight: 600; }

.issue { border-left: 3px solid var(--border); padding: 6px 10px; margin-bottom: 8px; background: #fafbfc; border-radius: 0 6px 6px 0; }
.issue.hoch { border-color: var(--err); }
.issue.mittel { border-color: var(--warn); }
.issue.niedrig { border-color: #9aa5b5; }
.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #eef0f3; color: var(--muted); margin-right: 6px; }
details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.dropzone { border: 2px dashed var(--border); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); }

/* Handy / schmale Fenster */
@media (max-width: 760px) {
  #root { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px; gap: 4px; position: sticky; top: 0; z-index: 10; }
  .brand { padding: 4px 8px 6px; width: 100%; }
  .brand img { max-width: 150px; }
  .nav-btn { width: auto; flex: 1 1 auto; text-align: center; padding: 8px 4px; font-size: 13px !important; margin: 0; white-space: nowrap; }

  /* Sprachen nebeneinander, Tempo und Start-Knopf darunter in voller Breite */
  .lang-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px 8px; align-items: end; }
  .lang-row > .field select { width: 100%; min-width: 0; }
  .lang-row > .lang-arrow { padding: 0 0 9px !important; }
  .lang-row > :nth-child(n+4) { grid-column: 1 / -1; }
  .lang-row > .grow { display: none; }
  .lang-row > button { width: 100%; padding: 10px; }
  .tempo { margin-left: 0; }
  .tempo .seg { display: flex; }
  .tempo .seg button { flex: 1; }

  .row > .field { flex: 1 1 140px; }
  .row > .field > input, .row > .field > select { width: 100%; }
  .panel .row > button, .panel .row > input[type='text'] { flex: 1 1 auto; }
  .glossary-list { width: 100% !important; }
  .glossary-list + .grow { flex-basis: 100%; }
  table.terms td input[type='text'] { font-size: 14px; padding: 6px 5px; }

  /* Überschrift über den Knöpfen statt daneben */
  .row > h2.grow { flex-basis: 100%; }
  .panel .row > h2.grow ~ button { flex: 1 1 auto; }
  .sidebar .foot { display: none; }
  main { padding: 14px 12px; overflow: visible; }
  .grid2 { grid-template-columns: 1fr; }
  textarea.doc { min-height: 200px; }
  .progress { width: 120px; }
  .table-wrap { max-height: none; }
  input[type='text'], input[type='password'], select, textarea, button { font-size: 16px; } /* verhindert Zoom auf dem Handy */
}
