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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --sidebar: #1e293b;
    --sidebar-hover: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

/* ============================================
   SHIPPING ALARM BANNER STYLES
   ============================================ */
.shipping-alarm-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    background: linear-gradient(135deg, #f48fb1, #f8bbd0);
    color: white;
    padding: 16px 24px;
    animation: alarm-pulse 1s ease-in-out infinite;
    box-shadow: 0 4px 20px rgba(244, 143, 177, 0.4);
    pointer-events: none; /* Allow clicks to pass through to elements below */
}

@keyframes alarm-pulse {
    0%, 100% {
        opacity: 1;
        background: linear-gradient(135deg, #f48fb1, #f8bbd0);
    }
    50% {
        opacity: 0.9;
        background: linear-gradient(135deg, #ec407a, #f48fb1);
    }
}

.alarm-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    pointer-events: auto; /* Re-enable clicks on the alarm content itself */
}

.alarm-icon {
    animation: alarm-shake 0.5s ease-in-out infinite;
}

@keyframes alarm-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.alarm-details h3 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.alarm-details p {
    font-size: 14px;
    opacity: 0.9;
}

.acknowledge-btn {
    background: white;
    color: #ec407a;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.acknowledge-btn:hover {
    background: #f5f5f5;
    transform: scale(1.05);
}

.logistics-note {
    font-size: 12px;
    opacity: 0.8;
    font-style: italic;
}

/* Mobile responsive for alarm banner */
@media (max-width: 768px) {
    .alarm-content {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .alarm-icon {
        display: none;
    }

    .acknowledge-btn {
        width: 100%;
        padding: 14px 20px;
    }
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

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

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

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.user-email {
    font-size: 12px;
    color: #94a3b8;
}

/* Compact logout button integrated with user info */
.logout-button-compact {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logout-button-compact:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

.logout-button-compact:active {
    transform: translateY(0);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    height: 64px;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sync-status {
    font-size: 14px;
    color: var(--text-muted);
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Dashboard Search Container */
.dashboard-search-container {
    max-width: 900px;
    margin: 0 auto;
    padding-top: 60px;
}

.search-hero {
    text-align: center;
    margin-bottom: 48px;
}

.search-hero-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.2;
}

.search-hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
}

/* Model Search Bar */
.model-search-wrapper {
    position: relative;
    margin-bottom: 48px;
}

.model-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 8px 20px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.model-search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.model-search-icon {
    width: 28px;
    height: 28px;
    color: var(--text-muted);
    margin-right: 16px;
    flex-shrink: 0;
}

.model-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 20px;
    padding: 16px 0;
    background: transparent;
    color: var(--text);
}

.model-search-input::placeholder {
    color: var(--text-muted);
}

.clear-search-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.clear-search-btn:hover {
    background: var(--danger);
    color: white;
}

.clear-search-btn svg {
    width: 20px;
    height: 20px;
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
}

.search-result-item {
    padding: 16px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 16px;
}

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

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

.search-result-item.active {
    background: #eff6ff;
}

.search-result-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
}

.search-result-model {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.search-result-name {
    font-size: 14px;
    color: var(--text-muted);
}

.search-result-match {
    background: #fef3c7;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

.no-results {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
}

/* Selected Model Display */
.selected-model-display {
    margin-bottom: 48px;
}

.selected-model-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.selected-model-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.selected-model-info {
    flex: 1;
}

.selected-model-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.selected-model-name {
    font-size: 18px;
    color: var(--text-muted);
}

/* Model Specifications */
.model-specs-section {
    padding: 24px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 24px;
    margin-top: 24px;
}

.specs-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.spec-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.spec-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Model Resources Grid */
.model-resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.resource-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.resource-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-icon svg {
    width: 32px;
    height: 32px;
}

.pdf-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.price-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.resource-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.resource-description {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Dashboard Stats */
.dashboard-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 32px;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.stat-mini {
    text-align: center;
}

.stat-mini-label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-mini-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-icon {
    width: 20px;
    height: 20px;
}

.stat-icon.blue { color: #3b82f6; }
.stat-icon.green { color: #10b981; }
.stat-icon.orange { color: #f59e0b; }
.stat-icon.purple { color: #8b5cf6; }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.stat-description {
    font-size: 12px;
    color: var(--text-muted);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.card:last-child {
    margin-bottom: 0;
}

.card-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.card-description {
    font-size: 14px;
    color: var(--text-muted);
}

.card-content {
    padding: 24px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

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

.action-btn svg {
    width: 24px;
    height: 24px;
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--background);
    border-radius: 8px;
    transition: all 0.2s;
}

.file-item:hover {
    background: #e0f2fe;
}

.file-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.file-icon.pdf {
    background: #fee2e2;
    color: #dc2626;
}

.file-icon.excel {
    background: #d1fae5;
    color: #059669;
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.file-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* Search Section */
.search-section {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.search-bar {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.2s;
}

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

/* Buttons */
.btn-primary {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

.btn-secondary {
    padding: 12px 24px;
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Table */
.table-container {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: visible;
}

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

.parts-table thead {
    background: var(--background);
}

.parts-table th {
    padding: 16px 10px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

/* Center align numeric columns in quote table */
#quoteLineItemsTable th:nth-child(3),
#quoteLineItemsTable th:nth-child(4),
#quoteLineItemsTable th:nth-child(5),
#quoteLineItemsTable th:nth-child(6) {
    text-align: center;
}

#quoteLineItemsTable td:nth-child(6) {
    text-align: center;
    font-weight: 500;
}

.parts-table td {
    padding: 14px 10px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    overflow: visible;
    vertical-align: middle;
}

.parts-table td input {
    width: 100%;
    box-sizing: border-box;
    font-size: 13px;
    padding: 8px 10px !important;
    text-align: left;
}

/* Specific input alignment for table cells */
.parts-table td input[type="number"] {
    text-align: center !important;
    padding: 8px 6px !important;
}

.parts-table td input[type="text"].search-input {
    padding: 8px 10px !important;
}

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

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

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 48px !important;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.page-info {
    font-size: 14px;
    color: var(--text-muted);
}

/* Documents Grid */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.document-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.document-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.document-preview {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-icon {
    width: 64px;
    height: 64px;
    color: white;
}

.document-info {
    padding: 20px;
}

.document-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.document-description {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.document-meta {
    font-size: 12px;
    color: var(--text-muted);
}

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

/* Freight modal should appear on top of calendar when both are open */
#freightQuoteModal {
    z-index: 10002 !important;
}

#freightQuoteModal .modal-content {
    z-index: 10003 !important;
}

/* Shipping confirmation modal should appear on top of calendar when both are open */
#shippingConfirmationModal {
    z-index: 10002 !important;
}

#shippingConfirmationModal .modal-content {
    z-index: 10003 !important;
}

/* Upload photos modal should appear on top of shipping confirmation modal */
#uploadPhotosModal {
    z-index: 10010 !important;
}

#uploadPhotosModal .modal-content {
    z-index: 10011 !important;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.pdf-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.pdf-canvas {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* Price List Actions */
.price-list-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.file-preview {
    text-align: center;
    padding: 48px 24px;
    background: var(--background);
    border-radius: 12px;
}

.file-preview-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-preview-icon svg {
    width: 48px;
    height: 48px;
    color: var(--primary);
}

.file-preview h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.file-preview p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Documentation */
.documentation {
    max-width: 800px;
}

.doc-section {
    margin-bottom: 32px;
}

.doc-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.doc-section p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 12px;
}

.doc-section ul,
.doc-section ol {
    padding-left: 24px;
    margin-top: 8px;
}

.doc-section li {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.8;
}

.doc-section strong {
    color: var(--text);
    font-weight: 600;
}

/* Model Detail Page */
.model-detail-container {
    max-width: 1400px;
    margin: 0 auto;
}

.model-detail-header {
    display: grid;
    grid-template-columns: 1fr 500px;
    gap: 32px;
    margin-bottom: 32px;
}

.model-info-section {
    display: flex;
    flex-direction: column;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    width: fit-content;
    margin-bottom: 24px;
}

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

.btn-back svg {
    width: 18px;
    height: 18px;
}

.model-detail-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.model-detail-subtitle {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.model-meta-tags {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.meta-tag {
    padding: 6px 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.meta-tag.status-available {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

/* 3D Viewer Container */
.model-3d-viewer-container {
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--background);
}

.viewer-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.viewer-controls {
    display: flex;
    gap: 8px;
}

.model-3d-viewer {
    width: 100%;
    height: 500px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.viewer-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 20px;
}

.viewer-placeholder svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.viewer-placeholder p {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.viewer-placeholder small {
    font-size: 13px;
    opacity: 0.8;
}

.viewer-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    z-index: 10;
}

.viewer-loading.active {
    display: flex;
}

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

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

.viewer-loading p {
    font-size: 16px;
    font-weight: 500;
}

/* Model Tabs */
.model-tabs {
    display: flex;
    gap: 4px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.model-tabs-content {
    min-height: 400px;
}

.tab-content {
    display: none;
}

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

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.action-buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.action-button:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.pdf-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.price-bg {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.download-bg {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.action-text {
    flex: 1;
}

.action-text strong {
    display: block;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 4px;
}

.action-text span {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
}

/* Info List */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.text-muted {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* 3D Parts List Styles */
.parts-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.stat-pill.green {
    background: #d1fae5;
    color: #065f46;
}

.stat-pill.orange {
    background: #fed7aa;
    color: #92400e;
}

.stat-pill.blue {
    background: #dbeafe;
    color: #1e40af;
}

.parts-list-controls {
    margin-bottom: 24px;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.filter-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.part-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
    cursor: pointer;
}

.part-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.part-card.clickable3d {
    border-left: 4px solid #8b5cf6;
}

.part-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.part-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.part-type-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.part-type-badge.psm {
    background: #dbeafe;
    color: #1e40af;
}

.part-type-badge.par {
    background: #fce7f3;
    color: #9f1239;
}

.part-type-badge.asm {
    background: #e0e7ff;
    color: #3730a3;
}

.part-filename {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-family: 'Courier New', monospace;
}

.part-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.part-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.part-no-price {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.part-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

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

.icon-btn svg {
    width: 16px;
    height: 16px;
}

.view-3d-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.view-3d-btn:hover {
    transform: scale(1.05);
}

.tab-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.tab-btn.active .tab-badge {
    background: rgba(255, 255, 255, 0.3);
}

/* Part Info Panel */
.part-info-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 16px;
    min-width: 250px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 100;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.part-info-panel.fade-out {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

.part-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.part-info-header strong {
    font-size: 18px;
    color: var(--primary);
}

.part-info-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--background);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.part-info-close:hover {
    background: var(--danger);
    color: white;
}

.part-info-body {
    font-size: 14px;
}

.part-info-type {
    display: inline-block;
    padding: 4px 8px;
    background: var(--background);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.part-info-file {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.part-info-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.part-info-no-price {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .model-detail-header {
        grid-template-columns: 1fr;
    }

    .model-3d-viewer-container {
        order: -1;
    }

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

/* Mobile Menu Components */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .model-detail-title {
        font-size: 32px;
    }

    .model-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 45%;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 100;
        transition: left 0.3s;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .main-content {
        width: 100%;
    }

    .content-area {
        padding: 16px;
    }

    /* Make all tables scrollable horizontally on mobile */
    .card-content table,
    .parts-list table,
    .quotes-list table,
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Wrapper for tables to enable scrolling */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }

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

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

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .search-section {
        flex-direction: column;
    }

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

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    /* Edit Unknown Item Modal - keep visible when keyboard opens */
    #editUnknownItemModal {
        align-items: flex-start;
        padding-top: 20px;
    }

    #editUnknownItemModal .modal-content {
        margin-top: 0;
        max-height: 80vh;
    }

    .price-list-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .top-header {
        padding: 0 16px;
    }

    .page-title {
        font-size: 18px;
    }

    .stat-value {
        font-size: 24px;
    }
}

/* Autocomplete Suggestions for Quote Line Items */
.autocomplete-suggestions {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: white !important;
    border: 2px solid #1565c0 !important;
    border-radius: 8px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
    z-index: 99999 !important;
    margin-top: 4px !important;
}

.autocomplete-item {
    padding: 15px !important;
    cursor: pointer !important;
    border-bottom: 1px solid #e0e0e0 !important;
    transition: background 0.2s ease !important;
    background: white !important;
}

.autocomplete-item:hover {
    background: #e3f2fd !important;
}

.autocomplete-item:last-child {
    border-bottom: none !important;
}

.part-number-autocomplete {
    position: relative !important;
}

/* Make sure the parent td has relative positioning */
td {
    position: relative;
}

/* Quote Builder Table - Allow autocomplete overflow */
#quoteLineItemsTable {
    position: relative;
}

#quoteLineItemsTable tbody {
    position: relative;
}

#quoteLineItemsTable td {
    position: relative;
    overflow: visible !important;
}

/* Fix modal scrolling for quote builder */
.modal-body {
    position: relative;
}

/* Ensure table wrapper doesn't clip autocomplete */
.table-container {
    position: relative;
}

/* ============================================
   SHIPPING STYLES
   ============================================ */

/* Shipping line item highlighting */
.shipping-line-item {
    background: #e8f5e9 !important;
    border-left: 4px solid #2e7d32 !important;
}

.shipping-line-item:hover {
    background: #c8e6c9 !important;
}

/* Shipping service card styles */
.shipping-service-card {
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.shipping-service-card:hover {
    border-color: #1565c0;
    background: #f5f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.15);
}

/* Loading spinner */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #1565c0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Shipping modal specific styles */
#shippingPackageModal .search-input,
#shippingServiceModal .search-input {
    padding: 10px !important;
}

#shippingPackageModal select.search-input {
    cursor: pointer;
}

/* ============================================
   EMAIL SECTION STYLES
   ============================================ */

.email-badge {
    display: inline-block;
    background: #f44336;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    min-width: 18px;
    text-align: center;
}

.email-item {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.email-item:hover {
    background: #f5f5f5;
}

.email-item.unread {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.email-item.unread:hover {
    background: #bbdefb;
}

.email-checkbox {
    margin-right: 12px;
    margin-top: 4px;
}

.email-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1565c0;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    margin-right: 15px;
}

.email-content {
    flex: 1;
    min-width: 0;
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.email-from {
    font-weight: 600;
    color: #212121;
    font-size: 15px;
}

.email-item.unread .email-from {
    font-weight: 700;
}

.email-date {
    color: #757575;
    font-size: 13px;
    white-space: nowrap;
    margin-left: 12px;
}

.email-subject {
    color: #424242;
    font-size: 14px;
    margin-bottom: 4px;
    font-weight: 500;
}

.email-item.unread .email-subject {
    font-weight: 600;
}

.email-preview {
    color: #757575;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.email-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.email-tag.parts-detected {
    background: #fff3e0;
    color: #ef6c00;
}

.email-tag.high-confidence {
    background: #e8f5e9;
    color: #2e7d32;
}

.no-emails {
    padding: 60px 20px;
    text-align: center;
    color: #666;
}

.no-emails svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    color: #bdbdbd;
}

.email-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.email-action-btn {
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.email-action-btn:hover {
    background: #f5f5f5;
    border-color: #1565c0;
    color: #1565c0;
}

/* Shipping Center Styles */
.shipping-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.shipping-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.shipping-tab-btn:hover {
    color: var(--primary);
    background: rgba(21, 101, 192, 0.05);
}

.shipping-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.shipping-tab-content {
    display: none;
}

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

.shipments-list {
    display: grid;
    gap: 16px;
}

.shipment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.shipment-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shipment-info {
    flex: 1;
}

.shipment-quote-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}

.shipment-customer {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.shipment-details {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.shipment-detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shipment-actions {
    display: flex;
    gap: 8px;
}

/* Shipping Confirmation Filter Buttons */
.confirmation-filter-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.confirmation-filter-btn:hover {
    color: var(--primary);
    background: rgba(21, 101, 192, 0.05);
}

.confirmation-filter-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.confirmation-filter-btn[data-filter="pendingFactory"].active {
    color: #e65100;
    border-bottom-color: #ff9800;
    background: #fff8e1;
}

/* Email Detail Modal Styles */
#emailDetailModal .modal-body h4 {
    color: #1565c0;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.parsed-part-item {
    padding: 10px;
    background: white;
    border: 1px solid #ffb74d;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.parsed-part-item strong {
    color: #e65100;
}

.confidence-high {
    color: #2e7d32;
    font-weight: 600;
}

.confidence-medium {
    color: #f57c00;
    font-weight: 600;
}

.confidence-low {
    color: #c62828;
    font-weight: 600;
}

/* Model Detail Page Tabs */
.model-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.tab-btn.active {
    color: white !important;
    background: var(--primary) !important;
    border-bottom-color: var(--primary);
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}

.tab-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 6px;
    font-weight: 600;
}

.model-tabs-content {
    position: relative;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

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

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

/* ============================================================================
   ALERT ANIMATIONS - Warranty Stale Alerts & Calendar Reminders
   ============================================================================ */

/* Blinking/Pulsing Alert Badge */
@keyframes alert-blink {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

@keyframes alert-pulse {
    0%, 100% {
        background-color: #ef4444;
    }
    50% {
        background-color: #dc2626;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@keyframes pulse-alarm {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}

/* Alert Badge Styles */
.alert-badge {
    animation: alert-blink 2s infinite, alert-pulse 2s infinite;
    background: #ef4444 !important;
    color: white !important;
    font-weight: 700 !important;
    position: relative;
    border: 2px solid #fff !important;
}

.alert-badge-urgent {
    animation: alert-blink 1s infinite, alert-pulse 1s infinite, shake 0.5s infinite;
    background: #dc2626 !important;
}

/* Stale Warranty Row Highlight */
.warranty-row-stale {
    background: #fef2f2 !important;
    border-left: 4px solid #ef4444 !important;
}

.warranty-row-stale:hover {
    background: #fee2e2 !important;
}

/* Calendar Event Alert Dot */
.calendar-alert-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right: 2px;
    animation: alert-blink 2s infinite;
    z-index: 10;
}

/* Alert Banner */
.alert-banner {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #ef4444;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: shake 0.3s;
}

.alert-banner-icon {
    font-size: 24px;
    animation: alert-blink 2s infinite;
}

/* Notification Bell Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    animation: alert-blink 2s infinite;
    border: 2px solid white;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   Optimizes desktop interface for mobile touch
   ======================================== */

/* Mobile viewport adjustments */
@media (max-width: 768px) {
    /* Prevent text size adjustment on iOS */
    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }

    /* Make all touch targets at least 44x44px (Apple HIG) */
    button, .btn-primary, .btn-secondary, input[type="button"],
    input[type="submit"], a.nav-item {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
        font-size: 16px;
    }

    /* Larger form inputs for mobile */
    input[type="text"], input[type="email"], input[type="number"],
    input[type="tel"], input[type="date"], select, textarea {
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 12px;
        min-height: 44px;
    }

    /* Sidebar: Make collapsible on mobile */
    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        bottom: 0;
        width: 250px;
        transition: left 0.3s ease;
        z-index: 1000;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    /* Main content full width on mobile */
    .main-content {
        margin-left: 0;
        padding: 10px;
    }

    /* Cards: Full width on mobile */
    .card {
        margin-bottom: 15px;
    }

    /* Tables: Horizontal scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
        font-size: 14px;
    }

    /* Modals: Full screen on mobile */
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .modal-body {
        padding: 15px;
    }

    /* Photo upload grid */
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Action buttons stack vertically */
    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }

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

    /* Search inputs */
    .search-input {
        font-size: 16px;
        padding: 12px;
    }

    /* Navigation items larger for touch */
    .nav-item {
        padding: 15px 20px;
        font-size: 16px;
    }

    .nav-icon {
        width: 24px;
        height: 24px;
    }
}

/* Tablet (iPad) optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Hide sidebar on iPad - use full width */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s;
        width: 280px;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    /* Main content takes full width */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 16px;
    }

    /* Show mobile menu toggle on iPad */
    .mobile-menu-toggle {
        display: flex !important;
    }

    /* Page content full width */
    .page-content,
    .tab-content,
    .shipping-tab-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    /* Cards and containers full width */
    .card,
    .stats-container,
    .equipment-grid {
        width: 100% !important;
    }

    /* Touch-friendly buttons on iPad */
    button, .btn-primary, .btn-secondary {
        min-height: 44px;
        padding: 12px 18px;
        font-size: 16px;
    }

    input, select, textarea {
        font-size: 16px;
        padding: 12px;
        min-height: 48px;
    }

    /* Tabs should be full width and scrollable */
    .shipping-tabs,
    .model-tabs,
    .tabs {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .shipping-tabs button,
    .model-tabs button,
    .tabs button {
        font-size: 15px;
        padding: 14px 20px;
        white-space: nowrap;
    }

    /* Top header adjustments */
    .top-header {
        padding: 12px 16px;
    }

    .page-title {
        font-size: 20px;
    }

    /* Mobile overlay for sidebar */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .mobile-overlay.active {
        display: block;
    }

    /* Scrollable lists for shipping confirmations and tracking */
    #confirmationsList,
    #trackingList,
    #freightQuotesTableBody,
    .shipments-list {
        max-height: calc(100vh - 350px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-right: 8px;
    }

    /* Make the card body scrollable */
    #shipping-tab-confirmations .card-body,
    #shipping-tab-tracking .card-body {
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 220px);
        overflow: hidden;
    }

    /* Filter tabs and sort controls stay fixed */
    #shipping-tab-confirmations .card-body > div:first-child,
    #shipping-tab-confirmations .card-body > div:nth-child(2) {
        flex-shrink: 0;
    }

    /* List container scrolls */
    #confirmationsList {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Scrollbar styling for touch */
    #confirmationsList::-webkit-scrollbar,
    #trackingList::-webkit-scrollbar {
        width: 8px;
    }

    #confirmationsList::-webkit-scrollbar-track,
    #trackingList::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    #confirmationsList::-webkit-scrollbar-thumb,
    #trackingList::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }

    #confirmationsList::-webkit-scrollbar-thumb:hover,
    #trackingList::-webkit-scrollbar-thumb:hover {
        background: #a1a1a1;
    }
}

/* Touch device optimizations (all screen sizes) */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets */
    button, a, input[type="checkbox"], input[type="radio"] {
        cursor: pointer;
    }

    /* Remove hover effects on touch devices */
    button:hover, .btn-primary:hover, .btn-secondary:hover {
        transform: none;
    }

    /* Active states for touch feedback */
    button:active, .btn-primary:active, .btn-secondary:active {
        transform: scale(0.97);
        transition: transform 0.1s;
    }

    /* Prevent text selection on buttons */
    button, .btn-primary, .btn-secondary {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* iPhone specific */
@media only screen
  and (max-width: 428px) {
    /* Even smaller screens */
    .main-content {
        padding: 8px;
    }

    .card {
        padding: 12px;
    }

    /* Stack form fields */
    .form-row {
        flex-direction: column;
    }

    .form-group {
        width: 100%;
        margin-right: 0;
    }

    /* Photo grid single column on small phones */
    .photo-grid {
        grid-template-columns: 1fr;
    }
}

/* Landscape mode adjustments */
@media (max-width: 896px) and (orientation: landscape) {
    .modal-content {
        height: 100vh;
        overflow-y: auto;
    }

    .sidebar {
        height: 100vh;
    }
}

/* ========================================
   SHIPPING CONFIRMATION MODAL - iPad/Tablet Optimized
   ======================================== */

/* iPad and Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Modal takes more screen space on iPad */
    #shippingConfirmationModal .modal-content {
        max-width: 95% !important;
        width: 95% !important;
        max-height: 95vh !important;
        margin: 2.5vh auto;
        padding: 0;
    }

    #shippingConfirmationModal .modal-header {
        padding: 20px 24px;
    }

    #shippingConfirmationModal .modal-header h3 {
        font-size: 22px;
    }

    #shippingConfirmationModal .modal-body {
        padding: 24px;
    }

    /* Larger touch-friendly inputs */
    #shippingConfirmationModal input,
    #shippingConfirmationModal textarea,
    #shippingConfirmationModal select {
        font-size: 18px !important;
        padding: 14px 16px !important;
        min-height: 52px;
        border-radius: 8px;
    }

    #shippingConfirmationModal textarea {
        min-height: 120px;
    }

    /* Larger labels */
    #shippingConfirmationModal label {
        font-size: 16px !important;
        margin-bottom: 8px !important;
    }

    /* Section headers */
    #shippingConfirmationModal h4 {
        font-size: 20px !important;
        margin-bottom: 20px !important;
    }

    /* Shipment reference box */
    #shippingConfirmationModal .modal-body > div:first-child {
        padding: 20px !important;
    }

    #shippingConfirmationModal .modal-body > div:first-child strong {
        font-size: 20px !important;
    }

    #shippingConfirmationModal .modal-body > div:first-child p {
        font-size: 16px !important;
        margin-top: 8px !important;
    }

    #shippingConfirmationModal .modal-body > div:first-child span[id="confirmShippingType"] {
        font-size: 16px !important;
        padding: 10px 16px !important;
    }

    /* Grid layouts - stack on narrower tablets */
    #shippingConfirmationModal div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Photo upload buttons */
    #shippingConfirmationModal .btn-secondary,
    #shippingConfirmationModal button[onclick*="upload"],
    #shippingConfirmationModal button[onclick*="attach"] {
        font-size: 16px !important;
        padding: 14px 20px !important;
        min-height: 52px;
    }

    /* Footer buttons - larger and more spaced */
    #shippingConfirmationModal .modal-footer {
        padding: 20px 24px !important;
        gap: 16px !important;
        flex-direction: column !important;
    }

    #shippingConfirmationModal .modal-footer button {
        font-size: 18px !important;
        padding: 16px 24px !important;
        min-height: 56px;
        width: 100%;
    }

    #shippingConfirmationModal .modal-footer > div {
        width: 100%;
        flex-direction: column !important;
        gap: 12px !important;
    }

    /* Packing list section */
    #packingListSection {
        padding: 20px !important;
    }

    #packingListContainer input {
        font-size: 20px !important;
        padding: 16px !important;
        letter-spacing: 2px;
    }

    /* Email container fields */
    #confirmEmailsContainer input {
        font-size: 18px !important;
    }

    #confirmEmailsContainer button {
        min-width: 52px !important;
        min-height: 52px !important;
    }
}

