/* ============================================
   Cloud-Cut Admin - Combined Stylesheet
   Login screen + Library admin app styles
   ============================================ */

/* ---- Login Screen ---- */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #e8e8ec;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-header { margin-bottom: 24px; }

.login-logo {
  color: #4a90e2;
  font-size: 24px;
  font-weight: 700;
}

.login-badge {
  display: inline-block;
  background: #4a90e2;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-subtitle {
  color: #666;
  font-size: 14px;
  margin-bottom: 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form input[type="email"] {
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.login-form input[type="email"]:focus {
  border-color: #4a90e2;
}

.login-status {
  margin-top: 16px;
  font-size: 14px;
  min-height: 20px;
}

.login-status.success { color: #22c55e; }
.login-status.error { color: #ef4444; }

.btn-loading, .hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---- Admin-Specific Overrides ---- */
.sidebar-logo {
  color: #4a90e2;
  font-size: 18px;
  font-weight: 700;
}

.sidebar-badge {
  display: inline-block;
  background: #4a90e2;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
}

.user-info {
  margin-bottom: 10px;
}

.user-email {
  display: block;
  font-size: 12px;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 4px;
  text-transform: uppercase;
}

.user-role-badge.admin {
  background: rgba(74, 144, 226, 0.2);
  color: #4a90e2;
}

.user-role-badge.sub-admin {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
}

.btn-signout {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid rgba(255, 100, 100, 0.3);
  color: rgba(255, 150, 150, 0.8);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 8px;
}

.btn-signout:hover {
  background: rgba(200, 50, 50, 0.3);
  border-color: rgba(255, 100, 100, 0.5);
  color: #fff;
}

/* ---- Users Management View ---- */
.users-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg, #fff);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
}

.users-table th,
.users-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.users-table th {
  background: var(--bg-color, #f3f4f6);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-secondary, #6b7280);
}

.users-table td {
  font-size: 14px;
}

.users-table .role-select {
  padding: 4px 8px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
}

.users-table .btn-icon {
  padding: 4px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  border-radius: 4px;
}

.users-table .btn-icon:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ---- Add User / Add Tester Modal ---- */
.inline-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.inline-form input,
.inline-form select {
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  font-size: 14px;
}

.inline-form input { flex: 1; }

/* ---- Deploy Output ---- */
.deploy-log {
  background: #1a1a2e;
  color: #a0e0a0;
  padding: 16px;
  border-radius: 8px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ---- Nav Badge ---- */
.nav-badge {
  background: var(--danger-color, #ef4444);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: auto;
}

/* ============================================
   Library Generator Styles (imported below)
   ============================================ */

/* Library Generator Admin App Styles */

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f3f4f6;
    --sidebar-bg: #1f2937;
    --sidebar-text: #e5e7eb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-nav {
    list-style: none;
    padding: 16px 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.2);
    border-left: 3px solid var(--primary-color);
}

.nav-icon {
    font-size: 1.25rem;
}

.nav-label {
    font-size: 0.95rem;
}

.nav-badge {
    position: absolute;
    right: 16px;
    background: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.nav-badge.hidden {
    display: none;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dev Mode Toggle */
.dev-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: var(--sidebar-text);
    opacity: 0.8;
}

.dev-mode-toggle .toggle-label {
    opacity: 0.7;
}

.dev-mode-toggle .toggle-switch {
    position: relative;
    width: 36px;
    height: 18px;
    flex-shrink: 0;
}

.dev-mode-toggle .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.dev-mode-toggle .toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    border-radius: 18px;
    transition: 0.2s;
}

.dev-mode-toggle .toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.2s;
}

.dev-mode-toggle .toggle-switch input:checked + .slider {
    background-color: var(--warning-color);
}

.dev-mode-toggle .toggle-switch input:checked + .slider:before {
    transform: translateX(18px);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.connection-status:hover {
    background: rgba(255, 255, 255, 0.1);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary-color);
    flex-shrink: 0;
}

.status-dot.connected {
    background: var(--success-color);
}

.status-dot.disconnected {
    background: var(--danger-color);
}

.status-dot.connecting,
.status-dot.reconnecting {
    background: var(--warning-color);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.connection-status .status-text {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content */
.main-content {
    display: block; /* Override main app's grid layout on main element */
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.view-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.view-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-warning {
    background: #f0ad4e;
    color: #000;
}

.btn-warning:hover:not(:disabled) {
    background: #ec971f;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
}

.btn-close:hover {
    color: var(--text-primary);
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.category-tab:hover {
    border-color: var(--primary-color);
}

.category-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.category-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--card-bg);
    cursor: pointer;
    min-width: 160px;
}

/* Parts Grid Container (contains bulk bar + grid) */
.parts-grid {
    display: flex;
    flex-direction: column;
}

.part-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.part-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.part-card.selected {
    border-color: var(--primary-color);
}

.part-card-thumbnail {
    width: 100%;
    height: 150px;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.part-card-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.part-card-thumbnail canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Status Badges */
.part-card-thumbnail .status-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.status-included {
    background: #22c55e;
    color: white;
}

.status-excluded {
    background: #ef4444;
    color: white;
}

/* Part Card Checkbox */
.part-card {
    position: relative;
}

.part-card-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
}

.part-select-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
}

/* Bulk Operations Bar */
.bulk-operations-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
}

.select-all-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.select-all-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.bulk-operation-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.bulk-operation-select:hover {
    border-color: #cbd5e1;
}

.selection-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: auto;
}

/* Parts Grid Inner (for proper grid layout with bulk bar) */
.parts-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.part-card-info {
    padding: 12px;
}

.part-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.part-card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.part-card-category {
    background: var(--bg-color);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Detail Panel */
.detail-panel {
    width: 400px;
    background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.detail-panel.visible {
    transform: translateX(0);
}

.detail-panel.hidden {
    transform: translateX(100%);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.detail-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.detail-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Include in Library Toggle */
.include-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.include-toggle input[type="checkbox"] {
    display: none;
}

.include-toggle .toggle-slider {
    width: 40px;
    height: 22px;
    background: #ccc;
    border-radius: 11px;
    position: relative;
    transition: background 0.2s;
}

.include-toggle .toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: left 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.include-toggle input:checked + .toggle-slider {
    background: #22c55e;
}

.include-toggle input:checked + .toggle-slider::after {
    left: 20px;
}

.detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Detail Form */
.detail-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input:disabled,
.form-group select:disabled {
    background: var(--bg-color);
    color: var(--text-secondary);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* Tags Input */
.tags-input {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 42px;
    cursor: text;
}

.tags-input:focus-within {
    border-color: var(--primary-color);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-color);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.tag-remove {
    cursor: pointer;
    opacity: 0.6;
}

.tag-remove:hover {
    opacity: 1;
}

.tags-input input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 100px;
    font-size: 0.9rem;
    padding: 4px;
}

/* Preview Canvas */
.preview-container {
    position: relative;
    width: 100%;
    height: 280px;
    background: #1a1a2e;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    overflow: hidden;
    margin-bottom: 0;
}

.preview-container canvas {
    width: 100%;
    height: 100%;
}

/* PCB Standoff Controls - below preview */
.pcb-standoff-controls {
    background: #2a2a3e;
    padding: 12px 16px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pcb-standoff-controls .standoff-info {
    color: #a0aec0;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pcb-standoff-controls .standoff-info #hole-count-display {
    flex: 1;
}

#btn-redetect-holes {
    padding: 3px 8px;
    font-size: 0.75rem;
}

.debug-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #718096;
    user-select: none;
}

.debug-toggle input[type="checkbox"] {
    display: none;
}

.debug-toggle-label {
    opacity: 0.7;
}

.debug-toggle:hover .debug-toggle-label {
    opacity: 1;
    color: #4a9eff;
}

.debug-slider {
    position: relative;
    width: 32px;
    height: 18px;
    background: #555;
    border-radius: 9px;
    transition: background 0.2s;
}

.debug-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.debug-toggle input[type="checkbox"]:checked + .debug-slider {
    background: #4a9eff;
}

.debug-toggle input[type="checkbox"]:checked + .debug-slider::after {
    transform: translateX(14px);
}

.pcb-standoff-controls .standoff-settings {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.pcb-standoff-controls .setting-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pcb-standoff-controls .setting-group label {
    color: #718096;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pcb-standoff-controls select,
.pcb-standoff-controls input[type="number"] {
    background: #1a1a2e;
    border: 1px solid #4a5568;
    border-radius: var(--radius-sm);
    color: #e2e8f0;
    padding: 6px 10px;
    font-size: 0.9rem;
    min-width: 70px;
}

.pcb-standoff-controls select:focus,
.pcb-standoff-controls input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.pcb-standoff-controls .input-with-unit {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pcb-standoff-controls .input-with-unit input {
    width: 60px;
}

.pcb-standoff-controls .input-with-unit .unit {
    color: #718096;
    font-size: 0.85rem;
}

.pcb-standoff-controls .btn-group {
    display: flex;
}

.pcb-standoff-controls .btn-toggle {
    background: #1a1a2e;
    border: 1px solid #4a5568;
    color: #a0aec0;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pcb-standoff-controls .btn-toggle:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.pcb-standoff-controls .btn-toggle:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: none;
}

.pcb-standoff-controls .btn-toggle:hover {
    background: #2d3748;
}

.pcb-standoff-controls .btn-toggle.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* PCB Fields Section */
.pcb-fields-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.pcb-fields-section .section-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.detected-holes-list {
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px;
    margin: 8px 0;
    background: var(--bg-color);
}

.detected-holes-list .no-holes {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

.hole-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    margin-bottom: 4px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
}

.hole-item:last-child {
    margin-bottom: 0;
}

.hole-info {
    font-size: 0.85rem;
    font-family: monospace;
}

.btn-remove-hole {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 4px;
    opacity: 0.7;
}

.btn-remove-hole:hover {
    opacity: 1;
}

.hole-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-group {
    display: flex;
    gap: 0;
}

.btn-toggle {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.btn-toggle:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.btn-toggle:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: none;
}

.btn-toggle.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-toggle:hover:not(.active) {
    background: var(--bg-color);
}

/* Detail Actions */
.detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.detail-actions .btn {
    flex: 1;
}

/* Submissions List */
.submissions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.submission-card {
    display: flex;
    gap: 16px;
    background: var(--card-bg);
    padding: 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.submission-card:hover {
    box-shadow: var(--shadow-md);
}

.submission-thumbnail {
    width: 80px;
    height: 80px;
    background: #f9fafb;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.submission-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.submission-info {
    flex: 1;
}

.submission-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.submission-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.submission-actions {
    display: flex;
    gap: 8px;
}

.submission-actions .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.submission-rejection-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f59e0b;
}

.submission-rejection-section.hidden {
    display: none;
}

.submission-rejection-section .rejection-reason-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 8px;
}

.submission-rejection-section .rejection-reason-input:focus {
    outline: none;
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.submission-rejection-section .rejection-buttons {
    display: flex;
    gap: 8px;
}

.submission-rejection-section .rejection-buttons .btn {
    flex: 1;
}

/* Publish Queue */
.publish-queue {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.publish-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg);
    padding: 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.publish-item-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.publish-item-info {
    flex: 1;
}

.publish-item-status {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-color);
}

.publish-item-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.publish-item-status.uploading {
    background: #dbeafe;
    color: #1e40af;
}

.publish-item-status.completed {
    background: #d1fae5;
    color: #065f46;
}

.publish-item-status.failed {
    background: #fee2e2;
    color: #991b1b;
}

/* Progress Bar */
.publish-progress {
    margin-top: 20px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
}

.publish-progress.hidden {
    display: none;
}

.progress-bar {
    height: 8px;
    background: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-content {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

/* Add Part Modal Preview */
.add-part-preview-container {
    width: 100%;
    height: 200px;
    background: #1a1a2e;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.add-part-preview-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.add-part-preview-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    padding: 20px 30px;
    border: 2px dashed #444;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.add-part-preview-hint:hover {
    color: #aaa;
    border-color: #666;
    background: rgba(255, 255, 255, 0.05);
}

/* Enclosure Import Controls */
.enclosure-import-controls {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.enclosure-import-controls.hidden {
    display: none;
}

.enclosure-import-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.enclosure-import-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.enclosure-import-actions button {
    flex: 1;
}

.enclosure-import-zrot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.enclosure-import-zrot.hidden {
    display: none;
}

.enclosure-import-zrot label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.enclosure-import-zrot .btn-group {
    display: flex;
    gap: 4px;
}

.enclosure-import-zrot .btn-group button {
    padding: 4px 10px;
    font-size: 0.8rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
}

.enclosure-import-zrot .btn-group button:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.enclosure-import-dims {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: monospace;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 300;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--primary-color);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 60px;
    }

    .sidebar-header h1,
    .nav-label,
    .status-text {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 16px;
    }

    .nav-badge {
        right: 8px;
        top: 8px;
    }

    .detail-panel {
        width: 100%;
        max-width: 400px;
    }
}

@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
    }

    .parts-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Connector Controls - below preview */
.connector-controls {
    background: #2a2a3e;
    padding: 12px 16px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.connector-status {
    color: #a0aec0;
    font-size: 0.85rem;
    text-align: center;
}

.connector-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.connector-settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.connector-settings .setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #a0aec0;
}

.connector-settings .setting-row label {
    font-weight: 500;
}

.connector-settings .setting-row span {
    color: #e2e8f0;
}

.connector-settings .input-with-unit {
    display: flex;
    align-items: center;
    gap: 4px;
}

.connector-settings .input-with-unit input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 0.85rem;
    text-align: right;
    /* Hide number input spinners */
    -moz-appearance: textfield;
}

/* Hide spinners for Chrome, Safari, Edge */
.connector-settings .input-with-unit input::-webkit-outer-spin-button,
.connector-settings .input-with-unit input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Style span values to match inputs */
.connector-settings .input-with-unit span#zoffset-value {
    display: inline-block;
    width: 60px;
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 0.85rem;
    text-align: right;
    cursor: not-allowed;
}

.connector-settings .input-with-unit .unit {
    font-size: 0.85rem;
    color: #718096;
    min-width: 22px;
    text-align: left;
}

/* Z-Offset Slider */
.zoffset-slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
}

.zoffset-slider-track {
    position: relative;
    width: 24px;
    height: 150px;
    background: linear-gradient(to bottom, #ffff00 0%, #ff0000 100%);
    border-radius: 12px;
    cursor: pointer;
}

.zoffset-slider-track.back-mounting {
    background: linear-gradient(to bottom, #ff0000 0%, #ffff00 100%);
}

.zoffset-slider-handle {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid #333;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.zoffset-slider-handle:active {
    cursor: grabbing;
}

.zoffset-slider-value {
    color: #e2e8f0;
    font-size: 0.8rem;
    font-family: monospace;
}

/* Small Button Variants */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

/* Preview Canvas for Connectors */
#connector-preview-canvas {
    width: 100%;
    height: 100%;
}

/* Aperture Preview Container */
.aperture-preview-container {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    margin-top: 10px;
}

#aperture-preview-canvas {
    border-radius: var(--radius-sm);
}

/* Aperture Preview Controls (toggle switch) */
.aperture-preview-controls {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 6px;
    border-radius: 4px;
}

/* Connector Artwork Edit Button (same as main app) */
.connector-artwork-edit-btn {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 4px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    z-index: 10;
}

.connector-artwork-edit-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary-color);
}

.connector-artwork-edit-btn .artwork-count-badge {
    background: #4CAF50;
    color: white;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 2px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 28px;
    height: 16px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 16px;
    transition: 0.2s;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle-switch input:checked + .slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(12px);
}

/* Hidden utility class */
.hidden {
    display: none !important;
}

/* Connector Artwork Edit Button - same as main app */
.connector-artwork-edit-btn {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 4px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s, border-color 0.2s;
  z-index: 10;
}

.connector-artwork-edit-btn:hover {
  background: rgba(255, 255, 255, 1);
  border-color: #999;
}

.connector-artwork-edit-btn:active {
  background: #f0f0f0;
}

/* Artwork count badge */
.connector-artwork-edit-btn .artwork-count-badge {
  background: #4CAF50;
  color: white;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 10px;
  margin-left: 2px;
}

/* Submission type badge */
.submission-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  background: #e0e7ff;
  color: #3730a3;
}

