/* NYO Automation × Gastek — Prototyp Teil 1/3 */

:root{
  --sidebar-bg: #0b1220;
  --sidebar-bg-2: #0f1830;
  --sidebar-text: #93a1b8;
  --sidebar-text-strong: #e6ebf5;
  --sidebar-active: #17223f;
  --accent: #2f6fed;
  --accent-dark: #1f4fc4;
  --accent-soft: #eaf0ff;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e3e8f0;
  --border-strong: #d3dae6;
  --text-primary: #101828;
  --text-secondary: #5b667a;
  --text-muted: #8994a8;
  --success: #0f8a5f;
  --success-bg: #e7f7ef;
  --warning: #b6740a;
  --warning-bg: #fdf3e0;
  --danger: #c1361c;
  --danger-bg: #fbeae6;
  --info: #2f6fed;
  --info-bg: #eaf0ff;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow-md: 0 4px 16px rgba(16,24,40,.08);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  font-size: 14.5px;
  line-height: 1.5;
}
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; }

#app{
  display:flex;
  min-height:100vh;
  min-width: 1100px;
}

/* ---------- Sidebar ---------- */
.sidebar{
  width: 250px;
  flex: 0 0 250px;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  display:flex;
  flex-direction: column;
  padding: 22px 14px;
  position: sticky;
  top:0;
  height: 100vh;
}
.sidebar-header{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 6px 10px 22px 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: 14px;
}
.logo-mark{
  width: 34px; height:34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #6aa0ff);
  color:#fff;
  font-weight:700;
  font-size: 16px;
  display:flex; align-items:center; justify-content:center;
  flex: none;
  box-shadow: 0 3px 10px rgba(47,111,237,.4);
}
.logo-text{ display:flex; flex-direction:column; line-height:1.15; }
.logo-text strong{ color: var(--sidebar-text-strong); font-size: 15px; letter-spacing:.2px; }
.logo-text span{ font-size: 11.5px; color: var(--sidebar-text); letter-spacing:.3px; }

