/* ========== CAD Application Layout ========== */
html, body {
    overflow: hidden !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/*
 * Hide any script elements that might render as visible text.
 * This targets scripts inside specific containers where the issue occurs.
 * Note: CSS display:none on script elements should not affect execution.
 */
#assemblyTree script,
#formparts script,
.tree-container script,
.node-row script,
.node-info script,
.node-tags script {
    display: none !important;
    font-size: 0 !important;
    line-height: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Hide the footer for CAD app feel */
#bottom {
    display: none !important;
}

/* Make viewport fill available space */
.center_content {
    height: calc(100vh - 60px) !important;
    overflow: hidden !important;
}

#viewport {
    width: 100% !important;
    height: 100% !important;
}

/* ========== Loading Progress Bars ========== */
.loading-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.loading-bar.active {
    opacity: 1;
}
.loading-bar-fill {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s ease;
    width: 0%;
}
.loading-bar-fill.indeterminate {
    width: 30%;
    animation: loading-bar-slide 1.5s ease-in-out infinite;
}
@keyframes loading-bar-slide {
    0% { margin-left: 0%; }
    50% { margin-left: 70%; }
    100% { margin-left: 0%; }
}
.loading-bar-label {
    position: absolute;
    top: 6px;
    left: 12px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* ========== Dark Glassmorphic Theme ========== */

/* Main info panel */
#info {
    background: rgba(20, 20, 25, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    /* Extend panel to 10px above bottom: viewport height - header(60px) - top(20px) - bottom(10px) */
    max-height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
}

/* Forms inside info panel - participate in flex layout */
#info #formparts {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;  /* Allow shrinking in flexbox */
}

