body {
    background: url('background.jpg') no-repeat center center fixed;
    background-size: cover;
}
#loginContainer {
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.table-container {
    max-height: 500px;
    overflow-y: auto;
}
.app-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 2.5rem;
    letter-spacing: 1px;
    color: #2D2A32;
    margin-bottom: 1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.form-check-input:checked {
    background-color: #5a67d8;
    border-color: #5a67d8;
}
.form-check-input {
    cursor: pointer;
    width: 2.5em;
    height: 1.25em;
    transition: background-color 0.25s ease, border-color 0.25s ease;
    box-shadow: none;
}
.form-check-label {
    user-select: none;
    font-weight: 500;
    color: #495057;
}
.dropdown-item {
    white-space: wrap !important;
}
.toggle-container {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.info-label {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: #6c757d;
    text-wrap: nowrap;
}
.toggle-checkbox {
    display: none;
}
.toggle-label {
    display: flex;
    flex: 0 0 74px;
    align-items: center;
    justify-content: space-between;
    background-color: #e0e0e0;
    border-radius: 20px;
    padding: 0 5px;
    width: 100%;
    height: 100%;
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    transition: background-color 0.3s ease;
    font-size: 14px;
    color: #aaa;
}
.toggle-checkbox:not(:checked) + .toggle-label .b2b {
    font-weight: 700;
    text-shadow: 0 0 6px rgba(255,255,255,0.8);
}

/* active = B2B when CHECKED */
.toggle-checkbox:checked + .toggle-label .b2c {
    font-weight: 700;
    text-shadow: 0 0 6px rgba(255,255,255,0.8);
}
.toggle-label span {
    z-index: 2;
    text-align: center;
    transition: color 0.3s ease;
}
.toggle-switch {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 35px;
    height: 20px;
    background-color: white;
    border-radius: 12px;
    transition: left 0.3s ease;
    z-index: 1;
}
.toggle-checkbox:checked + .toggle-label .toggle-switch {
    left: 37px;
}
.toggle-checkbox:not(:checked) + .toggle-label .b2b {
    color: #1f2937;
}
.toggle-checkbox:not(:checked) + .toggle-label .b2c {
    color: #aaa;
}
.toggle-checkbox:checked + .toggle-label .b2b {
    color: #aaa;
}
.toggle-checkbox:checked + .toggle-label .b2c {
    color: #1f2937;
}
*:not(input):not(textarea):not([contenteditable]) {
    caret-color: transparent;
}
input, textarea, [contenteditable] {
    caret-color: auto !important;
}
.order-row:hover td {
    background-color: #f0f0f0 !important;
}
.order-row.selected-row td {
    background-color: #7f9db0 !important;
}
.order-row, .product-row {
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
}
.glowing-text {
    font-size: 5rem; /* You can adjust size as needed */
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5), 
                0 0 10px rgba(255, 255, 255, 0.3);
}
.tooltip {
    opacity: 1 !important;
}

.tooltip-inner {
    background: rgba(40, 40, 40, 0.85);
    color: #fff;
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
@keyframes softGlow {
    0% {
    box-shadow: 0 0 0px rgba(255, 223, 0, 0.0);
    }
    50% {
    box-shadow: 0 0 10px rgba(255, 223, 0, 0.6);
    }
    100% {
    box-shadow: 0 0 0px rgba(255, 223, 0, 0.0);
    }
}

.glow-effect {
    animation: softGlow 2s ease-out forwards;
    border-radius: 50%;
}
#genericBulb {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#genericBulb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 12px 4px rgba(255, 223, 0, 0.6);
}
.generic-slide-text {
    position: absolute;
    right: calc(100% + 5px); /* positions it just to the left of the container */
    top: 50%;
    transform: translateY(-50%) translateX(20px);  /* start off-screen to the right */
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: #6c757d;
    opacity: 0;
    transition: transform 0.7s ease, opacity 0.8s ease;
    white-space: nowrap;
    pointer-events: none;
}
.generate-reports-btn {
    position: relative; /* Keeps the red notification dot attached to the button */
    margin-bottom: 8px; /* The nudge up from the tab baseline! */
    width: 40px; 
    height: 40px; 
    z-index: 30;
    border: none;
    cursor: pointer;
    padding: 0; 
    border-radius: 6px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: rgba(255, 255, 255, 0.8); 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: visible !important;
}

#appContainer .generate-reports-btn:hover {
    background: rgba(201, 201, 201, 0.9);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.generate-reports-btn svg,
