/* Bruno Cockpit — Main Stylesheet
   CSS-Variablen 1:1 aus bruno.css übernommen (docs/style-uebernahme.md)
   Drag-Drop, Custom-Tabs und Resize-Handle bewusst NICHT übernommen.
*/

:root {
  --bg:           #0f0f0f;
  --surface:      #161616;
  --surface2:     #1e1e1e;
  --surface3:     #252525;
  --border:       #2a2a2a;
  --accent:       #FF8800;
  --accent-dim:   rgba(255, 136, 0, 0.15);
  --accent-glow:  rgba(255, 136, 0, 0.4);
  --text:         #e8e8e8;
  --text-dim:     #888;
  --text-muted:   #555;
  --green:        #22c55e;
  --red:          #ef4444;
  --yellow:       #eab308;
  --blue:         #3b82f6;
  --font:         'Montserrat', sans-serif;
  --mono:         'JetBrains Mono', monospace;
  --rail-width:   48px;
  --topbar-h:     48px;
  --chat-w:       300px;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
}

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

/* ── App Shell ──────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Topbar ─────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

#topbar-logo {
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  color: var(--text);
  white-space: nowrap;
  user-select: none;
}

#topbar-logo span.accent { color: var(--accent); }

#topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text);
  cursor: default;
}

.user-chip .user-icon { font-size: 14px; }

.topbar-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.topbar-action:hover {
  background: var(--surface2);
  color: var(--text);
  text-decoration: none;
}

.topbar-action.active { color: var(--accent); }

.topbar-logout {
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s;
  text-decoration: none;
}
.topbar-logout:hover { color: var(--text); text-decoration: none; }

/* ── Main Area ──────────────────────────────────────────── */
#main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Chat Spalte (300px fix) ────────────────────────────── */
#chat-col {
  width: var(--chat-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

#chat-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  user-select: none;
}

#chat-placeholder .chat-ph-icon { font-size: 28px; opacity: 0.4; }
#chat-placeholder .chat-ph-text { font-size: 11px; color: var(--text-muted); }

/* ── Tab Rail (48px senkrecht) ──────────────────────────── */
#tab-rail {
  width: var(--rail-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
  user-select: none;
}

.rail-item {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s, background 0.15s, box-shadow 0.2s;
  position: relative;
  text-decoration: none;
}

.rail-item:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.rail-item.active {
  opacity: 1;
  background: var(--accent-dim);
  box-shadow: inset 2px 0 0 0 var(--accent), 0 0 10px 0 rgba(255, 136, 0, 0.18);
}

.rail-item .rail-icon { font-size: 18px; line-height: 1; }

.rail-item .rail-label {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-align: center;
  max-width: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-item.active .rail-label { color: var(--accent); }

/* Tooltip via title attr — browser native, no JS needed */

/* ── Content Area ───────────────────────────────────────── */
#content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.content-inner {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.content-inner::-webkit-scrollbar { width: 6px; }
.content-inner::-webkit-scrollbar-track { background: transparent; }
.content-inner::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Section Headers ────────────────────────────────────── */
.section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── Status Kacheln (Tiles) ─────────────────────────────── */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.tile {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}

.tile:hover { border-color: var(--accent); background: var(--surface3); text-decoration: none; }
.tile.no-link { cursor: default; }
.tile.no-link:hover { border-color: var(--border); background: var(--surface2); }

.tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tile-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tile-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tile-status-dot.green  { background: var(--green); box-shadow: 0 0 4px var(--green); }
.tile-status-dot.yellow { background: var(--yellow); box-shadow: 0 0 4px var(--yellow); }
.tile-status-dot.red    { background: var(--red); box-shadow: 0 0 4px var(--red); }
.tile-status-dot.grey   { background: var(--text-muted); }

.tile-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.tile-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Placeholder Boxes ──────────────────────────────────── */
.placeholder-box {
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
}

.placeholder-box .ph-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.4; }
.placeholder-box .ph-title { font-size: 14px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.placeholder-box .ph-desc { font-size: 12px; }

/* ── Section Boxes (Tests & Gates) ─────────────────────── */
.section-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.section-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-box-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.section-box-body {
  color: var(--text-muted);
  font-size: 12px;
}

/* ── Settings Page ──────────────────────────────────────── */
.settings-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  max-width: 480px;
}

.settings-section h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.settings-row:last-child { border-bottom: none; }
.settings-label { color: var(--text-dim); }
.settings-value { color: var(--text); font-weight: 600; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface3);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.lang-btn:hover { border-color: var(--accent); color: var(--text); }
.lang-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── Login Page ─────────────────────────────────────────── */
#login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  flex-direction: column;
  gap: 20px;
}

.login-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 40px;
  width: 100%;
  max-width: 380px;
}

.login-logo {
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text);
}

.login-logo .accent { color: var(--accent); }

.login-subtitle {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }

.login-btn {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #000;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.15s;
}

.login-btn:hover { opacity: 0.88; }
.login-btn:active { opacity: 0.75; }

.login-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--red);
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.login-lang {
  display: flex;
  gap: 12px;
  justify-content: center;
  font-size: 11px;
}

.login-lang a { color: var(--text-muted); }
.login-lang a:hover { color: var(--text); }
.login-lang a.active { color: var(--accent); font-weight: 600; }

/* ── Utility ────────────────────────────────────────────── */
.text-green  { color: var(--green); }
.text-yellow { color: var(--yellow); }
.text-red    { color: var(--red); }
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.fw-600 { font-weight: 600; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ── Run Data Grid (Tests & Gates Live-Daten) ───────────── */
.data-loading { padding: 16px; color: var(--text-muted); font-size: 12px; }
.no-data-hint { padding: 16px; color: var(--text-dim); font-size: 12px; }

.run-grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 0;
}
.run-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 5px 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.run-row:last-child { border-bottom: none; }
.run-label { color: var(--text-dim); min-width: 140px; flex-shrink: 0; }
.run-val   { color: var(--text); font-weight: 500; }
.run-val.mono, .mono  { font-family: var(--mono); font-size: 11px; }
.run-val.small { font-size: 11px; }
.run-val.status-green  { color: var(--green); }
.run-val.status-yellow { color: var(--yellow); }
.run-val.status-red    { color: var(--red); }

.run-alert {
  margin: 6px 12px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.run-alert.red    { background: rgba(239,68,68,0.12); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.run-alert.yellow { background: rgba(234,179,8,0.12); color: var(--yellow); border: 1px solid rgba(234,179,8,0.3); }

/* ── Drift List ─────────────────────────────────────────── */
.drift-ok {
  padding: 12px 16px;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
}
.drift-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 8px 8px;
  max-height: 340px;
  overflow-y: auto;
}
.drift-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.4;
}
.drift-item.warn  { background: rgba(234,179,8,0.06); }
.drift-item.error { background: rgba(239,68,68,0.08); }
.drift-sev { flex-shrink: 0; width: 14px; font-size: 11px; }
.drift-item.warn  .drift-sev { color: var(--yellow); }
.drift-item.error .drift-sev { color: var(--red); }
.drift-msg { color: var(--text-dim); font-family: var(--mono); }
