/**
 * Style V2 - CreateQuotation Redesign
 *
 * Extends style.css. Loaded after style.css in index.html.
 * Hero Upload, Part Card V2, Chip Selectors, Sidebar, Responsive.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes drawPath {
    to { stroke-dashoffset: 0; }
}

@keyframes pulse-subtle {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); }
}

/* ── Layout principal ── */
.main-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px;
    display: grid;
    gap: 20px;
    transition: grid-template-columns 0.3s ease;
}

.main-layout.has-parts {
    grid-template-columns: 1fr 280px;
}

.main-layout.empty-state {
    grid-template-columns: 1fr;
}

/* ── Hero Upload (empty state) ── */
.hero-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
    animation: fadeUp 0.6s ease-out;
}

.hero-upload__title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    font-family: 'DM Sans', 'Roboto', sans-serif;
    margin-bottom: 10px;
}

.hero-upload__subtitle {
    color: #6b7b8d;
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
}

.hero-upload__dropzone {
    width: 100%;
    max-width: 600px;
    border: 2px dashed #d0d5dd;
    border-radius: 16px;
    background: #fafbfc;
    padding: 50px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    animation: fadeUp 0.8s ease-out;
}

.hero-upload__dropzone:hover,
.hero-upload__dropzone.dragover {
    border-color: #c8850f;
    background: #fef9f0;
    transform: scale(1.01);
    box-shadow: 0 8px 30px rgba(200,133,15,0.12);
}

.hero-upload__icon-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c8850f 0%, #a06b0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 20px rgba(200,133,15,0.25);
}

.hero-upload__format-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: #f0f2f5;
    color: #5a6a7a;
    letter-spacing: 0.5px;
}

.hero-upload__steps {
    display: flex;
    gap: 40px;
    margin-top: 50px;
    opacity: 0.7;
    animation: fadeUp 1s ease-out;
}

.hero-upload__step {
    text-align: center;
    position: relative;
}

.hero-upload__step-icon { font-size: 24px; margin-bottom: 6px; }
.hero-upload__step-label { font-size: 11px; color: #8896a6; font-weight: 500; }
.hero-upload__step-arrow {
    position: absolute;
    right: -28px;
    top: 12px;
    color: #d0d5dd;
    font-size: 14px;
}

/* ── Part Card V2 ── */
.part-card-v2 {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e8ecf0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    overflow: hidden;
    animation: fadeUp 0.5s ease-out;
    margin-bottom: 16px;
}

/* Header colapsable */
.part-card-v2__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f8f9fb;
    border-bottom: 1px solid #eef1f4;
    cursor: pointer;
    transition: background 0.15s;
    gap: 12px;
}

.part-card-v2__header:hover {
    background: #f0f2f5;
}

.part-card-v2__header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.part-card-v2__header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.part-card-v2__header-prices {
    text-align: right;
}

/* Thumbnail wrapper in header */
.part-card-v2__thumb {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    background: #f0f2f5;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #e2e6ea;
}

.part-card-v2__thumb canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.part-card-v2__header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.part-card-v2__filename {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.part-card-v2__dimensions-hint {
    font-size: 12px;
    color: #8896a6;
}

.part-card-v2__header-price {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
}

.part-card-v2__header-unit-price {
    font-size: 11px;
    color: #8896a6;
}

.part-card-v2__duplicate {
    background: none;
    border: none;
    color: #c0c8d0;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}

.part-card-v2__duplicate:hover {
    color: #f97316;
    background: #fff7ed;
}

.part-card-v2__delete {
    background: none;
    border: none;
    color: #c0c8d0;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}

.part-card-v2__delete:hover {
    color: #e53e3e;
    background: #fff5f5;
}

.part-card-v2__toggle {
    transition: transform 0.2s;
    font-size: 12px;
    color: #8896a6;
}

.part-card-v2__toggle.collapsed {
    transform: rotate(-90deg);
}

/* Body expandido: single column */
.part-card-v2__body {
    padding: 16px 20px;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

.part-card-v2__body.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0 20px;
}

/* Geometry badges — compact inline row */
.part-card-v2__geometry-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef1f4;
}

.part-card-v2__geo-badge-inline {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f4f6f8;
    border-radius: 8px;
    font-size: 12px;
}

.part-card-v2__geo-badge-icon { font-size: 13px; }

.part-card-v2__geo-badge-label {
    color: #8896a6;
    font-weight: 500;
}

.part-card-v2__geo-badge-value {
    font-weight: 600;
    color: #2d3748;
}

/* ── Scale button — small icon inside the dimensions badge ── */
.scale-part-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 2px;
    margin-left: 4px;
    color: #8896a6;
    opacity: 0.5;
    transition: opacity 0.15s, color 0.15s;
    font-size: 11px;
    line-height: 1;
}
.scale-part-btn:hover {
    opacity: 1;
    color: #3b82f6;
}

/* ── DXF Edit button — small icon next to scale button ── */
.dxf-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 2px;
    margin-left: 4px;
    color: #8896a6;
    opacity: 0.5;
    transition: opacity 0.15s, color 0.15s;
    font-size: 11px;
    line-height: 1;
}
.dxf-edit-btn:hover {
    opacity: 1;
    color: #a855f7;
}