/* Mobile phones (under 768px) */
@media (max-width: 767px) {
    /* Full screen modal on mobile */
    #shippingConfirmationModal .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 100vh !important;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    #shippingConfirmationModal .modal-header {
        padding: 16px 20px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        border-bottom: 1px solid #e0e0e0;
    }

    #shippingConfirmationModal .modal-header h3 {
        font-size: 20px;
    }

    #shippingConfirmationModal .modal-body {
        padding: 20px;
        padding-bottom: 200px; /* Extra space for footer */
    }

    /* Even larger inputs on phone */
    #shippingConfirmationModal input,
    #shippingConfirmationModal textarea,
    #shippingConfirmationModal select {
        font-size: 18px !important;
        padding: 16px !important;
        min-height: 56px;
        border-radius: 10px;
    }

    #shippingConfirmationModal textarea {
        min-height: 140px;
    }

    /* Larger labels */
    #shippingConfirmationModal label {
        font-size: 17px !important;
        margin-bottom: 10px !important;
        display: block;
    }

    /* Section headers */
    #shippingConfirmationModal h4 {
        font-size: 20px !important;
        margin-bottom: 20px !important;
        padding-bottom: 10px;
        border-bottom: 2px solid #e3f2fd;
    }

    /* Shipment reference - stack vertically */
    #shippingConfirmationModal .modal-body > div:first-child > div {
        flex-direction: column !important;
        gap: 12px;
    }

    #shippingConfirmationModal .modal-body > div:first-child strong {
        font-size: 22px !important;
    }

    #shippingConfirmationModal .modal-body > div:first-child p {
        font-size: 17px !important;
    }

    #shippingConfirmationModal .modal-body > div:first-child span[id="confirmShippingType"] {
        font-size: 16px !important;
        padding: 12px 20px !important;
        display: inline-block;
        margin-top: 8px;
    }

    /* Stack all grid layouts */
    #shippingConfirmationModal div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Photo buttons - full width stacked */
    #shippingConfirmationModal div[style*="display: flex; gap: 8px"] {
        flex-direction: column !important;
        gap: 12px !important;
    }

    #shippingConfirmationModal .btn-secondary,
    #shippingConfirmationModal button {
        font-size: 17px !important;
        padding: 16px 20px !important;
        min-height: 56px;
    }

    /* Fixed footer on mobile */
    #shippingConfirmationModal .modal-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 16px 20px !important;
        background: white;
        border-top: 2px solid #e0e0e0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
        flex-direction: column !important;
        gap: 12px !important;
        z-index: 100;
    }

    #shippingConfirmationModal .modal-footer button {
        width: 100% !important;
        font-size: 18px !important;
        padding: 18px !important;
        min-height: 60px;
    }

    #shippingConfirmationModal .modal-footer > div {
        width: 100%;
        flex-direction: column !important;
        gap: 10px !important;
    }

    /* Packing list - larger barcode inputs */
    #packingListContainer input {
        font-size: 22px !important;
        padding: 18px !important;
        letter-spacing: 3px;
        font-family: monospace;
    }

    /* Email fields */
    #confirmEmailsContainer > div {
        flex-direction: column !important;
        gap: 10px !important;
    }

    #confirmEmailsContainer input {
        font-size: 18px !important;
    }

    #confirmEmailsContainer button {
        min-width: 100% !important;
        min-height: 52px !important;
    }

    /* Blast chiller checkbox larger */
    #blastChillerNotesCheckbox {
        width: 24px !important;
        height: 24px !important;
    }
}