/* Assembly tree panel group - fill available space */
#info #assemblyTree {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Project name header */
.panel-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 14px 16px;
}
.panel-header .ui-inplace-display {
    color: #ffffff !important;
    font-size: 20px !important;
    font-weight: 600 !important;
}
.panel-header .ui-inplace-content input {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
}
.panel-header .ui-inplace-content .ui-button {
    background: rgba(74, 158, 255, 0.3) !important;
    border: none !important;
    border-radius: 4px !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    cursor: pointer !important;
    margin-left: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.panel-header .ui-inplace-content .ui-button:hover {
    background: rgba(74, 158, 255, 0.5) !important;
}
/* Save button - checkmark */
.panel-header .ui-inplace-content .ui-inplace-save::before {
    content: "✓";
    color: #4caf50;
    font-size: 16px;
    font-weight: bold;
}
/* Cancel button - X */
.panel-header .ui-inplace-content .ui-inplace-cancel::before {
    content: "✕";
    color: #f44336;
    font-size: 14px;
    font-weight: bold;
}


/* Section headers */
.section-header {
    background: rgba(74, 158, 255, 0.1);
    color: #4a9eff;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* View toggle switch */
.view-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}
.view-toggle-btn {
    background: transparent;
    border: none;
    color: #666;
    padding: 4px 10px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
}
.view-toggle-btn:hover {
    color: #aaa;
}
.view-toggle-btn.active {
    background: rgba(74, 158, 255, 0.3);
    color: #4a9eff;
}

/* BOM Table */
.bom-container {
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
}
.bom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.bom-table th {
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    padding: 6px 8px;
    text-align: left;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0.3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.bom-table td {
    padding: 8px;
    color: #ccc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}
.bom-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}
.bom-table .bom-name {
    color: #fff;
    font-weight: 500;
    max-width: 80px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.bom-table .bom-qty {
    text-align: center;
    color: #4a9eff;
    font-weight: 600;
}
.bom-table .bom-price {
    text-align: right;
    color: #4CAF50;
    font-weight: 600;
}
.bom-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}
.bom-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* BOM Toolbar */
.bom-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 16px;
}
.bom-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bom-filter label {
    color: #888;
    font-size: 10px;
    text-transform: uppercase;
}
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.selection-count {
    color: #4a9eff;
    font-weight: bold;
    font-size: 11px;
}
.bom-checkbox {
    width: 30px;
    text-align: center;
}
.bom-checkbox .ui-chkbox {
    margin: 0 auto;
}
.bom-checkbox .ui-chkbox .ui-chkbox-box {
    width: 16px !important;
    height: 16px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 3px !important;
}
.bom-checkbox .ui-chkbox .ui-chkbox-box.ui-state-active {
    background: #4a9eff !important;
    border-color: #4a9eff !important;
}
.bom-checkbox .ui-chkbox-icon {
    color: #fff !important;
    display: block !important;
    visibility: visible !important;
}

/* Tree container */
.tree-container {
    background: transparent;
    /* Calculate max height: viewport - header(60px) - top margin(20px) - bottom margin(10px) - panel header(~50px) - dropzone(~80px) - section header(~40px) - quote totals(~60px) */
    max-height: calc(100vh - 320px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
}
.tree-container::-webkit-scrollbar {
    width: 6px;
}
.tree-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.tree-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.tree-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Custom tree styles */
.tree-node {
    transition: margin-left 0.15s ease;
    position: relative;
}
.tree-toggle.ui-button {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    padding: 0 !important;
    color: #4a9eff !important;
    cursor: pointer !important;
    border-radius: 3px !important;
    transition: background 0.15s !important;
    z-index: 10 !important;
    background: transparent !important;
    border: none !important;
    font-size: 12px !important;
}
.tree-toggle.ui-button:hover {
    background: rgba(74, 158, 255, 0.2) !important;
}
.tree-toggle.ui-button .ui-button-text {
    padding: 0 !important;
    line-height: 24px !important;
}

/* Node rows - compact list style */
.node-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 4px 4px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}
.node-row.viewing-current {
    border-left: 3px solid #4caf50;
}
/* Removed node-row.viewing-current:hover - using thumbnail hover only */
/* Flash highlight animation when clicking on a part in 3D view */
.node-row.flash-highlight {
    animation: flashHighlight 1.5s ease-out;
}
@keyframes flashHighlight {
    0% { background: rgba(255, 193, 7, 0.5); }
    100% { background: transparent; }
}
.node-thumb {
    width: 144px;
    height: 144px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}
.node-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.15s;
}
.node-thumb img:hover {
    opacity: 0.8;
}
.node-info {
    flex: 1;
    min-width: 0;
}
/* Admin Debug Price Breakdown */
.debug-breakdown {
    margin-top: 6px;
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 3px;
    background: rgba(255, 100, 100, 0.05);
    font-size: 9px;
}
.debug-breakdown summary {
    padding: 3px 6px;
    cursor: pointer;
    color: #ff6b6b;
    font-weight: 500;
    user-select: none;
}
.debug-breakdown summary:hover {
    background: rgba(255, 100, 100, 0.1);
}
.debug-breakdown[open] summary {
    border-bottom: 1px solid rgba(255, 100, 100, 0.2);
}
.debug-content {
    padding: 4px 6px;
}
.debug-row {
    display: flex;
    justify-content: space-between;
    padding: 1px 0;
    color: #aaa;
}
.debug-row .debug-label {
    color: #888;
}
.debug-row.total {
    border-top: 1px solid rgba(255, 100, 100, 0.2);
    margin-top: 3px;
    padding-top: 3px;
    color: #4CAF50;
    font-weight: bold;
}
.debug-section-header {
    font-size: 10px;
    font-weight: bold;
    color: #ff9800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 0 2px 0;
    border-bottom: 1px dashed rgba(255, 152, 0, 0.3);
    margin-bottom: 2px;
}
.debug-section-header .weld-symbol {
    font-size: 12px;
    margin-right: 4px;
}
.node-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.node-table td {
    padding: 1px 0;
    vertical-align: top;
}
.node-table .label {
    color: #666;
    width: 55px;
    white-space: nowrap;
}
.node-table .value {
    color: #ccc;
}
.node-name {
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    display: block;
}
.node-name .ui-inplace {
    display: block;
    margin-left: 0;
}
/* Only truncate the display text, not the edit controls */
.node-name .ui-inplace-display {
    display: block;
    max-width: 180px; /* ~30 chars truncation */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ffffff !important;
    cursor: pointer;
    padding-left: 0 !important;
}
/* Edit content should not be truncated */
.node-name .ui-inplace-content {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
.node-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.node-tags > * {
    display: inline-flex;
    align-items: center;
}
.node-material-name {
    color: #888;
    font-size: 9px;
    margin-top: 1px;
}
.node-name .ui-inplace-content input {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border-radius: 3px !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
    width: 100px !important;
}
.node-name .ui-inplace-content .ui-button {
    background: rgba(74, 158, 255, 0.3) !important;
    border: none !important;
    border-radius: 3px !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    cursor: pointer !important;
    margin-left: 2px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.node-name .ui-inplace-content .ui-button:hover {
    background: rgba(74, 158, 255, 0.5) !important;
}
.node-name .ui-inplace-content .ui-button .ui-icon {
    color: #fff !important;
}
/* Save button - checkmark */
.node-name .ui-inplace-content .ui-inplace-save::before {
    content: "✓";
    color: #4caf50;
    font-size: 14px;
    font-weight: bold;
}
/* Cancel button - X */
.node-name .ui-inplace-content .ui-inplace-cancel::before {
    content: "✕";
    color: #f44336;
    font-size: 12px;
    font-weight: bold;
}
.node-badge {
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 2px;
    background: rgba(74, 158, 255, 0.2);
    color: #4a9eff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 4px;
}
.node-badge.part {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}
.node-price {
    color: #4CAF50;
    font-size: 12px;
    font-weight: 600;
}
/* Delete button */
.delete-btn.ui-button {
    color: rgba(255, 100, 100, 0.6) !important;
    font-size: 14px !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    transition: color 0.15s, background 0.15s !important;
    background: transparent !important;
    border: none !important;
    min-width: auto !important;
}
.delete-btn.ui-button:hover {
    color: #ff6b6b !important;
    background: rgba(255, 100, 100, 0.15) !important;
}
.delete-btn.ui-button .ui-button-text {
    padding: 0 !important;
}
/* Only show delete row for root nodes (depth 0) */
.delete-row {
    display: none;
}
.delete-row[data-depth="0"] {
    display: table-row;
}

/* Simulation button - compact */
.sim-btn {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 9px;
    cursor: pointer;
    transition: background 0.15s;
}
.sim-btn:hover {
    background: rgba(76, 175, 80, 0.3);
}
/* Weld button */
.weld-btn {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 9px;
    cursor: pointer;
    transition: background 0.15s;
}
.weld-btn:hover {
    background: rgba(255, 152, 0, 0.35);
}
.weld-btn.active {
    background: rgba(255, 152, 0, 0.5);
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.4);
}

/* Tap button */
.tap-btn {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 9px;
    cursor: pointer;
    transition: background 0.15s;
}
.tap-btn:hover {
    background: rgba(33, 150, 243, 0.35);
}
.tap-btn.active {
    background: rgba(33, 150, 243, 0.5);
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.4);
}