/* Thumbnail placeholder */
.thumb-placeholder {
  font-size: 2rem;
  color: var(--text-secondary);
}

.thumb-placeholder-large {
  font-size: 4rem;
  color: var(--text-secondary);
}

/* Review Modal Styles */
.review-container {
  display: flex;
  gap: 24px;
  min-height: 300px;
}

.review-preview {
  flex: 0 0 300px;
}

.review-thumbnail {
  width: 300px;
  height: 300px;
  background: #f9fafb;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.review-thumbnail img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.review-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-section {
  background: #f9fafb;
  padding: 16px;
  border-radius: var(--radius-md);
}

.review-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.review-field {
  display: flex;
  margin-bottom: 8px;
}

.review-field:last-child {
  margin-bottom: 0;
}

.review-field label {
  font-weight: 500;
  color: var(--text-secondary);
  width: 120px;
  flex-shrink: 0;
}

.review-field span {
  color: var(--text-primary);
}

.artwork-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.artwork-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.artwork-type {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--primary-color);
  color: white;
}

.artwork-content {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Review Actions Panel (in detail panel) */
.review-actions-panel {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.review-actions-header {
  font-weight: 600;
  color: #92400e;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.review-actions-buttons {
  display: flex;
  gap: 12px;
}

.review-actions-buttons .btn {
  flex: 1;
  padding: 10px 16px;
}

/* Rejection reason input */
.rejection-reason-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f59e0b;
}

.rejection-reason-section.hidden {
  display: none;
}

.rejection-reason-input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 8px;
}