.nav{ display:flex; flex-direction:column; gap:2px; flex:1; }
.nav-link{
  display:flex; align-items:center; gap:11px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 13.6px;
  font-weight:500;
  transition: background .12s ease, color .12s ease;
}
.nav-icon{ width:18px; height:18px; flex:none; opacity:.85; }
.nav-link:hover{ background: rgba(255,255,255,.05); color: var(--sidebar-text-strong); }
.nav-link.active{ background: var(--sidebar-active); color: var(--sidebar-text-strong); }
.nav-link.active .nav-icon{ color: #7ea3ff; opacity:1; }
.nav-link.disabled-hint{ position:relative; }

.sidebar-footer{
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 14px 10px 4px 10px;
}
.footer-customer{ color: var(--sidebar-text-strong); font-size: 12.8px; font-weight:600; }
.footer-note{ color: #5f6d88; font-size: 11.3px; margin-top:2px; }

/* ---------- Content shell ---------- */
.content{
  flex:1;
  padding: 28px 36px 60px;
  overflow-x: auto;
}
.page-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  margin-bottom: 22px;
  gap: 20px;
}
.page-head h1{ font-size: 22px; margin:0 0 4px; letter-spacing:-.2px; }
.page-eyebrow{ font-size: 12px; text-transform:uppercase; letter-spacing:.6px; color: var(--text-muted); font-weight:600; margin-bottom:6px; }
.page-sub{ color: var(--text-secondary); font-size: 13.6px; margin:0; }
.breadcrumb{ font-size: 12.8px; color: var(--text-muted); margin-bottom: 10px; }
.breadcrumb a{ color: var(--accent); font-weight:500; }
.breadcrumb a:hover{ text-decoration: underline; }
.breadcrumb .sep{ margin: 0 6px; color: var(--border-strong); }

/* ---------- Buttons / chips ---------- */
.btn{
  display:inline-flex; align-items:center; gap:6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor:pointer;
  transition: border-color .12s ease, background .12s ease;
}
.btn:hover{ border-color: var(--accent); color: var(--accent-dark); }
.btn-primary{
  background: var(--accent);
  border-color: var(--accent);
  color:#fff;
}
.btn-primary:hover{ background: var(--accent-dark); border-color: var(--accent-dark); color:#fff; }
.btn-sm{ padding: 5px 10px; font-size: 12.2px; border-radius:6px; }
.link-btn{
  color: var(--accent); font-weight:600; cursor:pointer; border:none; background:none; padding:0; font-size: inherit;
}
.link-btn:hover{ text-decoration: underline; }

.chip{
  display:inline-flex; align-items:center; gap:5px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid #d6e3ff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.3px;
  font-weight: 600;
  white-space: nowrap;
}
.chip:hover{ background:#dde9ff; }
.chip-ghost{
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.chip-ghost:hover{ border-color: var(--accent); color: var(--accent-dark); }

.badge{
  display:inline-flex; align-items:center; gap:5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.8px;
  font-weight: 700;
  letter-spacing: .2px;
}
.badge::before{ content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }
.badge-success{ background: var(--success-bg); color: var(--success); }
.badge-warning{ background: var(--warning-bg); color: var(--warning); }
.badge-info{ background: var(--info-bg); color: var(--info); }
.badge-neutral{ background: #eef1f6; color: var(--text-secondary); }
.badge-danger{ background: var(--danger-bg); color: var(--danger); }

/* ---------- Cards / surfaces ---------- */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad{ padding: 20px 22px; }

/* ---------- KPI ---------- */
.kpi-grid{
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.kpi-card{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px;
  box-shadow: var(--shadow-sm);
}
.kpi-value{ font-size: 24px; font-weight: 700; letter-spacing:-.4px; }
.kpi-label{ font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

.kpi-col{ display:flex; flex-direction:column; gap:10px; }
.kpi-col .kpi-card{ display:flex; align-items:center; justify-content:space-between; }
.kpi-col .kpi-value{ font-size:20px; }

/* ---------- Tables ---------- */
table.data-table{
  width:100%;
  border-collapse: collapse;
  font-size: 13.4px;
}
.data-table thead th{
  text-align:left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  font-weight:700;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.data-table thead th:first-child{ border-top-left-radius: var(--radius); }
.data-table thead th:last-child{ border-top-right-radius: var(--radius); }
.data-table tbody td{
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td{ border-bottom:none; }
.data-table tbody tr.row-link{ cursor:pointer; transition: background .1s ease; }
.data-table tbody tr.row-link:hover{ background: var(--surface-2); }
.mono{ font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 12.8px; }
.cell-muted{ color: var(--text-muted); }

.table-wrap{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.toolbar{
  display:flex; align-items:center; gap:10px; margin-bottom:14px;
}
.search-input{
  border:1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  width: 280px;
  background: var(--surface);
}
.search-input:focus{ outline:2px solid var(--accent-soft); border-color: var(--accent); }

/* ---------- Assistant layout ---------- */
.assistant-layout{
  display:grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  align-items: start;
}
.chat-panel{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display:flex;
  flex-direction: column;
  min-height: 640px;
}
.chat-header{
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display:flex; align-items:center; gap:10px;
}
.chat-avatar{
  width:32px; height:32px; border-radius:9px;
  background: linear-gradient(135deg, var(--accent), #6aa0ff);
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:700; font-size:13px;
}
.chat-header-title{ font-weight:700; font-size:14.5px; }
.chat-header-sub{ font-size:12px; color: var(--text-muted); }

.chat-body{
  flex:1;
  padding: 20px;
  display:flex; flex-direction:column; gap: 16px;
  overflow-y: auto;
  max-height: 620px;
}
.chat-empty{
  margin: auto;
  text-align:center;
  color: var(--text-secondary);
  max-width: 420px;
  padding: 30px 10px;
}
.chat-empty h3{ color: var(--text-primary); margin-bottom:6px; }

.msg{ display:flex; gap: 10px; max-width: 92%; }
.msg-user{ align-self:flex-end; flex-direction: row-reverse; }
.msg-avatar{
  width:28px; height:28px; border-radius:8px; flex:none;
  display:flex; align-items:center; justify-content:center;
  font-size:11.5px; font-weight:700;
}
.msg-user .msg-avatar{ background: var(--accent); color:#fff; }
.msg-assistant .msg-avatar{ background: #eef1f6; color: var(--text-secondary); }
.msg-bubble{
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 13.6px;
}
.msg-user .msg-bubble{ background: var(--accent); color: #fff; border-color: var(--accent); }
.msg-assistant .msg-bubble{ max-width: 640px; }
.msg-assistant .msg-bubble h2{ font-size:16px; margin: 2px 0 8px; }
.msg-assistant .msg-bubble p{ margin: 8px 0; }

.answer-stats{ font-size: 12.6px; color: var(--text-secondary); margin-bottom: 12px; }
.answer-stats strong{ color: var(--text-primary); }

.answer-banner{
  display:flex; align-items:center; gap:8px;
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight:600;
  margin: 14px 0 12px;
}
.answer-banner.ok{ background: var(--success-bg); color: var(--success); }
.answer-banner.warn{ background: var(--warning-bg); color: var(--warning); }

.sources-block{ margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
.sources-label{ font-size: 11.3px; text-transform:uppercase; letter-spacing:.4px; color: var(--text-muted); font-weight:700; margin-bottom:8px; }
.sources-list{ display:flex; flex-wrap:wrap; gap:6px; }

.open-doc-link{
  color: var(--accent); font-weight:600; cursor:pointer; white-space:nowrap;
}
.open-doc-link:hover{ text-decoration: underline; }

.chat-input-row{
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display:flex; gap:10px;
}
.chat-input{
  flex:1;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.8px;
  resize: none;
}
.chat-input:focus{ outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.send-btn{
  border:none; background: var(--accent); color:#fff;
  border-radius: 10px; padding: 0 18px; font-weight:700; font-size:13.6px;
  cursor:pointer;
}
.send-btn:hover{ background: var(--accent-dark); }

.example-prompts{ display:flex; flex-direction:column; gap:8px; }
.example-prompt-btn{
  text-align:left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 12.6px;
  color: var(--text-primary);
  cursor:pointer;
  transition: border-color .12s ease, background .12s ease;
}
.example-prompt-btn:hover{ border-color: var(--accent); background: var(--accent-soft); }

.side-panel{ display:flex; flex-direction:column; gap: 18px; }
.side-card-title{ font-size:12px; text-transform:uppercase; letter-spacing:.5px; color: var(--text-muted); font-weight:700; margin-bottom:10px; }

.trust-note{
  display:flex; gap:9px; align-items:flex-start;
  background: var(--info-bg); border:1px solid #d6e3ff; border-radius: 10px; padding: 12px 13px;
  font-size:12.2px; color: var(--accent-dark);
}
.trust-note svg{ flex:none; margin-top:1px; }

/* ---------- Detail grids ---------- */
.meta-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.meta-item{ }
.meta-label{ font-size: 11.3px; text-transform:uppercase; letter-spacing:.4px; color: var(--text-muted); font-weight:700; margin-bottom:4px; }
.meta-value{ font-size: 14.5px; font-weight:600; }
.meta-value.link{ color: var(--accent); cursor:pointer; }
.meta-value.link:hover{ text-decoration: underline; }

.doku-banner{
  display:flex; align-items:center; justify-content:space-between;
  background: var(--success-bg);
  border: 1px solid #cdeedd;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 22px;
}
.doku-banner.incomplete{ background: var(--warning-bg); border-color: #f5e3bb; }
.doku-banner-value{ font-size: 22px; font-weight:800; color: var(--success); }
.doku-banner.incomplete .doku-banner-value{ color: var(--warning); }
.doku-banner-label{ font-size: 12.8px; color: var(--text-secondary); margin-top:2px; }

.section-title{ font-size: 15px; font-weight:700; margin: 26px 0 12px; }

.zeugnis-req-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.zeugnis-req-card{
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px;
  background: var(--surface);
}
.zeugnis-req-id{ font-weight:700; font-size: 14px; color: var(--accent-dark); margin-bottom:4px; cursor:pointer; }
.zeugnis-req-id:hover{ text-decoration: underline; }
.zeugnis-req-count{ font-size: 12.6px; color: var(--text-secondary); margin-bottom: 10px; }

.callout{
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  font-size: 13.2px;
  color: var(--text-secondary);
  margin: 18px 0;
}
.callout strong{ color: var(--text-primary); }

/* ---------- Placeholder pages ---------- */
.placeholder-page{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center;
  padding: 90px 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  background: var(--surface);
}
.placeholder-icon{
  width:56px; height:56px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent);
  display:flex; align-items:center; justify-content:center;
  margin-bottom: 18px;
}
.placeholder-page h2{ color: var(--text-primary); margin:0 0 8px; font-size: 18px; }
.placeholder-page p{ max-width: 420px; font-size: 13.4px; }
.placeholder-tag{
  margin-top:14px;
  font-size: 11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.4px;
  color: var(--text-muted); background: var(--surface-2); border:1px solid var(--border);
  padding: 5px 12px; border-radius: 999px;
}

/* ---------- Modal ---------- */
.modal-backdrop{
  position: fixed; inset:0; background: rgba(15,23,42,.5);
  display:flex; align-items:center; justify-content:center;
  z-index: 100;
  animation: fade .12s ease;
}
@keyframes fade{ from{opacity:0} to{opacity:1} }
.modal-box{
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  overflow:hidden;
}
.modal-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3{ margin:0; font-size:15.5px; }
.modal-head-sub{ font-size:12px; color: var(--text-muted); margin-top:3px; }
.modal-close{
  border:none; background:none; cursor:pointer; color: var(--text-muted);
  font-size: 18px; line-height:1; padding:2px;
}
.modal-close:hover{ color: var(--text-primary); }
.modal-body{ padding: 18px 20px; }
.doc-preview{
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 22px 16px;
  text-align:center;
  color: var(--text-secondary);
  font-size: 12.6px;
  margin-bottom: 14px;
}
.doc-path{
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.8px;
  background: #101828;
  color: #cfe0ff;
  padding: 10px 12px;
  border-radius: 8px;
  word-break: break-all;
  margin-top:10px;
}
.modal-meta-row{ display:flex; justify-content:space-between; font-size:12.8px; padding:6px 0; border-bottom:1px solid var(--border); }
.modal-meta-row:last-child{ border-bottom:none; }
.modal-meta-row span:first-child{ color: var(--text-muted); }
.modal-meta-row span:last-child{ font-weight:600; }
.modal-foot{ padding: 14px 20px 18px; }
