








.planer, .planer * { box-sizing: border-box; }

.planer [hidden] { display: none !important; }
.planer { margin: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #f0f0f0; overflow-x: hidden; color: #222; }
.planer .page-wrapper { display: flex; align-items: flex-start; gap: 16px; padding: 10px; }
.planer .sidebar {
    position: sticky; top: 10px; flex: 0 0 340px; max-height: calc(100vh - 20px);
    overflow-y: auto; overflow-x: hidden; background: #fff; border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); padding: 10px; z-index: 100;
}
.planer .sidebar::-webkit-scrollbar { width: 8px; }
.planer .sidebar::-webkit-scrollbar-thumb { background: #999; border-radius: 4px; }
.planer .main-content { flex: 1 1 auto; min-width: 0; position: relative; }
.planer .kopf { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px 2px; }
.planer .kopf h2 { font-size: 18px; margin: 0; color: #222; }
.planer .kopf span { font-size: 12px; color: #666; }
.planer #canvasContainer {
    position: relative; width: 100%; height: calc(100vh - 205px); min-height: 400px;
    overflow: auto; border: 2px solid #ccc; border-radius: 8px; background: #dcdcdc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.planer #canvas2d { display: block; background: #fff; touch-action: none; outline: none; }
.planer .controls { display: flex; flex-direction: column; gap: 10px; }
.planer .section { border: 1px solid #e0e0e0; padding: 12px; border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.planer .section > summary { margin: 0 0 10px 0; padding-bottom: 8px; border-bottom: 2px solid #f0f0f0; color: #333; font-size: 14px; font-weight: 600; cursor: pointer; user-select: none; }
.planer .section:not([open]) > summary { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.planer .button-row { display: flex; flex-wrap: wrap; gap: 6px; }
.planer .button-row button { flex: 1 1 auto; }
.planer hr { border: none; border-top: 1px solid #e0e0e0; margin: 10px 0; }
.planer button, .planer select, .planer input[type="file"] {
    padding: 8px 12px; font-size: 13px; cursor: pointer; border: 1px solid #d0d0d0; background: #f9f9f9;
    border-radius: 6px; transition: all 0.15s ease; font-family: inherit; font-weight: 500;
}
.planer button:hover:not(:disabled), .planer select:hover { background: #e8e8e8; border-color: #aaa; }
.planer button.active { background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%); color: #fff; border-color: #4CAF50; }
.planer button:disabled { opacity: 0.5; cursor: not-allowed; }
.planer button.primaer { background: linear-gradient(135deg, #2E7D32 0%, #388E3C 100%); color: #fff; border-color: #2E7D32; font-weight: 600; padding: 10px 14px; }
.planer button.primaer:hover:not(:disabled) { background: #2E7D32; }
.planer button.gross { width: 100%; padding: 12px; font-size: 14px; }
.planer :focus-visible { outline: 2px solid #2196F3; outline-offset: 2px; }
.planer input[type="number"], .planer input[type="text"] { width: 100%; padding: 8px; border: 1px solid #d0d0d0; border-radius: 6px; font-size: 13px; font-family: inherit; }
.planer input[type="range"] { width: 100%; cursor: pointer; }
.planer input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.planer label { font-size: 13px; display: flex; align-items: center; gap: 8px; font-weight: 500; color: #555; }
.planer label.stapel { flex-direction: column; align-items: stretch; gap: 3px; }
.planer select { width: 100%; }
.planer .zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.planer #status { text-align: center; margin: 5px 0; min-height: 26px; padding: 5px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.planer #infoBox { margin: 0 0 8px 0; padding: 10px 12px; background: linear-gradient(135deg, #fff3cd 0%, #ffe8a1 100%); border: 1px solid #ffc107; border-radius: 8px; font-size: 12px; }
.planer #infoBox strong { color: #856404; }


.planer #infoBox .info-mehr { margin-top: 4px; }
.planer #infoBox .info-mehr > summary { cursor: pointer; color: #856404; font-weight: 600; }
.planer #infoBox .info-mehr[open] > summary { margin-bottom: 4px; }
.planer .hinweis-text { font-size: 11px; color: #767676; margin-top: 4px; line-height: 1.4; }
.planer .kosten-warn { color: #A94400; }

.planer .kosten-anfrage { color: #555; font-style: italic; }
.planer .mauer-positionen { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.planer .mauer-position { background: #f5f7f5; border-radius: 6px; padding: 6px 8px; font-size: 12px; }
.planer .mauer-position-fehler { background: #fff3e0; }
.planer .mauer-position-zeile { display: flex; justify-content: space-between; gap: 8px; margin-top: 3px; }
.planer .mauer-position code { font-size: 11px; color: #555; }
.planer #beetOptionen { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; margin-top: 8px; }
.planer #beetOptionen label { font-weight: 400; }
.planer .mauer-summe { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 6px; border-top: 1px solid #ddd; font-size: 13px; }
.planer #mauerInfo { margin-top: 10px; font-size: 12px; }
.planer .bestell-summe { font-size: 22px; font-weight: 700; color: #2E7D32; margin: 4px 0; }
.planer .fehler-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; background: #e53935; color: #fff; font-size: 11px; font-weight: 700; vertical-align: middle; }
.planer #fehlerProtokollListe { max-height: 180px; overflow-y: auto; font-size: 11px; }



.planer #kostenLeiste { position: relative; margin-top: 6px; width: 340px; max-width: 100%; font-size: 12px; }
.planer #kostenLeisteToggle { display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; padding: 0 12px; background: #fff; border: 2px solid #333; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.2); cursor: pointer; font-size: 12px; text-align: left; }
.planer #kostenLeiste[data-offen="true"] #kostenLeisteToggle { border-radius: 0 0 8px 8px; }
.planer #kostenLeisteToggle .kosten-label { color: #666; }
.planer #kostenLeisteToggle strong { margin-left: auto; font-size: 14px; }
.planer .kosten-chip { background: #eee; border-radius: 10px; padding: 2px 8px; color: #555; white-space: nowrap; }
.planer .kosten-chip-warn { background: #FFE0B2; color: #A94400; cursor: pointer; }
.planer #kostenPanel { position: absolute; left: 0; bottom: 100%; width: 100%; z-index: 400; background: #fff; border: 2px solid #333; border-bottom: none; border-radius: 8px 8px 0 0; box-shadow: 0 4px 12px rgba(0,0,0,0.3); max-height: 45vh; overflow-y: auto; padding: 8px 10px; }
.planer .kosten-modus { display: flex; gap: 4px; margin-bottom: 8px; }
.planer .kosten-modus-btn { flex: 1; padding: 4px; border: 1px solid #d0d0d0; background: #f7f7f7; border-radius: 4px; cursor: pointer; font-size: 11px; }
.planer .kosten-modus-btn.active { background: #2196F3; border-color: #1976D2; color: #fff; font-weight: 600; }
.planer .kosten-gruppe { margin-bottom: 8px; }
.planer .kosten-gruppe-kopf { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid #ddd; padding-bottom: 3px; margin-bottom: 3px; font-weight: 600; }
.planer .kosten-zeile { display: flex; gap: 6px; align-items: baseline; padding: 2px 0; cursor: pointer; }
.planer .kosten-zeile:hover { background: #f3f7f3; }
.planer .kosten-zeile .kz-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planer .kosten-zeile .kz-spez { color: #767676; font-size: 10px; white-space: nowrap; font-weight: 400; }
.planer .kosten-zeile .kz-preis { margin-left: auto; white-space: nowrap; }
.planer .kosten-position { padding-left: 8px; }
.planer .kosten-leer { color: #767676; padding: 6px 0; }
.planer .kosten-fuss { display: flex; justify-content: space-between; gap: 6px; border-top: 1px solid #ddd; padding-top: 5px; margin-top: 4px; font-size: 11px; }
.planer .kosten-hinweis { color: #767676; font-size: 10px; padding-top: 4px; }


.planer #contextMenu { display: none; position: fixed; background: #fff; border: 1px solid #999; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.3); z-index: 9999; min-width: 190px; padding: 4px 0; }
.planer #contextMenu button { display: block; width: 100%; padding: 10px 15px; border: none; background: #fff; text-align: left; font-size: 13px; border-radius: 0; color: #333; }
.planer #contextMenu button:hover { background: #2196F3; color: #fff; }
.planer #contextMenu hr { margin: 4px 0; }


.planer .modal-overlay { display: none; position: fixed; z-index: 4999; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.planer .modal { display: none; position: fixed; z-index: 5000; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); width: 92%; max-width: 820px; max-height: 88vh; overflow: hidden; flex-direction: column; }
.planer .modal-overlay.active { display: block; }
.planer .modal.active { display: flex; }
.planer .modal-header { padding: 16px 20px; background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%); color: #fff; }
.planer .modal-header h3 { margin: 0; font-size: 20px; }
.planer .modal-body { flex: 1; overflow-y: auto; padding: 18px 20px; background: #fafafa; font-size: 13px; }
.planer .modal-footer { padding: 12px 20px; border-top: 1px solid #ddd; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; background: #f5f5f5; align-items: center; }
.planer .modal-footer .links { margin-right: auto; font-size: 12px; color: #555; }
.planer .bestell-tabelle { width: 100%; border-collapse: collapse; font-size: 13px; }
.planer .bestell-tabelle th, .planer .bestell-tabelle td { padding: 6px 8px; border-bottom: 1px solid #e0e0e0; text-align: left; vertical-align: top; }
.planer .bestell-tabelle th { background: #eee; }
.planer .bestell-tabelle td.rechts, .planer .bestell-tabelle th.rechts { text-align: right; white-space: nowrap; }
.planer .bestell-tabelle tfoot td { border-bottom: none; }
.planer .bestell-tabelle tr.summe td { font-weight: 700; font-size: 14px; border-top: 2px solid #333; }
.planer .bestell-tabelle tr.anfrage td { background: #fff8e1; }
.planer #bestellFortschritt { font-size: 13px; color: #2E7D32; margin-top: 10px; }
.planer #bestellWarenkorbHinweis { font-size: 12px; color: #A94400; margin-top: 10px; }

@media (max-width: 1100px) {
    .planer .page-wrapper { flex-direction: column; }
    .planer .sidebar { position: relative; top: 0; flex: 1 1 auto; width: 100%; max-height: none; }
    



    .planer .main-content { width: 100%; }
    .planer #canvasContainer { height: 70vh; }
    .planer .button-row button { min-height: 44px; }
}


.planer .kosten-laden { color: #767676; font-style: italic; }

.planer #planerDatenFehler { margin: 0 0 8px 0; padding: 10px 12px; background: #FFEBEE; border: 1px solid #e53935; border-radius: 8px; color: #b71c1c; font-weight: 600; font-size: 13px; }















.planer button { color: #222; }
.planer button:hover:not(:disabled) { color: #222; }
.planer button.primaer:hover:not(:disabled), .planer button.active:hover:not(:disabled) { color: #fff; }
.planer button.active:hover:not(:disabled) { background: #45a049; }
.planer .modal { height: auto; }
.planer .modal-body { height: auto; }
.planer .modal-header h3 { color: #fff; }
.planer input[type="number"], .planer input[type="text"] { background: #fff; }