.generate-reports-btn i { /* Apply to both SVG and FontAwesome icon */
    transition: transform 0.2s ease;
    font-size: 1.2rem; /* Adjust icon size */
}
.report-download-btn{
    border:none;
    background:transparent;
    padding:4px;
    display:flex;
    align-items:center;
    justify-content:center;
}
.report-download-btn svg{
    width:20px;
    height:20px;
    fill:#5f6368;
    transition:transform .2s ease;
}
.report-download-btn:hover svg{
    transform:scale(1.15);
}

/* Notification Badge */
.report-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background-color: #dc3545;
    border-radius: 50%;
    border: 2px solid white;
    display: none; /* Hidden by default */
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    animation: pulse-red 2s infinite;
}
.report-badge.visible {
    display: block;
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* Report Cards in Dashboard */
.report-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e9ecef;
}
.report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.report-card.report-due {
    border-left: 4px solid #dc3545;
    background-color: #fff5f5;
}
.report-card .card-header {
    background: transparent;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.report-meta {
    font-size: 0.8rem;
    color: #6c757d;
}
.report-actions {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 10px;
}
/* Container for the actual report output (spinner/download btn) */
.report-output-container {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Prevents headers in the Matching Products table from wrapping */
#productTable.table thead th {
    white-space: nowrap;
}

.truck-bright-green {
    color: #4CBB17 !important; /* bright green */
}

.truck-faded-grey {
    color: #b0b0b0 !important; /* soft grey for subtle appearance */
}
.file-link i      { font-size: .9rem; color:#6c757d; }
.file-link:hover i{ color:#343a40;   }

/* Tab styling */
.nav-tabs {
    border-bottom: none; /* Remove default border to make them stick out */
    margin-top: 1rem; /* Space from top of app container */
    margin-bottom: -1px; /* Overlap with the card border */
    position: relative;
    z-index: 10; /* Ensure tabs are above the card */
}
.nav-tabs .nav-item {
    margin-bottom: 0; /* Remove default bottom margin */
}
.nav-tabs .nav-link {
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-bottom: none; /* Make them stick out */
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    padding: 0.5rem 1rem;
    color: #495057;
    font-weight: 500;
    margin-right: 0.25rem; /* Space between tabs */
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-tabs .nav-link.active {
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff; /* Only bottom border is white to blend with card */
    color: #2D2A32;
    font-weight: 700;
}

.customer-info-field {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    border-left: 3px solid #0d6efd;
}

.contact-card {
    background-color: #f8f9fa;
    border-left: 5px solid #6c757d;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}
.contact-card h6 {
    color: #0d6efd;
    margin-bottom: 0.5rem;
}
.contact-card p {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}
/* Styles for initially hidden content in Customer Info tab */
.customer-info-content-hidden {
    display: none;
}

/* --- Quote Calculator Styles --- */
#quoteCalculatorTable [contenteditable="true"] {
    background-color: #eef2ff;
    outline: 1px dashed #aabaff;
    transition: background-color 0.2s ease, outline 0.2s ease;
}
#quoteCalculatorTable [contenteditable="true"]:focus {
    background-color: #ffffff;
    outline: 2px solid #5a67d8;
}
#quoteCalculatorTable .placeholder-row td {
    color: #9ca3af;
    font-style: italic;
}
#quoteCalculatorTable .placeholder-row [contenteditable="true"] {
    background-color: #f9fafb;
}
/* Allow the dropdown to overflow the accordion and card boundaries */
#quoteAccordion, 
#quoteAccordion .accordion-item, 
#quoteAccordion .accordion-body,
#quoteAccordion .table-responsive {
    overflow: visible !important;
}

/* Quote Calculator Horizontal Stretch Magic */
.quote-calc-wrapper {
  transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out;
  border-radius: 0.375rem;
}

/* Only apply this stretch on desktop (md breakpoint and up) */
@media (min-width: 768px) {
  .quote-calc-wrapper.expanded-full-width {
    /* Shifts left exactly the width of col-md-4 */
    margin-left: -50%; 
    /* Stretches width to cover all 12 columns */
    width: 150%; 
    position: relative;
    z-index: 10; /* Ensures it sits above the order history text */
    /* Adds a subtle drop shadow on the left side to show it's overlapping */
    box-shadow: -15px 5px 15px -15px rgba(0,0,0,0.1); 
    background-color: white; 
  }
}

