.service-packages { min-width:0; padding:16px 0; }
.service-packages *, .service-packages-modal * { box-sizing:border-box; letter-spacing:0; }
.sp-heading, .sp-line-toolbar, .sp-group > header, .sp-line-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.sp-heading { margin-bottom:14px; }
.sp-heading h2, .sp-line-toolbar h3, .sp-group h4 { margin:0; font-size:16px; }
.sp-actions { display:flex; align-items:center; gap:4px; flex-shrink:0; }
.sp-actions .icon-button { width:34px; height:34px; min-height:34px; padding:7px; flex:none; }
.sp-actions svg { width:18px; height:18px; }
.sp-filters { display:grid; grid-template-columns:minmax(180px,2fr) repeat(3,minmax(120px,1fr)); gap:12px; }
.sp-filters > label, .sp-form label.field { display:flex; flex-direction:column; gap:5px; font-size:13px; font-weight:600; color:#46565c; min-width:0; }
.sp-count { margin:12px 0 8px; color:var(--muted,#59686d); font-size:13px; }
.sp-table { table-layout:fixed; }
.sp-table th:first-child { width:25%; }
.sp-table th:nth-child(2) { width:24%; }
.sp-table th:last-child { width:80px; }
.sp-table td, .sp-table th { overflow-wrap:anywhere; }
.sp-table tbody tr { cursor:default; }
.sp-table small { display:block; margin-top:4px; color:var(--muted,#59686d); font-size:12px; }
.sp-name { border:0; background:none; color:var(--accent,#683774); padding:0; text-align:left; font:inherit; font-weight:650; overflow-wrap:anywhere; cursor:pointer; }
.sp-name:hover { text-decoration:underline; }
.sp-number { font-variant-numeric:tabular-nums; text-align:right; }
.sp-status { font-size:12px; color:#21645a; }
.sp-inactive { color:#6a7176; }
.sp-table-action { padding:6px !important; }
.sp-table-action .icon-button { width:32px; height:32px; padding:6px; }
.sp-empty { padding:24px 12px; text-align:center; border-block:1px solid var(--line,#d7dddb); color:var(--muted,#59686d); }
.sp-error { padding:10px 12px; background:#fff1ef; border-left:3px solid #aa3e35; color:#8b3029; overflow-wrap:anywhere; }
.sp-error[hidden], .sp-form [hidden] { display:none !important; }
.sp-sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.modal.service-packages-modal { width:min(1060px,calc(100vw - 48px)); }
.service-packages-modal .modal-head { flex-shrink:0; gap:12px; padding-block:12px; }
.service-packages-modal .modal-head > div { min-width:0; overflow-wrap:anywhere; }
.service-packages-modal .modal-foot { flex-shrink:0; }
.service-packages-modal .modal-body { min-width:0; }
.sp-fields { padding:0; margin:0; border:0; min-width:0; }
.sp-master-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.sp-span-two { grid-column:span 2; }
.sp-form .field input, .sp-form .field select, .sp-form .field textarea { min-width:0; width:100%; font-weight:400; font-size:14px; }
.sp-form .field textarea { min-height:66px; }
.sp-active { display:flex; align-items:center; gap:8px; align-self:center; font-size:14px; }
.sp-active input { width:17px; height:17px; min-height:17px; margin:0; accent-color:var(--accent); }
.sp-social-note { margin:12px 0 0; padding:8px 0; color:#59686d; font-size:13px; }
.sp-line-toolbar { margin-top:22px; padding:12px 0; border-top:1px solid var(--line,#d7dddb); flex-wrap:wrap; }
.sp-price-mode { display:flex; gap:0; padding:0; margin:0; border:0; min-width:0; }
.sp-price-mode legend { font-size:12px; color:var(--muted,#59686d); margin-bottom:5px; }
.sp-price-mode label { display:flex; align-items:center; cursor:pointer; }
.sp-price-mode input { width:16px; height:16px; margin:0 0 0 8px; accent-color:var(--accent); }
.sp-price-mode span { min-width:55px; padding:6px 9px; font-size:13px; }
.sp-price-mode label:has(input:checked) { background:#eef3f2; outline:1px solid #c7d4d0; border-radius:4px; }
.sp-group { border:0; margin:0; padding:0; }
.sp-group > header { padding:10px 0; border-bottom:1px solid var(--line,#d7dddb); }
.sp-group h4 { font-size:14px; }
.sp-group-empty > [data-sp-lines]::after { content:'Keine Positionen'; display:block; padding:12px 0; color:var(--muted,#59686d); font-size:13px; }
.sp-line { padding:10px 0 14px; border-bottom:1px solid var(--line,#d7dddb); }
.sp-line-head { margin-bottom:8px; }
.sp-line-head strong { font-size:13px; color:var(--muted,#59686d); }
.sp-move-up svg { transform:rotate(-90deg); }
.sp-move-down svg { transform:rotate(90deg); }
.sp-line .icon-button:disabled { cursor:default; opacity:.35; }
.sp-position-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 12px; }
.sp-line-numbers { display:grid; grid-template-columns:minmax(80px,.75fr) minmax(110px,1.3fr) minmax(70px,.7fr); gap:10px; }
.sp-line-result { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:8px; min-height:22px; }
.sp-line-result output { margin-left:auto; font-size:14px; font-weight:650; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.sp-line-result small { color:#755719; font-size:12px; }
.sp-totals { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:16px 28px; margin:0; padding:16px 0 4px; }
.sp-totals > div { min-width:100px; text-align:right; }
.sp-totals dt { margin-bottom:5px; font-size:12px; color:var(--muted,#59686d); }
.sp-totals dd { margin:0; font-size:16px; font-weight:650; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
@media(min-width:850px) {
  .sp-position-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .sp-position-grid > .sp-line-result { grid-column:1 / -1; }
}
@media(max-width:760px) {
  .sp-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .sp-table, .sp-table tbody { display:block; border:0; }
  .sp-table thead { display:none; }
  .sp-table tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 14px; padding:12px 0; border-bottom:1px solid var(--line,#d7dddb); }
  .sp-table td { display:block; height:auto; padding:0; border:0; }
  .sp-table td::before { content:attr(data-label); display:block; margin-bottom:4px; color:var(--muted,#59686d); font-size:11px; }
  .sp-table td:first-child { grid-column:1 / -1; }
  .sp-table .sp-number { text-align:left; }
  .sp-table .sp-table-action { grid-column:2; justify-self:end; }
  .sp-master-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:480px) {
  .service-packages { padding-top:10px; }
  .sp-heading { align-items:flex-start; }
  .sp-heading h2 { padding-top:8px; }
  .sp-heading .button { padding-inline:8px; }
  .modal.service-packages-modal { width:calc(100vw - 24px); max-height:calc(100dvh - 24px); }
  .service-packages-modal .modal-body { padding:12px; }
  .service-packages-modal .modal-head, .service-packages-modal .modal-foot { padding-inline:12px; }
  .sp-line-numbers { grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr) minmax(0,.7fr); gap:7px; }
  .sp-form .field input, .sp-form .field select { padding:8px 6px; }
  .sp-totals { gap:12px; justify-content:space-between; }
  .sp-totals > div { min-width:0; }
  .sp-totals dd { font-size:14px; }
}
