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

:root {
    --cart-width: 340px;
    --header-height: 48px;
    --bg: #f3f4f6;
    --card: #fff;
    --card-hover: #fafbfc;
    --border: #e5e7eb;
    --text: #1f2937;
    --text-light: #6b7280;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37,99,235,0.08);
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --transition: 0.15s ease;
}

/* ─── Dark Mode ───────────────────────────────────────── */
body.dark {
    --bg: #111827;
    --card: #1f2937;
    --card-hover: #263244;
    --border: #374151;
    --text: #f3f4f6;
    --text-light: #9ca3af;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59,130,246,0.12);
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
}
body.dark .header { background: #0a0f1a; }
body.dark .firma-breakdown,
body.dark .cart-summary { background: #151f2e; }
body.dark .badge-einmalig { background: #064e3b; color: #6ee7b7; }
body.dark .badge-monatlich { background: #1e3a5f; color: #93c5fd; }
body.dark .badge-stündlich { background: #451a03; color: #fcd34d; }
body.dark .bundle-card { background: linear-gradient(135deg, #1a2744 0%, #1e2d4a 100%); }
body.dark .modal { background: #1f2937; }
body.dark .toast { background: #f3f4f6; color: #111827; }

html { font-size: 13px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
    transition: background 0.3s, color 0.3s;
}

/* ─── Header ─────────────────────────────────────────── */
.header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: #111827; color: #fff;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 100%; padding: 0 16px;
}
.logo {
    font-size: 1.1rem; font-weight: 700; letter-spacing: -0.3px;
    cursor: default; user-select: none;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
    background: none; border: 1px solid rgba(255,255,255,0.2);
    color: #fff; width: 32px; height: 32px; border-radius: 6px;
    cursor: pointer; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.icon-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.4); }

/* ─── Internal Banner ─────────────────────────────────── */
.internal-banner {
    background: #dc2626; color: #fff;
    text-align: center; padding: 6px 16px;
    font-size: 0.82rem; font-weight: 700;
    letter-spacing: 1px;
    position: fixed; top: var(--header-height); left: 0; right: 0;
    z-index: 99;
}
.internal-close {
    background: none; border: none; color: #fff;
    font-size: 1.2rem; cursor: pointer;
    margin-left: 12px; vertical-align: middle;
}
body.internal-active .layout { margin-top: calc(var(--header-height) + 32px); }
body.internal-active .tab-bar { top: calc(var(--header-height) + 32px); }
body.internal-active .cart { top: calc(var(--header-height) + 32px); }

/* ─── Layout ─────────────────────────────────────────── */
.layout {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}
.main-content {
    flex: 1;
    padding: 12px 16px;
    margin-right: var(--cart-width);
    min-width: 0;
}

/* ─── Tab Bar ────────────────────────────────────────── */
.tab-bar {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 8px 0; margin-bottom: 8px;
    position: sticky; top: var(--header-height);
    background: var(--bg); z-index: 10;
}
.tab {
    padding: 5px 12px; border: 1px solid var(--border);
    border-radius: 20px; background: var(--card);
    color: var(--text-light); font-size: 0.85rem;
    cursor: pointer; transition: all var(--transition);
    white-space: nowrap; font-weight: 500;
}
.tab:hover { border-color: var(--primary); color: var(--primary); }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab.multi-active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.tab .tab-count {
    display: inline-block; margin-left: 4px;
    background: rgba(0,0,0,0.1); padding: 0 5px;
    border-radius: 8px; font-size: 0.75rem;
}
.tab.active .tab-count { background: rgba(255,255,255,0.25); }

/* ─── Toolbar ────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.search-input {
    flex: 1; max-width: 300px; padding: 6px 12px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.9rem; background: var(--card); color: var(--text);
}
.search-input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.result-count { font-size: 0.8rem; color: var(--text-light); }

/* ─── Setup Panel ───────────────────────────────────── */
.setup-panel {
    display: flex; align-items: center; justify-content: center;
    min-height: 50vh; text-align: center;
}
.setup-inner { max-width: 500px; padding: 40px 20px; }
.setup-inner h2 { font-size: 1.4rem; margin-bottom: 8px; }
.setup-hint { color: var(--text-light); font-size: 0.9rem; margin-bottom: 24px; }
.setup-presets {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap; justify-content: center; margin-bottom: 24px;
}
.setup-label { font-size: 0.78rem; color: var(--text-light); }
.preset-btn {
    padding: 6px 14px; border: 1px solid var(--border); border-radius: 20px;
    background: var(--card); color: var(--text); font-size: 0.82rem;
    cursor: pointer; transition: all var(--transition); font-weight: 500;
}
.preset-btn:hover { border-color: var(--primary); color: var(--primary); }
.preset-btn.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.setup-go-btn { padding: 10px 32px; font-size: 0.95rem; border-radius: 8px; }
.setup-effort {
    display: flex; gap: 10px; justify-content: center;
    margin-top: 32px; opacity: 0.35; transition: opacity 0.3s;
}
.setup-effort:hover { opacity: 0.8; }
.effort-dot {
    width: 10px; height: 10px; border-radius: 50%; border: none;
    background: var(--text-light); cursor: pointer;
    transition: all var(--transition); padding: 0;
}
.effort-dot:hover { transform: scale(1.4); }
.effort-dot.active { background: var(--primary); transform: scale(1.3); }

/* Tabs inside setup panel */
.setup-inner .tab-bar {
    justify-content: center;
    position: static;
    margin-bottom: 24px;
    padding: 0;
}

/* ─── Product Grid ───────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

/* ─── Product Card ───────────────────────────────────── */
.product-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px;
    transition: box-shadow var(--transition); font-size: 0.85rem;
}
.product-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.card-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 4px; gap: 8px;
}
.card-name {
    font-size: 0.92rem; font-weight: 600;
    display: flex; align-items: center; gap: 6px;
}
.card-info-btn {
    background: none; border: 1px solid var(--border);
    border-radius: 50%; width: 20px; height: 20px;
    font-size: 0.7rem; cursor: pointer; color: var(--text-light);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all var(--transition);
}
.card-info-btn:hover {
    border-color: var(--primary); color: var(--primary);
    background: var(--primary-light);
}
.badge {
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.3px;
    padding: 1px 6px; border-radius: 3px; font-weight: 600; white-space: nowrap;
}
.badge-einmalig { background: #dcfce7; color: #166534; }
.badge-monatlich { background: #dbeafe; color: #1e40af; }
.badge-stündlich { background: #fef3c7; color: #92400e; }
.card-desc {
    font-size: 0.8rem; color: var(--text-light);
    margin-bottom: 8px; line-height: 1.4;
}

/* Variants */
.variant-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.variant-btn {
    padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px;
    background: var(--card); cursor: pointer; font-size: 0.78rem;
    transition: all var(--transition); line-height: 1.3; color: var(--text);
}
.variant-btn:hover { border-color: var(--primary); color: var(--primary); }
.variant-btn.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.variant-btn .v-price { display: block; font-size: 0.68rem; opacity: 0.8; }

/* Tooltip */
.variant-btn[data-tooltip] { position: relative; }
.variant-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute; bottom: calc(100% + 6px); left: 50%;
    transform: translateX(-50%);
    background: #1f2937; color: #fff;
    padding: 4px 8px; border-radius: 4px;
    font-size: 0.7rem; white-space: nowrap; z-index: 10;
    pointer-events: none;
}

/* Card Actions */
.card-actions { display: flex; align-items: center; gap: 6px; }
.qty-input {
    width: 48px; padding: 4px 6px;
    border: 1px solid var(--border); border-radius: 4px;
    font-size: 0.85rem; text-align: center;
    background: var(--card); color: var(--text);
}
.qty-input:focus { outline: none; border-color: var(--primary); }
.btn-add {
    flex: 1; padding: 5px 10px;
    background: var(--primary); color: #fff; border: none;
    border-radius: 4px; cursor: pointer; font-size: 0.8rem; font-weight: 600;
    transition: background var(--transition);
}
.btn-add:hover { background: var(--primary-hover); }
.btn-add:disabled { opacity: 0.4; cursor: not-allowed; }

/* Complexity Slider */
.complexity-row {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 6px; font-size: 0.75rem; color: var(--text-light);
}
.complexity-row input[type="range"] { flex: 1; accent-color: var(--primary); height: 4px; }
.complexity-val {
    font-weight: 600; color: var(--text); min-width: 36px; text-align: right;
}

/* Questions */
.card-questions {
    margin-top: 8px; padding-top: 8px;
    border-top: 1px dashed var(--border);
}
.question-item { margin-bottom: 6px; }
.question-item label {
    display: block; font-size: 0.75rem; font-weight: 600;
    margin-bottom: 2px; color: var(--text);
}
.question-item select, .question-item input[type="number"] {
    padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px;
    font-size: 0.8rem; width: 100%; background: var(--card); color: var(--text);
}
.question-item select:focus, .question-item input:focus {
    outline: none; border-color: var(--primary);
}

/* Dependencies */
.dep-hint {
    font-size: 0.72rem; color: var(--warning);
    margin-top: 6px; display: flex; align-items: center; gap: 4px;
}

/* ─── Bundle Card ────────────────────────────────────── */
.bundle-card {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    border-color: var(--primary);
}
.bundle-discount {
    display: inline-block; background: var(--primary); color: #fff;
    padding: 1px 8px; border-radius: 3px; font-size: 0.7rem; font-weight: 700;
}
.bundle-items { list-style: none; margin: 6px 0; font-size: 0.78rem; }
.bundle-items li {
    padding: 2px 0 2px 14px; position: relative; color: var(--text-light);
}
.bundle-items li::before {
    content: "\2713"; position: absolute; left: 0;
    color: var(--success); font-weight: 700; font-size: 0.7rem;
}
.bundle-pricing {
    display: flex; align-items: center; gap: 8px; margin: 6px 0;
}
.old-price { text-decoration: line-through; color: var(--text-light); font-size: 0.82rem; }
.new-price { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.bundle-target { font-size: 0.7rem; color: var(--text-light); font-style: italic; }

/* ─── Cart ───────────────────────────────────────────── */
.cart {
    background: var(--card);
    border-left: 1px solid var(--border);
    position: fixed; top: var(--header-height); right: 0; bottom: 0;
    width: var(--cart-width);
    display: flex; flex-direction: column; z-index: 50;
    font-size: 0.82rem;
}
.cart-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.cart-header h2 { font-size: 1rem; }
.cart-count { font-size: 0.75rem; color: var(--text-light); }

/* Customer Name */
.customer-name-row { padding: 6px 14px; border-bottom: 1px solid var(--border); }
.customer-name-input {
    width: 100%; padding: 5px 10px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.82rem; background: var(--card); color: var(--text);
    font-weight: 500;
}
.customer-name-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }
.customer-name-input::placeholder { color: var(--text-light); font-weight: 400; }

/* Phase Bar */
.phase-bar {
    display: flex; gap: 4px; padding: 8px 14px;
    border-bottom: 1px solid var(--border);
}
.phase-tab {
    padding: 3px 8px; border: 1px solid var(--border);
    border-radius: 12px; background: transparent;
    color: var(--text-light); font-size: 0.68rem;
    cursor: pointer; transition: all var(--transition);
    font-weight: 500;
}
.phase-tab:hover { border-color: var(--primary); color: var(--primary); }
.phase-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Scrollable cart body */
.cart-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.cart-items { padding: 8px 14px; }
.cart-empty {
    color: var(--text-light); font-size: 0.82rem;
    text-align: center; padding: 24px 0;
}

/* Cart Item */
.cart-item {
    display: flex; align-items: flex-start;
    padding: 8px 0; border-bottom: 1px solid var(--border);
    animation: slideIn 0.2s ease;
    cursor: grab; transition: opacity 0.2s, background 0.2s;
}
.cart-item:active { cursor: grabbing; }
.cart-item.dragging { opacity: 0.4; }
.cart-item.drag-over { border-top: 2px solid var(--primary); }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.8rem; font-weight: 600; }
.cart-item-detail { font-size: 0.72rem; color: var(--text-light); }
.cart-item-hours {
    font-size: 0.68rem; color: var(--text-light); font-style: italic;
}
.cart-item-complexity {
    font-size: 0.68rem; color: var(--warning); font-style: italic;
}
.cart-item-phase-select {
    padding: 1px 4px; border: 1px solid var(--border); border-radius: 3px;
    font-size: 0.68rem; background: var(--card); color: var(--text);
    margin-top: 2px;
}
.cart-item-right {
    display: flex; flex-direction: column; align-items: flex-end;
    margin-left: 8px; gap: 2px;
}
.cart-item-price {
    font-size: 0.82rem; font-weight: 600; white-space: nowrap;
}
.cart-item-remove {
    background: none; border: none; color: var(--danger);
    cursor: pointer; font-size: 0.9rem; padding: 0 2px;
    opacity: 0.5; transition: opacity var(--transition);
}
.cart-item-remove:hover { opacity: 1; }

/* Cart Item Comment */
.cart-item-comment {
    width: 100%; margin-top: 4px; padding: 3px 6px;
    border: 1px solid var(--border); border-radius: 3px;
    font-size: 0.72rem; font-family: inherit;
    background: var(--card); color: var(--text);
    resize: vertical; min-height: 22px; max-height: 80px;
    line-height: 1.3;
}
.cart-item-comment:focus { outline: none; border-color: var(--primary); }
.cart-item-comment::placeholder { color: var(--text-light); }

/* Cart Quantity Controls */
.cart-item-qty {
    display: inline-flex; align-items: center; gap: 2px;
    margin-top: 2px;
}
.qty-btn {
    width: 18px; height: 18px; border: 1px solid var(--border);
    border-radius: 3px; background: var(--card); color: var(--text);
    font-size: 0.72rem; cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition); line-height: 1;
}
.qty-btn:hover { border-color: var(--primary); color: var(--primary); }
.cart-item-qty span { font-size: 0.72rem; font-weight: 600; min-width: 16px; text-align: center; }

/* Hours Estimate */
.hours-estimate {
    padding: 8px 14px; border-top: 1px solid var(--border);
    background: var(--primary-light);
}
.hours-row {
    display: flex; justify-content: space-between;
    font-size: 0.82rem; font-weight: 600;
}
.hours-disclaimer {
    font-size: 0.68rem; color: var(--text-light);
    margin-top: 4px; line-height: 1.4;
    font-style: italic;
}

/* Margin View (Internal) */
.margin-view {
    padding: 8px 14px; border-top: 2px solid var(--danger);
    background: #fef2f2;
}
body.dark .margin-view { background: #2d1515; }
.margin-view h3 {
    font-size: 0.75rem; margin-bottom: 6px; color: var(--danger);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.margin-row {
    display: flex; justify-content: space-between;
    padding: 2px 0; font-size: 0.78rem;
}
.margin-row.margin-good span:last-child { color: var(--success); font-weight: 700; }
.margin-row.margin-bad span:last-child { color: var(--danger); font-weight: 700; }

/* Firma Breakdown */
.firma-breakdown {
    padding: 8px 14px; border-top: 1px solid var(--border);
    background: #f9fafb;
}
body.dark .firma-breakdown { background: #151f2e; }
.firma-breakdown h3 {
    font-size: 0.75rem; margin-bottom: 6px; color: var(--text-light);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.firma-bar-row {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 4px; font-size: 0.75rem;
}
.firma-bar-label { width: 110px; font-weight: 500; text-align: right; flex-shrink: 0; font-size: 0.72rem; }
.firma-bar-track { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.firma-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.firma-bar-fill.marketing { background: #f59e0b; }
.firma-bar-fill.webdesign { background: #8b5cf6; }
.firma-bar-fill.peoplesquare { background: #3b82f6; }
.firma-bar-pct { width: 44px; font-weight: 600; font-size: 0.72rem; }

/* Global Notes */
.global-notes { padding: 8px 14px; border-top: 1px solid var(--border); }
.global-notes-input {
    width: 100%; padding: 5px 8px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.78rem; font-family: inherit;
    background: var(--card); color: var(--text);
    resize: vertical; min-height: 36px; max-height: 120px;
    line-height: 1.4;
}
.global-notes-input:focus { outline: none; border-color: var(--primary); }
.global-notes-input::placeholder { color: var(--text-light); }

/* Cart Summary */
.cart-summary {
    padding: 10px 14px; border-top: 2px solid var(--border);
    background: #f9fafb;
}
body.dark .cart-summary { background: #151f2e; }
.summary-row {
    display: flex; justify-content: space-between;
    padding: 2px 0; font-size: 0.82rem;
}
.summary-row.total { font-weight: 700; color: var(--primary); font-size: 0.88rem; }
.pm-row { margin: 6px 0; }
.pm-row label { font-size: 0.78rem; display: block; margin-bottom: 2px; }
.pm-row input[type="range"] { width: 100%; accent-color: var(--primary); }
.pm-amount { font-size: 0.72rem; color: var(--text-light); }

.discount-row { margin: 6px 0; }
.discount-row label { font-size: 0.78rem; display: block; margin-bottom: 2px; }
.discount-row input[type="range"] { width: 100%; accent-color: var(--primary); }
.cart-summary hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

.cart-actions {
    padding: 8px 14px 14px;
    display: flex; flex-direction: column; gap: 5px;
}
.btn {
    padding: 7px 12px; border: none; border-radius: var(--radius);
    cursor: pointer; font-size: 0.8rem; font-weight: 600; text-align: center;
    transition: background var(--transition);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { opacity: 0.8; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

/* ─── Modal ──────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 200;
}
.modal {
    background: var(--card); border-radius: 8px;
    padding: 20px; max-width: 480px; width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    color: var(--text);
}
.modal h3 { font-size: 1rem; margin-bottom: 8px; }
.modal p { font-size: 0.88rem; color: var(--text-light); margin-bottom: 14px; line-height: 1.5; }
.modal-actions { display: flex; gap: 8px; }
.modal-close {
    position: absolute; top: 12px; right: 12px;
    background: none; border: none; font-size: 1.3rem;
    cursor: pointer; color: var(--text-light);
}
.modal-detail {
    position: relative; max-width: 560px; max-height: 80vh; overflow-y: auto;
}
.modal-detail h3 { font-size: 1.1rem; }
.modal-detail .detail-billing { margin-bottom: 8px; }
.modal-detail .detail-desc {
    font-size: 0.88rem; color: var(--text-light);
    margin-bottom: 12px; line-height: 1.6;
}
.modal-detail .detail-section { margin-bottom: 12px; }
.modal-detail .detail-section h4 {
    font-size: 0.82rem; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-light); margin-bottom: 6px;
}
.modal-detail .detail-list { list-style: none; font-size: 0.85rem; }
.modal-detail .detail-list li { padding: 3px 0 3px 18px; position: relative; }
.modal-detail .detail-list li::before {
    content: "\2192"; position: absolute; left: 0; color: var(--primary);
}
.modal-detail .detail-variants { display: flex; flex-wrap: wrap; gap: 8px; }
.modal-detail .detail-variant-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 8px 12px; min-width: 100px;
}
.modal-detail .detail-variant-card strong { display: block; font-size: 0.9rem; }
.modal-detail .detail-variant-card .dv-price { color: var(--primary); font-weight: 700; }
.modal-detail .detail-variant-card .dv-label { font-size: 0.75rem; color: var(--text-light); }
.modal-detail .detail-variant-card .dv-hours { font-size: 0.7rem; color: var(--text-light); font-style: italic; }
.modal-detail .detail-questions { font-size: 0.85rem; }
.modal-detail .detail-questions li { padding: 3px 0 3px 18px; position: relative; }
.modal-detail .detail-questions li::before {
    content: "?"; position: absolute; left: 0; color: var(--warning); font-weight: 700;
}

/* ─── Cart Toggle (Mobile) ───────────────────────────── */
.cart-toggle {
    display: none; position: fixed; bottom: 16px; right: 16px;
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--primary); color: #fff; border: none;
    cursor: pointer; box-shadow: 0 4px 12px rgba(37,99,235,0.4);
    z-index: 200; font-size: 1.2rem;
}
.cart-badge {
    position: absolute; top: -3px; right: -3px;
    background: var(--danger); color: #fff;
    width: 18px; height: 18px; border-radius: 50%;
    font-size: 0.65rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* ─── Toast ──────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1f2937; color: #fff;
    padding: 8px 20px; border-radius: var(--radius);
    font-size: 0.82rem; z-index: 1000; opacity: 0;
    transition: all 0.25s ease; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ─── Snapshot Controls ──────────────────────────────── */
.snapshot-controls { display: flex; align-items: center; gap: 4px; }
.snapshot-code-input {
    width: 80px; padding: 4px 8px; border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px; background: rgba(255,255,255,0.1); color: #fff;
    font-size: 0.8rem; text-align: center; letter-spacing: 1px;
    font-weight: 600;
}
.snapshot-code-input::placeholder { color: rgba(255,255,255,0.4); font-weight: 400; }
.snapshot-code-input:focus { outline: none; border-color: var(--primary); background: rgba(255,255,255,0.15); }

/* ─── Print Detail Sections ──────────────────────────── */
.print-detail-section { display: none; }

/* ─── Print ──────────────────────────────────────────── */
@media print {
    .header, .tab-bar, .toolbar, .product-grid, .cart-toggle,
    .cart-actions, .discount-row, .pm-row, .toast, .main-content, .modal-overlay,
    .cart-item-remove, .cart-item-phase-select, .phase-bar,
    .margin-view, .internal-banner, .setup-panel,
    .cart-item-qty, .qty-btn { display: none !important; }
    .cart {
        position: static; width: 100%; border: none;
        font-size: 11pt;
    }
    .cart-scroll { overflow: visible; }
    .layout { display: block; margin-top: 0; }
    .cart-header h2 { font-size: 14pt; }
    .cart-item { break-inside: avoid; cursor: default; }
    .customer-name-row { border: none; padding: 4pt 0; }
    .customer-name-input { border: none; padding: 0; font-size: 12pt; font-weight: 600; }
    .cart-item-comment { border: none; padding: 0; font-size: 9pt; color: #555; resize: none; }
    body::before {
        content: "Angebots-Kalkulation";
        display: block; font-size: 16pt; font-weight: 700;
        padding: 10pt 0; border-bottom: 2pt solid #333; margin-bottom: 12pt;
    }
    .hours-estimate { background: none; border-top: 1pt solid #ccc; }
    .hours-disclaimer { font-size: 8pt; }

    /* Print Detail Sections */
    .print-detail-section { display: block !important; page-break-before: always; }
    .print-detail-section h2 {
        font-size: 14pt; border-bottom: 2pt solid #333;
        padding-bottom: 6pt; margin-bottom: 12pt;
    }
    .print-item-detail { break-inside: avoid; margin-bottom: 14pt; padding-bottom: 10pt; border-bottom: 0.5pt solid #ddd; }
    .print-item-detail h4 { font-size: 11pt; border-bottom: 0.5pt solid #ccc; padding-bottom: 4pt; margin-bottom: 6pt; }
    .print-item-detail p { font-size: 9pt; color: #333; line-height: 1.5; margin-bottom: 6pt; }
    .print-item-detail ul { font-size: 9pt; padding-left: 16pt; margin-bottom: 6pt; }
    .print-item-detail li { padding: 1pt 0; }
    .print-item-detail .print-comment { font-size: 9pt; color: #555; font-style: italic; margin-top: 4pt; }
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
    .main-content { margin-right: 0; }
    .cart {
        position: fixed; top: auto; bottom: 0; left: 0; right: 0;
        width: 100%; max-height: 65vh;
        transform: translateY(100%); transition: transform 0.3s ease;
        border-top: 2px solid var(--border); border-left: none;
        border-radius: 8px 8px 0 0;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
    }
    .cart.open { transform: translateY(0); }
    .cart-toggle { display: flex; align-items: center; justify-content: center; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}

@media (max-width: 500px) {
    .product-grid { grid-template-columns: 1fr; }
    .tab-bar { gap: 4px; }
    .tab { font-size: 0.78rem; padding: 4px 8px; }
}
