/* CORTEX Angebotskalkulator · Tool-spezifisches CSS */

.header-back {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary); text-decoration: none;
  transition: color .2s;
}
.header-back:hover {
  color: var(--text-primary);
}
.header-title {
  display: flex; flex-direction: column; gap: 2px;
}
.header-title h1 {
  font-size: 16px; font-weight: 600; color: var(--text-primary);
}
.header-title .sub {
  font-size: 12px; color: var(--text-secondary);
}
.brand-logo {
  width: 34px; height: 34px;
  background: linear-gradient(145deg, #c27a00, #e8a020);
  border-radius: 9px; box-shadow: 0 2px 8px rgba(194,122,0,.28);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 14px; color: #fff; letter-spacing: -.5px;
}

main { max-width: 1200px; margin: 0 auto; padding: 32px 16px; }

/* ── WORKFLOW HINT ── */
.workflow {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.workflow h3 {
  color: var(--amber);
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}
.workflow-steps {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.ws {
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-primary);
}
.ws strong {
  color: var(--amber);
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
}
.ws-arrow {
  color: var(--text-tertiary);
  font-size: 16px;
}

/* ── INPUT / CONFIG ── */
.input-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.input-card h2 {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 16px;
  font-weight: 600;
}
.input-row {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.ig {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 140px;
}
.ig label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.ig input,
.ig select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  transition: border-color .2s;
}
.ig input:focus,
.ig select:focus {
  outline: none;
  border-color: var(--blue);
}

textarea#json-input, textarea#spr-text {
  width: 100%;
  min-height: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  resize: vertical;
  line-height: 1.6;
  tab-size: 2;
  transition: border-color .2s;
}
textarea#json-input:focus, textarea#spr-text:focus {
  outline: none;
  border-color: var(--blue);
}
textarea#json-input::placeholder, textarea#spr-text::placeholder {
  color: var(--text-tertiary);
  font-family: var(--font);
  font-size: 13px;
  font-style: italic;
}

.btn-load {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #c27a00, #e8a020);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  transition: opacity .2s;
}
.btn-load:hover {
  opacity: 0.9;
}
.btn-load:active {
  opacity: 0.85;
}

/* ── TABS ── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.tab {
  padding: 12px 16px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
  font-family: var(--font);
}
.tab.active {
  color: var(--amber);
  border-bottom-color: var(--amber);
}
.tab:hover:not(.active) {
  color: var(--text-primary);
}
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

/* ── KALKULATION CARDS ── */
.kalk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 700px) {
  .kalk-grid {
    grid-template-columns: 1fr;
  }
}
.kalk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.kalk-card h3 {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
}
.kalk-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.kalk-row:last-child {
  border: none;
}
.kalk-row .val {
  font-weight: 600;
  color: var(--amber);
}
.kalk-row .val.green {
  color: var(--green);
}
.kalk-row .val.red {
  color: var(--rose);
}
.kalk-row .val.orange {
  color: var(--amber);
}
.kalk-row .val.yellow {
  color: var(--amber);
}

/* ── PRICE HIGHLIGHT BOX ── */
.price-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.price-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s;
}
.price-tile.highlight {
  border-color: var(--amber);
  border-width: 2px;
}
.price-tile.mind {
  border-color: var(--border);
}
.price-tile .label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
  font-weight: 500;
}
.price-tile .amount {
  font-size: 32px;
  font-weight: 700;
  color: var(--amber);
}
.price-tile.mind .amount {
  color: var(--text-primary);
  font-size: 28px;
}
.price-tile .sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ── GEWINN SLIDER ── */
.slider-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.slider-section h3 {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 16px;
  font-weight: 600;
}
.slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.slider-row label {
  font-size: 13px;
  color: var(--text-primary);
  min-width: 140px;
  font-weight: 500;
}
input[type=range] {
  flex: 1;
  accent-color: var(--amber);
}
.slider-val {
  font-weight: 700;
  color: var(--amber);
  min-width: 50px;
  text-align: right;
  font-size: 13px;
}
input.gew-num {
  width: 70px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--amber);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

/* ── CHART ── */
canvas#gewinnChart {
  width: 100%;
  height: 200px;
  display: block;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  margin-top: 12px;
}

/* ── STUECKLISTE TABLE ── */
.gruppe-block {
  margin-bottom: 32px;
}
.gruppe-header {
  background: var(--surface2);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  border: 1px solid var(--border-soft) 1px solid var(--border-soft) 0 0;
}
table.st {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  border: 1px solid var(--border-soft);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
table.st th {
  background: var(--surface2);
  padding: 10px 12px;
  text-align: left;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  border-bottom: 1px solid var(--border-soft);
}
table.st td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  color: var(--text-primary);
}
table.st tr:last-child td {
  border-bottom: none;
}
table.st tr:hover td {
  background: var(--surface2);
}
.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  margin-right: 4px;
  text-transform: uppercase;
}
.tag-sp {
  background: var(--blue-bg);
  color: var(--blue);
}
.tag-mh {
  background: var(--green-bg);
  color: var(--green);
}
.tag-lw {
  background: var(--amber-bg);
  color: var(--amber);
}

/* ── KANTEN SVG ── */
.kanten-svg-wrap {
  display: inline-block;
  vertical-align: middle;
}
.kanten-svg-wrap svg {
  display: block;
}

/* ── 3D MÖBEL ── */
#modell-scene {
  perspective: 600px;
  width: 240px;
  height: 260px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cube-wrap {
  width: 180px;
  height: 220px;
  transform-style: preserve-3d;
  transform: rotateX(-18deg) rotateY(-28deg);
  position: relative;
}
.face {
  position: absolute;
  background: rgba(194, 122, 0, .08);
  border: 1.5px solid rgba(194, 122, 0, .25);
  backface-visibility: visible;
}
.face-label {
  position: absolute;
  font-size: 9px;
  color: rgba(194, 122, 0, .4);
  width: 100%;
  text-align: center;
  top: 50%;
  transform: translateY(-50%);
}
.shelf-line {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 1.5px;
  background: rgba(194, 122, 0, .35);
}
.door-face {
  position: absolute;
  background: rgba(194, 122, 0, .1);
  border: 1.5px solid rgba(194, 122, 0, .35);
}
.modell-info {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 12px;
}

/* ── ANGEBOT ── */
.angebot-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.angebot-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.angebot-meta {
  font-size: 12px;
  color: var(--text-secondary);
}
.pos-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.pos-block h4 {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-weight: 600;
}
.pos-block .desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.pos-block .price-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.angebot-total {
  background: var(--surface);
  border: 2px solid var(--amber);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.angebot-total .t-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.angebot-total .t-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--amber);
}
.mind-note {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.btn-xml {
  margin-top: 16px;
  padding: 11px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--amber);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.btn-xml:hover {
  background: var(--surface2);
  border-color: var(--amber);
}
.btn-xml2 {
  margin-left: 8px;
  color: var(--green);
  border-color: var(--border);
}
.btn-xml2:hover {
  border-color: var(--green);
  background: var(--green-bg);
}

/* ── WARN / INFO ── */
.warn {
  background: var(--rose-bg);
  border: 1px solid var(--rose);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--rose);
  margin-bottom: 12px;
}
.info-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  background: var(--surface2);
  color: var(--text-secondary);
  font-weight: 500;
}

/* Sprachfeld: dieselbe Optik wie das JSON-Feld, aber flacher — dort steht ein
   Satz, keine Stückliste. */
textarea#spr-text { min-height: 90px; font-family: var(--font); font-size: 14px; }