.rejection-reason-input:focus {
  outline: none;
  border-color: var(--danger-color);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.btn-confirm-reject {
  width: 100%;
}

/* ============================================================================
   Base Popover Styles
   ============================================================================ */

/* Popover container - full screen overlay */
.popover {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popover.hidden {
  display: none;
}

/* Backdrop - dark overlay behind dialog */
.popover-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
  cursor: pointer;
}

/* Dialog box */
.popover-dialog {
  position: relative;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 2;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header with title and close button */
.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #e0e0e0;
  background: #f9f9f9;
}

.popover-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #333;
  font-weight: 600;
}

/* Close button */
.popover-close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.popover-close-btn:hover {
  background: #e0e0e0;
  color: #333;
}

.popover-close-btn:active {
  background: #d0d0d0;
}

/* Scrollable content area */
.popover-content {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 2;
  position: relative;
}

/* ============================================================================
   Artwork Editor Popover Styles (for connector artwork editing)
   ============================================================================ */

/* Override popover positioning for artwork editor - right-side panel */
.artwork-editor-popover {
  justify-content: flex-end;
  align-items: flex-start;
  pointer-events: none;
}

.artwork-editor-popover .popover-backdrop {
  background: rgba(0, 0, 0, 0.2);
  pointer-events: auto;
}