/* Simulation status indicators */
.sim-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 4px;
}
.sim-status.infeasible {
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.3);
}
.sim-status.warnings {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}
.sim-status.ok {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}
.sim-status-icon {
    font-size: 10px;
}

/* Amatix processing spinner - shown while simulation is generating */
.sim-loading {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #888;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.05);
}
.sim-loading .spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(76, 175, 80, 0.2);
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: sim-spin 0.8s linear infinite;
}
.sim-loading .sim-loading-text {
    color: #888;
}
@keyframes sim-spin {
    to { transform: rotate(360deg); }
}
/* Transition state when simulation becomes ready */
.sim-loading.sim-ready {
    animation: sim-fadeOut 0.3s ease-out forwards;
}
@keyframes sim-fadeOut {
    to { opacity: 0; transform: scale(0.9); }
}

/* Compact dropdown styling */
.compact-dropdown.ui-selectonemenu {
    min-width: 70px !important;
    max-width: 90px !important;
    height: 18px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 3px !important;
}
.compact-dropdown .ui-selectonemenu-label {
    padding: 1px 4px !important;
    font-size: 9px !important;
    line-height: 14px !important;
    color: #aaa !important;
    background: transparent !important;
}
.compact-dropdown .ui-selectonemenu-trigger {
    width: 16px !important;
    height: 16px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.06) !important;
}
.compact-dropdown .ui-selectonemenu-trigger .ui-icon {
    margin-top: 1px !important;
    color: #666 !important;
}

/* Dropdown panel */
.ui-selectonemenu-panel {
    background: rgba(30, 30, 35, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}
.ui-selectonemenu-panel .ui-selectonemenu-items-wrapper {
    max-height: 150px !important;
}
.ui-selectonemenu-panel .ui-selectonemenu-item {
    padding: 6px 10px !important;
    font-size: 11px !important;
    color: #ccc !important;
    background: transparent !important;
}
.ui-selectonemenu-panel .ui-selectonemenu-item:hover {
    background: rgba(74, 158, 255, 0.15) !important;
    color: #fff !important;
}
.ui-selectonemenu-panel .ui-selectonemenu-item.ui-state-highlight {
    background: rgba(74, 158, 255, 0.25) !important;
    color: #fff !important;
}

/* Grand total section */
.grand-total {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.1), rgba(74, 158, 255, 0.05));
    border-top: 1px solid rgba(74, 158, 255, 0.2);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.grand-total-label {
    color: #888;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.grand-total-value {
    color: #4a9eff;
    font-size: 22px;
    font-weight: 700;
}


