.customer-form-tabs{display:flex;gap:8px;margin:14px 0 2px;padding:0 2px;border-bottom:1px solid #e2e3e9}
.customer-template-badge{display:block;width:max-content;margin-top:5px;padding:3px 7px;border-radius:12px;color:#28783b;background:#eaf8ee;font-size:10px;font-weight:750}
.customer-form-tabs button{padding:12px 14px;border:0;border-bottom:3px solid transparent;color:#737887;background:transparent;font:inherit;font-size:12px;font-weight:800;cursor:pointer}
.customer-form-tabs button[aria-selected="true"]{border-bottom-color:var(--p);color:var(--p)}
.customer-form-tabs button:disabled{opacity:.45;cursor:not-allowed}
#customerTemplatePanel{padding-top:20px}
#customerTemplatePanel[hidden],#customerDataPanel[hidden],.template-message[hidden]{display:none!important}
.template-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}
.template-head h3{margin:0;font-size:16px}.template-head p{max-width:600px;margin:5px 0 0;color:var(--muted);font-size:11px;line-height:1.5}
.template-head .secondary{white-space:nowrap}
.template-message{padding:13px 15px;border-radius:11px;color:#5d5770;background:#f6f4fb;font-size:12px}
.template-message.error{color:#913b46;background:#faecee}
.template-rooms{display:grid;gap:13px}
.template-empty{display:grid;place-items:center;gap:6px;min-height:170px;padding:24px;border:1px dashed #d8d3e7;border-radius:14px;color:var(--muted);text-align:center}
.template-empty strong{color:var(--ink);font-size:13px}.template-empty span{font-size:11px}
.template-room{padding:17px;border:1px solid #e2e3e9;border-radius:14px;background:#fcfcfe}
.template-room-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.template-room-title{display:flex;align-items:center;gap:10px}.template-room-title strong{display:block;font-size:13px}.template-room-title small{display:block;margin-top:3px;color:var(--muted);font-size:10px}
.template-room-number{width:27px;height:27px;display:grid;place-items:center;border-radius:8px;color:#fff;background:var(--p);font-size:11px;font-weight:800}
.template-room-actions{display:flex;align-items:center;gap:12px}.template-rename-room,.template-remove-room{border:0;background:none;font:inherit;font-size:10px;font-weight:750;cursor:pointer}.template-rename-room{color:var(--p)}.template-remove-room{color:#9a4a4a}
.template-item-list{margin-bottom:10px}.template-room-empty{margin:12px 0;color:var(--muted);font-size:11px}
.template-item-list .goods-row{padding:13px 7px}.template-item-list .goods-name{overflow-wrap:anywhere}
.template-item-list .qty-control button:disabled{opacity:.4;cursor:not-allowed}
.template-picker-controls input,.template-picker-controls select,.template-custom-item input{width:100%;min-height:37px;padding:7px 9px;border:1px solid #dfe1e7;border-radius:9px;color:var(--ink);background:#fff;font:inherit;font-size:12px}
.template-detail-dialog{width:min(620px,calc(100% - 30px));padding:0;overflow:auto}
.template-detail-dialog .template-dialog-head{padding:21px 22px;border-bottom:1px solid #e2e3e9}
.template-detail-eyebrow{display:block;margin-bottom:5px;color:var(--p);font-size:10px;font-weight:800}
.template-detail-dialog .template-dialog-head p{margin:5px 0 0;color:var(--muted);font-size:10px}
.template-detail-body{display:grid;gap:15px;padding:21px 22px}
.template-detail-body label{display:grid;gap:6px;color:#555b69;font-size:10px;font-weight:780}
.template-detail-body [hidden]{display:none!important}
.template-detail-body input:not([type="checkbox"]),.template-detail-body textarea{width:100%;min-height:44px;padding:9px 11px;border:1px solid #dfe1e7;border-radius:9px;color:var(--ink);background:#fff;font:inherit;font-size:12px}
.template-detail-body textarea{min-height:105px;resize:vertical}
.template-detail-times{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.template-detail-options{display:flex;flex-wrap:wrap;gap:8px}
.template-detail-options label{display:flex;align-items:center;gap:7px;min-height:42px;padding:0 10px;border:1px solid #dfe1e7;border-radius:9px;background:#fff;font-size:10px}
.template-detail-options input{accent-color:var(--p)}
.template-detail-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 22px 21px}
.template-detail-actions>div{display:flex;gap:8px}
.template-detail-remove{border:0;color:#9a4a4a;background:transparent;font:inherit;font-size:10px;font-weight:750;cursor:pointer}
.template-room-name-dialog{width:min(520px,calc(100% - 30px))}.template-room-name-dialog form>label{display:grid;gap:6px;margin-top:18px;color:#555b69;font-size:10px;font-weight:780}.template-room-name-dialog input{width:100%;min-height:44px;padding:9px 11px;border:1px solid #dfe1e7;border-radius:9px;color:var(--ink);background:#fff;font:inherit;font-size:12px}.template-room-name-dialog form>p{margin:7px 0 19px;color:var(--muted);font-size:10px}.template-room-name-actions{display:flex;align-items:center;justify-content:space-between;gap:10px}.template-room-name-actions>div{display:flex;gap:8px}.template-room-name-reset{border:0;color:var(--p);background:transparent;font:inherit;font-size:10px;font-weight:750;cursor:pointer}
.template-add-item{min-height:36px}.template-actions{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:19px;padding-top:16px;border-top:1px solid #e2e3e9}
.template-actions span{color:var(--muted);font-size:11px}.template-actions span.is-dirty{color:#9b6d19}.template-actions span.is-saved{color:#28783b}
.template-dialog{width:min(590px,calc(100% - 30px));max-height:min(720px,calc(100vh - 30px));padding:21px;border:1px solid #e2e3e9;border-radius:16px;color:var(--ink);background:#fff;box-shadow:0 22px 70px #1c1f2d40}
.template-dialog::backdrop{background:#171326b8}.template-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.template-dialog h3{margin:0;font-size:17px}.template-dialog>p{margin:6px 0 16px;color:var(--muted);font-size:11px;line-height:1.5}
.template-dialog-close{width:34px;height:34px;border:0;border-radius:9px;color:var(--muted);background:#f3f3f7;font-size:20px;cursor:pointer}
.template-room-choices,.template-item-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:430px;overflow:auto}
.template-room-choices button,.template-item-choices button{display:flex;align-items:center;gap:10px;min-height:48px;padding:10px 12px;border:1px solid #e2e3e9;border-radius:10px;color:var(--ink);background:#fff;text-align:left;font:inherit;font-size:11px;font-weight:700;cursor:pointer}
.template-room-choices button:hover,.template-item-choices button:hover{border-color:#a89bce;background:#faf9ff}
.template-room-choices button span{font-size:18px}.template-item-choices button{justify-content:space-between}.template-item-choices button small{flex:none;color:var(--p);font-size:10px}
.template-picker-controls{display:grid;grid-template-columns:1fr 170px;gap:10px;margin-bottom:12px}.template-picker-controls label,.template-custom-item label{display:grid;gap:6px;color:#555b69;font-size:10px;font-weight:750}
.template-item-choices>p{grid-column:1/-1;color:var(--muted);font-size:11px}.template-custom-item{margin-top:15px;padding-top:13px;border-top:1px solid #e2e3e9}.template-custom-item>div{display:flex;gap:9px;margin-top:7px}.template-custom-item .secondary{white-space:nowrap}
@media(max-width:740px){.template-head{flex-direction:column}.template-head .secondary{width:100%}.template-room-head{align-items:flex-start}.template-room-actions{align-items:flex-end;flex-direction:column;gap:7px}.template-room-choices,.template-item-choices{grid-template-columns:1fr}.template-picker-controls{grid-template-columns:1fr}.template-actions{align-items:stretch;flex-direction:column}.template-actions .primary{width:100%}.template-detail-times{grid-template-columns:1fr}.template-detail-actions,.template-room-name-actions{align-items:stretch;flex-direction:column}.template-detail-actions>div>*,.template-room-name-actions>div>*{flex:1}}

.template-content-grid{display:grid;grid-template-columns:minmax(0,1fr) 255px;gap:16px;align-items:start}
.template-content-grid .template-rooms{min-width:0}
.template-content-grid .template-summary{top:87px;min-width:0}
.template-summary>div:first-child p{margin:5px 0 17px;color:#ffffffa0;font-size:9px}
@media(max-width:1100px){.template-content-grid{grid-template-columns:minmax(0,1fr)}.template-content-grid .template-summary{position:static}}

.template-delete-button{border:1px solid #d89aa0;border-radius:9px;padding:10px 13px;color:#9b3444;background:#fff3f4;font:inherit;font-size:12px;font-weight:750;cursor:pointer}.template-delete-button:hover{background:#ffe5e8}.template-delete-button:disabled{opacity:.55;cursor:wait}.template-delete-button[hidden]{display:none!important}

/* iPad: Stammkunden-Umzugsgutvorlage ohne gequetschte Gegenstandszeilen. */
@media (min-width:741px) and (max-width:1366px){
  #customerTemplatePanel{min-width:0}
  #customerTemplatePanel .template-head{flex-wrap:wrap;row-gap:13px}
  #customerTemplatePanel .template-head>div{min-width:0;flex:1 1 310px}
  #customerTemplatePanel .template-head h3{line-height:1.35;overflow-wrap:anywhere}
  #customerTemplatePanel .template-head p{line-height:1.55}
  #customerTemplatePanel .template-content-grid{grid-template-columns:minmax(0,1fr);gap:19px}
  #customerTemplatePanel .template-summary{position:static;min-width:0}
  #customerTemplatePanel .template-room{min-width:0;padding:20px}
  #customerTemplatePanel .template-room-head{align-items:flex-start;flex-wrap:wrap;row-gap:12px}
  #customerTemplatePanel .template-room-title{min-width:0;flex:1 1 220px}
  #customerTemplatePanel .template-room-title strong{line-height:1.4;overflow-wrap:anywhere}
  #customerTemplatePanel .template-room-actions{flex-wrap:wrap;gap:9px 15px}
  #customerTemplatePanel .template-item-list .goods-row{min-width:0;gap:12px;align-items:start}
  #customerTemplatePanel .template-item-list .goods-row>div{min-width:0}
  #customerTemplatePanel .template-item-list .goods-name{line-height:1.45;overflow-wrap:anywhere}
  #customerTemplatePanel .template-item-list .goods-meta{line-height:1.45;row-gap:6px}
  #customerTemplatePanel .template-actions{flex-wrap:wrap;row-gap:12px}
  #customerTemplatePanel .template-actions span{line-height:1.45}
  #customerTemplatePanel .template-detail-body input,
  #customerTemplatePanel .template-detail-body textarea{box-sizing:border-box}
}
@media (min-width:741px) and (max-width:950px){
  #customerTemplatePanel .template-room{padding:16px}
  #customerTemplatePanel .template-room-head{gap:12px}
  #customerTemplatePanel .template-item-list .goods-row{grid-template-columns:minmax(0,1fr)}
  #customerTemplatePanel .template-item-list .goods-actions{flex-wrap:wrap;justify-content:flex-start}
  #customerTemplatePanel .template-actions{align-items:stretch;flex-direction:column}
  #customerTemplatePanel .template-actions .primary{align-self:flex-start}
  #customerTemplatePanel .template-picker-controls{grid-template-columns:minmax(0,1fr)}
}


/* Template editor: actions belong to the left workspace, summary starts at its top edge. */
#customerTemplatePanel .template-content-grid{
  grid-template-columns:minmax(0,1fr) 305px;
  gap:18px;
  align-items:start;
}
#customerTemplatePanel .template-content-main{min-width:0}
#customerTemplatePanel .template-head{
  align-items:flex-start;
  gap:18px;
}
#customerTemplatePanel .template-head>div:first-child{min-width:0;flex:1}
#customerTemplatePanel .template-head-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:10px;
}
#customerTemplatePanel .template-head-actions button{min-height:44px;white-space:nowrap}
#customerTemplatePanel .template-summary{
  width:100%;
  margin-top:0;
  top:94px;
  padding:20px;
  border-radius:18px;
}
#customerTemplatePanel .template-summary h2{font-size:18px;line-height:1.3}
#customerTemplatePanel .template-summary>div:first-child p{font-size:11px;line-height:1.45}
#customerTemplatePanel .template-actions{margin-top:16px}
@media(max-width:1366px){
  #customerTemplatePanel .template-content-grid{grid-template-columns:minmax(0,1fr)}
  #customerTemplatePanel .template-summary{position:static}
}
@media(max-width:740px){
  #customerTemplatePanel .template-head{flex-direction:column;align-items:stretch}
  #customerTemplatePanel .template-head-actions{justify-content:stretch}
  #customerTemplatePanel .template-head-actions button{flex:1 1 auto}
}

/* Deactivated template save must not look like an actionable primary button. */
#templateSave:disabled{color:#747987;background:#e2e4eb;box-shadow:none;border:1px solid #cfd2dc;cursor:not-allowed;opacity:1}
#templateSave:disabled:hover{color:#747987;background:#e2e4eb;box-shadow:none;transform:none}