.artwork-editor-popover .popover-content {
  width: 400px;
  max-width: 450px;
  max-height: 95vh;
  overflow-y: auto;
  margin: 8px;
  cursor: default;
  pointer-events: auto;
}

.artwork-editor-popover .popover-header {
  cursor: move;
}

/* Artwork editor body */
.artwork-editor-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Preview Canvas */
.artwork-preview-container {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px 16px 0 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#artwork-preview-canvas {
  display: block;
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Preview section wrapper */
.artwork-preview-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Insert button under preview */
.artwork-preview-insert-container {
  display: flex;
  justify-content: center;
  padding: 8px 0;
  width: 100%;
}

.artwork-preview-insert-container button {
  min-width: 100px;
}

/* Preview controls (show/hide connector toggle) */
.artwork-preview-controls {
  display: none;
  justify-content: flex-end;
  width: 100%;
  padding-top: 4px;
}

.artwork-preview-controls.visible {
  display: flex;
}

/* Toggle switch styling */
.artwork-toggle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #555;
  cursor: pointer;
  user-select: none;
}

.artwork-toggle-switch .toggle-label {
  font-size: 0.85rem;
}

.artwork-toggle-switch .toggle-slider-container {
  position: relative;
  width: 36px;
  height: 20px;
}

.artwork-toggle-switch .toggle-slider-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.artwork-toggle-switch .toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 20px;
}