/* PrimeFaces inplace editor buttons */
.ui-inplace-editor .ui-button {
    background: rgba(74, 158, 255, 0.2) !important;
    border: none !important;
    border-radius: 4px !important;
    margin-left: 4px !important;
}
.ui-inplace-editor .ui-button:hover {
    background: rgba(74, 158, 255, 0.3) !important;
}
.ui-inplace-editor .ui-button .ui-icon {
    color: #4a9eff !important;
}

/* ========== Weld Panel Layout ========== */
.weld-panel-container {
    position: fixed;
    top: 380px;
    right: 20px;
    bottom: 110px;
    z-index: 100;
}

#weld-panel.weld-panel {
    width: 300px;
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.weld-panel > .weld-panel-header {
    flex: 0 0 auto !important;
}

.weld-panel > .weld-panel-list {
    flex: 1 1 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 0 !important;
}

@media (max-width: 768px) {
    .weld-panel-container {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 60px;
    }

    .weld-panel {
        width: auto;
        max-width: 100%;
        max-height: 50vh;
    }
}

/* ========== Suppression Styling ========== */

/* Suppress button */
.suppress-btn.ui-button {
    color: rgba(150, 150, 150, 0.6) !important;
    font-size: 11px !important;
    padding: 2px 5px !important;
    border-radius: 3px !important;
    transition: color 0.15s, background 0.15s !important;
    background: transparent !important;
    border: none !important;
    min-width: auto !important;
    margin-left: 4px !important;
}
.suppress-btn.ui-button:hover {
    color: #ffc107 !important;
    background: rgba(255, 193, 7, 0.15) !important;
}
.suppress-btn.ui-button.active {
    color: #ff6b6b !important;
    background: rgba(255, 107, 107, 0.15) !important;
}
.suppress-btn.ui-button .ui-button-text {
    padding: 0 !important;
}

/* Suppressed node row styling */
.node-row.suppressed {
    opacity: 0.5;
}

/* Suppressed node name - strikethrough */
.node-row.suppressed .node-name {
    text-decoration: line-through;
    color: #888 !important;
}

/* Grey out thumbnails for suppressed items */
.node-row.suppressed .node-thumb img {
    filter: grayscale(80%);
}

/* Suppressed price should show strikethrough */
.node-row.suppressed .node-price {
    text-decoration: line-through;
    color: #666 !important;
}

/* Dim the node-info area for suppressed items */
.node-row.suppressed .node-info {
    color: #777;
}

/* Show suppressed badge */
.node-row.suppressed .node-badge {
    opacity: 0.5;
}

/* ========== Hide in Viewer Styling ========== */

/* Hide button (eye icon) */
.hide-btn.ui-button {
    color: rgba(150, 150, 150, 0.6) !important;
    font-size: 11px !important;
    padding: 2px 5px !important;
    border-radius: 3px !important;
    transition: color 0.15s, background 0.15s !important;
    background: transparent !important;
    border: none !important;
    min-width: auto !important;
    margin-left: 4px !important;
}
.hide-btn.ui-button:hover {
    color: #64b5f6 !important;
    background: rgba(100, 181, 246, 0.15) !important;
}
.hide-btn.ui-button.active {
    color: #90a4ae !important;
    background: rgba(144, 164, 174, 0.15) !important;
}
.hide-btn.ui-button .ui-button-text,
.hide-btn.ui-button .ui-button-icon {
    padding: 0 !important;
}
.hide-btn.ui-button .ui-button-icon {
    font-size: 12px !important;
}

/* Hidden in viewer node row styling */
.node-row.hidden-in-viewer {
    opacity: 0.7;
}

/* Hidden in viewer thumbnail - add opacity overlay */
.node-row.hidden-in-viewer .node-thumb img {
    opacity: 0.4;
}

/* Show eye-slash icon styling for hidden items */
.node-row.hidden-in-viewer .hide-btn.ui-button {
    color: #90a4ae !important;
}

/* ========== Quantity Editor Styling ========== */

