:root {
    /* Brand Colors */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #8b5cf6;
    --secondary-hover: #7c3aed;
    --accent: #06b6d4;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;

    /* Backgrounds */
    --bg-body: #0f172a;
    --bg-body-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(51, 65, 85, 0.8);
    --bg-input: rgba(15, 23, 42, 0.6);
    --bg-nav: rgba(15, 23, 42, 0.85);

    /* Text */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-placeholder: #64748b;

    /* Borders & Effects */
    --border: rgba(148, 163, 184, 0.15);
    --border-hover: rgba(148, 163, 184, 0.3);
    --glass-blur: blur(12px);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.3);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Transitions */
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    background-image: var(--bg-body-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* --- Navigation --- */
.dashboard-nav {
    background: var(--bg-nav);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    gap: 0.75rem;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.025em;
}

.nav-brand img {
    height: 40px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.3));
}

.nav-brand span {
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    background: rgba(15, 23, 42, 0.4);
    padding: 0.3rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
    transition: var(--transition-fast);
    border-radius: var(--radius-md);
    white-space: nowrap;
}

.nav-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.4);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

#userEmailDisplay {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* --- Layout Sections --- */
.dashboard-content {
    padding: 2rem;
    flex: 1;
    position: relative;
}

.dashboard-section {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dashboard-section.active-section {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
}

.section-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--text-main), #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* --- Cards & Containers --- */
.prod-form-card,
.prod-tools-card,
.prod-table-card,
.config-panel,
.qc-recipe-card,
.qc-batch-select-card,
.qc-tools-card,
.qc-table-card,
.imaging-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    margin-bottom: 1.5rem;
}

.prod-form-card:hover,
.prod-tools-card:hover,
.qc-recipe-card:hover,
.qc-batch-select-card:hover,
.imaging-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Forms & Inputs --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition-fast);
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-placeholder);
}

/* Input Validation States */
input.validation-error,
textarea.validation-error,
select.validation-error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

input.validation-error:focus,
textarea.validation-error:focus,
select.validation-error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

input.validation-success,
textarea.validation-success,
select.validation-success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

input.validation-success:focus,
textarea.validation-success:focus,
select.validation-success:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.validation-message {
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: none;
}

.validation-message.error {
    color: #ef4444;
    display: block;
}

.validation-message.success {
    color: #10b981;
    display: block;
}

/* Form Card Header */
.form-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.form-card-header h3 {
    margin: 0;
}

/* Gear Button */
.btn-gear {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.4rem;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

.btn-gear:hover {
    opacity: 1;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
    transform: rotate(45deg);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    height: 38px;
    padding: 0 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    width: 36px;
    height: 20px;
    background: rgba(100, 116, 139, 0.4);
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(16px);
}

.toggle-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

.toggle-switch input:checked ~ .toggle-label {
    color: var(--primary);
}

/* Enhanced Form Inputs */
.prod-form-card input[type="text"],
.prod-form-card input[type="number"],
.prod-form-card input[type="date"],
.prod-form-card select {
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
}

.prod-form-card input:hover,
.prod-form-card select:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

/* Readonly inputs - subtle muted style */
.readonly-input {
    opacity: 0.6;
    cursor: default;
    background: rgba(15, 23, 42, 0.4) !important;
    border-style: dashed !important;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

/* --- Buttons --- */
.btn-primary,
.btn-secondary,
.btn-micro,
.btn-mini,
.btn-icon {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #ef4444;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    transform: translateY(-1px);
}

.btn-micro {
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3);
}

.btn-micro:hover {
    filter: brightness(1.1);
}

/* View Toggle Button Group */
.view-toggles {
    display: inline-flex;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-left: 0.5rem;
}

.view-toggles .btn-mini {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: none;
    border-right: 1px solid var(--border);
}

.view-toggles .btn-mini:last-child {
    border-right: none;
}

.view-toggles .btn-mini:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.view-toggles .btn-mini.active {
    background: var(--primary);
    color: white;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.report-header-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.btn-icon {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 50%;
    font-size: 1.1rem;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

/* --- Tables --- */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    position: relative;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

thead th {
    background: rgba(30, 41, 59, 0.95);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

tbody tr {
    background: transparent;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

tbody td {
    padding: 1rem;
    color: var(--text-main);
}

@media (max-width: 720px) {
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    .mobile-card-table-wrap {
        background: transparent !important;
        border: none;
        border-radius: 0;
        overflow: visible;
    }

    .mobile-card-table-wrap::before {
        display: none !important;
    }

    .mobile-card-table {
        border-collapse: separate;
        border-spacing: 0;
        min-width: 0;
        width: 100%;
    }

    .mobile-card-table thead {
        display: none;
    }

    .mobile-card-table,
    .mobile-card-table tbody,
    .mobile-card-table tr,
    .mobile-card-table td {
        display: block;
    }

    .mobile-card-table tbody {
        display: grid;
        gap: 0.85rem;
    }

    .mobile-card-table tr {
        background:
            linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.96)),
            rgba(15, 23, 42, 0.94);
        border: 1px solid rgba(148, 163, 184, 0.18);
        border-radius: var(--radius-md);
        box-shadow: 0 16px 32px rgba(2, 6, 23, 0.26);
        overflow: hidden;
        padding: 0.85rem;
    }

    .mobile-card-table tr:hover {
        background:
            linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98)),
            rgba(15, 23, 42, 0.98);
    }

    .mobile-card-table tr.mobile-card-spacer {
        display: none;
    }

    .mobile-card-table tr.mobile-card-empty {
        color: var(--text-muted);
        text-align: center;
    }

    .mobile-card-table tr.mobile-card-empty td {
        border: 0;
        display: block;
        padding: 0;
    }

    .mobile-card-table td {
        align-items: center;
        border-bottom: 1px solid rgba(148, 163, 184, 0.12);
        color: var(--text-main);
        display: grid;
        gap: 0.75rem;
        grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr);
        min-width: 0;
        padding: 0.55rem 0;
        text-align: right;
        word-break: break-word;
    }

    .mobile-card-table td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .mobile-card-table td::before {
        color: var(--text-muted);
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-align: left;
        text-transform: uppercase;
    }

    .mobile-card-table td[data-label="Date"],
    .mobile-card-table td[data-label="SKU"],
    .mobile-card-table td[data-label="Code"] {
        align-items: start;
        font-size: 1.05rem;
        font-weight: 700;
        grid-template-columns: 1fr;
        text-align: left;
    }

    .mobile-card-table td[data-label="Date"]::before,
    .mobile-card-table td[data-label="SKU"]::before,
    .mobile-card-table td[data-label="Code"]::before {
        margin-bottom: -0.25rem;
    }

    .mobile-card-table td[data-label="Actions"] {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: flex-start;
        text-align: left;
    }

    .mobile-card-table td[data-label="Actions"]::before {
        flex: 0 0 100%;
    }

    .mobile-card-table .btn-icon,
    .mobile-card-table .btn-micro {
        min-height: 2rem;
    }

    #skuTable.mobile-card-table td[data-label="Select"] {
        display: flex;
        justify-content: space-between;
        text-align: left;
    }

    #skuTable.mobile-card-table td[data-label="Select"]::before {
        content: "Select";
    }
}

.ingredient-nutrient-table-wrap {
    min-height: 320px;
    background: rgba(15, 23, 42, 0.32);
}

.ingredient-nutrient-table {
    width: 100%;
    min-width: 540px;
    border-collapse: collapse;
}

.ingredient-nutrient-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(30, 41, 59, 0.98);
}

.ingredient-nutrient-table tbody tr {
    display: table-row;
}

.ingredient-nutrient-table tbody td {
    color: var(--text-main);
    vertical-align: middle;
    background: transparent;
}

.ingredient-nutrient-table input[type="number"] {
    min-width: 80px;
}

/* --- Specific Modules --- */

/* Dumping Schedule */
.employee-manager {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: var(--radius-md);
}

.employee-list {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    max-height: 250px;
    overflow-y: auto;
    margin-top: 1rem;
}

.employee-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* SKU Imaging */
.imaging-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
}

.imaging-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.imaging-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: var(--transition-fast);
}

.imaging-tab-btn.active {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 2px solid var(--primary);
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    transition: var(--transition-fast);
    cursor: pointer;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.preview-compare {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.preview-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1;
    position: relative;
    border: 1px solid var(--border);
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: #1e293b;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
}

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

#settingsModal .modal-content {
    max-width: 1000px;
}

.settings-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.settings-tab-btn:hover {
    color: var(--text-main);
    border-color: var(--border);
}

.settings-tab-btn.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border);
}

.settings-tab-content {
    display: none;
    margin-top: 1.5rem;
}

.settings-tab-content.active {
    display: block;
}

/* Odoo Settings Tab */
#tab-odoo .odoo-settings-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

#tab-odoo .odoo-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.75rem;
}

#tab-odoo .odoo-feature-card {
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

#tab-odoo .odoo-feature-card h4 {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

#tab-odoo .odoo-feature-card p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

#tab-odoo .odoo-setup-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

#tab-odoo .odoo-step-card {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

#tab-odoo .odoo-step-card .step-num {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    line-height: 1.5rem;
    text-align: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

#tab-odoo .odoo-step-card h4 {
    display: inline;
    font-size: 0.9rem;
}

#tab-odoo .odoo-step-card p,
#tab-odoo .odoo-step-card code {
    font-size: 0.82rem;
}

#tab-odoo .odoo-step-card code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

#tab-odoo details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
}

#tab-odoo details[open] summary {
    margin-bottom: 0.75rem;
}

#tab-odoo details ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

#tab-odoo details li {
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.82rem;
}

#tab-odoo details li strong {
    color: var(--danger);
}

@media (max-width: 768px) {
    #tab-odoo .odoo-settings-top,
    #tab-odoo .odoo-setup-steps {
        grid-template-columns: 1fr;
    }
}

.permissions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.permissions-table th,
.permissions-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.4rem 0.5rem;
    text-align: center;
}

.permissions-table th:first-child,
.permissions-table td:first-child {
    text-align: left;
}

.permissions-table .admin-role-select {
    min-width: 110px;
    width: 100%;
}

.permissions-table small {
    display: block;
    margin-top: 0.2rem;
}

#navLogo {
    height: 36px;
    max-width: 180px;
    object-fit: contain;
}

/* --- Login Overlay --- */
#loginOverlay {
    background-image: var(--bg-body-gradient) !important;
}

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-body-gradient);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.login-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 420px;
    text-align: center;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.5s ease-out;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-divider {
    text-align: center;
    margin: 1rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    height: 1px;
    background: var(--border);
    flex: 1;
}

/* --- Utilities --- */
.text-muted {
    color: var(--text-muted) !important;
}

.hidden {
    display: none !important;
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .dashboard-nav {
        flex-direction: column;
        align-items: stretch;
        padding: 0.65rem 1rem;
        gap: 0.55rem;
    }

    .nav-brand {
        font-size: 1.05rem;
        justify-content: center;
    }

    .nav-links {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0.35rem;
        scroll-padding-inline: 0.5rem;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-btn {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .user-menu {
        align-self: center;
        gap: 0.5rem;
        padding: 0.35rem 0.55rem;
    }

    #userEmailDisplay {
        max-width: 12rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .imaging-grid {
        grid-template-columns: 1fr;
    }

    .preview-compare {
        flex-direction: column;
    }
}

/* --- Print Overrides (Preserving Original Functionality) --- */

/* --- RESTORED DUMPING SCHEDULE --- */
/* --- Dumping Schedule Grid --- */
.dumping-page {
    background: white;
    color: black;
    width: 100%;
    max-width: 1100px;
    /* Slightly wider */
    min-height: 800px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border: 1px solid #ccc;
    box-shadow: 0 0 15px black;
    margin-bottom: 2rem;
}

.dumping-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 4px double black;
    padding-bottom: 0.5rem;
}

.dumping-header h1 {
    font-family: 'Times New Roman', serif;
    font-size: 3.5rem;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0;
}

.dumping-header h2 {
    font-size: 2rem;
    font-weight: bold;
    color: #444;
}

.dumping-banner {
    background: black;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.dumping-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 2px solid black;
    flex: 1;
}

.d-col-header {
    text-align: center;
    font-weight: bold;
    border-right: 1px solid black;
    border-bottom: 2px solid black;
    padding: 0.5rem;
    background: #eee;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.d-col-header:last-child {
    border-right: none;
}

.d-cell {
    border-right: 1px solid black;
    border-bottom: 1px solid black;
    min-height: 80px;
    position: relative;
    padding: 4px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.d-cell:nth-child(7n) {
    border-right: none;
}

/* Last col right border */
.d-cell.bottom-row {
    border-bottom: none;
}

.d-date {
    font-size: 0.9rem;
    font-weight: bold;
    align-self: flex-end;
    margin-bottom: 4px;
}

.d-name {
    font-size: 1.4rem;
    /* Big names as requested */
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    margin-top: auto;
    margin-bottom: auto;
    word-break: break-all;
}

.d-cell.weekend {
    background: #f3f3f3;
}

.d-cell.holiday {
    background: #e2e8f0;
}

.holiday-name {
    font-size: 0.7rem;
    text-align: center;
    font-weight: normal;
    font-style: italic;
    margin-bottom: 2px;
}

/* --- Converter Card --- */

/* --- RESTORED CALENDAR --- */
/* --- Julian Calendar Styles --- */
#calendar-container,
#dumping-calendar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.calendar-page {
    background: white;
    color: black;
    width: 100%;
    max-width: 1000px;
    aspect-ratio: 11 / 8.5;
    /* Landscape approximation */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* --- Month Calibration Controls --- */
.month-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    color: #0f172a;
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.slider-container label {
    font-weight: 500;
}

.slider-container input[type="range"] {
    width: 200px;
    accent-color: var(--primary);
    cursor: pointer;
}

.btn-small-print {
    background: var(--bg-card);
    color: white;
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    border-radius: 0.4rem;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-small-print:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.calendar-page {
    background: white;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    page-break-after: always;
    display: flex;
    flex-direction: column;
}

.page-title {
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
    border-bottom: 2px solid #000;
    padding-bottom: 0.5rem;
}

.months-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    border: 1px solid black;
}

.month-column {
    border-right: 1px solid black;
}

.month-column:last-child {
    border-right: none;
}

.month-header {
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid black;
    padding: 4px;
    background: #f1f5f9;
}

.day-row {
    display: grid;
    grid-template-columns: 24px 24px 1fr;
    font-size: 0.65rem;
    border-bottom: 1px solid #e2e8f0;
    line-height: 1.4;
}

.day-row:last-child {
    border-bottom: none;
}

.date-part,
.day-part {
    text-align: center;
    border-right: 1px solid #e2e8f0;
    padding: 1px 0;
}

.julian-part {
    text-align: right;
    padding: 1px 4px;
    font-weight: 500;
}

.day-row.weekend {
    background: #f8fafc;
}


/* --- RESTORED QC STYLES --- */
/* === QC Batch Testing Styles === */

/* Facility Tab Navigation */
.qc-facility-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.qc-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: all 0.2s;
}

.qc-tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.qc-tab-btn.active {
    color: white;
    background: var(--secondary);
    border-bottom: 3px solid var(--accent);
}

/* QC Container Layout */
.qc-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 1.5rem;
}