/* Resend Confirmation Modal - iPad/Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    #resendConfirmationModal .modal-content {
        max-width: 90% !important;
        width: 90% !important;
    }

    #resendConfirmationModal input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }

    #resendConfirmationModal label {
        font-size: 18px;
        padding: 12px 8px;
    }

    #resendConfirmationModal button {
        font-size: 18px !important;
        padding: 16px 24px !important;
        min-height: 56px;
    }
}

/* Tracking/Confirmations List - iPad optimized */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Shipment cards in list */
    .shipment-card,
    div[style*="border-radius: 8px"][style*="margin-bottom"] {
        padding: 20px !important;
    }

    .shipment-card button,
    div[style*="border-radius: 8px"] button {
        font-size: 16px !important;
        padding: 14px 20px !important;
        min-height: 52px;
    }

    /* Make info text larger */
    .shipment-card p,
    .shipment-card span {
        font-size: 16px !important;
    }

    .shipment-card strong {
        font-size: 18px !important;
    }
}

/* Upload Photos Modal - iPad/Mobile */
@media (max-width: 1024px) {
    #uploadPhotosModal .modal-content {
        max-width: 95% !important;
        width: 95% !important;
    }

    #uploadPhotosModal div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    #uploadPhotosModal button {
        font-size: 17px !important;
        padding: 16px 20px !important;
        min-height: 56px;
    }

    #uploadPhotosModal h4 {
        font-size: 20px !important;
    }

    #uploadPhotosModal p {
        font-size: 16px !important;
    }
}

