/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
header {
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
}

header > .container:first-child {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 1rem 2rem;
    margin: 0 auto;
    max-width: 100%;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-logo {
    width: 1em;
    height: 1em;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem 0;
}

/* Detail page uses full width */
main.container:has(#detail-container) {
    max-width: 100%;
    margin: 0;
    padding: 2rem;
}

#detail-container {
    width: 100%;
}

/* Tabs */
.tabs {
    background: var(--surface);
    padding: 0;
}

.tabs .container {
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.tab-button {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tab-button:hover {
    background: var(--background);
    color: var(--text-primary);
}

.tab-button.active {
    background: var(--primary-color);
    color: white;
}

/* Sub-tabs Navigation */
.sub-tabs-nav {
    background: var(--surface);
    border-bottom: 3px solid var(--primary-color);
}

.sub-tabs-nav .container {
    padding-top: 0;
    padding-bottom: 0.25rem;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.tab-content h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

/* Section Grid */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Buttons */
button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

button:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-secondary:hover {
    background: #475569;
}

/* Data Display */
.data-display {
    background: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    min-height: 200px;
    margin-top: 2rem;
    display: none;
}

.data-display.active {
    display: block;
}

.data-display pre {
    background: var(--background);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.5;
}

.data-display table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-display table th {
    background: var(--background);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.data-display table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.data-display table tr:hover {
    background: var(--background);
}

/* Sub-tabs (Level 2) */
.sub-tabs {
    display: none;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    flex-wrap: wrap;
}

.sub-tabs.active {
    display: flex;
}

.sub-tab-button {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sub-tab-button:hover {
    background: var(--background);
    color: var(--text-primary);
}

.sub-tab-button.active {
    background: var(--primary-color);
    color: white;
}

/* View All Container */
.view-all-container {
    min-height: 400px;
    background: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.view-all-container p.text-center {
    padding: 3rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Data Header */
.data-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.data-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    white-space: nowrap;
}

.data-header-spacer {
    flex: 1;
}

.data-info {
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
}

.add-new-btn {
    padding: 0.4rem 0.75rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.add-new-btn:hover {
    background: #059669;
    box-shadow: var(--shadow);
}

/* Table Wrapper */
.table-wrapper {
    overflow-x: auto;
    margin: 1rem 0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--background);
    border-radius: 6px;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.pagination-btn:disabled {
    background: var(--secondary-color);
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pagination-info {
    font-weight: 500;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    margin-left: 0.5rem;
    border: 2px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error State */
.error {
    background: #fee2e2;
    color: var(--error);
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--error);
}

/* Footer */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: auto;
    text-align: center;
}

footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-button {
        white-space: nowrap;
    }

    .section-grid {
        grid-template-columns: 1fr;
    }

    .card-actions {
        flex-direction: column;
    }

    .card-actions button {
        width: 100%;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.hidden {
    display: none;
}

/* Clickable Rows */
.clickable-row {
    transition: background-color 0.2s ease;
}

.clickable-row:hover {
    background-color: var(--background) !important;
    cursor: pointer;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.breadcrumb .separator {
    color: var(--text-secondary);
    margin: 0 0.25rem;
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

/* Header Title Row */
.header-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* Header Account Link */
.header-account-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.header-account-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.header-account-link svg {
    flex-shrink: 0;
}

/* Global Search */
.global-search-container {
    position: relative;
    min-width: 250px;
}

.global-search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    outline: none;
    transition: all 0.2s ease;
}

.global-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.global-search-input:focus {
    background: rgba(255, 255, 255, 0.3);
}

.global-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background: var(--surface);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.global-search-dropdown.active {
    display: block;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--background);
}

.search-result-type {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.125rem;
}

.search-result-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.search-result-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

.search-no-results,
.search-error {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.search-error {
    color: var(--error);
}

/* Collection Search */
.collection-search {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-left: 1rem;
}

.collection-search-input {
    width: 200px;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.collection-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.search-clear-btn {
    padding: 0.3rem 0.5rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-clear-btn:hover {
    background: #475569;
}

/* Column Customize Button */
.column-customize-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.column-customize-btn:hover {
    background: var(--border);
    color: var(--text-primary);
    transform: none;
}

.column-customize-btn.customized {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.column-customize-btn.customized:hover {
    background: var(--primary-hover);
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-overlay.active {
    display: flex;
}

/* Modal Content */
.modal-content {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.column-customizer-content {
    min-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: var(--background);
    color: var(--text-primary);
    transform: none;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--background);
    border-radius: 0 0 8px 8px;
}

/* Column Lists */
.column-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.column-list {
    background: var(--background);
    border-radius: 6px;
    padding: 1rem;
}

.column-list h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.column-list-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
}

.column-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
    min-height: 150px;
}

.column-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.column-list li:last-child {
    margin-bottom: 0;
}

.column-list li:hover {
    border-color: var(--primary-color);
    background: white;
}

/* Selected columns list */
.selected-columns li {
    cursor: grab;
}

.selected-columns li:active {
    cursor: grabbing;
}

.selected-columns li.dragging {
    opacity: 0.5;
    background: var(--primary-color);
    color: white;
}

.drag-handle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: grab;
}

.column-name {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.column-type {
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 0.125rem 0.375rem;
    background: var(--border);
    border-radius: 3px;
}

.remove-column-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
}

.remove-column-btn:hover {
    background: var(--error);
    color: white;
    transform: none;
}

/* Available columns - click to add */
.available-columns li {
    cursor: pointer;
}

.available-columns li:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.available-columns li:hover .column-name,
.available-columns li:hover .column-type {
    color: white;
}

.available-columns li:hover .column-type {
    background: rgba(255, 255, 255, 0.2);
}

/* Button styles for modal */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

/* Responsive modal */
@media (max-width: 600px) {
    .column-customizer-content {
        min-width: auto;
    }

    .column-lists {
        grid-template-columns: 1fr;
    }

    .modal-overlay {
        padding: 1rem;
    }
}

/* Related Items Section */
.related-items-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.related-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.related-items-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-child-btn {
    padding: 0.4rem 0.75rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-child-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Related Items Table */
.related-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.related-items-table th {
    background: var(--background);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    color: var(--text-primary);
}

.related-items-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.related-items-table tr:hover {
    background: var(--background);
}

.related-items-table .actions-col {
    width: 80px;
    text-align: center;
}

.no-related-items {
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem 0;
}

/* Auto-populate prompt for empty distributor SKUs */
.auto-populate-prompt {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

.auto-populate-prompt p {
    margin-bottom: 1rem;
    font-style: normal;
}

.auto-populate-prompt .auto-populate-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    margin-bottom: 0;
}

.auto-populate-prompt button {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
}

.auto-populate-prompt button:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* Small loading spinner for buttons */
.loading-spinner-small {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Delete button in related items */
.delete-child-btn {
    padding: 0.25rem 0.5rem;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-child-btn:hover {
    background: #dc2626;
    transform: none;
}

/* Clickable links in related items table */
.related-item-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s ease;
}

.related-item-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* View Toggle Buttons for switchable related items */
.view-toggle-container {
    display: flex;
    gap: 0.25rem;
    background: var(--background);
    border-radius: 6px;
    padding: 3px;
}

.view-toggle-btn {
    padding: 0.35rem 0.75rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-toggle-btn:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.view-toggle-btn.active {
    background: var(--primary-color);
    color: white;
}

.view-toggle-btn.active:hover {
    background: var(--primary-hover);
}

/* Add Child Form */
.add-child-form {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.add-child-form.hidden {
    display: none;
}

.add-form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.add-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.add-form-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.add-form-field input,
.add-form-field select {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.add-form-field input:focus,
.add-form-field select:focus {
    border-color: var(--primary-color);
}

.add-form-field-checkbox {
    flex-direction: row;
    align-items: center;
}

.add-form-field-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.add-form-field-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.add-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.add-form-actions button {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

/* ==========================================
   Detail Page Sidebar Layout
   ========================================== */

.detail-layout {
    display: flex;
    gap: 1.5rem;
    min-height: calc(100vh - 200px);
    align-items: flex-start;
    width: 100%;
}

/* Sidebar Navigation */
.detail-sidebar {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    flex: 0 0 180px;
    background: var(--surface);
    border-radius: 8px;
    padding: 0.5rem;
    position: sticky;
    top: 1rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    width: 100%;
}

.sidebar-nav-item:hover {
    background: var(--background);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: var(--primary-color);
    color: white;
}

.sidebar-nav-item.active:hover {
    background: var(--primary-hover);
}

.sidebar-nav-item .nav-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.sidebar-nav-item.active .nav-icon {
    opacity: 1;
}

/* Separator in sidebar */
.sidebar-separator {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* Main Content Area */
.detail-main {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

/* Section Content */
.detail-section {
    display: none;
    width: 100%;
}

.detail-section.active {
    display: block;
    width: 100%;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
    width: 100%;
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.section-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Info Section Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    width: 100%;
}

.info-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
}

.info-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.info-card-value {
    font-size: 1rem;
    color: var(--text-primary);
    word-break: break-word;
}

.info-card-value a {
    color: var(--primary-color);
    text-decoration: none;
}

.info-card-value a:hover {
    text-decoration: underline;
}

/* Placeholder sections */
.placeholder-section {
    background: var(--surface);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.placeholder-section h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.placeholder-section p {
    margin: 0;
    font-size: 0.9rem;
}

/* Manage Section */
.manage-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.manage-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.manage-action-btn:hover {
    background: var(--background);
    border-color: var(--primary-color);
}

.manage-action-btn.danger {
    border-color: var(--error);
}

.manage-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.manage-action-btn .action-icon {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.manage-action-btn.danger .action-icon {
    color: var(--error);
}

.manage-action-info {
    flex: 1;
}

.manage-action-info .action-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.manage-action-btn.danger .action-title {
    color: var(--error);
}

.manage-action-info .action-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .detail-layout {
        flex-direction: column;
    }

    .detail-sidebar {
        width: 100%;
        position: static;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .sidebar-nav-item {
        flex: 0 0 auto;
    }
}

/* ==========================================
   Changelog Timeline
   ========================================== */

.changelog-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 2rem;
}

.changelog-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.changelog-entry {
    display: flex;
    gap: 1rem;
    position: relative;
    padding-bottom: 1.5rem;
}

.changelog-entry:last-child {
    padding-bottom: 0;
}

.changelog-icon {
    position: absolute;
    left: -2rem;
    width: 22px;
    height: 22px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.changelog-icon svg {
    width: 12px;
    height: 12px;
    color: var(--text-secondary);
}

.changelog-content {
    flex: 1;
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.changelog-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.changelog-type {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    background: var(--background);
    color: var(--text-secondary);
}

.changelog-type.created {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.changelog-type.edited {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.changelog-type.archived {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.changelog-type.unarchived {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.changelog-type.relation_added {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.changelog-type.relation_removed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.changelog-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.changelog-details {
    margin-top: 0.5rem;
}

.changelog-changes {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
}

.changelog-changes li {
    padding: 0.25rem 0;
    color: var(--text-secondary);
}

.changelog-changes li strong {
    color: var(--text-primary);
}

.changelog-user {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.relation-entity {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--background);
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--primary-color);
}

/* ==========================================
   Relationships Section
   ========================================== */

.relationships-subsection {
    margin-bottom: 2rem;
}

.relationships-subsection h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.relationships-subsection:last-child {
    margin-bottom: 0;
}

/* ==========================================
   Comments Section
   ========================================== */

.comments-add-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.comments-add-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
}

.comments-add-form textarea:focus {
    border-color: var(--primary-color);
}

.comments-add-form button {
    align-self: flex-end;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comments-empty {
    background: var(--surface);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.comment-item {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-user {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.comment-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Loading States */
.section-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

/* ==========================================
   Dashboard
   ========================================== */

.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Stats Row */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* Dashboard Panels */
.dashboard-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.dashboard-panel {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-link:hover {
    background: var(--background);
    color: var(--primary-hover);
    transform: none;
}

.panel-content {
    flex: 1;
    padding: 0.5rem;
    overflow-y: auto;
}

/* Dashboard Items */
.dashboard-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--border);
}

.dashboard-item:last-child {
    border-bottom: none;
}

.dashboard-item:hover {
    background: var(--background);
}

.item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    flex: 1;
}

.item-id {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    font-family: monospace;
}

.item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.item-qty {
    font-weight: 500;
}

.item-project {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.25rem;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Build lifecycle statuses */
.status-planning {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.status-long_lead,
.status-long-lead {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-short_lead,
.status-short-lead {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.status-components_ready,
.status-components-ready {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-assembly {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.status-complete {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

/* Project lifecycle statuses */
.status-recommended {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.status-not_recommended,
.status-not-recommended {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-obsolete,
.status-end_of_life,
.status-end-of-life {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Generic statuses */
.status-created {
    background: rgba(100, 116, 139, 0.1);
    color: var(--secondary-color);
}

.status-draft {
    background: rgba(100, 116, 139, 0.1);
    color: var(--secondary-color);
}

.status-archived {
    background: rgba(100, 116, 139, 0.15);
    color: #475569;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    height: 100%;
    min-height: 150px;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-panels {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 2rem;
    }
}

/* ==========================================
   Pricing Section
   ========================================== */

.pricing-section {
    background: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
}

.pricing-table {
    width: auto;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
}

.pricing-table th {
    background: var(--background);
    padding: 0.15rem 0.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.pricing-table td {
    padding: 0.1rem 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pricing-table tbody tr:hover {
    background: var(--background);
}

.pricing-table td:first-child {
    font-weight: 500;
    color: var(--text-primary);
}

.pricing-table td:nth-child(2) {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--success);
}

.pricing-table td:nth-child(3) {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.pricing-metadata {
    background: var(--background);
    border-radius: 6px;
    padding: 1rem 1.25rem;
}

.pricing-metadata p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pricing-metadata p:first-child {
    margin-top: 0;
}

.pricing-metadata p:last-child {
    margin-bottom: 0;
}

.pricing-metadata strong {
    color: var(--text-primary);
    font-weight: 600;
}

.pricing-fetched {
    font-size: 0.75rem !important;
    color: var(--text-secondary) !important;
    opacity: 0.7;
    margin-top: 0.25rem !important;
    margin-bottom: 0.25rem !important;
}

.no-pricing-data {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

.no-pricing-data p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.no-pricing-data p:first-child {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.pricing-stale-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: var(--warning);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pricing-stale-warning::before {
    content: '⚠';
    font-size: 1rem;
}

/* Distributor pricing blocks (multiple distributors per manufacturer part) */
.distributor-pricing-block {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--table-border-color);
}

.distributor-pricing-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.distributor-pricing-block h3 {
    font-size: 0.95rem;
    margin: 0 0 0.25rem 0;
    color: var(--text-color);
}

.pricing-variation {
    margin: 0.4rem 0;
    padding: 0.5rem;
    background: var(--hover-bg);
    border-radius: 4px;
}

.pricing-variation p {
    margin: 0.15rem 0;
    font-size: 0.8rem;
}

/* Out of stock styling */
.out-of-stock {
    color: var(--error);
    font-weight: 600;
}

.pricing-variation .pricing-meta {
    color: var(--secondary-text-color);
    font-size: 0.8rem;
}

.pricing-variation .pricing-table {
    margin-top: 0.5rem;
}

/* ==========================================
   Order Planning
   ========================================== */

.order-planning-container {
    min-height: 400px;
}

/* Order Planning Filters */
.order-planning-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group select,
.filter-group input[type="number"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.875rem;
    min-width: 150px;
    outline: none;
    transition: border-color 0.2s ease;
}

.filter-group select:focus,
.filter-group input[type="number"]:focus {
    border-color: var(--primary-color);
}

.filter-checkbox {
    flex-direction: row;
    align-items: center;
}

.filter-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Order Planning Summary */
.order-planning-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.order-planning-summary .summary-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border);
}

.order-planning-summary .summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.order-planning-summary .summary-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* Builds Summary */
.order-planning-builds {
    margin-bottom: 1.5rem;
}

.order-planning-builds h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
}

.builds-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.build-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.build-chip:hover {
    border-color: var(--primary-color);
    background: var(--background);
}

.build-chip .build-id {
    font-family: monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
}

.build-chip .build-name {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.build-chip .build-qty {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--background);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
}

.build-chip .build-date {
    font-size: 0.75rem;
    color: var(--warning);
    font-weight: 500;
}

/* Order Planning Table */
.order-planning-table h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
}

.order-planning-table table {
    width: 100%;
    border-collapse: collapse;
}

.order-planning-table th {
    background: var(--background);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.order-planning-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.order-planning-table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}

.order-planning-table tbody tr:hover {
    background: var(--background);
}

.order-planning-table tbody tr.needs-order {
    background: rgba(239, 68, 68, 0.03);
}

.order-planning-table tbody tr.needs-order:hover {
    background: rgba(239, 68, 68, 0.08);
}

.order-planning-table .metapart-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.order-planning-table .metapart-link:hover {
    text-decoration: underline;
}

.order-planning-table .qty-to-order {
    font-weight: 600;
    color: var(--error);
}

.order-planning-table .attrition-note {
    color: var(--warning);
    font-size: 0.8rem;
    cursor: help;
}

.order-planning-table .best-price {
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--success);
    cursor: help;
}

.order-planning-table .no-price {
    color: var(--text-secondary);
}

/* No Data State */
.order-planning-container .no-data {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    background: var(--background);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

/* Pricing Modal */
.pricing-modal-content {
    max-width: 800px;
    max-height: 90vh;
}

.pricing-modal-summary {
    background: var(--background);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.pricing-modal-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
}

.pricing-modal-summary .label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.pricing-modal-summary .value {
    color: var(--text-primary);
    font-weight: 500;
}

.pricing-modal-summary .value.highlight {
    color: var(--error);
    font-size: 1.1rem;
}

.pricing-modal-builds {
    margin-bottom: 1.5rem;
}

.pricing-modal-builds h4,
.pricing-modal-options h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.build-usage-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.build-usage-item .build-id {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--primary-color);
}

.build-usage-item .build-name {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.build-usage-item .build-qty {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.build-usage-item .build-date {
    font-size: 0.75rem;
    color: var(--warning);
}

/* Manufacturer Part Block */
.manufacturer-part-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.manufacturer-part-block:last-child {
    margin-bottom: 0;
}

.mp-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}

.mp-manufacturer {
    font-weight: 600;
    color: var(--text-primary);
}

.mp-mpn {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.preferred-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.125rem 0.5rem;
    background: var(--success);
    color: white;
    border-radius: 3px;
    margin-left: auto;
}

.mp-distributors {
    padding: 0.75rem 1rem;
}

.distributor-variation {
    padding: 0.75rem;
    background: var(--background);
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.distributor-variation:last-child {
    margin-bottom: 0;
}

.variation-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.variation-header .dist-name {
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

.variation-header .sku {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stock-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 3px;
    margin-left: auto;
}

.stock-badge.in-stock {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stock-badge.out-of-stock {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.variation-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.price-breaks-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.price-breaks-table th {
    background: var(--surface);
    padding: 0.5rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.price-breaks-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.price-breaks-table td:nth-child(2),
.price-breaks-table td:nth-child(3) {
    font-family: monospace;
}

.product-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--primary-color);
}

.product-link:hover {
    text-decoration: underline;
}

.no-pricing {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Responsive Order Planning */
@media (max-width: 768px) {
    .order-planning-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group select,
    .filter-group input[type="number"] {
        width: 100%;
    }

    .order-planning-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .pricing-modal-content {
        max-width: 100%;
        margin: 0.5rem;
    }
}

/* ==========================================
   Build Line Items Section (BOM with Consumption)
   ========================================== */

.build-bom-summary {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.build-bom-summary .summary-item {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.build-bom-summary .summary-item strong {
    color: var(--text-primary);
}

.build-bom-items {
    overflow-x: auto;
}

.bom-table {
    width: 100%;
}

.bom-table th.num-col,
.bom-table td.num-col {
    text-align: right;
    white-space: nowrap;
}

.bom-table .designators-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bom-item-row .metapart-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expand-placeholder {
    display: inline-block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.expand-btn {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.expand-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.expand-icon {
    line-height: 1;
}

.bom-item-details {
    background: var(--background);
}

.bom-item-details.hidden {
    display: none;
}

.bom-details-content {
    padding: 1rem 1.5rem;
}

.bom-details-content h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mfr-part-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.mfr-part-block:last-child {
    margin-bottom: 0;
}

.mfr-part-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.mfr-part-header a {
    font-weight: 600;
    font-size: 1rem;
}

.mfr-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.preferred-badge {
    background: var(--success);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.available-qty {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.lots-table-container {
    margin-top: 0.5rem;
}

.lots-mini-table {
    width: 100%;
    font-size: 0.85rem;
    border-collapse: collapse;
}

.lots-mini-table th,
.lots-mini-table td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.lots-mini-table th {
    background: var(--background);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.lots-mini-table td.num-col,
.lots-mini-table th.num-col {
    text-align: right;
}

.lots-mini-table tbody tr:last-child td {
    border-bottom: none;
}

.no-mfr-parts,
.no-lots,
.no-consumed-lots {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
    margin: 0;
    padding: 0.5rem 0;
}

.consumed-lots-table {
    margin-top: 0;
}

/* Status badges for BOM items */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pending {
    background: var(--background);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.status-badge.partial {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.status-badge.complete {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

/* ==========================================
   Table Sorting & Filtering
   ========================================== */

/* Table header with sort/filter */
.th-sortable {
    position: relative;
}

.th-content {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.th-sort-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: none;
    font-size: inherit;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
    border-radius: 4px;
    white-space: nowrap;
}

.th-sort-btn:hover {
    background: var(--surface);
    transform: none;
}

.th-label {
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Sort indicators */
.sort-indicator {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.25rem;
    vertical-align: middle;
}

.sort-indicator.sort-asc {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid var(--primary-color);
}

.sort-indicator.sort-desc {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid var(--primary-color);
}

.th-sortable.sorted-asc .th-sort-btn,
.th-sortable.sorted-desc .th-sort-btn {
    color: var(--primary-color);
}

/* Filter button in header */
.th-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s ease;
    opacity: 0.6;
}

.th-filter-btn:hover {
    background: var(--surface);
    color: var(--primary-color);
    opacity: 1;
    transform: none;
}

/* Active filter badge */
.filter-active-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    margin-left: 0.25rem;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.filter-active-badge:hover {
    transform: scale(1.3);
    background: var(--error);
}

/* Filter popover */
.filter-popover {
    display: none;
    position: absolute;
    z-index: 1001;
    min-width: 200px;
    max-width: 280px;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.filter-popover.active {
    display: block;
}

.filter-popover-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.filter-popover-body {
    padding: 0.75rem 1rem;
}

.filter-popover-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--background);
    border-radius: 0 0 8px 8px;
}

/* Filter options */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.filter-option:hover {
    background: var(--background);
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.filter-option span {
    text-transform: capitalize;
}

/* Numeric filter row */
.numeric-filter-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.numeric-filter-op {
    width: 50px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
}

.numeric-filter-op:focus {
    border-color: var(--primary-color);
}

.numeric-filter-val {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.875rem;
    outline: none;
}

.numeric-filter-val:focus {
    border-color: var(--primary-color);
}

/* Filtered indicator */
.filtered-indicator {
    color: var(--primary-color);
    font-weight: 500;
    font-style: italic;
    margin-left: 0.5rem;
}

/* Clear filters button */
.clear-filters-btn {
    padding: 0.4rem 0.75rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.clear-filters-btn:hover {
    background: #475569;
    transform: none;
}

/* Button sizes in filter popover */
.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

/* No results row in filtered table */
.no-results-row {
    text-align: center;
    padding: 2rem 1rem !important;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--background);
}

/* ==========================================
   BOM Management Styles
   ========================================== */

/* BOM Header */
.bom-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* BOM Locked Badge */
.bom-locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.bom-locked-badge svg {
    flex-shrink: 0;
}

/* BOM Lock Notice */
.bom-lock-notice {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.bom-lock-notice p {
    margin: 0;
    color: #92400e;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* BOM Import Section */
.bom-import-section {
    margin-bottom: 1.5rem;
}

.bom-import-section.hidden {
    display: none;
}

.bom-import-hint {
    background: var(--background);
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.bom-import-hint p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
}

/* BOM Edit Button */
.bom-edit-btn {
    min-width: 60px;
}

/* BOM Actions Column */
.bom-actions-col {
    white-space: nowrap;
}

.bom-actions-col.hidden {
    display: none;
}

/* Edit button in BOM table */
.edit-btn {
    padding: 0.25rem 0.5rem;
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-right: 0.5rem;
}

.edit-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.hidden {
    display: none;
}

/* Modal Content */
.modal-content {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0 0 0.75rem;
}

.modal-body ul {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.25rem;
}

.modal-body textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.875rem;
    resize: vertical;
    outline: none;
}

.modal-body textarea:focus {
    border-color: var(--primary-color);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--background);
}

/* Import Errors */
.import-errors {
    margin-top: 1rem;
    padding: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.875rem;
}

.import-errors.hidden {
    display: none;
}

.import-errors p {
    margin: 0 0 0.5rem;
}

.import-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

.import-errors li {
    margin-bottom: 0.25rem;
}

/* BOM Add Form in Edit Mode */
#bom-add-form {
    margin-bottom: 1.5rem;
}

#bom-add-form.hidden {
    display: none;
}

/* BOM Items Table */
.bom-items-table .actions-col {
    min-width: 120px;
}

/* Import Dropzone */
.import-dropzone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--background);
    margin-bottom: 1rem;
}

.import-dropzone:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

.import-dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
    border-style: solid;
}

.import-dropzone.file-loaded {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.import-dropzone.file-loaded .dropzone-icon svg {
    stroke: var(--success);
}

.dropzone-icon {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.dropzone-icon svg {
    stroke: var(--text-secondary);
    transition: stroke 0.2s ease;
}

.import-dropzone:hover .dropzone-icon svg {
    stroke: var(--primary-color);
}

.dropzone-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
}

.dropzone-subtext {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Import Divider */
.import-divider {
    display: flex;
    align-items: center;
    margin: 1rem 0;
}

.import-divider::before,
.import-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.import-divider span {
    padding: 0 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   Account Page Styles
   ========================================== */

.account-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.account-header {
    margin-bottom: 2rem;
}

.account-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
}

.account-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.account-section h2 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.section-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.section-description code {
    background: var(--background);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

.account-info-grid {
    display: grid;
    gap: 0.75rem;
}

.info-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 1rem;
}

.info-row label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-row span {
    font-size: 0.95rem;
}

/* Token Display */
.token-display-container {
    margin-bottom: 1.5rem;
}

.token-display-container > label {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.token-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.token-value {
    flex: 1;
    min-width: 200px;
    background: var(--background);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9rem;
    word-break: break-all;
    border: 1px solid var(--border);
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.copy-success {
    color: var(--success);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.copy-success.hidden {
    display: none;
}

/* KiCAD Setup Help */
.kicad-setup-help {
    background: var(--background);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.kicad-setup-help h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.kicad-setup-help ol {
    margin: 0;
    padding-left: 1.5rem;
}

.kicad-setup-help li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.kicad-setup-help li:last-child {
    margin-bottom: 0;
}

.kicad-setup-help pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    margin: 0.75rem 0 0;
    overflow-x: auto;
    font-size: 0.8rem;
    line-height: 1.5;
}

.kicad-setup-help code {
    background: var(--surface);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Loading and error states */
.loading-indicator {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    color: #dc2626;
}

.error-message.hidden {
    display: none;
}