.qc-container > * {
    min-width: 0;
}

.qc-recipe-card,
.qc-batch-select-card,
.qc-tools-card,
.qc-table-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.qc-recipe-card h3,
.qc-batch-select-card h3,
.qc-tools-card h3,
.qc-table-card h3 {
    margin-bottom: 1rem;
    color: var(--secondary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* QC Search Row */
.qc-search-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.qc-search-row input {
    flex: 1;
    background: #0f172a;
    border: 1px solid var(--border);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

@media (max-width: 720px) {
    .qc-recipe-card,
    .qc-batch-select-card,
    .qc-tools-card,
    .qc-table-card {
        max-width: 100%;
        min-width: 0;
        padding: 1rem;
        width: 100%;
    }

    .qc-search-row {
        align-items: stretch;
        flex-direction: column;
    }

    .qc-search-row input,
    .qc-search-row button {
        min-width: 0;
        width: 100%;
    }
}

/* QC Recipe Display */
.qc-recipe-display {
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    min-height: 200px;
}

.qc-recipe-display .recipe-header {
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.qc-recipe-display .recipe-header h4 {
    color: var(--secondary);
    margin: 0;
}

.qc-recipe-display .recipe-header .sku {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-right: 1rem;
}

.qc-recipe-display .recipe-header .weight {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.qc-recipe-display .recipe-section {
    margin-bottom: 1rem;
}

.qc-recipe-display .recipe-section h5 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.qc-characteristics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 0.5rem;
}

.qc-char-item {
    text-align: center;
}

.qc-char-item label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.qc-char-item span {
    font-weight: 600;
}

/* QC Table Specific */
#qcTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#qcTable th,
#qcTable td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

#qcTable th {
    background-color: rgba(139, 92, 246, 0.1);
    font-weight: 600;
    color: var(--secondary);
}

#qcTable tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* QC Settings Modal Tabs */
.qc-settings-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 600;
}

.qc-settings-tab.active {
    color: var(--secondary);
    border-bottom: 2px solid var(--secondary);
}

.qc-tab-content {
    display: none;
    padding-top: 1rem;
}

.qc-tab-content.active {
    display: block;
}

/* QC Characteristic Editor Rows */
.qc-char-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.qc-char-row label {
    min-width: 80px;
    color: var(--text-muted);
}

.qc-char-row input {
    flex: 1;
    background: #0f172a;
    border: 1px solid var(--border);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Add Product Form in QC Settings */
.add-product-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* === SKU IMAGING SYSTEM STYLES === */

/* Imaging Sub-tabs */
.imaging-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.imaging-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: all 0.2s;
}

.imaging-tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.imaging-tab-btn.active {
    color: white;
    background: var(--accent);
    border-bottom: 3px solid var(--primary);
}

/* Imaging Container */
.imaging-container {
    max-width: 1200px;
    margin: 0 auto;
}

.imaging-tab-content {
    display: none;
}

.imaging-tab-content.active {
    display: block;
}

/* Imaging Grid Layout */
.imaging-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

/* Imaging Cards */
.imaging-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.imaging-card h3 {
    margin-bottom: 1rem;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.2);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(6, 182, 212, 0.1);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.drop-icon {
    font-size: 3rem;
}

.drop-zone p {
    margin: 0;
}

/* Preview Area */
.preview-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.preview-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.preview-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.preview-image {
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-image img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

/* Imaging Actions */
.imaging-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.imaging-actions button {
    flex: 1;
    min-width: 120px;
}

.imaging-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.firebase-sku-list {
    margin-top: 0.5rem;
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
}

.firebase-sku-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
}

.firebase-sku-item:last-child {
    border-bottom: none;
}

.firebase-sku-path {
    flex: 1;
    word-break: break-all;
    color: var(--text-muted);
}

.firebase-sku-size {
    min-width: 70px;
    text-align: right;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Batch Results Grid */
.batch-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.batch-result-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem;
    text-align: center;
}

.batch-result-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.batch-result-item .batch-filename {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.5rem;
}

.batch-result-item.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.batch-result-item .batch-error {
    color: var(--danger);
    font-size: 0.75rem;
}

/* Generator Progress */
.generation-progress {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.generation-progress p {
    margin: 0 0 0.5rem 0;
}

.generation-progress .success {
    color: #22c55e;
}

.generation-progress .error {
    color: var(--danger);
}

.progress-bar {
    background: var(--border);
    border-radius: 0.25rem;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(to right, var(--primary), var(--accent));
    height: 100%;
    transition: width 0.3s ease;
}

/* Generated Images Grid */
.generated-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.generated-image-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    text-align: center;
}

.generated-image-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.generated-image-item .flavor-label {
    display: block;
    padding: 0.5rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.5);
    text-transform: capitalize;
}

/* Image Library */
.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.library-filters {
    display: flex;
    gap: 0.75rem;
}

.library-filters input,
.library-filters select {
    background: #0f172a;
    border: 1px solid var(--border);
    color: white;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.image-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* Form Elements in Imaging */
#section-imaging .form-group {
    margin-bottom: 1rem;
}

#section-imaging .form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: var(--text-muted);
}

#section-imaging .form-group input,
#section-imaging .form-group select,
#section-imaging .form-group textarea {
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--border);
    color: white;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

#section-imaging .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Mobile Responsiveness for Imaging */
@media (max-width: 768px) {
    .imaging-tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .imaging-grid {
        grid-template-columns: 1fr;
    }

    .preview-compare {
        grid-template-columns: 1fr;
    }

    .imaging-actions {
        flex-direction: column;
    }

    .imaging-actions button {
        width: 100%;
    }

    .library-header {
        flex-direction: column;
        align-items: stretch;
    }

    .library-filters {
        flex-direction: column;
    }

    .library-filters input,
    .library-filters select {
        width: 100%;
    }
}

/* --- RESTORED SKU CATALOG --- */
/* === SKU CATALOG SPECIFIC STYLES === */


/* SKU Entry Form */
.sku-entry-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.sku-entry-form .form-group {
    flex: 1;
    min-width: 120px;
}

/* SKU Tools Bar */
.sku-tools-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.tool-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* SKU Table */
#skuTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#skuTable th,
#skuTable td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

#skuTable th {
    background-color: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: var(--accent);
}

#skuTable tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

#skuTable code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: monospace;
}

/* Photo Status Badges */
.photo-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.photo-status.taken {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.photo-status.taken:hover {
    background: rgba(34, 197, 94, 0.3);
}

.photo-status.pending {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.4);
}

.photo-status.skipped {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.photo-status.skipped:hover {
    background: rgba(245, 158, 11, 0.3);
}

/* Photo Buttons in Table */
#skuTable .btn-micro {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Selected SKUs List */
.selected-skus-list {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    max-height: 150px;
    overflow-y: auto;
}

.selected-sku-item {
    padding: 0.25rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.selected-sku-item:last-child {
    border-bottom: none;
}

.selected-sku-item code {
    background: var(--accent);
    color: white;
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
    margin-right: 0.5rem;
}

/* Detected Variants */
.detected-variants {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.detected-variants strong {
    color: var(--secondary);
}

/* Generation Log */
.generation-log {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.log-entry {
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.log-entry.success {
    color: #22c55e;
}

.log-entry.error {
    color: var(--danger);
}

/* Capture Modal */
.capture-preview {
    background: #0f172a;
    border: 2px dashed var(--border);
    border-radius: 0.5rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.capture-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

#skipUnitBtn {
    background: rgba(245, 158, 11, 0.18);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.45);
}

#skipUnitBtn:hover {
    background: rgba(245, 158, 11, 0.28);
}

.captured-preview {
    text-align: center;
}

.captured-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.5rem;
    border: 2px solid var(--accent);
}

/* Mobile Responsiveness for SKU Catalog */
@media (max-width: 768px) {
    .sku-entry-form {
        flex-direction: column;
    }

    .sku-entry-form .form-group {
        width: 100%;
    }

    .sku-tools-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .tool-group {
        flex-wrap: wrap;
        justify-content: center;
    }

    .sku-search-sticky {
        position: sticky;
        top: calc(var(--nav-height, 0px) + 0.5rem);
        z-index: 50;
        background: rgba(15, 23, 42, 0.95);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 0.5rem;
        width: 100%;
    }

    .sku-search-sticky input {
        width: 100% !important;
    }

    #skuTable:not(.mobile-card-table) {
        font-size: 0.8rem;
    }

    #skuTable:not(.mobile-card-table) th,
    #skuTable:not(.mobile-card-table) td {
        padding: 0.5rem 0.25rem;
    }

    /* Hide less important columns on mobile */
    #skuTable:not(.mobile-card-table) th:nth-child(4),
    #skuTable:not(.mobile-card-table) td:nth-child(4) {
        display: none;
    }
}

/* --- RESTORED PRINT STYLES (Production) --- */
@media print {

    /* Default page setup - portrait for Production Report */
    @page {
        size: portrait;
        margin: 0.5in;
    }

    /* Landscape for Dumping Schedule */
    body.print-landscape {
        /* This class is added by JS when printing dumping schedule */
    }

    @page landscape-page {
        size: landscape;
        margin: 0.25in;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .no-print,
    .dashboard-nav,
    .dashboard-section:not(.active-section),
    .month-controls,
    .dumping-page.print-hidden {
        display: none !important;
    }

    #app,
    .dashboard-content,
    .dashboard-section,
    .print-container {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
        background: white !important;
    }

    .print-container {
        display: block !important;
    }

    .table-responsive {
        overflow: visible !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .dumping-page {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        page-break-after: always;
        break-after: page;

        /* Fill the page but leave a tiny buffer to prevent 2nd empty page */
        height: 94vh !important;
        width: 100% !important;
        overflow: hidden;

        display: flex !important;
        flex-direction: column !important;
    }

    .dumping-header {
        border-bottom: 2px double black !important;
        margin-bottom: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        flex-shrink: 0;
        /* Header stays fixed size */
    }

    .dumping-header h1 {
        font-size: 3rem !important;
        /* Restore large size */
    }

    .dumping-header h2,
    .right-header div {
        font-size: 1.8rem !important;
    }

    .dumping-grid {
        border: 2px solid black !important;
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        /* Make grid fill remaining vertical space */
        flex-grow: 1 !important;
    }

    .d-cell,
    .d-col-header {
        border-color: black !important;
    }

    .d-cell {
        min-height: 0 !important;
        /* Allow flex to manage height */
        padding: 4px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        /* Center content vertically */
    }

    .d-name {
        font-size: 1.3rem !important;
        /* Text big again */
        margin: auto 0 !important;
    }

    .d-date {
        font-size: 1rem !important;
        position: absolute;
        top: 2px;
        right: 4px;
    }

    /* Force background colors for holidays/weekends on print if browser allows */
    .d-cell.weekend {
        background-color: #f3f3f3 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .dumping-banner {
        background: black !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-size: 1.8rem !important;
    }

    /* --- Production Report Print Styles --- */
    #section-production.active-section {
        position: static !important;
    }

    #section-production.active-section .production-container {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0.3in 0.4in 0.6in 0.8in !important;
        /* Bottom padding reserves space for the fixed footer */
        overflow: hidden !important;
    }

    /* Hide non-report elements in production mode */
    #section-production.active-section .prod-form-card,
    #section-production.active-section .prod-tools-card,
    #section-production.active-section .report-header-controls,
    #section-production.active-section .section-header,
    #prodTable thead th:last-child,
    #prodTable tbody td:last-child {
        display: none !important;
    }

    #section-production.active-section .prod-table-card {
        background: white !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    #section-production.active-section .prod-table-card .print-title {
        display: block !important;
        text-align: center;
        font-size: 18pt;
        font-weight: bold;
        margin-top: 0 !important;
        margin-bottom: 12px;
        color: black !important;
    }

    #section-production.active-section .prod-table-card .screen-title {
        display: none !important;
    }

    #prodTable {
        width: 100% !important;
        border-collapse: collapse !important;
        font-family: Arial, sans-serif !important;
        font-size: 9pt !important;
        /* Reduced from 10pt */
        table-layout: fixed !important;
    }

    #prodTable th,
    #prodTable td {
        border: 1px solid black !important;
        padding: 2px 4px !important;
        /* Reduced from 6px 8px */
        color: black !important;
        text-align: center !important;
    }

    #section-production.active-section .prod-table-card h3.print-title {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }

    #prodTable th {
        text-transform: uppercase;
        font-weight: bold;
        background: #f0f0f0 !important;
        border-bottom: 2px solid black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Column 1: Date */
    #prodTable th:first-child,
    #prodTable td:first-child {
        min-width: 0 !important;
        width: 0.75in !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
        white-space: nowrap !important;
    }

    /* Column 2: Waste - narrow */
    #prodTable th:nth-child(2),
    #prodTable td:nth-child(2) {
        width: 0.35in !important;
    }

    /* Column 3: Pack - narrow */
    #prodTable th:nth-child(3),
    #prodTable td:nth-child(3) {
        width: 0.4in !important;
    }

    /* Column 4: Description - narrower, center aligned */
    #prodTable th:nth-child(4),
    #prodTable td:nth-child(4) {
        width: 1.6in !important;
        text-align: center !important;
    }

    /* Column 5: Weight - narrow */
    #prodTable th:nth-child(5),
    #prodTable td:nth-child(5) {
        width: 0.45in !important;
    }

    /* Column 6: Batch - wider */
    #prodTable th:nth-child(6),
    #prodTable td:nth-child(6) {
        width: 0.9in !important;
    }

    /* Column 7: Flavor - wider */
    #prodTable th:nth-child(7),
    #prodTable td:nth-child(7) {
        width: 1.05in !important;
    }

    /* Column 8: Code - narrow */
    #prodTable th:nth-child(8),
    #prodTable td:nth-child(8) {
        width: 0.4in !important;
    }

    /* Column 9: Cases - wider */
    #prodTable th:nth-child(9),
    #prodTable td:nth-child(9) {
        width: 0.5in !important;
    }

    /* Footer */
    body::after {
        content: "Bernard Food Industries - Skokie Facility";
        display: block;
        position: fixed;
        bottom: 0.3in;
        right: 0.5in;
        text-align: right;
        font-size: 9pt;
        color: #666 !important;
        font-style: italic;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        z-index: 9999;
    }

    /* Hide footer on Dumping Schedule (landscape), Julian Calendar, and Photos To-Do */
    body.print-landscape::after,
    body.print-julian::after,
    body.printing-todo::after {
        display: none !important;
    }

    #section-production.active-section .prod-table-card::after {
        display: none !important;
    }
}

