/* KURTH GlasERP 9.29.0 – Belegakte, Eingang «aus Mail», Positionsvorschläge */
.ak-akte, .ak-vorschlaege { margin-top: 14px; }
.ak-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ak-kopf h2 { margin: 0; }
.ak-kopf p { margin: 2px 0 0; }
.ak-drop { border: 2px dashed var(--line2, #d7dade); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted, #73777f);
  cursor: pointer; margin: 6px 0 10px; background: #fafbfc; }
.ak-drop.aktiv, .ak-drop:focus { border-color: var(--blue, #245db5); background: var(--bluebg, #edf4ff); outline: none; }
.ak-drop-gross { padding: 40px 14px; font-size: 15px; }
.ak-gruppe { border-top: 1px solid var(--line, #e6e8eb); padding: 8px 0; }
.ak-gruppe > summary { cursor: pointer; font-size: 15px; padding: 4px 0; }
.ak-gruppe > summary small { color: var(--muted, #73777f); font-weight: 400; margin-left: 4px; }
.ak-gruppe h4 { margin: 12px 0 6px; font-size: 13px; }
.ak-liste { list-style: none; margin: 4px 0; padding: 0; }
.ak-liste > li { padding: 6px 0; border-bottom: 1px solid var(--line, #e6e8eb); }
.ak-datei { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ak-name { min-width: 0; flex: 1 1 360px; }
.ak-meta { font-size: 12px; color: var(--muted, #73777f); margin-top: 2px; }
.ak-mailzeile { font-size: 12px; margin-top: 2px; }
.ak-knoepfe { display: flex; gap: 4px; flex-wrap: wrap; align-items: flex-start; }
.ak-link { background: none; border: 0; padding: 0; color: var(--blue, #245db5); cursor: pointer; font: inherit; text-align: left; word-break: break-word; }
.ak-link[disabled] { color: inherit; cursor: default; }
.ak-link:hover:not([disabled]) { text-decoration: underline; }
.ak-chip { border: 1px solid var(--line2, #d7dade); background: #fff; border-radius: 14px; padding: 2px 9px; margin: 2px 2px 0 0; cursor: pointer; font-size: 12px; }
.ak-chip:hover { border-color: var(--blue, #245db5); }
.ak-papier ul { list-style: none; padding-left: 14px; margin: 4px 0; }
.ak-papier li { padding: 2px 0; }
.ak-hinweis { font-size: 12px; color: var(--muted, #73777f); margin: 6px 0; white-space: pre-line; }
.ak-tab { width: 100%; font-size: 12.5px; }
.ak-gruppe[open] { overflow-x: auto; }   /* v10 Layout: breite Dateitabellen (Positionen, Systron) laufen am Handy im eigenen Rahmen statt über den Rand */
.ak-tab td, .ak-tab th { padding: 5px 7px; vertical-align: top; }
.ak-text { white-space: pre-wrap; word-break: break-word; font: 13px/1.45 ui-monospace, Menlo, Consolas, monospace; background: #fafbfc;
  border: 1px solid var(--line, #e6e8eb); border-radius: 8px; padding: 10px; max-height: 60vh; overflow: auto; }
.ak-mailkopf { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 4px 0 10px; font-size: 13px; }
.ak-mailkopf dt { color: var(--muted, #73777f); }
.ak-mailkopf dd { margin: 0; word-break: break-word; }

/* Ansicht am rechten Rand: bleibt offen, während man im Beleg Positionen erfasst */
.ak-ansicht { position: fixed; top: 0; right: 0; bottom: 0; width: min(46vw, 900px); background: #fff; z-index: 900;
  box-shadow: -6px 0 24px rgba(0, 0, 0, .18); display: flex; flex-direction: column; }
.ak-ansicht > header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line, #e6e8eb); }
.ak-ansicht > header b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-ansicht > header span { display: flex; gap: 6px; flex: none; }
.ak-ansicht-inhalt { flex: 1; overflow: auto; padding: 10px; }
.ak-pdf { width: 100%; height: 100%; min-height: 70vh; border: 0; }
.ak-bild { max-width: 100%; height: auto; display: block; margin: 0 auto; }
body.ak-ansicht-offen #view { max-width: calc(100% - min(46vw, 900px)); margin-left: 0; }
.ak-eingang-ansicht .ak-ansicht { position: static; width: auto; box-shadow: none; height: calc(100vh - 160px); }

/* Eingang «Neuer Auftrag aus Mail»: links prüfen, rechts der Anhang */
.ak-eingang-raster { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(360px, 1.2fr); gap: 14px; align-items: start; }
.ak-eingang-ansicht { position: sticky; top: 10px; min-height: 60vh; padding: 0; overflow: hidden; }
.ak-eingang-ansicht > p { padding: 16px; }
.ak-art { display: flex; gap: 18px; margin-bottom: 8px; }
.ak-art label { display: flex; gap: 6px; align-items: center; font-size: 14px; color: inherit; margin: 0; }
.ak-art input { width: auto; }
.ak-neukunde { border: 1px solid var(--line, #e6e8eb); border-radius: 8px; padding: 8px 10px; margin: 8px 0; background: #fafbfc; }
.ak-nk-fragen { margin: 6px 0 10px; padding: 8px 10px; border-radius: 8px; background: var(--amberbg, #fff4df); font-size: 13px; }   /* 31.10.2026: neuer Kunde – Kundentyp, Gruppe, Zahlung */
.ak-nk-fragen .ak-art { align-items: center; margin: 6px 0; flex-wrap: wrap; }
.ak-vorschlag-leer { margin: 12px 0; padding: 8px 10px; border-radius: 8px; background: var(--bluebg, #edf4ff); font-size: 13px; }
.ak-ki-eingang { overflow-x: auto; }   /* 31.10.2026: KI liest die ganze Mail – Positionen schon in der Vorschau */
.ak-ki-liste { list-style: none; margin: 6px 0; padding: 0; }
.ak-ki-liste li { display: grid; grid-template-columns: 22px 68px 1fr; gap: 8px; align-items: start; padding: 7px 0; border-top: 1px solid var(--line, #e6e8eb); font-size: 13px; }
.ak-ki-liste li input { width: auto; margin: 3px 0 0; }
.ak-ki-liste small { color: var(--muted, #73777f); }
.ak-ki-stk { white-space: nowrap; color: var(--muted, #73777f); }
.ak-ki-liste li.ak-erledigt { opacity: .85; }
.ak-stapel { margin-top: 14px; }
/* Skizze umzeichnen (31.10.2026): Teile, Knöpfe, KURTH CAD darunter */
.ak-sk-arbeitsplatz { display: block; }
.ak-ki-start { max-width: none; }
.ak-ki-skizze { display: block; line-height: 0; }
.ak-sk-leiste { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; margin-bottom: 10px; }
.ak-sk-teile { display: flex; gap: 6px; flex-wrap: wrap; }
.ak-sk-teile .ak-chip.aktiv { border-color: var(--ink, #111); font-weight: 700; }
.ak-sk-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ak-sk-info { grid-column: 1 / -1; font-size: 13px; }
.ak-sk-cad .pg-frame { width: 100%; height: calc(100vh - 300px); min-height: 520px; border: 1px solid var(--line, #e6e8eb); border-radius: 8px; }
@media (max-width: 800px) { .ak-sk-leiste { grid-template-columns: 1fr; } .ak-sk-knoepfe { justify-content: flex-start; } }
.ak-stapel-liste { list-style: none; margin: 6px 0 0; padding: 0; }
.ak-stapel-liste li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line, #e6e8eb); font-size: 13px; }
.ak-stapel-liste li input { width: auto; margin: 3px 0 0; }
.ak-stapel-liste li.ak-erledigt { opacity: .7; }
/* 31.10.2026: leere Liste und Fehlerzeile über die ganze Breite (vorher Wort für Wort in der schmalen ersten Spalte) */
.ak-stapel-liste li.muted, .ak-stapel-liste li.dialog-error { display: block; }
.ak-st-kopfknoepfe { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ak-st-kopfknoepfe > [hidden] { display: none; }   /* Knopfstil setzt display – ausgeblendet bleibt ausgeblendet */
.ak-st-info { margin-top: 3px; }
.ak-st-knoepfe { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
@media (max-width: 700px) { .ak-stapel-liste li { grid-template-columns: 22px 1fr; } .ak-st-knoepfe { grid-column: 2; justify-content: flex-start; } }
.ak-ki-liste .ak-frage { color: var(--amber, #a96800); }
.ak-ki-liste .dialog-error { color: var(--red, #b42318); }
.ak-ki-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ak-ki-status { margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; background: var(--bluebg, #edf4ff); font-size: 13px; }
.ak-ki-laeuft::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 50%;
  border: 2px solid var(--blue, #245db5); border-right-color: transparent; vertical-align: -1px; animation: ak-dreh .9s linear infinite; }
@keyframes ak-dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ak-ki-laeuft::before { animation: none; } }

/* Positionsvorschläge */
.ak-vorschlag { border-top: 1px solid var(--line, #e6e8eb); padding: 8px 0; }
.ak-vkopf { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.ak-vknoepfe { margin-left: auto; display: flex; gap: 6px; }
.ak-skizze { width: 64px; height: 48px; color: var(--ink, #111); }
.ak-frage { color: #9a3412; font-size: 12px; }
.ak-erledigt { opacity: .55; }
.ak-pruef small { color: var(--muted, #73777f); }

@media (max-width: 1100px) {
  .ak-eingang-raster { grid-template-columns: 1fr; }
  .ak-ansicht { width: 100vw; }
  body.ak-ansicht-offen #view { max-width: none; }
}
.ak-schalter { display: flex; gap: 8px; align-items: center; color: inherit; font-size: 13px; font-weight: 400; margin: 8px 0; }
.ak-schalter input { width: auto; margin: 0; }

/* v9.31.0: Kette Anfrage → Angebot → Auftrag (Montageprozess) */
.mk-kette { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 12px; font-size: 13px; }
.mk-kette .mk-glied { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 10px; border: 1px solid var(--border, #ddd); border-radius: 4px; text-decoration: none; color: inherit; }
.mk-kette a.mk-glied:hover { border-color: #000; }
.mk-kette .mk-glied small { color: var(--muted, #666); }
.mk-kette .mk-leer { color: var(--muted, #888); border-style: dashed; }
/* Stammdaten → KI → Aufrufe & Kosten (31.10.2026): Luft zwischen den Tabellen */
.ak-ki-kosten .wiz-hint { margin: 10px 0 18px; }
.ak-ki-kosten h3 { margin: 6px 0 8px; }
/* KI-Einstellungen: Preisliste je Modell (31.10.2026) */
.ak-ki-preise { margin: 12px 0 4px; }
.ak-ki-preise summary { cursor: pointer; font-weight: 600; }
.ak-ki-preise h4 { margin: 12px 0 6px; }
/* KI: Nachbestellung erkannt, allgemeine Regeln (31.10.2026) */
.ak-ki-nachbestellung { color: #0f5f86; font-size: 12px; margin-top: 3px; }
.ak-ki-regeln { margin: 12px 0 4px; }
.ak-ki-regeln textarea { width: 100%; }
/* Glas von Hand in der KI-Vorschau (1.11.2026): Rohglas wählen, fremden Namen merken */
.ak-glas-wahl { margin: 6px 0 2px; padding: 8px 10px; border: 1px dashed var(--line2, #d7dade); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; }
.ak-glas-kopf { flex: 1 1 100%; }
.ak-glas-wahl .ak-glas-artikel { max-width: 340px; }
.ak-glas-wahl .ak-glas-name { width: 190px; }
.ak-glas-merken-label { white-space: nowrap; }
.ak-glas-merken { margin: 0 4px 0 0; }
.ak-glas-setzen { margin-left: 2px; }
.ak-glas-fehler:empty { display: none; }
.ak-ki-namen { margin: 12px 0 0; }
.ak-ki-namen-neu { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 8px; }
.ak-ki-namen-neu input { width: 240px; }
.ak-namen-tab { margin: 6px 0; }
/* Prüfbericht 1.11.2026, Befund 3: Hinweis vor dem Anlegen ohne übernehmbare Position; kleiner Knopf «Leeren Entwurf anlegen» im Stapel */
.ak-anlegen-hinweis { margin: 0 0 8px; color: var(--amber, #8f5800); }
.ak-st-leer { opacity: .85; }
/* Auftragsart für neue Belege aus dem Stapel (Fabian 7.11.2026) */
.ak-st-typ{margin:0;align-self:center;font-size:12px;white-space:nowrap}