/* ── Scale popover panel ── */
.scale-popover {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 12px 16px;
    margin-bottom: 12px;
    animation: scalePopoverIn 0.15s ease-out;
}
@keyframes scalePopoverIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.scale-popover__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.scale-popover__title {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
}
.scale-popover__close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #a0aec0;
    padding: 0 4px;
}
.scale-popover__close:hover { color: #2d3748; }

.scale-popover__body {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.scale-popover__row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.scale-popover__row label {
    font-size: 12px;
    color: #8896a6;
    min-width: 40px;
    font-weight: 500;
}
.scale-popover__input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}
.scale-popover__input-group input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    text-align: right;
    font-family: inherit;
}
.scale-popover__input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.scale-popover__input-group span {
    font-size: 12px;
    color: #8896a6;
}

.scale-popover__footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
}
.btn-scale-apply {
    padding: 5px 14px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-scale-apply:hover { background: #2563eb; }
.btn-scale-apply:disabled { opacity: 0.6; cursor: wait; }

.btn-scale-cancel {
    padding: 5px 14px;
    background: #fff;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-scale-cancel:hover { background: #f8fafc; }

/* Config sections — 2x2 grid for compactness */
.part-card-v2__config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    margin-bottom: 14px;
}

.config-section {
    margin-bottom: 20px;
}

.config-section__label {
    font-size: 12px;
    font-weight: 700;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

/* Config dropdowns — 2x2 grid */
.config-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.config-section-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.config-section-compact__label {
    font-size: 11px;
    font-weight: 700;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.config-select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e2e6ea;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s;
    appearance: auto;
}

.config-select:focus {
    outline: none;
    border-color: #c8850f;
    box-shadow: 0 0 0 3px rgba(200, 133, 15, 0.1);
}

.config-select:hover {
    border-color: #c8850f;
}

/* Procesos extra (checkboxes inline) */
.processes-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.process-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1.5px solid #e2e6ea;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.process-chip.active {
    border-color: #c8850f;
    background: #fef6e8;
    color: #9a6a0a;
}

.process-chip input[type="checkbox"] {
    display: inline-block;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #c8850f;
}

/* Quantity stepper (in header) */
.quantity-stepper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.quantity-stepper__btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #e2e6ea;
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.quantity-stepper__btn:hover {
    border-color: #c8850f;
    background: #fef6e8;
    color: #c8850f;
}

.quantity-stepper__input {
    width: 90px;
    text-align: center;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid #e2e6ea;
    font-size: 14px;
    font-weight: 700;
    font-family: 'DM Mono', monospace;
    color: #2d3748;
}

.quantity-stepper__input:focus {
    outline: none;
    border-color: #c8850f;
}

/* ── Dropzone compacta ── */
.dropzone-compact {
    border: 2px dashed #d0d5dd;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafbfc;
}

.dropzone-compact:hover {
    border-color: #c8850f;
    background: #fef9f0;
}

.dropzone-compact__plus {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e8ecf0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #8896a6;
}

/* ── Sidebar sticky ── */
.order-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
    animation: fadeUp 0.4s ease-out;
}

.order-sidebar__card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e8ecf0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.order-sidebar__card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eef1f4;
    background: #f8f9fb;
}