/* --- RESTORED PRINT STYLES (Calendar/Dumping) --- */
@media print {
    @page {
        size: landscape;
        margin: 0;
        /* MAXIMIZE SPACE: Remove printer margins control */
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 11px;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
    }

    .no-print,
    .dashboard-nav,
    .dashboard-section:not(.active-section) {
        display: none !important;
    }

    #app,
    .dashboard-content,
    .dashboard-section,
    .print-container {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
        height: auto !important;
        background: white !important;
    }

    .print-container {
        display: block !important;
    }

    /* --- Dumping Schedule Print Logic --- */
    .dumping-page {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;

        /* INCREASED PADDING TO PREVENT CLIPPING */
        /* 0.5in is safer for printer hardware margins */
        padding: 0.35in 0.35in 0.35in 0.5in !important;

        page-break-after: always;
        break-after: page;
        page-break-inside: avoid;

        /* Force exact fit */
        height: 100vh !important;
        width: 100vw !important;
        box-sizing: border-box;
        overflow: hidden;

        display: flex !important;
        flex-direction: column !important;
    }

    .dumping-header {
        border-bottom: 2px double black !important;
        margin-bottom: 0.1rem !important;
        padding-bottom: 0.1rem !important;
        flex-shrink: 0;
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-end !important;
    }

    /* Container for Month and Year on the left */
    .left-header {
        display: flex !important;
        align-items: baseline !important;
        gap: 1rem !important;
    }

    .dumping-header h1 {
        font-size: 2.2rem !important;
        margin: 0 !important;
        line-height: 1;
        background: none !important;
        -webkit-text-fill-color: black !important;
        padding-left: 5px;
        /* Extra safety for the first letter */
    }

    /* Year (div inside left-header) */
    .left-header div {
        font-size: 2.2rem !important;
        line-height: 1;
    }

    /* Title on the right */
    .right-header h2 {
        font-size: 1.5rem !important;
        margin: 0 !important;
        line-height: 1;
        text-align: right;
    }

    .dumping-grid {
        border: 2px solid black !important;
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        grid-template-rows: auto;
        grid-auto-rows: 1fr !important;
        border-bottom: 2px solid black !important;
        flex: 1 !important;
        height: auto !important;
        align-content: stretch !important;
    }

    .print-hidden {
        display: none !important;
    }

    /* Print Logic: Hide spacers if compact mode is on */
    .print-compact .date-spacer-row {
        display: none !important;
    }


    .d-cell,
    .d-col-header {
        border-color: black !important;
    }

    .d-col-header {
        padding: 2px !important;
        font-size: 0.8rem !important;
    }

    .d-cell {
        min-height: 0 !important;
        padding: 0 2px !important;
        /* Side padding only */
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        border-bottom: 1px solid black !important;
    }

    /* Ensure no double borders causing overflow */
    .d-cell:nth-last-child(-n+7) {
        border-bottom: none !important;
    }


    .d-name {
        /* INCREASED SIZE AS REQUESTED */
        font-size: 1.6rem !important;
        font-weight: 800 !important;
        margin: 0 !important;
        line-height: 0.9;
        /* Tight line height to fit bigger text */
        letter-spacing: -0.5px;
        /* Help fit longer names */
    }

    .d-date {
        font-size: 0.75rem !important;
        position: absolute;
        top: 1px;
        right: 2px;
        line-height: 1;
    }

    .holiday-name {
        font-size: 0.65rem !important;
        line-height: 1;
    }

    .d-cell.weekend {
        background-color: #f3f3f3 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .dumping-banner {
        /* Hide banner on print if it takes too much space, or make it tiny */
        display: none !important;
    }

    /* --- Julian Calendar Print Logic (Refactored) --- */
    .calendar-page {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0.25in !important;
        border-radius: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        min-height: 0 !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        page-break-after: always !important;
        break-after: page !important;
    }

    /* ... (Rest of existing Julian styles if needed, kept concise here) ... */
    .calendar-page:last-child {
        page-break-after: auto !important;
    }

    .page-title {
        font-size: 1.2rem !important;
        margin-bottom: 0.2rem;
    }

    .months-grid {
        display: grid !important;
        grid-template-columns: repeat(6, 1fr) !important;
        flex: 1 !important;
        border: 1px solid black !important;
        border-right: none;
        width: 100% !important;
        overflow: visible !important;
    }

    .month-column {
        display: flex !important;
        flex-direction: column !important;
        border-right: 1px solid black !important;
        height: 100% !important;
    }

    .month-header {
        background: #eee;
        font-size: 0.9rem !important;
        padding: 2px !important;
        border-bottom: 1px solid black;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .day-row {
        flex: 1 !important;
        display: grid !important;
        grid-template-columns: 20px 20px 1fr !important;
        border-bottom: 1px solid #ccc !important;
        font-size: 0.65rem !important;
        align-items: center !important;
        padding: 0 !important;
        line-height: 1 !important;
    }

    .day-row.weekend {
        background: #f0f0f0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .julian-part {
        text-align: right;
        padding-right: 2px;
    }

    html,
    body,
    #calendar-container {
        overflow: visible !important;
    }

    #calendar-container,
    .dashboard-section {
        height: auto !important;
    }
}

/* =============================================================================
   SKU IMAGER WORKFLOW ENHANCEMENT STYLES
   ============================================================================= */

/* Group Badge */
.group-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 50%;
    text-transform: uppercase;
}

/* Production Queue Tab */
#imaging-tab-queue .queue-search-container {
    position: relative;
    max-width: 500px;
}

#imaging-tab-queue .search-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

#imaging-tab-queue .search-input-wrapper input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: #0f172a;
    color: white;
    font-size: 1rem;
}

#imaging-tab-queue .search-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 60px;
    background: #1e293b;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-results-dropdown.hidden {
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: rgba(67, 97, 238, 0.2);
}

.search-result-code {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    color: var(--accent);
}

.search-result-title {
    flex: 1;
    color: var(--text);
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
}

/* Production Queue Table */
#productionQueueTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#productionQueueTable th,
#productionQueueTable td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

#productionQueueTable th {
    background-color: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: var(--accent);
}

#productionQueueTable tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Queue Status Badges */
.queue-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.queue-status.done {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.queue-status.processing {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
    animation: pulse 1.5s infinite;
}

.queue-status.skipped {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.queue-status.pending {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Queue Action Buttons */
.queue-action-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.queue-action-btn[data-type="finished"] {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
}

.queue-action-btn[data-type="finished"]:hover {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
}

.queue-action-btn[data-type="box"],
.queue-action-btn[data-type="unit"] {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.queue-action-btn[data-type="box"]:hover,
.queue-action-btn[data-type="unit"]:hover {
    transform: translateY(-1px);
}

/* Finished Product Modal */
#finishedProductModal .sku-info-box {
    line-height: 1.6;
}

#finishedProductModal .sku-info-box strong {
    color: var(--accent);
}

#finishedProductModal #finishedProgress,
#finishedProductModal #finishedProgress2 {
    padding: 0.5rem;
    border-radius: 0.375rem;
    text-align: center;
}

#finishedProductModal .processing {
    color: var(--warning);
    animation: pulse 1.5s infinite;
}

#finishedProductModal .success {
    color: #22c55e;
}

#finishedProductModal .error {
    color: var(--danger);
}

#finishedProductModal #firstGroupImage {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Hidden Class */
.hidden {
    display: none !important;
}

/* Add to Queue Button */
.add-queue-btn {
    background: rgba(67, 97, 238, 0.2);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.add-queue-btn:hover {
    background: var(--primary);
    color: white;
}

/* Remove Queue Button */
.remove-queue-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.remove-queue-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Queue Tools */
.queue-tools {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

/* Mobile Responsiveness for Production Queue */
@media (max-width: 768px) {
    #productionQueueTable {
        font-size: 0.8rem;
    }

    #productionQueueTable th,
    #productionQueueTable td {
        padding: 0.5rem 0.25rem;
    }

    .search-results-dropdown {
        right: 0;
    }

    #imaging-tab-queue .search-input-wrapper {
        flex-direction: column;
    }

    .queue-action-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* =============================================================================
   SKU PROGRESS STATISTICS
   ============================================================================= */

.progress-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.progress-bar-container {
    position: relative;
    height: 32px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--accent) 100%);
    transition: width 0.5s ease-out;
    border-radius: var(--radius-md);
}

.progress-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    z-index: 1;
}

.progress-breakdown {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.progress-breakdown .stat-item {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.progress-breakdown .stat-item:hover {
    border-color: var(--border-hover);
    color: var(--text-main);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .progress-breakdown {
        gap: 0.5rem;
    }

    .progress-breakdown .stat-item {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }

    .progress-bar-text {
        font-size: 0.8rem;
    }
}

/* Complete row highlighting */
#skuTable tr.row-complete {
    background: rgba(16, 185, 129, 0.1);
}

#skuTable tr.row-complete:hover {
    background: rgba(16, 185, 129, 0.15);
}

/* Complete badge next to SKU code */
.complete-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 0.5rem;
    background: var(--success);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: bold;
    vertical-align: middle;
}

/* =============================================================================
   COLLAPSIBLE CARDS
   ============================================================================= */

.collapsible-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.collapsible-header:hover {
    opacity: 0.8;
}

.collapse-arrow {
    display: inline-block;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.collapsible-card.collapsed .collapse-arrow {
    transform: rotate(-90deg);
}

.collapsible-card.collapsed .collapsible-body {
    display: none;
}

.collapsible-card.collapsed .collapsible-header {
    margin-bottom: 0 !important;
}

/* =============================================================================
   PHOTO TO-DO TAB
   ============================================================================= */

.todo-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.todo-stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.todo-stat-item .stat-count {
    font-weight: 700;
    font-size: 1.1rem;
}

.todo-table {
    width: 100%;
    border-collapse: collapse;
}

.todo-table th,
.todo-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.todo-table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
}

.todo-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.todo-status-needed {
    color: var(--danger);
    font-weight: 600;
    font-size: 0.85rem;
}

.todo-status-done {
    color: var(--success);
    font-size: 0.85rem;
}

.todo-status-skipped {
    color: var(--warning);
    font-size: 0.85rem;
    font-weight: 600;
}

.todo-print-header {
    display: none;
    text-align: center;
    margin-bottom: 1rem;
}

.todo-print-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.todo-print-header p {
    margin: 0.25rem 0 0 0;
    font-size: 0.85rem;
    color: #666;
}

/* --- To-Do Print Styles --- */
@media print {
    body.printing-todo {
        background: white !important;
        color: black !important;
        font-size: 11px;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.printing-todo * {
        color: black !important;
        background: white !important;
        border-color: #ccc !important;
    }

    body.printing-todo .no-print,
    body.printing-todo .dashboard-nav,
    body.printing-todo .imaging-tabs,
    body.printing-todo .imaging-tab-content:not(#imaging-tab-todo),
    body.printing-todo #imaging-tab-todo > .imaging-card:first-child {
        display: none !important;
    }

    body.printing-todo .todo-print-header {
        display: block !important;
        margin-left: 0.5in !important;
    }

    body.printing-todo .todo-print-area {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        margin-left: 0.5in !important;
    }

    body.printing-todo .todo-table {
        font-size: 10px;
        border-collapse: collapse;
    }

    body.printing-todo .todo-table th {
        background: #eee !important;
        font-weight: bold;
    }

    body.printing-todo .todo-table th,
    body.printing-todo .todo-table td {
        padding: 0.15rem 0.3rem;
        border: 1px solid #ccc;
        line-height: 1.2;
    }

    /* Hide GROUP column on print */
    body.printing-todo .todo-table th:nth-child(4),
    body.printing-todo .todo-table td:nth-child(4) {
        display: none !important;
    }

    /* Compact BOX and UNIT columns with centered checkmarks */
    body.printing-todo .todo-table th:nth-child(5),
    body.printing-todo .todo-table td:nth-child(5),
    body.printing-todo .todo-table th:nth-child(6),
    body.printing-todo .todo-table td:nth-child(6) {
        text-align: center;
        width: 40px;
    }

    body.printing-todo .todo-status-needed {
        font-weight: bold;
        font-size: 12px;
    }

    body.printing-todo .todo-status-done {
        font-size: 12px;
    }

    body.printing-todo .todo-status-skipped {
        font-weight: bold;
        font-size: 12px;
    }

    body.printing-todo .todo-stats {
        margin-bottom: 0.3rem !important;
    }

    body.printing-todo .todo-stat-item {
        border: 1px solid #ccc;
        padding: 0.1rem 0.4rem;
        font-size: 9px;
    }
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    pointer-events: none;
}

.toast-notification {
    background: var(--success);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 0.5rem 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-100%);
    animation: toastSlideDown 0.3s ease forwards, toastSlideUp 0.3s ease 2.7s forwards;
    pointer-events: auto;
}

@keyframes toastSlideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes toastSlideUp {
    from { transform: translateY(0); }
    to { transform: translateY(-100%); }
}

/* =====================================================
   RECIPE BOOK STYLES - Tandoor-Inspired Design
   ===================================================== */

