*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --fix: #3b82f6;
  --fix-light: #dbeafe;
  --var: #10b981;
  --var-light: #d1fae5;
  --total: #8b5cf6;
  --total-light: #ede9fe;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --hero-bg: #1e293b;
  --hero-text: #f8fafc;
}

body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

/* HERO */
.hero { background: var(--hero-bg); color: var(--hero-text); padding: 18px 24px; }
.hero h1 { margin-bottom: 0; }
.hero-inner { max-width: 1100px; margin: 0 auto; }
h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.subtitle { color: #94a3b8; font-size: 12px; margin-bottom: 20px; }

.hero-slider-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.hero-slider-row label { font-weight: 600; min-width: 140px; }
.hero-slider-row input[type=range] { flex: 1; accent-color: #60a5fa; }
.hero-slider-row .slider-val { min-width: 32px; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px; }

.hero-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hero-card { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 14px 16px; }
.hero-card--fix { border-color: rgba(59,130,246,0.4); background: rgba(59,130,246,0.1); }
.hero-card--var { border-color: rgba(16,185,129,0.4); background: rgba(16,185,129,0.1); }
.hero-card-label { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.hero-card-value { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* TABS */
.tab-nav { display: flex; gap: 0; border-bottom: 2px solid var(--border); background: white; padding: 0 24px; max-width: 100%; overflow-x: auto; }
.tab-btn { background: none; border: none; padding: 12px 18px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: color .15s; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--fix); border-bottom-color: var(--fix); }

/* PANELS */
.tab-panel { display: none; padding: 24px; }
.tab-panel.active { display: block; }

/* GRID */
.panel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* CARDS */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.card.wide { grid-column: 1 / -1; }
.card h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 14px; }

/* SLIDERS */
.slider-group { display: flex; flex-direction: column; gap: 10px; }
.slider-row { display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: 10px; }
.slider-row label { font-size: 13px; color: var(--text); }
.slider-row input[type=range] { width: 100%; accent-color: var(--fix); }
.slider-row select { width: 100%; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: white; }
.slider-val { min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: var(--fix); white-space: nowrap; }

/* MINI CARDS */
.card-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card-row--5 { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
.mini-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.mini-card--fix { border-top: 3px solid var(--fix); }
.mini-card--var { border-top: 3px solid var(--var); }
.mini-card--total { border-top: 3px solid var(--total); }
.mini-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.mini-total { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.mini-per { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* TOKEN BOX */
.token-box {}
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table td { padding: 5px 4px; border-bottom: 1px solid var(--border); }
.detail-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.detail-table tr.total-row td { font-weight: 700; color: var(--total); border-top: 2px solid var(--border); }
.detail-table tr:last-child td { border-bottom: none; }

/* BADGES */
.badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge--fix { background: var(--fix-light); color: var(--fix); }
.badge--var { background: var(--var-light); color: #059669; }

/* BREAKDOWN TABLE */
.breakdown-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.breakdown-table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.breakdown-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.breakdown-table td:nth-child(3),
.breakdown-table td:nth-child(4) { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.breakdown-table tbody tr:hover { background: var(--bg); }
.breakdown-table .subtotal td { background: var(--bg); font-weight: 700; }
.breakdown-table .grand td { background: #1e293b; color: white; font-weight: 800; }

/* CHARTS */
.chart-container { position: relative; height: 320px; }

/* SZENARIO-LEISTE */
.scenario-bar { background: #f1f5f9; border-bottom: 1px solid var(--border); padding: 10px 24px; }
.scenario-bar-inner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.scenario-bar-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }

.scenario-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; align-items: center; }
.no-scenarios { font-size: 12px; color: #94a3b8; font-style: italic; }

.scenario-chip { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 8px; background: white; cursor: pointer; overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.scenario-chip:hover { border-color: var(--fix); box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }
.scenario-chip.active { border-color: var(--fix); background: var(--fix-light); }

.chip-body { padding: 5px 10px; display: flex; flex-direction: column; gap: 1px; }
.chip-name { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.chip-meta { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.chip-btns { display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.chip-btn { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 13px; padding: 3px 7px; line-height: 1; transition: background .1s, color .1s; flex: 1; }
.chip-btn:hover { background: var(--bg); }
.chip-btn--export:hover { color: var(--fix); }
.chip-btn--delete:hover { color: #ef4444; background: #fef2f2; }

.scenario-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-sc { padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: background .15s; }
.btn-sc--save { background: var(--fix); color: white; }
.btn-sc--save:hover { background: #2563eb; }
.btn-sc--import { background: white; border-color: var(--border); color: var(--text); display: inline-block; }
.btn-sc--import:hover { background: var(--bg); }
.btn-sc--cancel { background: white; border-color: var(--border); color: var(--muted); }
.btn-sc--cancel:hover { background: var(--bg); }
.btn-sc--pdf { background: white; border-color: var(--border); color: var(--total); }
.btn-sc--pdf:hover { background: #ede9fe; border-color: var(--total); }
.btn-sc--pdf.loading { opacity: .6; cursor: wait; }

.scenario-name-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.scenario-name-row input[type=text] { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; outline: none; min-width: 220px; }
.scenario-name-row input[type=text]:focus { border-color: var(--fix); box-shadow: 0 0 0 2px rgba(59,130,246,0.2); }

/* PRICES GRID (2-column on desktop for the prices tab) */
.prices-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.prices-grid .wide { grid-column: 1 / -1; }

/* PRICE INPUTS */
.price-group { display: flex; flex-direction: column; }
.price-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.price-row:last-child { border-bottom: none; }
.price-row label { font-size: 13px; color: var(--text); }
.price-row--model     { grid-template-columns: 1fr auto auto; }
.price-row--subheader { grid-template-columns: 1fr auto auto; padding-bottom: 4px; }
.price-input-wrap { display: flex; align-items: center; gap: 3px; }
.price-currency { font-size: 12px; color: var(--muted); font-weight: 600; min-width: 8px; }
.price-unit     { font-size: 11px; color: var(--muted); white-space: nowrap; }
.price-col-header { font-size: 11px; color: var(--muted); text-align: right; white-space: nowrap; min-width: 82px; }
.price-input {
  width: 82px; padding: 4px 7px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; text-align: right;
  font-variant-numeric: tabular-nums;
  background: white; outline: none;
  -moz-appearance: textfield;
}
.price-input:focus   { border-color: var(--fix); box-shadow: 0 0 0 2px rgba(59,130,246,0.2); }
.price-input:disabled { background: var(--bg); color: var(--muted); cursor: default; }
.price-input::-webkit-inner-spin-button { opacity: 0.5; }

.prices-note { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.5; }
.btn-sc--reset { background: white; border-color: var(--border); color: var(--muted); }
.btn-sc--reset:hover { background: var(--bg); color: var(--text); }

.mini-card--profit-pos { border-top: 3px solid var(--var); }
.mini-card--profit-neg { border-top: 3px solid #ef4444; }
.mini-card--profit-pos .mini-total { color: #059669; }
.mini-card--profit-neg .mini-total { color: #ef4444; }

/* RESPONSIVE */
@media (max-width: 700px) {
  .hero-cards { grid-template-columns: repeat(2, 1fr); }
  .card-row, .card-row--5 { grid-template-columns: repeat(2, 1fr); }
  .slider-row { grid-template-columns: 1fr; }
  .slider-row input[type=range], .slider-row select { width: 100%; }
}

/* Pakete */
.pkg-form { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center; font-size: 13px; }
.pkg-form .price-input { width: 90px; }
.pkg-hint, .pkg-sub { font-size: 11px; color: var(--muted); font-weight: 400; }
.pkg-hint { margin-top: 12px; line-height: 1.5; }
.pkg-tier { display: grid; grid-template-columns: 1fr 110px 28px; gap: 8px; align-items: center; margin-bottom: 8px; }
.pkg-tier input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; width: 100%; box-sizing: border-box; }
.pkg-tier button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.pkg-notes { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px; padding: 8px; font: inherit; font-size: 13px; resize: vertical; }
.pkg-actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.pkg-status { font-size: 12px; color: var(--muted); }
.pkg-status.warn { color: #b45309; }
.pkg-summary { font-size: 13px; line-height: 1.6; margin: 0; }
.pkg-results { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.pkg-card { background: var(--card-bg); border: 1px solid var(--border); border-top: 3px solid var(--var); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.pkg-card.miss { border-top-color: #ef4444; }
.pkg-card h4 { margin: 0; font-size: 15px; }
.pkg-price { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pkg-price small { font-size: 12px; font-weight: 500; color: var(--muted); }
.pkg-pos { font-size: 12px; color: var(--muted); margin: 0; }
.pkg-limits { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; font-size: 13px; }
.pkg-limits input { width: 80px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; text-align: right; font-variant-numeric: tabular-nums; }
.pkg-limits span.u { color: var(--muted); font-size: 11px; margin-left: 4px; }
.pkg-card .detail-table td { font-size: 12px; padding: 3px 0; }
.pkg-margin { font-weight: 700; }
.pkg-margin.ok { color: var(--var); }
.pkg-margin.bad { color: #ef4444; }
.pkg-why { font-size: 12px; line-height: 1.5; margin: 0; color: var(--text); }
.pkg-rates th { text-align: right; font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.pkg-rates th:first-child, .pkg-rates td:first-child { text-align: left; }
.pkg-rates td { text-align: right; }
.pkg-credit-note { font-size: 11px; color: var(--muted); grid-column: 1 / -1; margin-top: -2px; }
.pkg-section-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; }
.pkg-section-head h3 { margin: 0; }
.pkg-card--credit { border-top-color: var(--total); }
.pkg-card--credit.miss { border-top-color: #ef4444; }
.pkg-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pkg-card-head input { font-weight: 700; font-size: 15px; border: 1px solid transparent; border-radius: 6px; padding: 2px 4px; width: 100%; }
.pkg-card-head input:hover, .pkg-card-head input:focus { border-color: var(--border); }
.pkg-card-head button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.pkg-warn { font-size: 11px; color: #ef4444; margin: 0; }
.pkg-kpi th { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px; }
.pkg-kpi th:first-child { text-align: left; }
.pkg-kpi td { padding: 3px 4px; }
.pkg-kpi td:first-child { font-size: 12px; }
.pkg-kpi input { width: 56px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; text-align: right; }
.pkg-select { padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.st { font-weight: 700; }
.st-below { color: #ef4444; }
.st-min { color: #d97706; }
.st-target { color: #10b981; }
.st-veryGood { color: #047857; }
.st-pill { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.st-pill.st-below { background: #fee2e2; }
.st-pill.st-min { background: #fef3c7; }
.st-pill.st-target { background: #d1fae5; }
.st-pill.st-veryGood { background: #a7f3d0; }
.quote-table { table-layout: fixed; width: 100%; }
.quote-table th, .quote-table td.num { text-align: right; }
.quote-table th, .quote-table td { overflow-wrap: anywhere; }
.quote-table th:first-child { text-align: left; }
.quote-table td { vertical-align: top; }
.quote-incl { color: var(--muted); font-size: 11px; margin-right: 4px; }
.quote-ok { color: #10b981; }
.quote-best { background: rgba(16, 185, 129, 0.08); }
.quote-total td { font-size: 14px; }
.pkg-card.warn { border-top-color: #d97706; }
.pkg-tier { grid-template-columns: 1fr 110px 150px 28px; }
.pkg-tier-cap input { width: 52px; }
.pkg-tier-cap .price-unit { white-space: nowrap; font-size: 11px; }
.pkg-tier-desc { grid-column: 1 / -1; width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font: inherit; font-size: 13px; line-height: 1.45; resize: vertical; margin-bottom: 6px; }
.pkg-desc { font-size: 12px; margin: 0; color: var(--text); font-style: italic; }
.has-hint { text-decoration: underline dotted rgba(100,116,139,.55); text-underline-offset: 3px; cursor: help; }
th.has-hint, .mini-label.has-hint, .hero-card-label.has-hint { text-decoration-color: rgba(148,163,184,.6); }
td[title^="Berechnung"], div[title^="Berechnung"], span[title^="Berechnung"] { text-decoration: underline dotted rgba(100,116,139,.45); text-underline-offset: 3px; cursor: help; }
.pkg-fixed input { width: 100%; box-sizing: border-box; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; text-align: right; }
.pkg-fixed td:first-child input { text-align: left; }
.pkg-fixed td { vertical-align: middle; }
.pkg-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.pkg-profile { font-size: 11px; font-weight: 600; color: var(--muted); margin: -4px 0 0; text-transform: uppercase; letter-spacing: .04em; }

/* Pro-Kunde-Basis: Nutzungsregler in einer Reihe über der Kundenpreis-Tabelle */
.mix-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.mix-controls select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.mix-controls button { margin-left: auto; }
.mix-table { table-layout: fixed; width: 100%; }
.mix-table th, .mix-table td.num { text-align: right; }
.mix-table th:first-child { text-align: left; }
.mix-table input { width: 70px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; text-align: right; font-size: 13px; }
.usage-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .usage-row { grid-template-columns: 1fr; } }

/* Anzahl Kunden (Skalierung) */
.base-slider-row { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; }
.base-slider-row label { font-weight: 600; min-width: 120px; }
.base-slider-row input[type=range] { flex: 1; }
.base-slider-row .slider-val { min-width: 40px; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px; }
.base-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.base-card { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 10px 14px; }
.base-card-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .base-cards { grid-template-columns: repeat(2, 1fr); } }

.mix-util { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; }
.mix-util input { width: 64px; text-align: right; }

.quote-sec td { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 12px; border-bottom: 1px solid var(--border); }
#quoteDetailBody tr:not(.total-row) td:last-child { font-weight: 400; }
#quoteDetailBody tr.quote-sec td { text-align: left; font-weight: 700; }
#quoteDetailBody td.st { font-weight: 600 !important; }

.pkg-text-input { width: 140px; text-align: left; text-transform: uppercase; }

.pkg-articles { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-top: 12px; }
.pkg-article-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.pkg-article-len { margin-left: auto; font-size: 11px; color: var(--muted); }
.pkg-article-text { font-size: 13px; line-height: 1.45; }

/* Kopfzeile mit Logo */
.brand { display: flex; align-items: center; gap: 14px; margin: 0; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-sep { width: 1px; height: 26px; background: rgba(227,227,228,.35); }
.brand-app { font-size: 20px; font-weight: 600; color: #E3E3E4; letter-spacing: .02em; }