.order-sidebar__card-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.order-sidebar__card-body {
    padding: 16px 20px;
}

.order-sidebar__part-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #4a5568;
    padding: 8px 0;
    border-bottom: 1px solid #f4f5f7;
}

.order-sidebar__part-row:last-of-type {
    border-bottom: none;
}

.order-sidebar__part-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
    font-weight: 500;
}

.order-sidebar__part-price {
    font-weight: 600;
}

.order-sidebar__subtotal-row {
    border-top: 2px solid #1a1a2e;
    margin-top: 12px;
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.order-sidebar__subtotal-label {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
}

.order-sidebar__subtotal-value {
    font-size: 18px;
    font-weight: 800;
    color: #1a1a2e;
}

.order-sidebar__note {
    font-size: 11px;
    color: #a0aab4;
    margin-top: 4px;
}

.order-sidebar__continue-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #5a8f3c 0%, #4a7830 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(90,143,60,0.3);
    transition: all 0.2s;
    font-family: inherit;
}

.order-sidebar__continue-btn:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 20px rgba(90,143,60,0.35);
}

.order-sidebar__continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.order-sidebar__action-card {
    margin-top: 12px;
    padding: 14px 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8ecf0;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.order-sidebar__action-card:hover {
    border-color: #c8850f;
    background: #fffcf5;
}

.order-sidebar__action-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
}

.order-sidebar__action-subtitle {
    font-size: 11px;
    color: #a0aab4;
}

/* ── Bulk Edit Toolbar ── */
.bulk-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fef6e8;
    border: 1.5px solid #c8850f;
    border-radius: 12px;
    margin-bottom: 12px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 16px;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
}

.bulk-toolbar.visible {
    max-height: 300px;
    opacity: 1;
    padding: 12px 16px;
}

.bulk-toolbar__row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bulk-toolbar__row + .bulk-toolbar__row {
    margin-top: 8px;
}

.bulk-toolbar__count {
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    min-width: 80px;
}

.bulk-toolbar__link-btn {
    background: none;
    border: none;
    color: #c8850f;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 2px 4px;
}

.bulk-toolbar__link-btn:hover {
    color: #a06b0a;
}

.bulk-toolbar__controls {
    gap: 8px;
}

.bulk-toolbar__processes {
    gap: 8px;
}

.bulk-toolbar__field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.bulk-toolbar__label {
    font-size: 10px;
    font-weight: 700;
    color: #78716c;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bulk-toolbar__select {
    padding: 6px 8px;
    border: 1px solid #d6d3d1;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background: #fff;
    color: #2d3748;
    cursor: pointer;
    min-width: 0;
    width: 100%;
}

.bulk-toolbar__select:focus {
    outline: none;
    border-color: #c8850f;
    box-shadow: 0 0 0 2px rgba(200, 133, 15, 0.15);
}

.bulk-toolbar__select--sm {
    max-width: 140px;
}

.bulk-toolbar__field--qty {
    max-width: 110px;
}

.bulk-toolbar__field--qty input {
    text-align: center;
}

.bulk-toolbar__field--qty input::placeholder {
    font-size: 11px;
    text-align: left;
}

.bulk-toolbar__actions {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    padding-top: 14px;
    flex-shrink: 0;
}

/* ── Parts toolbar (collapse/expand) ── */
.parts-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    margin-bottom: 8px;
}
.parts-toolbar__count {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-right: auto;
}
.parts-toolbar__btn {
    background: none;
    border: 1px solid #e2e6ea;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s;
}
.parts-toolbar__btn:hover {
    border-color: #94a3b8;
    color: #1e293b;
    background: #f8fafc;
}

/* ── Drag handle ── */
.part-card-v2__drag-handle {
    cursor: grab;
    padding: 4px 6px;
    color: #94a3b8;
    border-radius: 4px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}
.part-card-v2__drag-handle:hover {
    color: #475569;
    background: #f1f5f9;
}
.part-card-v2__drag-handle:active {
    cursor: grabbing;
}

