/* Kundenportal BauerSoftware - Shell-Layout um die DevExtreme-Widgets
   (Aufbau wie ai.proxie/admin/v2, hier helles Material-Theme) */
:root {
  --bg:       #f3f5f8;
  --surface:  #ffffff;
  --surface2: #f7f8fa;
  --border:   #dfe3e8;
  --text:     #1f2933;
  --muted:    #6b7280;
  --primary:  #1976d2;
  --danger:   #d32f2f;
  --r:        8px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: Roboto, "Segoe UI", Helvetica, Arial, sans-serif; font-size: 13px;
}
a { color: var(--primary); }

/* === Login === */
#login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 32px 40px; width: 420px; max-width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.login-logo { display: block; max-width: 100%; height: auto; margin: 0 auto 16px; }
.login-card h1 { font-size: 20px; margin: 0 0 6px; }
.login-card p  { color: var(--muted); margin: 0 0 20px; font-size: 13px; }
.login-card .field { margin-bottom: 14px; }
.login-card .field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.login-error { color: var(--danger); font-size: 13px; margin-bottom: 14px; }

/* === App-Shell === */
/* Feste Hoehe statt min-height: nur so bekommt der Splitter (.main, flex:1) eine
   definierte Hoehe, und der Inhalt scrollt in seiner Spalte statt die ganze Seite */
#app { display: none; flex-direction: column; height: 100vh; }
header.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 16px; display: flex; align-items: center; gap: 12px; height: 48px; flex-shrink: 0;
}
.topbar-logo { height: 30px; width: auto; }
header.topbar .title { font-size: 15px; font-weight: 600; flex: 1; }
.user-badge {
  font-size: 12px; color: var(--muted); background: var(--surface2);
  border: 1px solid var(--border); padding: 3px 10px; border-radius: 20px;
}
.main { display: flex; flex: 1; min-height: 0; }
#main-splitter .dx-splitter-item-content { overflow: hidden; height: 100%; }

nav#sidebar {
  width: 100%; height: 100%; background: var(--surface);
  padding: 6px 4px; overflow-y: auto;
}
/* Nur die Zeilenhoehe verdichten. Einrueckung (padding-left je Ebene) und die
   Aufklapp-Symbole kommen unveraendert aus dem Theme - eine fruehere Regel
   ".dx-treeview-node-container > .dx-treeview-node { padding-left: 0 }" traf
   ALLE Knoten (jeder liegt in einem eigenen Container) und hob die
   Einrueckung der Unterebenen auf. */
nav#sidebar .dx-treeview-item { padding-top: 2px; padding-bottom: 2px; min-height: 26px; }
/* Einrueckung je Ebene etwas deutlicher als die 15px des Themes; Wurzelknoten bleiben bei 0 */
nav#sidebar .dx-treeview-node { padding-inline-start: 18px; }
nav#sidebar .dx-treeview .dx-treeview-node.dx-treeview-root-node { padding-inline-start: 0; }
nav#sidebar .nav-badge {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px;
  border-radius: 10px; background: var(--primary); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}
nav#sidebar .nav-bold { font-weight: 600; }

.content { height: 100%; padding: 12px 16px; overflow-y: auto; min-width: 0; }
.page { display: none; }
.page.active { display: block; }
.page h1 { font-size: 18px; margin: 0 0 12px; }
.page h2 { font-size: 15px; margin: 16px 0 6px; }
.page p  { line-height: 1.5; margin: 6px 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; margin-bottom: 12px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.section-title  { font-size: 16px; font-weight: 600; }
.section-subtitle { color: var(--muted); font-size: 12px; margin-top: 1px; }
.toolbar { display: flex; gap: 10px; align-items: center; }
.text-muted { color: var(--muted); }
.empty-hint { color: var(--muted); font-size: 13px; padding: 8px 0; }

.group-text { background: #eef4fb; border: 1px solid #cfe0f5; border-radius: var(--r); padding: 6px 10px; margin-bottom: 8px; font-size: 12.5px; }
.file-link { font-weight: 600; text-decoration: none; }
.file-link:hover { text-decoration: underline; }
.file-size { color: var(--muted); margin-left: 6px; }
.file-missing { color: var(--danger); margin-left: 6px; }
.file-download { color: var(--primary); font-size: 18px; text-decoration: none; }
.file-download:hover { opacity: .7; }
.group-box { padding: 0; overflow: hidden; }
.group-box-title { font-weight: 600; font-size: 13px; padding: 6px 12px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.group-box .dx-datagrid { padding: 2px 4px; }
.row-hidden { color: var(--muted); font-style: italic; }
/* Legende unter den Download-Boxen (Dateiarten mit Erklaerung, z.B. .but) */
.file-legend { background: #eef4fb; border-color: #cfe0f5; padding: 10px 14px; font-size: 12.5px; line-height: 1.45; }
.file-legend-row { display: flex; align-items: flex-start; gap: 12px; }
.file-legend-row + .file-legend-row { margin-top: 8px; }
.file-legend-icon { flex: 0 0 auto; padding-top: 1px; }
.file-legend-text { flex: 1 1 auto; color: #374151; }
.file-legend-title { font-weight: 600; color: #1f2937; }

/* Posteingang */
.doc-icon { display: inline-block; width: 22px; text-align: center; font-weight: 700; font-size: 11px; border-radius: 3px; padding: 2px 0; color: #fff; }
.doc-icon.pdf   { background: #d32f2f; }
.doc-icon.word  { background: #1565c0; }
.doc-icon.excel { background: #2e7d32; }
.doc-icon.file  { background: #757575; }

/* Auftragsverarbeitung */
.adv-status { font-weight: 600; margin-bottom: 12px; }
.adv-status.signed { color: #2e7d32; }
.adv-actions { margin-top: 12px; }
.pdf-card { padding: 0; overflow: hidden; }
.pdf-frame { width: 100%; height: 70vh; border: 0; display: block; }

@media (max-width: 800px) {
  nav#sidebar { border-bottom: 1px solid var(--border); }
  .content { padding: 14px 16px; }
  .topbar-logo { display: none; }
}

.load-error { background: #fdecea; border: 1px solid #f5c6c2; border-radius: var(--r); padding: 10px 14px; color: #b71c1c; }

/* Dichte Tabellen: kein Umbruch, enge Zellen, Gruppenzeilen schmal */
.dx-datagrid .dx-datagrid-headers .dx-header-row > td { padding: 4px 8px; white-space: nowrap; font-size: 12px; }
.dx-datagrid .dx-datagrid-rowsview .dx-row > td { padding: 3px 8px; white-space: nowrap; }
.dx-datagrid .dx-datagrid-rowsview .dx-group-row > td { padding: 3px 8px; }
.dx-datagrid .dx-command-edit .dx-link { margin: 0 3px; }