/* ============================================
   FLOATING HORIZONTAL SCROLLBAR
   ============================================ */

/* Container for tables that need floating scrollbar */
.floating-scroll-container {
    position: relative;
}

/* The scrollable content area */
.floating-scroll-content {
    overflow-x: auto;
    overflow-y: visible;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Floating scrollbar at bottom of viewport */
.floating-scrollbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
    border-top: 3px solid #1565c0;
    z-index: 99999;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    display: none;
}

.floating-scrollbar.visible {
    display: block !important;
}

/* The inner div that creates the scrollbar width */
.floating-scrollbar-inner {
    height: 20px;
    background: transparent;
}

/* Custom scrollbar styling for floating scrollbar */
.floating-scrollbar::-webkit-scrollbar {
    height: 18px;
}

.floating-scrollbar::-webkit-scrollbar-track {
    background: #dee2e6;
    border-radius: 9px;
    margin: 3px 10px;
}

.floating-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    border-radius: 9px;
    border: 2px solid #dee2e6;
}

.floating-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1976d2, #1565c0);
}

/* Add padding at bottom when floating scrollbar is visible */
body.has-floating-scrollbar {
    padding-bottom: 35px;
}

/* Fixed-height scrollable freight quotes container */
#freightQuotesScrollContainer {
    scrollbar-width: auto;
    scrollbar-color: #1565c0 #e0e0e0;
}