/* Recipe Toolbar */
.recipe-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.recipe-search-box {
    flex: 1;
    min-width: 200px;
}

.recipe-search-box input {
    width: 100%;
    padding: 0.6rem 1rem;
    padding-left: 2.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
}

.recipe-filters {
    display: flex;
    gap: 0.5rem;
}

.recipe-filters select {
    min-width: 140px;
}

.recipe-toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.recipe-toolbar-actions button {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

/* Recipe Stats Bar */
.recipe-stats-bar {
    display: flex;
    gap: 1.5rem;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.recipe-stats-bar span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Recipe Grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.recipe-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    text-align: center;
}

.recipe-empty-state p {
    margin-top: 1rem;
    font-size: 1rem;
}

/* Recipe Card - Tandoor Inspired */
.recipe-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
}

.recipe-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.recipe-card-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-bottom: 1px solid var(--border);
}

.recipe-card-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.recipe-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    line-height: 1.3;
}

.recipe-card-codes {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    font-family: monospace;
}

.recipe-card-body {
    padding: 1rem 1.25rem;
}

.recipe-card-section {
    margin-bottom: 0.75rem;
}

.recipe-card-section:last-child {
    margin-bottom: 0;
}

.recipe-card-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.recipe-card-section-content {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-card-footer {
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recipe-card-series {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.recipe-card-series strong {
    color: var(--secondary);
}

.recipe-card-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition-fast);
}

.recipe-card:hover .recipe-card-actions {
    opacity: 1;
}

.recipe-card-actions button {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.recipe-card-actions .btn-edit {
    background: var(--primary);
    color: white;
}

.recipe-card-actions .btn-edit:hover {
    background: var(--primary-hover);
}

.recipe-card-actions .btn-ai {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
}

.recipe-card-actions .btn-ai:hover {
    filter: brightness(1.1);
}

/* Recipe Modal */
.recipe-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.recipe-modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.recipe-view-modal {
    max-width: 800px;
}

.recipe-edit-modal {
    max-width: 750px;
}

.recipe-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 10;
}

.recipe-modal-close:hover {
    background: var(--danger);
}

.recipe-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recipe-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.recipe-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
}

/* Recipe View Content - Beautiful Display */
.recipe-view-content {
    padding: 0;
}

.recipe-view-header {
    padding: 2rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-bottom: 1px solid var(--border);
}

.recipe-view-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.2);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}

.recipe-view-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 0.5rem 0;
}

.recipe-view-codes {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.recipe-view-body {
    padding: 1.5rem 2rem;
}

.recipe-view-section {
    margin-bottom: 1.5rem;
}

.recipe-view-section:last-child {
    margin-bottom: 0;
}

.recipe-view-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--secondary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(139, 92, 246, 0.3);
}

.recipe-view-section-title svg {
    width: 18px;
    height: 18px;
    stroke: var(--secondary);
}

.recipe-view-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-main);
    white-space: pre-wrap;
}

.recipe-view-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
}

.recipe-view-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.recipe-view-meta-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.recipe-view-meta-value {
    font-size: 0.95rem;
    color: var(--text-main);
}

/* Ingredients Display - Pill Style */
.recipe-ingredients-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recipe-ingredient-pill {
    display: inline-block;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.recipe-ingredient-pill.allergen {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
    font-weight: 600;
}

/* Edit Form */
.recipe-edit-form {
    padding: 1.5rem;
}

.recipe-form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0;
}

.recipe-form-row .form-group {
    flex: 1;
}

.recipe-edit-form .form-group {
    margin-bottom: 1rem;
}

.recipe-edit-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.recipe-edit-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* Batch Edit */
.recipe-batch-table-wrap {
    max-height: 60vh;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
}

.recipe-batch-table {
    width: 100%;
    border-collapse: collapse;
}

.recipe-batch-table th,
.recipe-batch-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.recipe-batch-table th {
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.9);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    z-index: 1;
}

.recipe-batch-input {
    width: 100%;
    padding: 0.45rem 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: var(--radius-sm);
}

.recipe-batch-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* AI Improve Button */
.btn-ai-improve {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-ai-improve:hover {
    filter: brightness(1.15);
    transform: scale(1.02);
}

.btn-ai-improve:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-ai-improve.loading {
    pointer-events: none;
}

.btn-ai-improve.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.3rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* AI Provider Config */
.ai-provider-config {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-content {
        padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(1.5rem + env(safe-area-inset-bottom));
    }

    .recipe-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .recipe-toolbar-actions {
        justify-content: center;
    }

    .recipe-grid {
        grid-template-columns: 1fr;
    }

    .recipe-form-row {
        flex-direction: column;
    }

    .recipe-modal-overlay {
        align-items: flex-start;
        overflow-y: auto;
        padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom));
    }

    .recipe-modal {
        margin: 0;
        max-height: calc(100dvh - 2rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        width: 100%;
    }

    .recipe-batch-table-wrap {
        max-height: 55vh;
    }

    .recipe-view-header,
    .recipe-view-body {
        padding: 1.25rem;
    }
}

/* =============================================================================
   BULK SETTINGS - OPTION TAGS & TABLES
   ============================================================================= */

.option-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.375rem 0.75rem;
    border-radius: 1.5rem;
    font-size: 0.875rem;
    margin: 0.25rem;
    transition: all 0.2s ease;
}

.option-tag:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.remove-option-btn {
    background: transparent;
    border: none;
    color: var(--text-muted, #6c757d);
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: color 0.2s ease;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-option-btn:hover {
    color: var(--danger, #dc3545);
}

.bulk-sku-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    margin-top: 1rem;
}

.bulk-sku-table-container table {
    margin-bottom: 0;
}

.bulk-sku-table-container thead {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
    box-shadow: 0 1px 0 var(--border);
}

.bulk-sku-table-container tbody tr:hover {
    background: var(--bg-card-hover);
}

/* Selection count badge */
#containerSelectedCount,
#backgroundSelectedCount {
    font-weight: 600;
    color: var(--primary, #007bff);
    margin-left: 0.5rem;
}

/* Responsive adjustments for bulk settings */
@media (max-width: 768px) {
    .option-tag {
        font-size: 0.8125rem;
        padding: 0.25rem 0.625rem;
        margin: 0.1875rem;
    }

    .bulk-sku-table-container {
        max-height: 300px;
        font-size: 0.875rem;
    }
}

/* ==============================================
   Documents Section Styles
   ============================================== */

#section-documents {
    padding-top: 0;
}

#section-documents .section-header {
    text-align: left;
    margin-bottom: 1rem;
}

#section-documents .section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    background: none;
    -webkit-text-fill-color: inherit;
    text-shadow: none;
}

#section-documents .section-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    background: none;
    -webkit-text-fill-color: inherit;
    text-shadow: none;
}

#section-documents .section-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.documents-subsection {
    animation: fadeIn 0.3s ease-in-out;
}

.sub-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    backdrop-filter: var(--glass-blur);
}

.sub-nav-btn {
    padding: 0.625rem 1.25rem;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.sub-nav-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-main);
}

.sub-nav-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
    .sub-nav-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    .qc-tab-btn,
    .san-tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}

.document-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.document-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.document-item-info {
    flex: 1;
}

.document-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.document-item-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.document-item-actions {
    display: flex;
    gap: 0.5rem;
}

.document-type-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-right: 0.5rem;
}

.document-type-badge.formulation {
    background: rgba(139, 92, 246, 0.2);
    color: var(--secondary);
}

.document-type-badge.bulletin {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
}