.qty-editor {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Stacked up/down arrows container */
.qty-arrows {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-left: 4px;
}

/* Arrow buttons */
.qty-arrow-up.ui-button,
.qty-arrow-down.ui-button {
    width: 16px !important;
    height: 10px !important;
    min-width: 16px !important;
    min-height: 10px !important;
    background: rgba(74, 158, 255, 0.2) !important;
    border: none !important;
    border-radius: 2px !important;
    color: #4a9eff !important;
    font-size: 6px !important;
    padding: 0 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}
.qty-arrow-up.ui-button:hover,
.qty-arrow-down.ui-button:hover {
    background: rgba(74, 158, 255, 0.4) !important;
}
.qty-arrow-up.ui-button .ui-button-text,
.qty-arrow-down.ui-button .ui-button-text {
    padding: 0 !important;
    line-height: 1 !important;
}

/* Quantity value wrapper - matches .node-name pattern */
.qty-value {
    display: inline-block;
    min-width: 30px;
    text-align: center;
}
.qty-value .ui-inplace {
    display: inline-block;
}
/* Display mode - visible by default, PrimeFaces hides it when editing */
.qty-value .ui-inplace-display {
    color: #4a9eff !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    cursor: pointer !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    transition: background 0.15s !important;
    min-width: 24px !important;
    text-align: center !important;
}
.qty-value .ui-inplace-display:hover {
    background: rgba(74, 158, 255, 0.15) !important;
}
.qty-value .ui-inplace-content input {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(74, 158, 255, 0.3) !important;
    color: #4a9eff !important;
    border-radius: 3px !important;
    padding: 2px 4px !important;
    font-size: 11px !important;
    width: 36px !important;
    text-align: center !important;
}
.qty-value .ui-inplace-content .ui-button {
    background: rgba(74, 158, 255, 0.3) !important;
    border: none !important;
    border-radius: 3px !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    cursor: pointer !important;
    margin-left: 2px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.qty-value .ui-inplace-content .ui-button:hover {
    background: rgba(74, 158, 255, 0.5) !important;
}
/* Save button - checkmark */
.qty-value .ui-inplace-content .ui-inplace-save::before {
    content: "✓";
    color: #4caf50;
    font-size: 14px;
    font-weight: bold;
}
/* Cancel button - X */
.qty-value .ui-inplace-content .ui-inplace-cancel::before {
    content: "✕";
    color: #f44336;
    font-size: 12px;
    font-weight: bold;
}

/* ========== CAD Annotation System ========== */

/* Annotation container - fixed overlay for balloons */
.annotation-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

/* Annotation balloon base style */
.annotation-balloon {
    position: absolute;
    background: rgba(15, 15, 20, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 6px 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: auto;
    cursor: default;
    transform: translate(-50%, -50%);
    transition: opacity 0.15s, box-shadow 0.15s;
}

.annotation-balloon:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Annotation type colors - applied via border */
.annotation-balloon[data-annotation-type="dimension"] {
    border-color: rgba(255, 215, 0, 0.4);
}

.annotation-balloon[data-annotation-type="info"] {
    border-color: rgba(74, 158, 255, 0.4);
}

.annotation-balloon[data-annotation-type="gdt"] {
    border-color: rgba(0, 206, 209, 0.4);
}

.annotation-balloon[data-annotation-type="weld"] {
    border-color: rgba(255, 152, 0, 0.4);
}

/* Dimension annotation specific */
.annotation-balloon .dimension-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--annotation-color, #FFD700);
}

.annotation-balloon .dimension-unit {
    font-size: 10px;
    color: #888;
    margin-left: 2px;
}

/* Info annotation specific */
.annotation-balloon .info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(74, 158, 255, 0.2);
    border-radius: 50%;
    margin-right: 6px;
    font-size: 10px;
    color: #4a9eff;
}

.annotation-balloon .info-text {
    color: #ccc;
}

/* GD&T annotation specific */
.annotation-balloon .gdt-frame {
    display: inline-flex;
    border: 1px solid rgba(0, 206, 209, 0.6);
    border-radius: 2px;
    overflow: hidden;
}

.annotation-balloon .gdt-cell {
    padding: 2px 6px;
    border-right: 1px solid rgba(0, 206, 209, 0.4);
    font-size: 11px;
    color: #00CED1;
}

.annotation-balloon .gdt-cell:last-child {
    border-right: none;
}

.annotation-balloon .gdt-symbol {
    font-family: 'GDT', sans-serif;
}

/* Weld annotation specific */
.annotation-balloon .weld-symbol-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.annotation-balloon .weld-symbol {
    color: #ff9800;
    font-weight: 600;
}

.annotation-balloon .weld-size {
    color: #ccc;
    font-size: 11px;
}

/* ========== Admin Price Breakdown ========== */
.price-breakdown {
    margin-bottom: 10px;
    padding: 10px;
    background: var(--surface-100, rgba(255, 255, 255, 0.05));
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.breakdown-label {
    color: var(--text-color-secondary, rgba(255, 255, 255, 0.6));
    font-size: 12px;
}

.breakdown-value {
    font-weight: 500;
    color: var(--text-color, rgba(255, 255, 255, 0.87));
    font-size: 12px;
}