/* Custom styles for the product info modal */
.modal-header-details {
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}
.modal-header-details .part-number {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0d6efd;
}
.modal-header-details .description {
    font-size: 1rem;
    color: #6c757d;
}
.modal-dl .row {
    padding: 0.75rem 0;
    margin: 0;
}
.modal-dl .row:nth-of-type(odd) {
    background-color: #f8f9fa;
}
.modal-dl dt {
    font-weight: 600;
}
.low-stock {
    background-color: #ffebe6;
    padding: 2px 6px;
    border-radius: 4px;
}
/* --- AI Research Confirmation Box --- */
#aiConfirmationBox {
    display: none; /* Initially hidden */
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
    border-left: 5px solid #1890ff;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
    transition: opacity 0.3s ease;
}
#priceTable tr {
    transition: background-color 0.3s ease;
}
.table.b2b-pricing-active #priceTable tr {
    background-color: #f3f5ff; /* Subtle blue tint for B2B */
}
.table.b2b-pricing-active #priceTable tr:hover {
    background-color: #e6eaf8; /* Slightly darker hover for B2B */
}
.price-check-link {
    color: #0d6efd; /* Bootstrap primary */
    cursor: pointer;
    transition: opacity 0.2s ease;
    text-decoration: none; /* No underline */
    font-weight: 500;
    display: inline-block; 
    white-space: nowrap; /* Keep it on one line */
}
.price-check-link:hover {
    color: #0d6efd; /* Keep color on hover */
    opacity: 0.7;
    text-decoration: none; /* No underline on hover */
}
/* === NEW Product Dashboard Modal Styles === */
#productInfoModal .modal-dl dt {
    font-size: 0.9rem;
}
#productInfoModal .modal-dl dd {
    font-size: 0.9rem;
}
#productInfoModal .metric-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}
#productInfoModal .metric-card h6 {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}
#productInfoModal .metric-card .metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0d6efd;
}
#productInfoModal .metric-card .metric-value .badge {
    font-size: 0.8rem;
    vertical-align: middle;
}
#productInfoModal .top-customer-list {
    list-style: none;
    padding-left: 0;
}
#productInfoModal .top-customer-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.9rem;
}
#productInfoModal .top-customer-list li:last-child {
    border-bottom: none;
}
#productInfoModal .top-customer-list .customer-name {
    font-weight: 500;
    color: #212529;
}
#productInfoModal .top-customer-list .customer-value {
    font-weight: 600;
    color: #0d6efd;
}
.os-container {
    background-color: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
}

/* Floating Filter Bar */
.os-filter-bar {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.os-filter-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #8898aa;
    font-weight: 700;
    margin-bottom: 0.4rem;
    display: block;
}

/* Sleek Table Styles */
.os-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
}

.os-table thead th {
    background-color: #f6f9fc;
    color: #8898aa;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.os-table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    color: #525f7f;
    font-size: 0.9rem;
    border-bottom: 1px solid #f6f9fc;
    transition: background-color 0.2s ease;
}

.os-table tbody tr:hover td {
    background-color: #fcfcfc;
}

.os-table tbody tr.expanded-row-parent td {
    background-color: #f8f9fe;
    border-bottom-color: transparent;
}

/* Type Badges */
.badge-os {
    padding: 0.35em 0.8em;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
.badge-os-order {
    background-color: #e0f2fe; /* Light Blue */
    color: #0369a1;
}
.badge-os-sample {
    background-color: #fef3c7; /* Light Amber */
    color: #b45309;
}

/* Detail View Grid */
.os-detail-wrapper {
    background-color: #f8f9fe;
    padding: 1.5rem;
    box-shadow: inset 0 4px 6px -4px rgba(0,0,0,0.1);
}

.os-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.os-detail-item label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #8898aa;
    margin-bottom: 0.2rem;
}

.os-detail-item span {
    display: block;
    font-size: 0.9rem;
    color: #32325d;
    font-weight: 500;
    word-break: break-word;
}

.row-toggle-icon {
    transition: transform 0.3s ease;
}
.expanded-row-parent .row-toggle-icon {
    transform: rotate(180deg);
}

/* Toggle Switch Customization for History Card */
.history-toggle-label {
    /* The container sizes itself natively to the rendered text and padding */
    width: max-content !important; 
    padding: 0.15rem 0.25rem !important; 
    flex: none !important;
}

.history-toggle-label span {
    font-size: 0.75rem !important;
    padding: 0 0.5rem; /* Native breathing room around the words */
    z-index: 2; 
}

/* UNCHECKED (Left) - "Purchases" active */
.history-toggle-label .toggle-switch {
    /* 'ch' uses the native font width. ~7 characters fits "Purchases" and its padding */
    width: 7ch !important; 
    left: 0.25rem !important; /* Matches the container's left padding */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; 
}

/* CHECKED (Right) - "Sales" active */
#historyToggle:checked + .history-toggle-label .toggle-switch {
    /* Shrinks to fit "Sales" natively */
    width: 4.5ch !important; 
    
    /* Perfect right-alignment: 100% width - pill width - right padding */
    left: calc(100% - 4.5ch - 0.25rem) !important; 
}