.document-type-badge.audit {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

/* Audit Form Styles */
.audit-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.audit-category-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.audit-category textarea {
    width: 100%;
    min-height: 60px;
    padding: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 0.5rem;
}

.audit-category textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.audit-category label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* Formulation Statement Styles */
.formulation-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.formulation-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.formulation-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.formulation-table th {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

.formulation-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.formulation-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.formulation-table input,
.formulation-table select {
    width: 100%;
    padding: 0.375rem;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.875rem;
}

.formulation-table input:focus,
.formulation-table select:focus {
    outline: none;
    border-color: var(--primary);
}

.formulation-table .btn-icon {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
}

.formulation-table .btn-icon:hover {
    opacity: 0.8;
}

.sku-search-result {
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: var(--transition-fast);
}

.sku-search-result:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.sku-search-result-name {
    font-weight: 600;
    color: var(--text-main);
}

.sku-search-result-code {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.image-preview-container {
    max-width: 300px;
    margin-top: 0.5rem;
}

.image-preview-container img {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* ─── Nutritionals Section ─── */

.nutritionals-subsection {
    animation: fadeIn 0.3s ease-in-out;
}

/* Modal overlay for nutritionals */
.nutritional-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.nutritional-modal-overlay .modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: var(--glass-blur);
    width: 100%;
}

.nutritional-modal-overlay .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.nutritional-modal-overlay .modal-header h3 {
    margin: 0;
    color: var(--text-main);
}

.nutritional-modal-overlay .modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
}

.nutritional-modal-overlay .modal-close:hover {
    color: var(--text-main);
}

.nutritional-modal-overlay .modal-body {
    padding: 1.5rem;
}

.formula-editor-modal {
    width: min(1360px, calc(100vw - 2rem));
    max-width: min(1360px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}

.formula-editor-modal .modal-body {
    overflow-y: auto;
    overflow-x: hidden;
}

.formula-grid-code-desc,
.formula-grid-meta,
.formula-grid-serving,
.formula-prepared-header,
.formula-prepared-meta,
.formula-editor-main {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.formula-grid-code-desc {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(320px, 2fr);
}

.formula-grid-meta {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.formula-grid-serving {
    grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
    align-items: end;
}

.formula-serving-actions {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.15rem;
    align-items: center;
}

.formula-prepared-card {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.formula-prepared-header {
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    margin-bottom: 0.75rem;
}

.formula-prepared-meta {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 0.75rem;
}

.formula-editor-main {
    grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 0;
}

.formula-editor-main > div,
.formula-editor-preview {
    min-width: 0;
}

.formula-editor-preview {
    overflow: hidden;
}

.nutritional-modal-overlay .modal-footer {
    border-top: 1px solid var(--border);
}

.nutritional-modal-overlay .form-group label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.nutritional-modal-overlay input,
.nutritional-modal-overlay select,
.nutritional-modal-overlay textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 0.5rem;
    font-size: 0.9rem;
}

.nutritional-modal-overlay input:focus,
.nutritional-modal-overlay select:focus,
.nutritional-modal-overlay textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.nut-help-btn {
    align-items: center;
    background: rgba(78, 127, 255, 0.12);
    border: 1px solid rgba(78, 127, 255, 0.45);
    border-radius: 999px;
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    height: 18px;
    justify-content: center;
    line-height: 1;
    margin-left: 0.35rem;
    padding: 0;
    vertical-align: middle;
    width: 18px;
}

.nut-help-btn:hover,
.nut-help-btn:focus {
    background: rgba(78, 127, 255, 0.22);
    border-color: var(--primary);
    outline: none;
}

.nut-help-anchor {
    align-items: center;
    display: inline-flex;
    gap: 0.35rem;
}

.nut-help-anchor .nut-help-btn {
    margin-left: 0;
}

.nut-help-control {
    align-items: center;
    display: inline-flex;
    gap: 0.35rem;
    min-width: 0;
}

.nut-help-control > input,
.nut-help-control > select,
.nut-help-control > textarea {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.nut-help-control > button:not(.nut-help-btn) {
    flex: 1 1 auto;
}

.nut-help-control > .nut-help-btn {
    margin-left: 0;
}

.nut-help-dialog {
    align-items: center;
    background: rgba(0, 0, 0, 0.58);
    bottom: 0;
    justify-content: center;
    left: 0;
    padding: 1rem;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 10000;
}

.nut-help-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.36);
    color: var(--text-main);
    max-width: 460px;
    width: min(460px, 100%);
}

.nut-help-card-header {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.85rem 1rem;
}

.nut-help-card-header h3 {
    font-size: 1rem;
    line-height: 1.2;
    margin: 0;
}

.nut-help-close {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    font-size: 1.25rem;
    height: 30px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 30px;
}

.nut-help-close:hover,
.nut-help-close:focus {
    border-color: var(--border);
    color: var(--text-main);
    outline: none;
}

.nut-help-card-body {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
    padding: 1rem;
}

.nut-help-card-body p {
    margin: 0;
}

@media (max-width: 720px) {
    .nutritionals-subsection .section-header {
        align-items: stretch !important;
        flex-direction: column;
        gap: 0.85rem;
        text-align: left;
    }

    .nutritionals-subsection .section-header > div:last-child {
        align-items: stretch !important;
        display: grid !important;
        gap: 0.5rem !important;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .nutritionals-subsection .section-header > div:last-child .nut-help-control {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
    }

    .nutritionals-subsection > .tool-container > .form-group {
        align-items: stretch;
        display: grid !important;
        gap: 0.5rem;
        grid-template-columns: 1fr;
    }

    .nutritionals-subsection > .tool-container > .form-group > .nut-help-control {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
    }

    .nutritionals-subsection .nut-help-control > button:not(.nut-help-btn) {
        justify-content: center;
        width: 100%;
    }
}

/* Status badges for nutritionals */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* ─── FDA Nutrition Facts Label (scoped) ─── */
.nutritional-label-wrapper .nf-render-root {
    display: inline-flex;
    flex-direction: column;
    gap: 0.75rem;
    color: #000;
}

.nutritional-label-wrapper .nf-render-root.nf-render-root-dual {
    display: inline-flex;
    flex-direction: column;
}

.nutritional-label-wrapper .nf-dual-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.nutritional-label-wrapper .nf-label.nf-label-dual {
    --nf-dual-name-col: 132px;
    --nf-dual-amount-col: 56px;
    --nf-dual-dv-col: 32px;
    --nf-dual-calories-font-size: 31px;
    --nf-dual-divider-color: rgba(0, 0, 0, 0.55);
    padding: 4px 6px 6px;
}

.nutritional-label-wrapper .nf-dual-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.nutritional-label-wrapper .nf-dual-col-name {
    width: var(--nf-dual-name-col);
}

.nutritional-label-wrapper .nf-dual-col-amount {
    width: var(--nf-dual-amount-col);
}

.nutritional-label-wrapper .nf-dual-col-dv {
    width: var(--nf-dual-dv-col);
}

.nutritional-label-wrapper .nf-dual-table th,
.nutritional-label-wrapper .nf-dual-table td {
    padding: 2px 6px;
    color: inherit;
    background: #fff;
    background-clip: padding-box;
    border-right: none;
    text-transform: none;
}

.nutritional-label-wrapper .nf-dual-name-header {
    padding: 0;
}

.nutritional-label-wrapper .nf-dual-column-heading {
    box-sizing: border-box;
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.02em;
    min-height: 14px;
    padding: 0 8px 2px 6px;
    text-align: right;
    vertical-align: bottom;
}

.nutritional-label-wrapper .nf-dual-column-heading-base {
    padding: 0 8px 2px 6px;
}

.nutritional-label-wrapper .nf-dual-column-heading-prepared {
    padding: 0 0 2px 6px;
}

.nutritional-label-wrapper .nf-dual-column-heading-text {
    display: block;
    width: 100%;
    text-align: right;
}

.nutritional-label-wrapper .nf-dual-calories-label-cell {
    text-align: left;
    vertical-align: bottom;
    padding: 0 6px 0 0;
}

.nutritional-label-wrapper .nf-dual-calories-cell {
    box-sizing: border-box;
    padding: 0 6px 0 4px;
    text-align: right;
    vertical-align: bottom;
}

.nutritional-label-wrapper .nf-dual-calories-cell-base {
    box-shadow: inset -1px 0 0 var(--nf-dual-divider-color);
}

.nutritional-label-wrapper .nf-dual-calories-cell-prepared {
    padding-right: 0;
}

.nutritional-label-wrapper .nf-dual-calories-value {
    display: block;
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    font-size: var(--nf-dual-calories-font-size);
    font-variant-numeric: tabular-nums lining-nums;
    line-height: 24px;
    text-align: right;
    white-space: nowrap;
}

.nutritional-label-wrapper .nf-dual-dv-header-row {
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    font-size: 10px;
    font-weight: 900;
    line-height: 12px;
}

.nutritional-label-wrapper .nf-dual-dv-header-row th {
    border-top: none;
    padding-top: 7px;
    padding-bottom: 3px;
    position: relative;
    vertical-align: bottom;
}

.nutritional-label-wrapper .nf-dual-dv-header-row th::before {
    border-top: 6px solid currentColor;
    content: "";
    left: 6px;
    position: absolute;
    right: 6px;
    top: 0;
}

.nutritional-label-wrapper .nf-dual-subhead-spacer {
    padding: 0;
}

.nutritional-label-wrapper .nf-dual-subhead-spacer::before {
    left: 0;
    right: 8px;
}

.nutritional-label-wrapper .nf-dual-dv-heading-cell {
    text-align: right;
    padding-right: 6px;
}

.nutritional-label-wrapper .nf-dual-dv-heading-cell.nf-dual-divider-mix {
    box-shadow: inset -1px 0 0 var(--nf-dual-divider-color);
}

.nutritional-label-wrapper .nf-dual-dv-heading-cell.nf-dual-divider-mix::before {
    right: 8px;
}

.nutritional-label-wrapper .nf-dual-dv-header-row th:last-child::before {
    left: 8px;
    right: 0;
}

.nutritional-label-wrapper .nf-dual-dv-header-row th:last-child {
    padding: 1px 0 3px 6px;
}

.nutritional-label-wrapper .nf-dual-dv-heading {
    display: block;
    text-align: right;
}

.nutritional-label-wrapper .nf-dual-row {
    font-size: 14px;
    line-height: 16px;
}

.nutritional-label-wrapper .nf-dual-row th,
.nutritional-label-wrapper .nf-dual-row td {
    border-top: 1px solid var(--nf-dual-divider-color);
    padding-top: 2px;
    padding-bottom: 2px;
    vertical-align: baseline;
}

.nutritional-label-wrapper .nf-dual-row.nf-dual-vitamin-start th,
.nutritional-label-wrapper .nf-dual-row.nf-dual-vitamin-start td {
    border-top: 8px solid currentColor;
}

.nutritional-label-wrapper .nf-vitamins-container-dual.nf-compact .nf-dual-row {
    font-size: 11px;
    line-height: 13px;
}

.nutritional-label-wrapper .nf-dual-name {
    min-width: 0;
    font-weight: normal;
    text-align: left;
    padding-right: 6px;
}

.nutritional-label-wrapper .nf-dual-divider-name {
    box-shadow: inset -1px 0 0 var(--nf-dual-divider-color);
}

.nutritional-label-wrapper .nf-dual-name.nf-indent-1 {
    padding-left: 16px;
}

.nutritional-label-wrapper .nf-dual-name.nf-indent-2 {
    padding-left: 32px;
}

.nutritional-label-wrapper .nf-dual-panel-cell {
    min-width: 0;
}

.nutritional-label-wrapper .nf-dual-amount-cell,
.nutritional-label-wrapper .nf-dual-dv-cell {
    min-width: 0;
    box-sizing: border-box;
}

.nutritional-label-wrapper .nf-dual-amount-cell {
    padding-left: 4px;
    padding-right: 6px;
    text-align: right;
}

.nutritional-label-wrapper .nf-dual-amount-span-cell {
    padding-right: 6px;
}

.nutritional-label-wrapper .nf-dual-dv-cell {
    padding-left: 4px;
    padding-right: 6px;
    text-align: right;
}

.nutritional-label-wrapper .nf-dual-divider-mix {
    box-shadow: inset -1px 0 0 var(--nf-dual-divider-color);
}

.nutritional-label-wrapper .nf-dual-amount-cell .nf-dual-amount {
    display: block;
    min-width: 0;
    text-align: right;
}

.nutritional-label-wrapper .nf-dual-amount {
    min-width: 0;
    font-variant-numeric: tabular-nums lining-nums;
    white-space: nowrap;
}

.nutritional-label-wrapper .nf-dual-dv {
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    display: block;
    font-variant-numeric: tabular-nums lining-nums;
    font-weight: 900;
    flex-shrink: 0;
    white-space: nowrap;
}

.nutritional-label-wrapper .nf-label-panel {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
}

.nutritional-label-wrapper .nf-panel-title {
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: inherit;
}

.nutritional-label-wrapper .nf-label {
    border: 1px solid currentColor;
    padding: 4px;
    font-family: Arial, Helvetica, sans-serif;
    width: 270px;
    background: #fff;
    color: inherit;
    line-height: 1;
}

.nutritional-label-wrapper .nf-title {
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    font-size: 27px;
    font-weight: 900;
    line-height: 1;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.nutritional-label-wrapper .nf-hairline {
    border-bottom: 1px solid currentColor;
    padding-top: 3px;
    margin-bottom: 3px;
}

.nutritional-label-wrapper .nf-servings-per {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: normal;
    line-height: 16px;
    margin: 0;
}

.nutritional-label-wrapper .nf-serving-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    font-size: 14px;
    font-weight: 900;
    line-height: 16px;
    margin: 0;
}

.nutritional-label-wrapper .nf-thick-sep {
    border-bottom: 10px solid currentColor;
    padding-top: 3px;
    margin-bottom: 1px;
}

.nutritional-label-wrapper .nf-thick-sep.nf-tight {
    padding-top: 1px;
}

.nutritional-label-wrapper .nf-medium-sep {
    border-bottom: 4px solid currentColor;
    padding-top: 3px;
    margin-bottom: 3px;
}

.nutritional-label-wrapper .nf-amount-header {
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    font-size: 11px;
    font-weight: 900;
    line-height: 12px;
    margin: 0;
}

.nutritional-label-wrapper .nf-calories-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    margin: 0;
}

.nutritional-label-wrapper .nf-calories-label {
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    font-weight: 900;
    font-size: 22px;
    line-height: 24px;
}

.nutritional-label-wrapper .nf-calories-value {
    font-size: 31px;
    line-height: 24px;
}

.nutritional-label-wrapper .nf-dv-header {
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    font-size: 10px;
    font-weight: 900;
    text-align: right;
    line-height: 12px;
    margin: 2px 0 4px 0;
}

.nutritional-label-wrapper .nf-nutrient-row {
    border-top: 1px solid currentColor;
    padding: 2px 0 3px 0;
    overflow: hidden;
    font-size: 14px;
    line-height: 16px;
}

.nutritional-label-wrapper .nf-nutrient-row .nf-name {
    float: left;
}

.nutritional-label-wrapper .nf-nutrient-row .nf-dv {
    float: right;
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    font-weight: 900;
}

.nutritional-label-wrapper .nf-bold {
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    font-weight: 900;
}

.nutritional-label-wrapper .nf-regular {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: normal;
}

.nutritional-label-wrapper .nf-indent-1 {
    padding-left: 16px;
}

.nutritional-label-wrapper .nf-indent-2 {
    padding-left: 32px;
}

.nutritional-label-wrapper .nf-italic {
    font-style: italic;
}

.nutritional-label-wrapper .nf-vitamin-row {
    border-top: 1px solid currentColor;
    padding: 2px 0 3px 0;
    overflow: hidden;
    font-size: 14px;
    line-height: 16px;
}

.nutritional-label-wrapper .nf-vitamins-container .nf-vitamin-row:first-child {
    border-top: none;
}

.nutritional-label-wrapper .nf-vitamin-row .nf-name {
    float: left;
}

.nutritional-label-wrapper .nf-vitamin-row .nf-dv {
    float: right;
}

.nutritional-label-wrapper .nf-vitamins-container.nf-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.nutritional-label-wrapper .nf-vitamins-container.nf-compact .nf-vitamin-row {
    border-top: 1px solid currentColor;
    font-size: 11px;
    line-height: 13px;
    padding: 2px;
}

.nutritional-label-wrapper .nf-vitamins-container.nf-compact .nf-vitamin-row:nth-child(-n+2) {
    border-top: none;
}

.nutritional-label-wrapper .nf-vitamins-container.nf-compact .nf-vitamin-row:nth-child(odd) {
    border-right: 1px solid currentColor;
}

.nutritional-label-wrapper .nf-footnote-sep {
    border-bottom: 4px solid currentColor;
    padding-top: 1px;
    margin-bottom: 3px;
}

.nutritional-label-wrapper .nf-not-significant-rule {
    border-top: 1px solid currentColor;
    margin-top: 2px;
}

.nutritional-label-wrapper .nf-not-significant-source {
    border-top: 1px solid currentColor;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9.5px;
    line-height: 11.5px;
    padding: 3px 0 1px;
}

.nutritional-label-wrapper .nf-label-warning {
    background: #fff8d8;
    border: 1px solid #d7ad26;
    border-radius: 4px;
    color: #3a2d00;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 15px;
    max-width: 420px;
    padding: 6px 8px;
}

.nutritional-label-wrapper .nf-footnote {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9.2px;
    line-height: 11.5px;
    margin: 1px 0 0 0;
}

.nutritional-label-wrapper .nf-ingredients-sep {
    border-bottom: 1px solid currentColor;
    padding-top: 4px;
    margin-bottom: 3px;
}

.nutritional-label-wrapper .nf-ingredients-header {
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    font-size: 12px;
    font-weight: 900;
    line-height: 14px;
    display: inline;
}

.nutritional-label-wrapper .nf-ingredients-text {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    line-height: 13px;
}

.nutritional-label-wrapper .nf-allergen-text {
    font-family: 'Arial Black', 'Helvetica Black', Arial, sans-serif;
    font-size: 12px;
    font-weight: 900;
    line-height: 14px;
    margin-top: 3px;
}

.nutritional-label-wrapper .nf-shared-footer {
    border: 1px solid currentColor;
    background: #fff;
    box-sizing: border-box;
    color: inherit;
    padding: 8px 10px;
    width: 100%;
}

.nutritional-label-wrapper .nf-hidden {
    display: none;
}

/* Label Options panel */
#section-nutritionals .section-header {
    text-align: left;
}

.nf-label-options {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    color: inherit;
}

.nf-label-options .nf-opts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
    font-size: 13px;
    align-items: center;
}

.nf-label-options label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.nf-label-options input[type="range"] {
    width: 90px;
}

.nf-label-options input[type="color"] {
    width: 32px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.nf-label-options select {
    padding: 2px 4px;
    font-size: 12px;
}

.nf-export-bar {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.nut-formula-ingredient-picker {
    position: relative;
    width: 240px;
}

.nut-formula-ingredient-picker .fline-ingredient-search {
    width: 100%;
}

.nut-formula-ingredient-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #10182a;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
    z-index: 30;
}

.nut-formula-ingredient-results-portal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5000;
}

.nut-formula-ingredient-result {
    display: block;
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: none;
    background: transparent;
    color: #f5f7fb;
    text-align: left;
    cursor: pointer;
}

.nut-formula-ingredient-result:hover,
.nut-formula-ingredient-result:focus {
    background: rgba(78, 127, 255, 0.16);
    outline: none;
}

.nut-formula-ingredient-code {
    font-size: 0.82rem;
    font-weight: 700;
}

.nut-formula-ingredient-desc {
    font-size: 0.78rem;
    color: rgba(245, 247, 251, 0.72);
}

.nut-formula-ingredient-empty {
    padding: 0.6rem;
    font-size: 0.8rem;
    color: rgba(245, 247, 251, 0.72);
}

.nut-formula-ingredient-results mark {
    background: rgba(255, 230, 122, 0.65);
    color: inherit;
    padding: 0;
}

@media (max-width: 1280px) {
    .formula-editor-main {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1080px) {
    .formula-grid-meta {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .formula-grid-serving,
    .formula-prepared-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .formula-serving-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 820px) {
    .formula-editor-modal {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
    }

    .formula-grid-code-desc,
    .formula-grid-meta,
    .formula-grid-serving,
    .formula-prepared-header,
    .formula-prepared-meta,
    .nf-label-options .nf-opts-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .formula-serving-actions {
        margin-bottom: 0;
    }

    .nutritional-modal-overlay .modal-header,
    .nutritional-modal-overlay .modal-body,
    .nutritional-modal-overlay .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* --- Shopify Section --- */

.shopify-subsection {
    animation: fadeIn 0.3s ease-in-out;
}

.shopify-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.shopify-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    backdrop-filter: var(--glass-blur);
}

.shopify-stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shopify-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

.shopify-stat-card .stat-value.status-connected {
    color: var(--success, #22c55e);
}

.shopify-stat-card .stat-value.status-error {
    color: var(--danger, #ef4444);
}

.shopify-stat-card .stat-value.status-draft {
    color: var(--text-muted);
}

.shopify-timestamps > div {
    padding: 0.25rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.shopify-settings-info {
    color: var(--text-main);
    line-height: 1.6;
}

/* --- Amazon Section --- */

.amazon-subsection {
    animation: fadeIn 0.3s ease-in-out;
}

.amazon-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.amazon-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    backdrop-filter: var(--glass-blur);
}

.amazon-stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.amazon-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

.amazon-stat-card .stat-value.status-connected {
    color: var(--success, #22c55e);
}

.amazon-stat-card .stat-value.status-error {
    color: var(--danger, #ef4444);
}

.amazon-stat-card .stat-value.status-draft {
    color: var(--text-muted);
}

.amazon-badge-seller {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #4361ee22;
    color: #4361ee;
}

.amazon-badge-vendor {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #f59e0b22;
    color: #f59e0b;
}

.amazon-badge-synced {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #22c55e22;
    color: var(--success, #22c55e);
}

.amazon-badge-pending {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #94a3b822;
    color: var(--text-muted);
}

.amazon-badge-low {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #ef444422;
    color: var(--danger, #ef4444);
}

.amazon-badge-ok {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #22c55e22;
    color: var(--success, #22c55e);
}

.amazon-status.status-pending {
    color: #f59e0b;
}

.amazon-status.status-shipped {
    color: var(--success, #22c55e);
}

.amazon-status.status-canceled {
    color: var(--danger, #ef4444);
}

.amazon-low-stock-row {
    background: #ef444410;
}

/* --- Odoo Dashboard Builder --- */

.odoo-subsection {
    animation: fadeIn 0.3s ease-in-out;
}

/* Toolbar */
.odoo-dash-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.odoo-dash-toolbar select,
.odoo-dash-toolbar button {
    white-space: nowrap;
}

.odoo-dash-toolbar select {
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
}

/* GridStack dark theme overrides */
.grid-stack {
    min-height: 200px;
}

.grid-stack-item-content {
    background: var(--bg-card, #16213e);
    border: 1px solid var(--border-color, #1e2d3d);
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
}

.grid-stack-placeholder > .placeholder-content {
    border: 2px dashed var(--border-color, #1e2d3d) !important;
    background: rgba(67, 97, 238, 0.05) !important;
    border-radius: var(--radius-md, 8px);
}

/* Dashboard Item */
.odoo-dash-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.odoo-dash-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color, #1e2d3d);
    min-height: 32px;
}

.odoo-dash-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.odoo-dash-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0 0.25rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s;
}

.grid-stack-item:hover .odoo-dash-item-remove {
    opacity: 1;
}

.odoo-dash-item-remove:hover {
    color: var(--danger, #ef4444);
}

.odoo-dash-item-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    overflow: hidden;
    position: relative;
}

.odoo-dash-item-body canvas {
    width: 100% !important;
    height: 100% !important;
}

/* KPI Tile */
.odoo-tile-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.odoo-tile-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Item states */
.odoo-item-loading {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.odoo-item-error {
    color: var(--danger, #ef4444);
    font-size: 0.85rem;
    text-align: center;
    padding: 0.5rem;
}

/* Empty state */
.odoo-empty-state {
    margin-top: 2rem;
}

/* --- AI Assistant --- */

.odoo-ai-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    max-height: 700px;
    background: var(--bg-card, #16213e);
    border: 1px solid var(--border-color, #1e2d3d);
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
}

.odoo-ai-status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color, #1e2d3d);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.odoo-ai-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.odoo-ai-status-dot.status-ok {
    background: var(--success, #22c55e);
}

.odoo-ai-status-dot.status-unknown {
    background: var(--text-muted, #64748b);
}

.odoo-ai-chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.odoo-ai-welcome {
    text-align: center;
    padding: 2rem 1rem;
}

.odoo-ai-welcome h2 {
    margin-bottom: 0.5rem;
}

.odoo-ai-welcome p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.odoo-ai-suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    max-width: 700px;
    margin: 0 auto;
}

.odoo-ai-suggestion {
    padding: 0.75rem 1rem;
    background: rgba(67, 97, 238, 0.08);
    border: 1px solid var(--border-color, #1e2d3d);
    border-radius: var(--radius-sm, 6px);
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    font-size: 0.85rem;
    transition: background 0.15s, border-color 0.15s;
}

.odoo-ai-suggestion:hover {
    background: rgba(67, 97, 238, 0.15);
    border-color: #4361ee;
}

.odoo-ai-input-area {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color, #1e2d3d);
}

.odoo-ai-input-area textarea {
    flex: 1;
    resize: none;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm, 6px);
    background: var(--bg-main, #0f172a);
    color: var(--text-main);
    border: 1px solid var(--border-color, #1e2d3d);
    font-size: 0.9rem;
    font-family: inherit;
    min-height: 38px;
    max-height: 120px;
}

.odoo-ai-input-area textarea:focus {
    outline: none;
    border-color: #4361ee;
}

.odoo-ai-input-area button {
    padding: 0.55rem 0.75rem;
    flex-shrink: 0;
}

/* AI Messages */
.odoo-ai-msg {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 85%;
    word-wrap: break-word;
}

.odoo-ai-msg-question {
    background: rgba(67, 97, 238, 0.12);
    border: 1px solid rgba(67, 97, 238, 0.25);
    margin-left: auto;
    text-align: right;
}

.odoo-ai-msg-answer {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.odoo-ai-msg-answer table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.odoo-ai-msg-answer th,
.odoo-ai-msg-answer td {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color, #1e2d3d);
    text-align: left;
}

.odoo-ai-msg-answer th {
    background: rgba(0, 0, 0, 0.2);
}

.odoo-ai-msg-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--danger, #ef4444);
}

.odoo-ai-msg-thinking {
    background: transparent;
    color: var(--text-muted);
    font-style: italic;
    border: none;
    padding: 0.5rem 0;
}

.odoo-ai-msg-plan {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* --- Wizard --- */

.odoo-wizard-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.odoo-wizard-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    background: var(--bg-card, #16213e);
    border: 2px solid var(--border-color, #1e2d3d);
    border-radius: var(--radius-md, 8px);
    color: var(--text-main);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.odoo-wizard-type-btn:hover {
    border-color: #4361ee;
    background: rgba(67, 97, 238, 0.05);
}

.odoo-wizard-type-btn.selected {
    border-color: #4361ee;
    background: rgba(67, 97, 238, 0.1);
}

.odoo-wizard-type-btn span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.odoo-wizard-type-btn strong {
    font-size: 0.95rem;
}

/* --- MRP Planner --- */

.odoo-mrp-results {
    background: var(--card-bg, #0f1923);
    border: 1px solid var(--border-color, #1e2d3d);
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 200px;
    line-height: 1.7;
}

.odoo-mrp-results h2 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
}

.odoo-mrp-results h2:first-child {
    margin-top: 0;
}

.odoo-mrp-results table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.9rem;
}

.odoo-mrp-results th,
.odoo-mrp-results td {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color, #1e2d3d);
    text-align: left;
}

.odoo-mrp-results th {
    background: rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.odoo-mrp-results ul,
.odoo-mrp-results ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.odoo-mrp-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.odoo-mrp-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-style: italic;
}

.odoo-mrp-summary {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.odoo-mrp-summary-card {
    flex: 1;
    min-width: 100px;
    background: var(--card-bg, #0f1923);
    border: 1px solid var(--border-color, #1e2d3d);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.mrp-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4361ee;
}

.mrp-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* --- Customer Growth --- */

.odoo-growth-controls {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.odoo-growth-controls .form-group {
    flex: 1;
    min-width: 150px;
}

.odoo-growth-controls .form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.odoo-growth-controls .form-group input {
    width: 100%;
}

.odoo-growth-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 220px;
}

.odoo-growth-summary {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.odoo-growth-summary-card {
    flex: 1;
    min-width: 130px;
    background: var(--card-bg, #0f1923);
    border: 1px solid var(--border-color, #1e2d3d);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.growth-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #22c55e;
}

.growth-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.odoo-growth-results {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    min-height: 220px;
    margin-top: 1rem;
}

.odoo-growth-empty,
.odoo-growth-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.odoo-growth-loading {
    font-style: italic;
}

.odoo-growth-brief {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.odoo-growth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.odoo-growth-list-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    background: rgba(255, 255, 255, 0.01);
}

.odoo-growth-list-card h3 {
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.odoo-growth-list-card p {
    margin-bottom: 0.85rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.odoo-growth-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.odoo-growth-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    background: rgba(15, 23, 42, 0.35);
}

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

.odoo-growth-item-name {
    font-weight: 600;
    color: var(--text-main);
}

.odoo-growth-item-value {
    white-space: nowrap;
    color: #60a5fa;
    font-weight: 600;
}

.odoo-growth-item-meta {
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.odoo-growth-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.odoo-growth-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.82rem;
    transition: var(--transition-fast);
}

.odoo-growth-action-btn:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.odoo-growth-action-btn.page-agent {
    border-color: rgba(34, 197, 94, 0.35);
    color: #c7f9d4;
}

.odoo-growth-action-btn.page-agent:hover {
    border-color: var(--success, #22c55e);
    background: rgba(34, 197, 94, 0.12);
}

/* --- Communications --- */

.odoo-comm-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.odoo-comm-form .form-group {
    flex: 1;
    min-width: 180px;
}

.odoo-comm-form .form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.odoo-comm-form .form-group select,
.odoo-comm-form .form-group input {
    width: 100%;
}

.odoo-comm-search-wrap {
    position: relative;
}

.odoo-comm-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    display: none;
    box-shadow: var(--shadow-md);
}

.odoo-comm-dropdown.open {
    display: block;
}

.odoo-comm-dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.odoo-comm-dropdown-item:hover {
    background: rgba(59, 130, 246, 0.15);
}

.odoo-comm-dropdown-item .comm-cust-name {
    color: var(--text-main);
    font-weight: 500;
}

.odoo-comm-dropdown-item .comm-cust-email {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.odoo-comm-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    margin-top: 0.25rem;
}

.odoo-page-agent-panel {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.18);
    border-radius: var(--radius-md);
    padding: 1rem 1.1rem;
    margin-top: 1rem;
}

.odoo-page-agent-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.odoo-page-agent-panel-header h3 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.odoo-page-agent-panel-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 760px;
}

.odoo-page-agent-status {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.odoo-page-agent-link-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.85rem;
}

.odoo-page-agent-link-row input {
    flex: 1;
    min-width: 240px;
}

.odoo-page-agent-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.odoo-followup-log-panel {
    background: rgba(96, 165, 250, 0.06);
    border: 1px solid rgba(96, 165, 250, 0.18);
    border-radius: var(--radius-md);
    padding: 1rem 1.1rem;
    margin-top: 1rem;
}

.odoo-followup-log-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.odoo-followup-log-panel-header h3 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.odoo-followup-log-panel-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 760px;
}

.odoo-followup-log-status {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.odoo-followup-log-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
    align-items: end;
}

.odoo-followup-log-form .form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.odoo-followup-log-form .form-group select,
.odoo-followup-log-form .form-group input,
.odoo-followup-log-form .form-group textarea {
    width: 100%;
}

.odoo-followup-log-form textarea {
    resize: vertical;
    min-height: 84px;
}

.odoo-followup-log-form-wide {
    grid-column: 1 / -1;
}

.odoo-followup-log-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.odoo-followup-log-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.odoo-followup-log-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-muted);
    border: 1px dashed rgba(96, 165, 250, 0.18);
    border-radius: var(--radius-sm);
}

.odoo-followup-log-entry {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    background: rgba(15, 23, 42, 0.32);
}

.odoo-followup-log-entry.current-context {
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.12);
}

.odoo-followup-log-entry-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.35rem;
}

.odoo-followup-log-entry-title {
    font-weight: 600;
    color: var(--text-main);
}

.odoo-followup-log-entry-time {
    color: var(--text-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.odoo-followup-log-entry-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.odoo-followup-log-entry-body {
    margin-top: 0.55rem;
    display: grid;
    gap: 0.45rem;
}

.odoo-followup-log-entry-line {
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.5;
}

.odoo-followup-log-entry-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-right: 0.35rem;
}

.odoo-followup-log-entry-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.odoo-followup-log-entry-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.82rem;
    transition: var(--transition-fast);
}

.odoo-followup-log-entry-btn:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.odoo-comm-results {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    min-height: 200px;
    margin-top: 1rem;
    line-height: 1.8;
}

.odoo-comm-empty,
.odoo-comm-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.odoo-comm-loading {
    font-style: italic;
}

.odoo-comm-draft-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.odoo-comm-draft-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.odoo-comm-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.odoo-comm-copy-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-main);
    border-color: var(--primary);
}

.odoo-comm-draft-body {
    line-height: 1.8;
    white-space: pre-wrap;
}

.odoo-comm-draft-body p {
    margin-bottom: 0.75rem;
}

.odoo-comm-context {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .odoo-page-agent-panel-header,
    .odoo-page-agent-link-row,
    .odoo-followup-log-panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .odoo-page-agent-status,
    .odoo-followup-log-status {
        white-space: normal;
    }
}

/* ═══════════════════════════════════════════════════════════════
   BID FILLER STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Drop Zone */
.bf-drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: var(--bg-card);
    max-width: 700px;
    margin: 3rem auto;
}
.bf-drop-zone:hover,
.bf-drop-zone.bf-drag-over {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: var(--shadow-glow);
}
.bf-drop-zone svg {
    stroke: var(--text-muted);
    margin-bottom: 1rem;
}
.bf-drop-zone h3 {
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

/* Processing */
.bf-processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
}
.bf-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
}
.bf-progress-bar-inner {
    height: 100%;
    width: 40%;
    background: var(--primary);
    border-radius: 2px;
    animation: bfIndeterminate 1.5s ease-in-out infinite;
}
@keyframes bfIndeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* Review Toolbar */
.bf-review-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
}
.bf-field-counts {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.bf-count-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--text-muted);
}
.bf-search-input {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.85rem;
    min-width: 180px;
}
.bf-search-input:focus {
    outline: none;
    border-color: var(--primary);
}
.bf-filter-bar {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.bf-filter-btn {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
}
.bf-filter-btn:hover {
    border-color: var(--primary);
    color: var(--text-main);
}
.bf-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Review View (position context for walkthrough overlay) */
#bf-review-view {
    position: relative;
}

/* Review Actions */
.bf-review-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0 1rem;
}

/* Review Layout */
.bf-review-layout {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 1rem;
    height: calc(100vh - 260px);
    min-height: 400px;
}
.bf-pdf-panel {
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}
.bf-pdf-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}
.bf-pdf-thumb {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition-fast);
    text-align: center;
    background: var(--bg-input);
}
.bf-pdf-thumb:hover {
    border-color: var(--primary);
}
.bf-pdf-thumb img {
    width: 100%;
    display: block;
}
.bf-pdf-thumb span {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.25rem;
}
.bf-pdf-thumb-more {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.bf-loading-thumbs {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}
.bf-fields-panel {
    overflow-y: auto;
}
.bf-field-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Page Groups */
.bf-page-group {
    margin-bottom: 0.5rem;
}
.bf-page-group-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-nav);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    backdrop-filter: var(--glass-blur);
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
}

/* Field Cards */
.bf-field-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    border-left: 3px solid var(--border);
}
.bf-border-high { border-left-color: var(--success); }
.bf-border-medium { border-left-color: var(--warning); }
.bf-border-low { border-left-color: #f97316; }
.bf-border-none { border-left-color: var(--text-muted); }
.bf-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}
.bf-field-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}
.bf-confidence-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
}
.bf-confidence-high { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.bf-confidence-medium { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.bf-confidence-low { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.bf-confidence-none { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
.bf-field-tooltip {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-style: italic;
}
.bf-field-interpretation {
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 0.25rem;
}
.bf-field-kb-path {
    font-size: 0.75rem;
    color: var(--secondary);
    margin-bottom: 0.35rem;
    font-family: monospace;
}
.bf-field-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.85rem;
}
.bf-field-input:focus {
    outline: none;
    border-color: var(--primary);
}
.bf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-main);
}
.bf-no-results {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* Download View */
.bf-download-container {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 700px;
    margin: 2rem auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}
.bf-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}
.bf-stat-card {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}
.bf-stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}
.bf-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* KB Editor */
.bf-kb-editor {
    width: 100%;
    min-height: 500px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    resize: vertical;
    line-height: 1.5;
}
.bf-kb-editor:focus {
    outline: none;
    border-color: var(--primary);
}

/* ─── KB Form Layout ────────────────────────────────── */
.bf-kb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.5rem;
}
.bf-kb-grid .full-width {
    grid-column: 1 / -1;
}
.bf-kb-grid label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.bf-kb-grid input[type="text"],
.bf-kb-grid textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
}
.bf-kb-grid input[type="text"]:focus,
.bf-kb-grid textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.bf-kb-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    align-items: center;
}
.bf-kb-checks label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
    margin-bottom: 0;
}
.bf-kb-sub {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.5rem;
}
.bf-kb-sub h4 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: var(--text-main);
}
.bf-kb-dynamic-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}
.bf-kb-dynamic-row input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.95rem;
}
.bf-kb-dynamic-row input:first-child {
    flex: 0 0 120px;
}
.bf-kb-dynamic-row input:focus {
    outline: none;
    border-color: var(--primary);
}
.bf-kb-dynamic-row .bf-kb-remove-row {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}
.bf-kb-section {
    margin-bottom: 1.5rem;
}
.bf-kb-section h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* ─── Signature Pad/Preview ──────────────────────────── */
.bf-sig-slot {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.bf-sig-preview {
    width: 100%;
    max-width: 300px;
    height: 80px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--bg-input);
    overflow: hidden;
}
.bf-sig-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.bf-sig-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.bf-sig-controls button {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
}
#bf-sig-canvas {
    width: 100%;
    max-width: 480px;
    height: 160px;
    background: #ffffff;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: crosshair;
    touch-action: none;
    display: block;
}
.bf-sig-preview-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.bf-sig-preview-mini img {
    max-width: 120px;
    max-height: 40px;
    object-fit: contain;
}
.bf-sig-preview-mini span {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.bf-sig-preview-mini svg {
    flex-shrink: 0;
    color: var(--text-muted);
}
.bf-sig-masked {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}
.bf-sig-masked svg {
    flex-shrink: 0;
}
#bf-ceo-name-modal .modal-content {
    text-align: left;
}
#bf-ceo-name-input {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text);
    font-size: 0.95rem;
}
#bf-ceo-name-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb, 59, 130, 246), 0.15);
}