#freightQuotesScrollContainer::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

#freightQuotesScrollContainer::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 7px;
}

#freightQuotesScrollContainer::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    border-radius: 7px;
    border: 2px solid #e0e0e0;
}

#freightQuotesScrollContainer::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1976d2, #1565c0);
}

#freightQuotesScrollContainer::-webkit-scrollbar-corner {
    background: #e0e0e0;
}

/* Ensure sticky header works properly */
#freightQuotesTable thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

#freightQuotesTable thead th {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
}

/* ============================================
   INVENTORY <-> EQUIPMENT MASTER MATCH STATUS BADGES
   ============================================ */
.match-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-status-matched {
    background: #d1fae5;
    color: #065f46;
}

.match-status-flagged {
    background: #fef3c7;
    color: #92400e;
}

.match-status-manual {
    background: #e0e7ff;
    color: #3730a3;
}

.match-status-unmatched {
    background: #f3f4f6;
    color: #6b7280;
}

/* Flagged Match Card Styles */
.flagged-match-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.flagged-match-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.flagged-match-card.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.suggestion-item {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.suggestion-item.selected {
    background: #dbeafe;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.confidence-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.confidence-high {
    background: #d1fae5;
    color: #065f46;
}

.confidence-medium {
    background: #fef3c7;
    color: #92400e;
}

.confidence-low {
    background: #fee2e2;
    color: #991b1b;
}


/* ============================================
   INVENTORY HIERARCHY STYLES
   ============================================ */

/* Parent rows - expandable/collapsible */
.parent-row {
    background: #f0f9ff !important;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.parent-row:hover {
    background: #e0f2fe !important;
}

/* Child rows - inventory items under parent */
.child-row {
    background: #ffffff !important;
}

.child-row td:first-child {
    padding-left: 50px !important;
    border-left: 3px solid #3b82f6 !important;
}

/* Section headers for unmatched/not found items */
.section-header {
    font-weight: 600;
    padding: 12px 15px !important;
}

/* Toggle icons */
.toggle-icon {
    display: inline-block;
    width: 20px;
    margin-right: 8px;
    transition: transform 0.2s ease;
    user-select: none;
}