.artwork-toggle-switch .toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.artwork-toggle-switch .toggle-slider-container input:checked + .toggle-slider {
  background-color: #007bff;
}

.artwork-toggle-switch .toggle-slider-container input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

/* Control Groups */
.artwork-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.artwork-control-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 12px;
}

.artwork-control-group label {
  font-weight: 500;
  font-size: 0.9rem;
  color: #333;
}

/* Text Input */
#artwork-text-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

#artwork-text-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Select Inputs */
#artwork-font-select,
#artwork-font-size-select,
#artwork-line-spacing-select {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
  background: white;
  cursor: pointer;
}

/* Style Buttons */
.artwork-style-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.artwork-style-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.artwork-style-btn:hover {
  background: #f0f0f0;
  border-color: #999;
}

.artwork-style-btn.active {
  background: #007bff;
  color: white;
  border-color: #0056b3;
}

/* Color Input */
.artwork-color-input {
  display: flex;
  gap: 8px;
  align-items: center;
}

input[type="color"] {
  width: 50px;
  height: 36px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  padding: 2px;
}

/* Hex input */
#artwork-hex-input {
  width: 86px;
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: monospace;
}

/* Stroke controls */
.artwork-stroke-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.artwork-stroke-row .artwork-control-group {
  flex: 1;
}

/* Shadow controls */
.artwork-shadow-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.artwork-shadow-row .artwork-control-group {
  flex: 1;
}

/* Clipart browser */
.clipart-browser {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clipart-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.clipart-category-btn {
  padding: 4px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
}

.clipart-category-btn.active {
  background: #007bff;
  color: white;
  border-color: #0056b3;
}

.clipart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
}

.clipart-item {
  width: 50px;
  height: 50px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.clipart-item:hover {
  border-color: #007bff;
  background: #f0f8ff;
}

.clipart-item.selected {
  border-color: #007bff;
  background: #e6f2ff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3);
}

.clipart-item img {
  max-width: 40px;
  max-height: 40px;
}

/* Image upload section */
.image-upload-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.image-upload-dropzone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.image-upload-dropzone:hover,
.image-upload-dropzone.dragover {
  border-color: #007bff;
  background: #f0f8ff;
}

/* Adjustments row for brightness/contrast/saturation */
.artwork-adjustments-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.artwork-adjustment-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.artwork-adjustment-item label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
}

.artwork-adjustment-item input[type="range"] {
  width: 100%;
  height: 4px;
}

/* Circular text controls */
.circular-text-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Action buttons row */
.artwork-action-buttons {
  display: flex;
  gap: 8px;
  padding: 8px 16px 16px 16px;
  border-top: 1px solid #eee;
}

.artwork-action-buttons button {
  flex: 1;
}

/* ============================================================================
   Artwork Tabs and Panel Styles
   ============================================================================ */