/* Position number */
.part-card-v2__position {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Dragging state */
.part-card-v2.dragging {
    opacity: 0.4;
    transform: scale(0.98);
    transition: opacity 0.15s, transform 0.15s;
}

/* Drop indicator lines */
.part-card-v2.drag-over-top {
    border-top: 3px solid var(--accent-color, #f97316);
    margin-top: -2px;
}
.part-card-v2.drag-over-bottom {
    border-bottom: 3px solid var(--accent-color, #f97316);
    margin-bottom: -2px;
}

/* Upload progress bar */
.upload-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}
.upload-progress-fill {
    height: 100%;
    background: var(--accent-color, #f97316);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}
.upload-counter {
    font-size: 13px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    margin-top: 4px;
}

/* ── Part selection checkbox ── */
.part-select-cb {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #c8850f;
    flex-shrink: 0;
}

/* ── Selected card highlight ── */
.part-card-v2.selected {
    border-color: #c8850f;
    background: #fffdf7;
    box-shadow: 0 0 0 2px rgba(200, 133, 15, 0.15), 0 2px 12px rgba(0,0,0,0.04);
}

.part-card-v2.selected .part-card-v2__header {
    background: #fef9f0;
}

/* ── Loading overlay for part cards during bulk operations ── */
.part-card-v2--loading {
    position: relative;
    pointer-events: none;
}
.part-card-v2--loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    border-radius: inherit;
    z-index: 5;
    animation: pulse-loading 1s ease-in-out infinite;
}
@keyframes pulse-loading {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

/* ── Disabled bulk apply button ── */
.bulk-toolbar__actions .btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .main-layout.has-parts {
        grid-template-columns: 1fr;
    }
    .order-sidebar {
        position: relative;
        top: 0;
    }
    .config-grid-2x2 {
        grid-template-columns: 1fr;
    }
    .part-card-v2__geometry-row {
        flex-direction: column;
    }
    .part-card-v2__thumb {
        width: 60px;
        height: 45px;
    }
    .bulk-toolbar.visible {
        max-height: 600px;
    }
    .bulk-toolbar__controls,
    .bulk-toolbar__processes {
        flex-direction: column;
    }
    .bulk-toolbar__select--sm {
        max-width: 100%;
    }
    .bulk-toolbar__actions {
        width: 100%;
        padding-top: 8px;
    }
    .bulk-toolbar__actions .btn {
        flex: 1;
        padding: 10px 16px;
    }
}

/* === Operations List (V2 tapping/drilling/countersinking) === */
.operations-section {
    margin-top: 6px;
}
.operations-add-btn {
    background: none;
    border: 1px dashed #cbd5e0;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    color: #718096;
    cursor: pointer;
    transition: all 0.15s;
}
.operations-add-btn:hover {
    border-color: #4299e1;
    color: #4299e1;
    background: #ebf8ff;
}
.operation-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
}
.operation-row select,
.operation-row input {
    padding: 4px 6px;
    border: 1px solid #e2e6ea;
    border-radius: 6px;
    font-size: 12px;
    background: white;
}
.operation-process { flex: 2; min-width: 0; }
.operation-diameter { flex: 1; min-width: 0; }
.operation-qty { width: 50px; flex: 0 0 50px; text-align: center; }
.operation-delete {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: #e53e3e;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.operation-delete:hover {
    background: #fed7d7;
}

/* ── 3D Folded Dimensions ─────────────────────────────────────── */
.step-3d-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e67e22;
    margin-right: 4px;
    vertical-align: middle;
}
.dim-3d-line {
    color: #e67e22;
    font-weight: 600;
    font-size: 12px;
}
.dim-2d-line {
    color: #7f8c8d;
    font-size: 11px;
}
.geo-dimensions-3d {
    display: none;
}
.geo-dimensions-3d.visible {
    display: inline;
}
.preview-dual {
    display: flex;
    gap: 4px;
    align-items: center;
}
.preview-3d-box {
    display: none;
    border: 1px solid #e67e22;
    border-radius: 4px;
    overflow: hidden;
    background: #f8f9fa;
}
.preview-3d-box.visible {
    display: block;
}
.folded-dims-cell {
    line-height: 1.6;
}

/* ===== DXF Entity Editor Modal ===== */
.dxf-editor-dialog {
    width: 90vw;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.dxf-editor-canvas-wrap {
    flex: 1;
    position: relative;
    min-height: 400px;
    background: var(--bg-secondary, #f8f9fa);
    overflow: hidden;
    cursor: crosshair;
    user-select: none;
    border-top: 1px solid var(--border-color, #e5e7eb);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.dxf-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted, #888);
}

/* Selection box overlay */
#dxfSelBox {
    position: absolute;
    pointer-events: none;
    border: 1px dashed #3b82f6;
    background: rgba(59, 139, 212, 0.07);
    z-index: 10;
}

/* Entity states */
.dxf-entity { cursor: pointer; }

.dxf-entity line,
.dxf-entity polyline,
.dxf-entity polygon,
.dxf-entity path,
.dxf-entity circle {
    stroke: var(--text-primary, #333);
    fill: none;
    vector-effect: non-scaling-stroke;
    stroke-width: 1px;
    transition: stroke 0.1s;
}

.dxf-entity:hover line,
.dxf-entity:hover polyline,
.dxf-entity:hover polygon,
.dxf-entity:hover path,
.dxf-entity:hover circle {
    stroke: #60a5fa;
}

.dxf-entity.dxf-selected line,
.dxf-entity.dxf-selected polyline,
.dxf-entity.dxf-selected polygon,
.dxf-entity.dxf-selected path,
.dxf-entity.dxf-selected circle {
    stroke: #f97316 !important;
    stroke-width: 2px;
}

.dxf-entity.dxf-role-cut line,
.dxf-entity.dxf-role-cut polyline,
.dxf-entity.dxf-role-cut polygon,
.dxf-entity.dxf-role-cut path,
.dxf-entity.dxf-role-cut circle { stroke: #22c55e !important; }

.dxf-entity.dxf-role-engrave line,
.dxf-entity.dxf-role-engrave polyline,
.dxf-entity.dxf-role-engrave polygon,
.dxf-entity.dxf-role-engrave path,
.dxf-entity.dxf-role-engrave circle { stroke: #a855f7 !important; }

.dxf-entity.dxf-role-ignore line,
.dxf-entity.dxf-role-ignore polyline,
.dxf-entity.dxf-role-ignore polygon,
.dxf-entity.dxf-role-ignore path,
.dxf-entity.dxf-role-ignore circle {
    stroke: #9ca3af !important;
    stroke-dasharray: 4 3;
}

.dxf-entity.dxf-role-delete line,
.dxf-entity.dxf-role-delete polyline,
.dxf-entity.dxf-role-delete polygon,
.dxf-entity.dxf-role-delete path,
.dxf-entity.dxf-role-delete circle {
    stroke: #ef4444 !important;
    opacity: 0.4;
}

/* Toolbar */
.dxf-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary, #f8f9fa);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    flex-wrap: wrap;
}
.dxf-toolbar-left { display: flex; gap: 6px; }
.dxf-toolbar-center { flex: 1; text-align: center; }
.dxf-sel-status { font-size: 12px; font-weight: 600; color: var(--text-primary, #333); }
.dxf-toolbar-hint { font-size: 11px; color: var(--text-muted, #888); font-style: italic; }

/* Actions panel */
.dxf-editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-secondary, #f8f9fa);
    border-top: 1px solid var(--border-color, #e5e7eb);
    flex-wrap: wrap;
}
.dxf-action-label { font-size: 12px; color: var(--text-muted, #888); }

/* Legend */
.dxf-editor-legend {
    display: flex;
    gap: 16px;
    padding: 6px 16px;
    font-size: 11px;
    color: var(--text-muted, #888);
    background: var(--bg-primary, #fff);
    border-top: 1px solid var(--border-color, #e5e7eb);
    flex-wrap: wrap;
}
.dxf-leg { display: flex; align-items: center; gap: 4px; }
.dxf-leg-dot { width: 16px; height: 3px; border-radius: 2px; }