/* Template Recognition Banner */
.bf-tpl-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}
.bf-tpl-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.9rem;
    color: var(--text-main);
}
.bf-tpl-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.bf-tpl-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Walkthrough Overlay */
.bf-wt-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 3rem;
    overflow-y: auto;
}
.bf-wt-card {
    width: 100%;
    max-width: 600px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.bf-wt-progress {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.bf-wt-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #34d399);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.bf-wt-counter {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.25rem;
}
.bf-wt-field-info {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.bf-wt-field-info .bf-wt-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 0.35rem;
    word-break: break-word;
}
.bf-wt-field-info .bf-wt-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}
.bf-wt-type-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}
.bf-wt-tooltip {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.35rem;
}
.bf-wt-match-info {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}
.bf-wt-match-info .bf-wt-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    word-break: break-word;
}
.bf-wt-match-info .bf-wt-interp {
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 0.15rem;
}
.bf-wt-match-info .bf-wt-kb {
    font-size: 0.75rem;
    color: var(--secondary);
    font-family: monospace;
}
.bf-wt-review-note {
    margin-bottom: 1rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.4;
}
.bf-wt-review-note.confirmed {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--success);
    color: var(--success);
}
.bf-wt-review-note.flagged {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--warning);
    color: var(--warning);
}
.bf-wt-correction {
    margin-top: 0.35rem;
    font-weight: 600;
    color: var(--text-main);
}
.bf-wt-edit-area {
    margin-bottom: 1rem;
}
.bf-wt-edit-area input,
.bf-wt-edit-area select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.9rem;
}
.bf-wt-edit-area label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
}
.bf-wt-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.bf-wt-actions button {
    flex: 1;
}
.bf-wt-bulk {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.bf-wt-bulk button {
    background: none;
    border: none;
    font-size: 0.8rem;
    color: var(--primary);
    cursor: pointer;
    padding: 0.25rem 0;
}
.bf-wt-bulk button:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .bf-kb-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 1024px) {
    .bf-review-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .bf-pdf-panel {
        max-height: 250px;
    }
}