/* Artwork Tabs */
.artwork-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e0e0e0;
  margin: 0 20px;
  padding: 0;
}

.artwork-tab {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  top: 2px;
  white-space: nowrap;
}

.artwork-tab:hover {
  color: #333;
  background-color: #f5f5f5;
}

.artwork-tab.active {
  color: var(--primary-color, #4a90e2);
  border-bottom-color: var(--primary-color, #4a90e2);
  font-weight: 600;
}

/* Artwork Panels (show/hide based on active tab) */
.artwork-panel {
  display: none;
}

.artwork-panel.active {
  display: block;
}

/* Connector artwork panel insert button */
.connector-artwork-insert-btn {
  width: 100%;
  padding: 10px 16px;
  margin-top: 8px;
  background: #4a90d9;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

.connector-artwork-insert-btn:hover {
  background: #3a7fc9;
}

.connector-artwork-insert-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Image filename display */
.image-filename {
  margin-top: 8px;
  font-size: 13px;
  color: #666;
  font-style: italic;
  min-height: 20px;
}

/* Image select button */
.artwork-select-image-btn {
  width: 100%;
  padding: 10px;
  background: #4a90d9;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.artwork-select-image-btn:hover {
  background: #3a7fc9;
}

.artwork-select-image-btn:active {
  background: #2a6eb9;
}

/* Artwork editor icon in header */
.artwork-editor-icon {
  font-size: 1.5rem;
}

/* Multi-select message */
#artwork-multi-select-message {
  display: none;
  padding: 16px;
  margin: 8px 16px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  color: #856404;
  text-align: center;
  font-size: 13px;
}

#artwork-multi-select-message.visible {
  display: block;
}

/* Normal mode only elements (hidden in connector mode) */
.connector-mode .normal-mode-only {
  display: none !important;
}

/* Connector mode elements */
.connector-artwork-list-panel {
  margin: 8px 16px;
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}

.connector-artwork-list-panel h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #666;
}

.connector-artwork-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}

.connector-artwork-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.connector-artwork-item:hover {
  border-color: #4a90d9;
  background: #f0f8ff;
}

.connector-artwork-item.selected {
  border-color: #4a90d9;
  background: #e6f2ff;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

.connector-artwork-item-preview {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 4px;
  font-size: 12px;
  color: #666;
}

.connector-artwork-item-info {
  flex: 1;
  min-width: 0;
}

.connector-artwork-item-type {
  font-size: 12px;
  font-weight: 500;
  color: #333;
}

.connector-artwork-item-detail {
  font-size: 11px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.connector-artwork-item-delete {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  line-height: 1;
}

.connector-artwork-item-delete:hover {
  color: #dc3545;
}

/* Connector finish button - visibility controlled by .hidden class via JS */
#connector-artwork-finish-btn {
  padding: 12px 16px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

#connector-artwork-finish-btn:hover {
  background: #218838;
}

/* ============================================================================
   Connector Artwork List Panel (inside artwork popover)
   ============================================================================ */

.connector-artwork-list-panel {
  margin: 0 16px 8px 16px;
  padding: 10px 12px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  max-height: 200px;
}

.connector-artwork-list-panel.hidden {
  display: none;
}

.connector-artwork-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.connector-artwork-list-title {
  font-weight: 600;
  font-size: 12px;
  color: #333;
}

.connector-artwork-count {
  font-size: 11px;
  color: #666;
}

.connector-artwork-list-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

.connector-artwork-empty {
  text-align: center;
  padding: 12px;
  color: #999;
  font-size: 11px;
  font-style: italic;
}

.connector-artwork-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: white;
  border-radius: 4px;
  font-size: 11px;
  min-width: 0;
  cursor: pointer;
}

.connector-artwork-item:hover {
  background: #f5f5f5;
}

.connector-artwork-item.selected {
  background: rgba(255, 136, 0, 0.15);
  border: 1px solid rgba(255, 136, 0, 0.5);
  margin: -1px;
}

.connector-artwork-item.selected:hover {
  background: rgba(255, 136, 0, 0.25);
}

.artwork-item-type {
  background: #e0e0e0;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
  text-transform: capitalize;
  font-size: 10px;
  flex-shrink: 0;
}

.artwork-item-preview {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #555;
}

.artwork-item-edit,
.artwork-item-delete {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #666;
  flex-shrink: 0;
}

.artwork-item-edit:hover {
  background: #e3f2fd;
  color: #1976d2;
}

.artwork-item-delete:hover {
  background: #ffebee;
  color: #d32f2f;
}

/* Rotate with spin checkbox in artwork list */
.artwork-item-rotate-checkbox {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: #666;
  cursor: pointer;
  margin-left: auto;
  margin-right: 4px;
  flex-shrink: 0;
}

.artwork-item-rotate-checkbox input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin: 0;
  cursor: pointer;
}

.artwork-item-rotate-checkbox .rotate-label {
  white-space: nowrap;
}

.artwork-item-rotate-checkbox:hover {
  color: #333;
}

/* Artwork rotation input in list items */
.artwork-item-rotation {
  display: flex;
  align-items: center;
  gap: 1px;
  font-size: 10px;
  color: #666;
  margin-left: auto;
  margin-right: 4px;
  flex-shrink: 0;
}

.artwork-item-rotation .artwork-rotation-input {
  width: 42px;
  padding: 2px 4px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 10px;
  text-align: right;
}

.artwork-item-rotation .artwork-rotation-input:focus {
  outline: none;
  border-color: #2196F3;
}

/* Hide spinner buttons on number input */
.artwork-item-rotation .artwork-rotation-input::-webkit-outer-spin-button,
.artwork-item-rotation .artwork-rotation-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.artwork-item-rotation .artwork-rotation-input[type=number] {
  -moz-appearance: textfield;
}

/* Existing artwork badge */
.existing-artwork-badge {
  font-size: 9px;
  background: #e8e8e8;
  color: #888;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

.connector-artwork-item.existing-artwork {
  opacity: 0.7;
}

/* Artwork section headers */
.artwork-section-header {
  font-size: 10px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  padding: 4px 0;
  margin-top: 4px;
}

.artwork-section-header:first-child {
  margin-top: 0;
}

/* ============================================================================
   Popover Footer and Button Styles
   ============================================================================ */

/* Footer with action buttons */
.popover-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #e0e0e0;
  background: #f9f9f9;
}

/* Base button styles for popover */
.popover-footer .btn-secondary,
.popover-footer .btn-primary,
.popover-footer .artwork-finish-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

/* Cancel button (secondary) */
.popover-footer .btn-secondary,
#artwork-cancel-btn {
  background: #6c757d;
  color: white;
  padding: 10px 24px;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.popover-footer .btn-secondary:hover,
#artwork-cancel-btn:hover {
  background: #5a6268;
}

/* Save button (finish/primary) */
.artwork-finish-btn,
#connector-artwork-finish-btn.artwork-finish-btn {
  background: #4caf50;
  color: white;
  padding: 10px 24px;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.artwork-finish-btn:hover {
  background: #43a047;
}

.artwork-finish-btn.hidden {
  display: none;
}

/* Primary button style */
.popover-footer .btn-primary {
  background: #007bff;
  color: white;
}

.popover-footer .btn-primary:hover {
  background: #0056b3;
}

/* Active state for all buttons */
.popover-footer .btn-primary:active,
.popover-footer .btn-secondary:active,
.popover-footer .artwork-finish-btn:active {
  transform: translateY(1px);
}

/* ==================== DISPLAY EDITOR STYLES ==================== */

/* Display Controls (same base as connector-controls) */
.display-controls {
    background: #2a2a3e;
    padding: 12px 16px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.display-status {
    color: #a0aec0;
    font-size: 0.85rem;
    text-align: center;
}

.display-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.display-settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.display-settings .setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #a0aec0;
}

.display-settings .setting-row label {
    font-weight: 500;
}

.display-settings .setting-row span {
    color: #e2e8f0;
}

.display-settings .input-with-unit {
    display: flex;
    align-items: center;
    gap: 4px;
}

.display-settings .input-with-unit input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 0.85rem;
    text-align: right;
    -moz-appearance: textfield;
}

.display-settings .input-with-unit input::-webkit-outer-spin-button,
.display-settings .input-with-unit input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.display-settings .input-with-unit span#display-zoffset-value {
    display: inline-block;
    width: 60px;
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 0.85rem;
    text-align: right;
    cursor: not-allowed;
}

.display-settings .input-with-unit .unit {
    font-size: 0.85rem;
    color: #718096;
    min-width: 22px;
    text-align: left;
}

/* Preview Canvas for Displays */
#display-preview-canvas {
    width: 100%;
    height: 100%;
}

#display-aperture-preview-canvas {
    border-radius: var(--radius-sm);
}

/* Collapsible Panels */
.collapsible-panel {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 10px;
}

.collapsible-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: #a0aec0;
    transition: background 0.2s;
}

.collapsible-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.collapsible-header .collapse-icon {
    font-size: 0.7rem;
    color: #718096;
    width: 12px;
}

.collapsible-header .panel-badge {
    margin-left: auto;
    font-size: 0.75rem;
    color: #e2e8f0;
    background: rgba(59, 130, 246, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
}

.collapsible-header .panel-badge:empty {
    display: none;
}

.collapsible-content {
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.collapsible-content.hidden {
    display: none;
}

/* Mesh Visibility Tree */
.mesh-visibility-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.mesh-tree {
    max-height: 200px;
    overflow-y: auto;
}

.mesh-tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.8rem;
    color: #a0aec0;
}

.mesh-tree-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--primary-color);
}