/* ─── Bid Filler Prototype (OCR) ─────────────────────────────── */

/* ─── Bid Filler Flow AI ─────────────────────────────────────── */

.bff-summary-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0 0.25rem;
    flex-wrap: wrap;
}

.bff-flow-status {
    color: var(--text-muted);
    font-size: 0.85rem;
    min-height: 1.2rem;
}

.bff-agent-panel {
    margin: 0.75rem 0;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.bff-agent-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.bff-agent-title {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 700;
}

.bff-agent-status {
    color: var(--text-muted);
    font-size: 0.78rem;
    min-height: 1.1rem;
}

.bff-agent-quick-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.bff-agent-quick-actions button,
.bff-agent-row button {
    padding: 0.38rem 0.65rem;
    font-size: 0.78rem;
}

.bff-agent-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.bff-agent-input {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.85rem;
}

.bff-agent-history {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.65rem;
    max-height: 118px;
    overflow: auto;
}

.bff-agent-entry {
    display: grid;
    grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
    gap: 0.45rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--text-muted);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.bff-agent-entry.success {
    border-left-color: var(--success);
}

.bff-agent-entry.error {
    border-left-color: var(--danger);
}

.bff-agent-command {
    color: var(--text-main);
    font-weight: 600;
}

.bff-agent-empty {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.bff-review-layout {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) 420px;
    gap: 1.25rem;
    height: calc(100vh - 330px);
    min-height: 440px;
}

.bff-page-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.bff-page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-main);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.bff-page-nav button {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.bff-page-viewer {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
    background: var(--bg-main);
}

.bff-page-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.bff-page-image {
    width: 100%;
    height: auto;
    display: block;
}

.bff-field-overlay {
    border: 2px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bff-overlay-high {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.5);
}

.bff-overlay-medium {
    background: rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.5);
}

.bff-overlay-low {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.5);
}

.bff-overlay-none {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.5);
}

.bff-field-overlay:hover,
.bff-overlay-hover {
    border-width: 3px;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
    z-index: 10;
}

.bff-card-highlighted {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    background: var(--bg-hover) !important;
}

.bff-field-card {
    cursor: pointer;
}

.bff-card-focused {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.bff-field-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.bff-card-review {
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.18);
}

.bff-field-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.35rem 0;
}

.bff-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bff-reason {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
    margin: 0.3rem 0 0.45rem;
}

.bff-alt-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.4rem;
}

.bff-alt-row select {
    flex: 1;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.8rem;
}

.bff-alt-row button {
    padding: 0.32rem 0.55rem;
    font-size: 0.78rem;
}

@media (max-width: 1100px) {
    .bff-review-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .bff-page-panel {
        max-height: 420px;
    }
    .bff-agent-header,
    .bff-agent-row {
        align-items: stretch;
        flex-direction: column;
    }
    .bff-agent-quick-actions {
        justify-content: flex-start;
    }
    .bff-agent-entry {
        grid-template-columns: 1fr;
    }
}

.bfp-review-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    height: calc(100vh - 320px);
    min-height: 400px;
}

.bfp-page-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.bfp-page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-main);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.bfp-page-nav button {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.bfp-page-viewer {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
    background: var(--bg-main);
}

.bfp-page-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.bfp-page-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Field overlays on page preview */
.bfp-field-overlay {
    border: 2px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bfp-overlay-high {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.5);
}

.bfp-overlay-medium {
    background: rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.5);
}

.bfp-overlay-low {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.5);
}

.bfp-overlay-none {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.5);
}

.bfp-overlay-hover,
.bfp-field-overlay:hover {
    border-width: 3px;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
    z-index: 10;
}

.bfp-overlay-high.bfp-overlay-hover { background: rgba(34, 197, 94, 0.25); }
.bfp-overlay-medium.bfp-overlay-hover { background: rgba(234, 179, 8, 0.25); }
.bfp-overlay-low.bfp-overlay-hover { background: rgba(249, 115, 22, 0.25); }
.bfp-overlay-none.bfp-overlay-hover { background: rgba(148, 163, 184, 0.25); }

/* Field card highlight when hovering overlay */
.bfp-card-highlighted {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    background: var(--bg-hover) !important;
}

/* Field card metadata row */
.bfp-field-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

@media (max-width: 1024px) {
    .bfp-review-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .bfp-page-panel {
        max-height: 350px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Sanitation & Compliance Tracker
   ═══════════════════════════════════════════════════════════════ */

/* Facility Tabs */
.san-facility-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.san-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: all 0.2s;
}

.san-tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.san-tab-btn.active {
    color: white;
    background: var(--secondary);
    border-bottom: 3px solid var(--accent);
}

/* Cards */
.san-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    backdrop-filter: var(--glass-blur);
}

.san-card h3 {
    color: var(--text-main);
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

/* Stats Grid */
.san-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.san-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    backdrop-filter: var(--glass-blur);
}

.san-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.san-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Charts Row */
.san-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Form Layout */
.san-form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.san-field {
    flex: 1;
    min-width: 180px;
}

.san-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.san-field input,
.san-field select,
.san-field textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.san-field textarea {
    resize: vertical;
}

/* Checklist */
.san-checklist-area {
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.san-checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
    user-select: none;
}

.san-area-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.san-checklist-items {
    padding: 0.25rem 0;
}

.san-checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    gap: 0.75rem;
}

.san-checklist-item:last-child {
    border-bottom: none;
}

.san-item-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-main);
}

.san-item-controls {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-shrink: 0;
}

.san-toggle-pass,
.san-toggle-fail {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.san-toggle-pass:hover { border-color: var(--success); color: var(--success); }
.san-toggle-fail:hover { border-color: var(--danger); color: var(--danger); }
.san-toggle-pass.active { background: var(--success); color: white; border-color: var(--success); }
.san-toggle-fail.active { background: var(--danger); color: white; border-color: var(--danger); }

.san-item-note {
    width: 120px !important;
    padding: 0.3rem 0.5rem !important;
    font-size: 0.8rem !important;
}

/* Tables */
.san-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.san-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.san-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    color: var(--text-main);
}

.san-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* Compliance Colors */
.san-compliance-high { color: var(--success); }
.san-compliance-mid { color: var(--warning); }
.san-compliance-low { color: var(--danger); }

/* CA Status Badges */
.san-status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.san-status-open { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.san-status-in_progress { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.san-status-verified { background: rgba(59, 130, 246, 0.15); color: var(--primary); }
.san-status-closed { background: rgba(16, 185, 129, 0.15); color: var(--success); }

/* CA Status Select */
.san-status-select {
    padding: 0.3rem 0.5rem;
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
}

/* Print */
@media print {
    .san-facility-tabs,
    #san-sub-nav,
    .san-form-row,
    .san-toggle-pass,
    .san-toggle-fail,
    .san-item-note,
    .san-status-select,
    button {
        display: none !important;
    }
    .san-card {
        break-inside: avoid;
        border: 1px solid #ccc;
        box-shadow: none;
        backdrop-filter: none;
    }
    .san-table th,
    .san-table td {
        color: #000;
        border-color: #ccc;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .san-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .san-charts-row {
        grid-template-columns: 1fr;
    }
    .san-form-row {
        flex-direction: column;
    }
    .san-checklist-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .san-item-controls {
        margin-top: 0.4rem;
    }
    .san-item-note {
        width: 100% !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Formulation Lab
   ═══════════════════════════════════════════════════════════════ */

/* Two-row sub-nav wrapper */
.fl-sub-nav-wrap {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.fl-nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    opacity: 0.6;
    padding: 0 0.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Cards */
.fl-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    backdrop-filter: var(--glass-blur);
}

.fl-card h3 {
    color: var(--text-main);
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
}

/* Form Layout */
.fl-form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.fl-field {
    flex: 1;
    min-width: 160px;
}

.fl-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.fl-field input,
.fl-field select,
.fl-field textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* Ingredient Tables */
.fl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.fl-table th {
    text-align: left;
    padding: 0.5rem 0.6rem;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fl-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    color: var(--text-main);
}

.fl-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.fl-table-compact th,
.fl-table-compact td {
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
}

.fl-input-sm {
    width: 100%;
    padding: 0.35rem 0.5rem;
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.fl-ing-select {
    width: 100%;
    padding: 0.35rem 0.5rem;
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.fl-remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.2rem 0.4rem;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.fl-remove-btn:hover {
    opacity: 1;
}

/* Result Grid */
.fl-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.fl-result-card {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
}

.fl-result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

.fl-result-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Info Box */
.fl-info-box {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.5;
}

/* Water Activity Scale */
.fl-aw-scale {
    position: relative;
    padding-bottom: 1.5rem;
}

.fl-aw-bar {
    display: flex;
    height: 28px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.fl-aw-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}

.fl-aw-safe { background: var(--success); }
.fl-aw-caution { background: #84cc16; }
.fl-aw-warn { background: var(--warning); }
.fl-aw-danger { background: var(--danger); }

.fl-aw-marker {
    position: absolute;
    bottom: 0;
    transform: translateX(-50%);
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 700;
}

/* Result Badges */
.fl-result-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.fl-badge-pass { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.fl-badge-fail { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* Blend Uniformity Chips */
.fl-bu-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.fl-bu-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 9999px;
    font-size: 0.85rem;
    color: var(--text-main);
}

.fl-bu-chip-x {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    line-height: 1;
}

/* Reformulation Split View */
.fl-reform-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Print */
@media print {
    .fl-card {
        break-inside: avoid;
        border: 1px solid #ccc;
        box-shadow: none;
        backdrop-filter: none;
    }
    .fl-table th,
    .fl-table td {
        color: #000;
        border-color: #ccc;
    }
    .fl-remove-btn,
    .fl-ing-select,
    button {
        display: none !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .fl-form-row {
        flex-direction: column;
    }
    .fl-reform-split {
        grid-template-columns: 1fr;
    }
    .fl-result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   GUIDE CARDS
   ============================================ */
.guide-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}
.guide-card {
    background: var(--card-bg, #1e1e2e);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.guide-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}
.guide-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.guide-card--blue::before  { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.guide-card--green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.guide-card--amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.guide-card--purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.guide-card--red::before    { background: linear-gradient(90deg, #ef4444, #f87171); }

.guide-card__icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.guide-card--blue .guide-card__icon   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.guide-card--green .guide-card__icon  { background: rgba(16,185,129,0.15); color: #34d399; }
.guide-card--amber .guide-card__icon  { background: rgba(245,158,11,0.15); color: #fbbf24; }
.guide-card--purple .guide-card__icon { background: rgba(139,92,246,0.15); color: #a78bfa; }
.guide-card--red .guide-card__icon    { background: rgba(239,68,68,0.15); color: #f87171; }

.guide-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.guide-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}
.guide-card__desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.guide-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.25rem;
}
.guide-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.guide-tag--blue   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.guide-tag--green  { background: rgba(16,185,129,0.15); color: #34d399; }
.guide-tag--amber  { background: rgba(245,158,11,0.15); color: #fbbf24; }
.guide-tag--red    { background: rgba(239,68,68,0.15);  color: #f87171; }
.guide-tag--purple { background: rgba(139,92,246,0.15); color: #a78bfa; }

.guide-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.15s, transform 0.15s;
    cursor: pointer;
    border: none;
}
.guide-card__btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}
.guide-card__btn--blue   { background: #3b82f6; color: #fff; }
.guide-card__btn--green  { background: #10b981; color: #fff; }
.guide-card__btn--amber  { background: #f59e0b; color: #1a1a2e; }
.guide-card__btn--purple { background: #8b5cf6; color: #fff; }
.guide-card__btn--red    { background: #ef4444; color: #fff; }

.guide-card--teal::before    { background: linear-gradient(90deg, #0d9488, #14b8a6); }
.guide-card--teal .guide-card__icon    { background: rgba(13,148,136,0.15); color: #14b8a6; }
.guide-card__btn--teal    { background: #0d9488; color: #fff; }
.guide-tag--teal { background: rgba(13,148,136,0.1); color: #0d9488; }

@media (max-width: 768px) {
    .guide-cards-grid {
        grid-template-columns: 1fr;
    }
}
@media print {
    .guide-cards-grid { break-inside: avoid; }
}

/* ═══════════════════════════════════════════════════════
   Market Intel
   ═══════════════════════════════════════════════════════ */
.mi-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.mi-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.mi-kpi-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.mi-kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
}
.mi-kpi-change {
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.mi-change-up { color: var(--danger); }
.mi-change-down { color: var(--success); }
.mi-change-flat { color: var(--text-muted); }
.mi-kpi-updated {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.mi-chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1rem;
}
.mi-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-width: 0;
    overflow: hidden;
}
.mi-chart-card canvas {
    height: 240px !important;
    max-width: 100%;
}
.mi-chart-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 0.75rem 0;
}
.mi-time-range-group {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.15rem;
}
.mi-time-range-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}
.mi-time-range-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}
.mi-time-range-btn.active {
    background: var(--primary);
    color: white;
}
.mi-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}
.mi-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: mi-spin 0.8s linear infinite;
    margin: 0 auto 0.75rem;
}
@keyframes mi-spin {
    to { transform: rotate(360deg); }
}
.mi-error {
    text-align: center;
    padding: 2rem;
    color: var(--danger);
}
@media (max-width: 768px) {
    .mi-chart-grid {
        grid-template-columns: 1fr;
    }
    .mi-kpi-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* ─── Market Intel: Alert Cards ─── */
.mi-alert-card {
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid;
}
.mi-alert-red {
    background: rgba(239, 68, 68, 0.08);
    border-left-color: var(--danger);
}
.mi-alert-yellow {
    background: rgba(234, 179, 8, 0.08);
    border-left-color: #eab308;
}
.mi-alert-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}
.mi-alert-arrow {
    font-size: 0.75rem;
}
.mi-alert-red .mi-alert-arrow,
.mi-alert-red .mi-alert-header strong { color: var(--danger); }
.mi-alert-yellow .mi-alert-arrow,
.mi-alert-yellow .mi-alert-header strong { color: #eab308; }
.mi-alert-action {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.mi-alert-buttons {
    display: flex;
    gap: 0.5rem;
}
.mi-alert-view-btn, .mi-alert-dismiss-btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    transition: var(--transition-fast);
}
.mi-alert-view-btn:hover { color: var(--primary); border-color: var(--primary); }
.mi-alert-dismiss-btn:hover { color: var(--danger); border-color: var(--danger); }

/* ─── Market Intel: Cost Pressure ─── */
.mi-pressure-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.mi-pressure-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
}
.mi-pressure-header:hover { background: rgba(255,255,255,0.03); }
.mi-pressure-name { font-weight: 600; font-size: 0.9rem; }
.mi-pressure-value { font-weight: 700; font-size: 0.95rem; }
.mi-pressure-red .mi-pressure-value { color: var(--danger); }
.mi-pressure-yellow .mi-pressure-value { color: #eab308; }
.mi-pressure-green .mi-pressure-value { color: var(--success); }
.mi-pressure-breakdown {
    padding: 0 1rem 0.75rem;
    border-top: 1px solid var(--border);
}
.mi-pressure-detail {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ─── Market Intel: Settings Panel ─── */
.mi-settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}
.mi-settings-section h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}
.mi-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
}
.mi-toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}
.mi-threshold-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    gap: 0.5rem;
    flex-wrap: wrap;
}
.mi-mapping-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.mi-mapping-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}
.mi-mapping-detail {
    padding: 0.5rem 1rem 0.75rem;
    border-top: 1px solid var(--border);
}
.mi-mapping-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    flex-wrap: wrap;
}

/* ─── Market Intel: Alert History ─── */
.mi-history-row {
    display: flex;
    gap: 1rem;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mi-history-date {
    color: var(--text-muted);
    min-width: 90px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PRODUCTION SCHEDULING — Gantt Chart, Drag-Drop, Changeover Management
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Header */
.ps-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.ps-header h2 { margin: 0; }
.ps-header-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}
.ps-date-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.25rem 0.75rem;
}
.ps-date-nav .btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}
.ps-date-nav .btn-icon:hover { color: var(--primary); background: rgba(59,130,246,0.1); }
#psDateLabel {
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 180px;
    text-align: center;
}

/* Loading & Empty */
.ps-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--text-muted);
}
.ps-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Gantt Wrapper */
.ps-gantt-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    overflow: hidden;
    min-height: 300px;
}

/* Gantt Container — scrollable */
.ps-gantt-container {
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
}

/* Gantt Header (timeline) */
.ps-gantt-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg-card);
    border-bottom: 2px solid var(--border);
}
.ps-gantt-timeline {
    display: flex;
    white-space: nowrap;
}
.ps-gantt-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.5rem 0;
    border-right: 1px solid var(--border);
    color: var(--text-main);
    background: var(--bg-card);
}
.ps-gantt-hours {
    border-top: 1px solid rgba(255,255,255,0.05);
}
.ps-gantt-hour-cell {
    text-align: center;
    font-size: 0.65rem;
    padding: 0.25rem 0;
    color: var(--text-muted);
    border-right: 1px solid rgba(255,255,255,0.04);
}
.ps-gantt-day-cell {
    text-align: center;
    font-size: 0.75rem;
    padding: 0.5rem 0;
    color: var(--text-muted);
    border-right: 1px solid var(--border);
}
.ps-gantt-day-cell.ps-weekend {
    background: rgba(255,255,255,0.02);
    color: rgba(255,255,255,0.3);
}

/* Gantt Body */
.ps-gantt-body {
    position: relative;
}

/* Gantt Row (one per production line) */
.ps-gantt-row {
    display: flex;
    min-height: 72px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast);
}
.ps-gantt-row:last-child { border-bottom: none; }
.ps-gantt-row--drop-target {
    background: rgba(59, 130, 246, 0.08) !important;
}

/* Line label */
.ps-gantt-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    position: sticky;
    left: 0;
    z-index: 10;
    min-width: 160px;
}
.ps-gantt-label-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
}
.ps-gantt-label-code {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Track (timeline area for jobs) */
.ps-gantt-track {
    position: relative;
    min-height: 72px;
}

/* Grid lines */
.ps-gantt-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    border-right: 1px solid rgba(255,255,255,0.04);
    pointer-events: none;
}
.ps-weekend-bg {
    background: rgba(255,255,255,0.015);
}

/* Now line (current time indicator) */
.ps-gantt-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ef4444;
    z-index: 5;
    pointer-events: none;
}
.ps-gantt-now-line::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -3px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

/* Job block */
.ps-gantt-job {
    position: absolute;
    top: 6px;
    bottom: 6px;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid rgba(255,255,255,0.15);
    overflow: hidden;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ps-gantt-job:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 4;
}
.ps-gantt-job--dragging {
    cursor: grabbing;
    opacity: 0.4;
    transform: none !important;
}
.ps-gantt-job--ghost {
    border: 2px dashed rgba(255,255,255,0.5);
}
.ps-gantt-job-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ps-gantt-job-detail {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Changeover block (on Gantt) */
.ps-gantt-changeover {
    position: absolute;
    top: 8px;
    bottom: 8px;
    border-radius: var(--radius-sm);
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 0 6px;
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: repeating-linear-gradient(
        45deg,
        var(--changeover-color, #f59e0b),
        var(--changeover-color, #f59e0b) 6px,
        color-mix(in srgb, var(--changeover-color, #f59e0b), black 20%) 6px,
        color-mix(in srgb, var(--changeover-color, #f59e0b), black 20%) 12px
    );
    border: 1px dashed rgba(255,255,255,0.3);
    opacity: 0.85;
}

/* Legend */
.ps-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--text-muted);
}
.ps-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.ps-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}
.ps-legend-stripe {
    background: repeating-linear-gradient(
        45deg, #f59e0b, #f59e0b 3px, #d97706 3px, #d97706 6px
    );
}

/* Status badge (orders table) */
.ps-status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}
.ps-priority-urgent {
    color: #ef4444;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Changeover panel */
.ps-changeover-panel {
    margin-top: 2rem;
}
.ps-changeover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.ps-changeover-header h3 { margin: 0; }
.ps-changeover-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

/* Changeover card */
.ps-changeover-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: var(--transition-fast);
}
.ps-changeover-card:hover {
    border-color: var(--primary);
}
.ps-changeover-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ps-changeover-card-actions {
    display: flex;
    gap: 0.25rem;
}
.ps-changeover-type-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}
.ps-changeover-card-line {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
}
.ps-changeover-card-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.ps-changeover-card-notes {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.25rem;
}

/* Orders panel */
.ps-orders-panel {
    margin-top: 2rem;
}
.ps-orders-panel h3 { margin-bottom: 1rem; }

/* Changeover modal */
.ps-modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
}
.ps-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ps-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.ps-modal-header h3 { margin: 0; font-size: 1.1rem; }
.ps-modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.ps-modal-body .form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.ps-modal-body label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.ps-modal-body select,
.ps-modal-body input,
.ps-modal-body textarea {
    padding: 0.6rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.9rem;
}
.ps-modal-body select:focus,
.ps-modal-body input:focus,
.ps-modal-body textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}
.ps-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

.sync-status-synced {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.sync-status-stale {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.sync-status-never {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.sync-status-pending {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent);
}

.sync-status-local,
.sync-status-external {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

.nutrition-sync-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 120px;
}

.nutrition-sync-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.nutrition-batch-report {
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.02);
}

.nutrition-batch-report-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.45rem;
}

.nutrition-batch-report-title {
    font-weight: 600;
    color: var(--text-primary);
}

.nutrition-batch-report-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nutrition-batch-report-summary {
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.nutrition-batch-report-actions {
    margin-bottom: 0.55rem;
}

.nutrition-batch-report-list {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

.nutrition-batch-report-label {
    font-weight: 600;
    color: var(--text-primary);
}

.nutrition-batch-report-value {
    color: var(--text-secondary);
}