.mesh-tree-item label {
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mesh-tree-item label.is-mesh {
    color: #e2e8f0;
}

/* View Toggle (Table / Tree switch) */
.view-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 8px;
}

.view-toggle-btn {
    flex: 1;
    padding: 4px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.view-toggle-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.view-toggle-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.view-toggle-btn.active {
    background: rgba(74, 144, 226, 0.3);
    color: #e2e8f0;
    border-color: rgba(74, 144, 226, 0.5);
}

.view-toggle-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
}

/* Model Settings Table (flat mesh list for enclosures) */
.enclosure-mesh-settings {
    margin-top: 12px;
}

.model-settings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.model-settings-table th,
.model-settings-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.model-settings-table th {
    background: rgba(0, 0, 0, 0.3);
    font-weight: 600;
    color: #94a3b8;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.model-settings-table th:not(:first-child) {
    text-align: center;
    width: 55px;
}

.model-settings-table td:not(:first-child) {
    text-align: center;
}

.model-settings-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.model-settings-table tbody tr.disabled {
    opacity: 0.5;
}

.model-settings-table .part-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #e2e8f0;
}

.model-settings-table .part-name-text {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-settings-table input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #4a90e2;
}

.model-settings-table input[type="checkbox"].machine-checkbox {
    accent-color: #e67e22;
}

.model-settings-table input[type="checkbox"].texture-checkbox {
    accent-color: #9b59b6;
}

.model-settings-table input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

/* Mounting Holes Section */
.mounting-holes-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.mounting-holes-actions #hole-detection-status {
    font-size: 0.8rem;
    color: #718096;
}

.mounting-holes-selection {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.hole-selection-actions {
    display: flex;
    gap: 8px;
}

.hole-info {
    font-size: 0.8rem;
    color: #718096;
    font-style: italic;
}

.standoff-settings {
    display: flex;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.standoff-settings .setting-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.standoff-settings .setting-group label {
    font-size: 0.75rem;
    color: #718096;
}

.standoff-settings .setting-group select,
.standoff-settings .setting-group input {
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 0.8rem;
}

.standoff-settings .setting-group select {
    width: 80px;
}

.standoff-settings .setting-group .input-with-unit {
    display: flex;
    align-items: center;
    gap: 4px;
}

.standoff-settings .setting-group .input-with-unit input {
    width: 50px;
    text-align: right;
    -moz-appearance: textfield;
}

.standoff-settings .setting-group .input-with-unit input::-webkit-outer-spin-button,
.standoff-settings .setting-group .input-with-unit input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.standoff-settings .setting-group .unit {
    font-size: 0.75rem;
    color: #718096;
}

/* Extra small button variant */
.btn-xs {
    padding: 4px 8px;
    font-size: 0.7rem;
}

/* Mounting side overlay - positioned at bottom-right of preview */
.mounting-side-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 10;
}

/* Mounting side mini toggle */
.mounting-side-mini-toggle {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    height: 28px;
}

.mounting-side-mini-toggle button {
    padding: 0 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mounting-side-mini-toggle button:first-child {
    border-right: 1px solid var(--border-color);
}

.mounting-side-mini-toggle button:hover:not(.active) {
    background: var(--bg-color);
    color: var(--text-primary);
}

.mounting-side-mini-toggle button.active {
    background: var(--primary-color);
    color: white;
}

/* ==================== ENCLOSURE EDITOR STYLES ==================== */

/* Enclosure Controls (same base as connector/display-controls) */
.enclosure-controls {
    background: #2a2a3e;
    padding: 12px 16px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.enclosure-status {
    color: #a0aec0;
    font-size: 0.85rem;
    text-align: center;
}

.enclosure-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.enclosure-settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.enclosure-settings.hidden {
    display: none;
}

.enclosure-settings .setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #a0aec0;
}

.enclosure-settings .setting-row label {
    font-weight: 500;
}

.enclosure-settings .setting-row span {
    color: #e2e8f0;
}

/* Preview Canvas for Enclosures */
#enclosure-preview-canvas {
    width: 100%;
    height: 100%;
}

/* ========================================
   Beta Testers
   ======================================== */

.beta-testers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.beta-testers-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.beta-testers-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.beta-testers-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.btn-danger {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ========================================
   Deploy
   ======================================== */

.deploy-log {
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    max-height: 600px;
    overflow-y: auto;
    color: #c9d1d9;
}

.deploy-line {
    white-space: pre-wrap;
    word-break: break-all;
}

.deploy-line.error {
    color: #f85149;
}
