/* Mobile-first Daily Inventory V2 Styles */

/* Remove article padding for full-width design */
article.content {
    padding: 0 !important;
}

.inventory-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #F1F5F9;
    z-index: 50;
}

.inventory-container:not(.home-container) {
    /* Solid slate background for depth behind white cards */
    background: #f1f5f9;
}

.inventory-container.action-mode {
    z-index: 2147480005;
}

.inventory-container.overlay-open {
    z-index: 2147480005;
}

.page-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.content-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    /* Increased padding for floating dock */
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
    background-color: transparent; /* Let container gradient show through */
    margin-top: 128px; /* 80px Header + 48px Tabs */
    padding-top: 0;
}

/* Constrain content width on larger screens, matching home page */
.page-content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 0 0.5rem; /* Side padding for mobile */
}

@media (min-width: 800px) {
    .page-content-wrapper {
        padding: 0; /* No extra padding when constrained by max-width */
    }
}

/* --- New Slim Header --- */
.header-container {
    position: absolute;
    top: -1px; /* Extend slightly to cover any sub-pixel gap */
    left: 0;
    width: 100%;
    height: 71px; /* Compensate for the -1px top */
    padding-top: 1px; /* Keep content in original position */
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 1rem;
    padding-right: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Subtle shadow */
    border-bottom: none; /* Clean look */
    z-index: 9999;
}

.header-left-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-title-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}

.header-date-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-subtitle {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    font-weight: 600;
}

.header-main-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
}

.header-right-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

/* Sync Button Wrapper */
.sync-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
}

.sync-mode-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #6b7280;
    margin-top: -12px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Sync Button */
.sync-btn {
    background: transparent !important;
    border: none !important;
    color: #6b7280;
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    outline: none !important;
    box-shadow: none !important;
    position: relative;
}

.sync-btn.manual-mode {
    color: #d97706;
}

.sync-badge {
    position: absolute;
    top: 0;
    right: -2px;
    background: #d97706;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.sync-btn:focus,
.sync-btn:active,
.sync-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    -webkit-tap-highlight-color: transparent !important;
}

.sync-btn:hover {
    background-color: #f3f4f6;
    color: #3b82f6;
}

.sync-btn.syncing {
    color: #3b82f6;
}

.sync-btn.syncing i {
    animation: spin 1s linear infinite;
}

/* Status Pill in Header */
.header-status-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    text-transform: uppercase;
}

.header-status-pill.draft {
    background-color: #fef3c7;
    color: #92400e;
}

.header-status-pill.certified {
    background-color: #d1fae5;
    color: #065f46;
}

.header-status-pill.unsynced {
    background-color: #fee2e2;
    color: #991b1b;
}

/* --- Floating Dock --- */
.floating-dock-container {
    position: absolute;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px)); /* Above bottom nav */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 1rem;
    z-index: 90;
    pointer-events: none; /* Let clicks pass through around the dock */
}

.floating-dock {
    pointer-events: auto;
    background: #1e293b; /* Solid dark slate - matches bottom nav */
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 400px;
    border: none;
}

/* Action Selector in Dock */
.dock-action-group {
    flex: 1;
    display: flex;
    gap: 2px;
}

.dock-main-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #F68D2E; /* Orange - brand warning color */
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 16px 4px 4px 16px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s;
    box-shadow: none;
}

.dock-main-btn:active {
    background: #e07a1f;
    transform: scale(0.98);
}

.dock-dropdown-btn {
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F68D2E;
    color: white;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px 16px 16px 4px;
    box-shadow: none;
}

.dock-dropdown-btn:active {
    background: #e07a1f;
}

/* Certify Button in Dock */
.dock-certify-btn {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    border: none;
    background: #475569; /* Lighter slate for contrast */
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: none;
}

.dock-certify-btn.ready {
    background: #22c55e; /* Bright green */
    color: white;
}

.dock-certify-btn:active {
    transform: scale(0.95);
}

/* Action Dropdown Menu (Upwards) */
.dock-dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 1rem;
    right: auto;
    width: calc(100% - 80px); /* Width of dock minus certify button area */
    max-width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-bottom: 10px;
    overflow: hidden;
    animation: slideUp 0.2s ease-out;
    z-index: 100;
    padding: 0.5rem;
    pointer-events: auto;
}

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

.dock-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0;
    border: none;
    background: none;
    color: #374151;
    font-weight: 500;
    border-radius: 8px;
    text-align: left;
    transition: all 0.2s;
    overflow: hidden;
}

.dock-menu-action {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: inherit;
    font-weight: inherit;
    font-size: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 8px 0 0 8px;
    transition: background 0.2s;
}

.dock-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 100%;
    padding: 0.75rem 0;
    border: none;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    border-left: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.dock-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #6b7280;
}

.dock-menu-toggle.on {
    color: #2563eb;
    background: #e0f2fe;
}

/* Case Toggle Switch */
.case-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-left: 1px solid #e5e7eb;
}

.case-toggle input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: #d1d5db;
    border-radius: 10px;
    transition: all 0.2s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.case-toggle input:checked + .toggle-slider {
    background: #005B94;
}

.case-toggle input:checked + .toggle-slider::after {
    left: 18px;
}

/* Menu header row */
.dock-menu-header {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.25rem;
}

.header-action {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-cases {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-right: 0.25rem;
    white-space: nowrap;
}

/* Dropdown Item Colors */
.dock-menu-item.action-install { color: #2563eb; }
.dock-menu-item.action-install .dock-menu-action:hover,
.dock-menu-item.action-install.active .dock-menu-action { background: #e0f2fe; }

.dock-menu-item.action-add { color: #059669; }
.dock-menu-item.action-add .dock-menu-action:hover,
.dock-menu-item.action-add.active .dock-menu-action { background: #d1fae5; }

.dock-menu-item.action-return { color: #d97706; }
.dock-menu-item.action-return .dock-menu-action:hover,
.dock-menu-item.action-return.active .dock-menu-action { background: #fef3c7; }

.dock-menu-item.action-scrap { color: #dc2626; }
.dock-menu-item.action-scrap .dock-menu-action:hover,
.dock-menu-item.action-scrap.active .dock-menu-action { background: #fee2e2; }

.dock-menu-item.action-transfer { color: #7c3aed; }
.dock-menu-item.action-transfer .dock-menu-action:hover,
.dock-menu-item.action-transfer.active .dock-menu-action { background: #ede9fe; }

.dock-menu-item i {
    font-size: 1.1rem;
}

/* Action Mode Colors - Solid Style */
.action-install .dock-main-btn, .action-install .dock-dropdown-btn { 
    color: white; 
    background: #2563eb;
}
.action-add .dock-main-btn, .action-add .dock-dropdown-btn { 
    color: white; 
    background: #059669;
}
.action-return .dock-main-btn, .action-return .dock-dropdown-btn { 
    color: white; 
    background: #F68D2E;
}
.action-scrap .dock-main-btn, .action-scrap .dock-dropdown-btn { 
    color: white; 
    background: #dc2626;
}
.action-transfer .dock-main-btn, .action-transfer .dock-dropdown-btn { 
    color: white; 
    background: #7c3aed;
}

.collapsing-header {
    padding-top: 50px; /* Push content down for persistent header */
    width: 100%;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
}

.loading-state, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-state i {
    font-size: 3rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

.error-state h3 {
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.error-state p {
    color: #6b7280;
}

.header-section {
    background: white;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    z-index: 10;
    color: #1f2937;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    /* filter: brightness(0) invert(1); Removed to show original colors */
}

.header-logo-small {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.header-left h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #005B94;
}

.date-display {
    font-size: 0.95rem;
    color: #374151;
    font-weight: 600;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: #6b7280;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.header-icon-btn i {
    font-size: 1.2rem;
}

.header-icon-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

.header-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.header-icon-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.offline-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    width: fit-content;
    margin-top: 0.5rem;
    background: #fef3c7;
    color: #92400e;
}

.certified-banner {
    background: #d1fae5;
    color: #065f46;
    padding: 0.75rem 1rem;
    margin: 0.5rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}



.action-menu-btn:not(:disabled):hover {
    color: #3b82f6;
    background: #eff6ff;
}

.action-menu-btn.active {
    color: #3b82f6;
    font-weight: 600;
}

.action-menu-btn.active i {
    transform: scale(1.1);
}


/* Action Section */
.action-section {
    background: white;
    padding: 1rem;
    margin: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.action-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    flex-shrink: 0;
    min-width: 70px;
}

.action-btn i {
    font-size: 1.1rem;
}

.action-btn:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.action-btn.active {
    border-color: #3b82f6;
    background: #dbeafe;
    color: #1e40af;
}

/* SKU Entry */
.sku-entry {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.sku-entry h5 {
    margin: 0 0 1rem 0;
    color: #1e40af;
    font-size: 1rem;
}

.sku-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.sku-entry-modal {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    margin-bottom: env(safe-area-inset-bottom, 0px);
    padding-bottom: 70px;
}

.edit-log-modal {
    max-width: 400px;
    margin: auto;
}

.edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.edit-form label {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
}

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

.action-context {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
    text-align: center;
}

.sku-entry-modal .modal-footer {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
}

.sku-entry-modal .modal-footer button {
    flex: 1;
}

.btn-primary {
    background: #1d4ed8;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background: #1e40af;
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f3f4f6;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.sku-info {
    display: flex;
    flex-direction: column;
}

.sku-info strong {
    font-size: 1rem;
    color: #1f2937;
}

.sku-info small {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.15rem;
}

.quantity-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-input input {
    width: 60px;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:active {
    background: #f3f4f6;
}

.add-btn {
    width: 100%;
    margin-top: 1rem;
}

/* Totals Section */
.totals-section {
    background: white;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Tabs Header - Fixed Position */
.tabs-header {
    position: absolute;
    top: 80px; /* Increased from 70px for breathing room */
    left: 0;
    width: 100%;
    height: 48px;
    display: flex;
    justify-content: center; /* Center the inner wrapper */
    background: #f1f5f9;
    padding: 0.25rem 1rem;
    z-index: 90;
    border-bottom: 1px solid #cbd5e1; /* Line between tabs and search bar */
}

/* Inner wrapper to constrain tab buttons */
.tabs-inner {
    display: flex;
    gap: 0.25rem;
    max-width: 800px;
    width: 100%;
}

/* Removed duplicate .tab styles to fix blue underline issue */


.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.section-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.btn-link {
    background: none;
    border: none;
    color: #3b82f6;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
}

.totals-list {
    background: transparent;
    padding: 8px; /* Give some side padding for the cards */
    padding-bottom: 5rem;
    display: flex;
    flex-direction: column;
    gap: 8px; /* 8px gap between cards */
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.activity-list {
    background: white;
    padding-bottom: 4rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.activity-controls {
    display: flex;
    gap: 1.5rem;
    padding: 0.875rem 1rem;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    justify-content: flex-end;
    align-items: center;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    color: #6b7280;
    font-size: 0.9rem;
    transition: color 0.2s;
    position: relative;
}

.control-item:hover {
    color: #3b82f6;
}

.control-item.active {
    color: #1e40af;
    font-weight: 500;
}

.control-item i {
    font-size: 1rem;
}

.filter-badge {
    width: 8px;
    height: 8px;
    background: #EA580C; /* Burnt Orange for visibility */
    border-radius: 50%;
    position: absolute;
    top: 6px;
    right: 6px;
    border: 1px solid white;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

.control-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #1f2937;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.control-select:focus {
    outline: none;
    border-color: #3b82f6;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.activity-item:hover {
    background: #f9fafb;
}

.activity-time {
    font-size: 0.75rem;
    color: #6b7280;
    min-width: 50px;
    flex-shrink: 0;
}

.activity-action {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
    min-width: 38px;
    flex-shrink: 0;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-align: center;
}

.activity-action.action-install {
    background: #dbeafe;
    color: #1e40af;
}

.activity-action.action-add {
    background: #d1fae5;
    color: #065f46;
}

.activity-action.action-scrap {
    background: #fee2e2;
    color: #991b1b;
}

.activity-action.action-return {
    background: #fef3c7;
    color: #92400e;
}

.activity-action.action-transfer {
    background: #e0e7ff;
    color: #3730a3;
}

.activity-sku {
    flex: 1;
    font-size: 0.85rem;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.activity-qty {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.activity-person {
    font-size: 0.75rem;
    color: #6b7280;
    min-width: 60px;
    text-align: right;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-delete-icon {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-delete-icon:hover {
    background: #fee2e2;
}

.total-item {
    position: relative;
    background: white;
    border-radius: 12px;
    /* Subtle border for definition without heaviness */
    border: 1px solid rgba(0, 0, 0, 0.04);
    /* Very subtle shadow for depth */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    /* margin-bottom: 8px; Removed in favor of gap */
    transition: all 0.2s ease;
}

.total-item:last-child {
    margin-bottom: 0;
}

.total-item.expanded {
    z-index: 10;
    /* Stronger lift when expanded */
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.02);
    transform: translateY(-2px);
    border-color: transparent;
}

.total-item.menu-open {
    z-index: 20;
}

.total-item:hover .sku-header {
    background: transparent;
}

.total-item.expanded .sku-header {
    background: white;
}

.sku-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 12px;
    background: transparent;
}

.total-item.expanded .sku-header {
    background: white;
    border-radius: 12px 12px 0 0;
}

.sku-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 40px;
}

.total-item.action-mode .sku-header {
    cursor: default;
}

.quantity-stepper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.quantity-stepper .qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: transform 0.1s;
}

.quantity-stepper .qty-btn:active {
    transform: scale(0.9);
}

.quantity-stepper .qty-btn.minus {
    color: #9ca3af;
}

.quantity-stepper .qty-btn.plus {
    color: #005B94;
}

.quantity-stepper .qty-input {
    width: 45px;
    text-align: center;
    border: none;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.quantity-stepper .qty-input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
    background: white;
}

.sku-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sku-name {
    font-size: 1rem; /* Slightly larger */
    font-weight: 700; /* Bolder */
    color: #0f172a; /* Slate 900 - Darker for contrast */
    line-height: 1.2;
    letter-spacing: -0.01em; /* Tighten up for modern look */
}

.sku-code {
    font-size: 0.75rem;
    color: #64748b; /* Slate 500 */
    font-weight: 500;
    margin-top: 2px;
}

.net-change {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem; /* More pill-like padding */
    border-radius: 999px; /* Full pill */
    margin-left: 0.5rem;
    flex-shrink: 0;
    min-width: 40px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.net-change.positive {
    background: #dcfce7; /* Green 100 */
    color: #15803d; /* Green 700 */
    border: 1px solid #bbf7d0;
}

.net-change.negative {
    background: #fee2e2; /* Red 100 */
    color: #b91c1c; /* Red 700 */
    border: 1px solid #fecaca;
}

.net-change.neutral {
    background: #f1f5f9; /* Slate 100 */
    color: #94a3b8; /* Slate 400 */
    border: 1px solid #e2e8f0;
}

.action-total-container {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 0.5rem;
}

.action-total-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.action-total {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: #eff6ff;
    color: #1e40af;
    min-width: 32px;
    text-align: center;
}

.sku-breakdown {
    margin-top: 0;
    padding: 8px 12px;
    /* Two-Tone: Light Gray background for details */
    background-color: #F8FAFC;
    /* Subtle inner shadow for depth */
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.03);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 0 0 12px 12px;
}

.action-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.action-preview-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
}

.action-preview-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.action-preview-value .updating {
    color: #9ca3af;
    text-decoration: line-through;
}

.action-preview-value i {
    font-size: 0.875rem;
    color: #6b7280;
}

.action-preview-value .projected {
    color: #3b82f6;
}

.sku-table-inline {
    display: flex;
    justify-content: space-between;
    gap: 0;
    margin-bottom: 0.75rem;
}

.table-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0;
    transition: all 0.2s;
}

.table-cell.editing {
    background: #eff6ff;
    border-radius: 6px;
    padding: 0.5rem 0.25rem;
    margin: -0.25rem 0.1rem;
}

.table-cell.editing .cell-value {
    font-weight: 700;
}

.table-cell:last-child {
    border-right: none;
}

.table-cell.xfer-cell {
    border-right: none;
}

.cell-label {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
}

.cell-value {
    font-size: 1.0rem;
    font-weight: 600;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.cell-value .old-value {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 0.75rem;
}

.cell-value i.bi-arrow-right {
    font-size: 0.65rem;
    color: #6b7280;
}

.cell-value.positive {
    color: #065f46;
}

.cell-value.negative {
    color: #991b1b;
}

.table-cell.net-cell {
    border-left: 1px solid #d1d5db;
    margin-left: 0;
    padding-left: 0;
}

.table-cell.net-cell .cell-label {
    font-weight: 700;
    color: #374151;
}

.table-cell.net-cell .cell-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.sku-activity {
    background: #f9fafb;
    border-radius: 6px;
    padding: 0.5rem;
    margin: 0 -1rem;
    width: calc(100% + 2rem);
}

.activity-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    padding: 0 1rem;
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    font-size: 0.75rem;
    table-layout: fixed;
}

.activity-table thead {
    background: #f3f4f6;
}

.activity-table th {
    padding: 0.4rem 0.35rem;
    text-align: left;
    font-size: 0.65rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.activity-table th:nth-child(1) { width: 28%; }
.activity-table th:nth-child(2) { width: 24%; }
.activity-table th:nth-child(3) { width: 15%; }
.activity-table th:nth-child(4) { width: 23%; }
.activity-table th:nth-child(5) { width: 10%; }

.activity-table td {
    padding: 0.4rem 0.35rem;
    border-top: 1px solid #e5e7eb;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-table tbody tr:hover {
    background: #f9fafb;
}

.btn-delete-small {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.9rem;
}

.btn-delete-small:hover {
    color: #dc2626;
}

.action-menu-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent collapsing */
    margin-left: 0.5rem; /* Add some spacing */
}

.btn-menu {
    background: transparent;
    border: none;
    color: #64748b; /* Slate 500 */
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem; /* Slightly larger */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px; /* Softer corners */
    transition: all 0.2s;
}

.btn-menu:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a; /* Slate 900 */
}

.action-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 140px;
    overflow: hidden;
}

.menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: white;
    border: none;
    color: #1f2937;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
    white-space: nowrap;
}

.menu-item:hover {
    background: #f3f4f6;
}

.menu-item.delete {
    color: #ef4444;
}

.menu-item.delete:hover {
    background: #fee2e2;
}

.menu-item i {
    font-size: 0.9rem;
}

.btn-action-small {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.9rem;
}

.btn-action-small:hover {
    color: #2563eb;
}

.action-buttons-cell {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.btn-action-icon {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-action-icon:hover {
    background: #dbeafe;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
}

/* Legacy action bar styles removed now that actions live in the fixed tray */

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center; /* Center horizontally for desktop */
    z-index: 2147490000;
    animation: fadeIn 0.2s ease-out;
}

.bottom-sheet {
    background: white;
    width: 100%;
    max-width: 600px; /* Match container max-width */
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 20px);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.bottom-sheet-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.bottom-sheet-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    flex: 1;
}

.sheet-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: none;
    background: white;
    border-radius: 12px;
    color: #334155;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.sheet-option:hover {
    background: #f8fafc;
}

.sheet-option.active {
    background: #eff6ff;
    color: #005B94;
    font-weight: 600;
}

.sheet-option i {
    font-size: 1.2rem;
}

.sheet-option .check-icon {
    margin-left: auto;
    color: #005B94;
}

/* Action Sheet Rows with Toggle */
.action-sheet-header {
    display: flex;
    justify-content: space-between;
    padding: 0 1rem 0.5rem 1rem;
    margin-bottom: 0.25rem;
}

.action-sheet-header .header-action,
.action-sheet-header .header-cases {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-sheet-row {
    display: flex;
    align-items: stretch;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.action-sheet-row .sheet-option {
    flex: 1;
    border-radius: 12px 0 0 12px;
}

/* Action-specific colors in sheet */
.sheet-option.action-install { color: #2563eb; }
.sheet-option.action-install.active { background: #eff6ff; color: #2563eb; }

.sheet-option.action-add { color: #059669; }
.sheet-option.action-add.active { background: #ecfdf5; color: #059669; }

.sheet-option.action-return { color: #d97706; }
.sheet-option.action-return.active { background: #fffbeb; color: #d97706; }

.sheet-option.action-scrap { color: #dc2626; }
.sheet-option.action-scrap.active { background: #fef2f2; color: #dc2626; }

.sheet-option.action-transfer { color: #7c3aed; }
.sheet-option.action-transfer.active { background: #f5f3ff; color: #7c3aed; }

.sheet-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    min-width: 70px;
    background: #f8fafc;
    border-left: 1px solid #e5e7eb;
    cursor: pointer;
}

.sheet-toggle input {
    display: none;
}

.sheet-toggle .toggle-slider {
    position: relative;
    width: 40px;
    height: 22px;
    background: #d1d5db;
    border-radius: 11px;
    transition: all 0.2s;
}

.sheet-toggle .toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.sheet-toggle input:checked + .toggle-slider {
    background: #005B94;
}

.sheet-toggle input:checked + .toggle-slider::after {
    left: 20px;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    width: 100%;
    max-height: 80vh;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.modal-title-block {
    flex: 1;
}

.modal-header h4,
.modal-header h5 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-subtitle {
    margin: 0.35rem 0 0 0;
    font-size: 0.9rem;
    color: #1f2937;
    font-weight: 400;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
}

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

/* Log Entry */
.log-entry {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

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

.log-action {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.log-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Toast */
.toast {
    display: block !important; /* Override Bootstrap's default hidden state */
    opacity: 1 !important;
    position: fixed;
    top: auto;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px)); /* Position above bottom menu */
    left: 50%;
    transform: translateX(-50%);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    z-index: 2147483647; /* Max z-index to ensure it's above everything */
    min-width: auto;
    width: max-content;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    pointer-events: auto;
    border: none;
    animation: toastSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastSlideUp {
    from { 
        transform: translate(-50%, 20px); 
        opacity: 0; 
    }
    to { 
        transform: translate(-50%, 0); 
        opacity: 1; 
    }
}

.toast.success {
    background: #059669; /* Deep Emerald */
    color: white;
}

.toast.error {
    background: #DC2626; /* Deep Red */
    color: white;
}

.toast.info {
    background: #374151; /* Dark Grey/Charcoal */
    color: white;
}

.toast.warning {
    background: #EA580C; /* Burnt Orange */
    color: white;
}

/* Header Layout & Components (Moved from DailyInventoryHeader.razor) */
.header-section {
    background: transparent; /* Removed gradient to prevent double-gradient effect */
    padding: 1rem 1rem 0.5rem 1rem;
    flex-shrink: 0;
    overflow: visible;
    position: relative;
    z-index: 100;
}

.header-eyebrow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.eyebrow-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.eyebrow-right {
    position: relative;
    z-index: 10001;
}

.auto-sync-dropdown {
    position: relative;
}

.auto-sync-button {
    background: transparent;
    border: none;
    color: #495965;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.auto-sync-button:hover {
    background: rgba(0,0,0,0.05);
}

.auto-sync-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 260px;
    z-index: 2147490000;
    overflow: hidden;
    animation: dropdownSlide 0.2s ease-out;
}

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

.sync-option {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 500;
}

.sync-option:hover {
    background: #f3f4f6;
}

.sync-option.active {
    background: #e0f2fe;
    color: #005B94;
}

.sync-option i {
    opacity: 0.7;
}

.sync-option.active i {
    opacity: 1;
}

.sync-info {
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
    display: flex;
    align-items: start;
    text-transform: none;
}

.sync-info i {
    margin-top: 2px;
    flex-shrink: 0;
}

.btn-comments {
    background: none;
    border: none;
    color: #495965;
    cursor: pointer;
    padding: 0.2rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-comments:hover {
    color: #005B94;
}

.btn-back-nav {
    color: #495965;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem; /* Larger touch target */
    margin-left: -0.5rem; /* Offset the padding to align visually with the edge */
}

.btn-back-nav:hover {
    color: #005B94;
}

.header-logo-small {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.hero-date-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.date-hero {
    background: transparent;
    border: none;
    text-align: center;
    cursor: pointer;
    padding: 0.25rem 1rem;
    border-radius: 12px;
    transition: background 0.2s;
}

.date-hero:active {
    background: rgba(0,0,0,0.03);
    transform: scale(0.98);
}

.date-main {
    font-size: 1.75rem;
    font-weight: 800;
    color: #495965;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.date-sub {
    font-size: 0.9rem;
    color: #495965;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.status-pill {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    vertical-align: middle;
}

.status-pill.draft { background: #e0f2fe; color: #005B94; }
.status-pill.unsynced { background: #fff7ed; color: #c2410c; }
.status-pill.certified { background: #d1fae5; color: #065f46; }

.nav-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-arrow:hover:not(:disabled) {
    background: rgba(0,0,0,0.05);
    color: #0f172a;
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-arrow {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-arrow:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Offline Banner */
.offline-banner {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Activity Section */
.activity-section {
    margin-bottom: 1.5rem;
}

.section-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 0 1rem 0.5rem 1rem;
    margin-top: 0;
}

/* Notes Card in Activity Tab */
.notes-card {
    background: transparent;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
    border: none;
    overflow: visible;
    transition: all 0.3s ease;
}

.notes-card.expanded {
    box-shadow: none;
    border-color: transparent;
}

.notes-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.25rem 1rem 1rem 1rem; /* Reduced top padding to bring closer to header */
    cursor: pointer;
    background: transparent;
    gap: 0.75rem;
}

.notes-header.locked {
    cursor: default;
    opacity: 0.7;
}

.notes-preview {
    flex: 1;
    font-size: 0.9rem;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toggle-icon {
    color: #94a3b8;
    transition: transform 0.3s ease;
    margin-top: 0.2rem;
}

.notes-card.expanded .toggle-icon {
    transform: rotate(180deg);
}

.notes-body {
    padding: 0 1rem 1rem 1rem;
    background: transparent;
    border-top: none;
}

.notes-input {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.95rem;
    resize: none;
    background: #f8fafc;
}

.notes-input:focus {
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 91, 148, 0.1);
    border-color: #005B94;
}

.notes-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

/* Activity Tab Styles */
.activity-sticky-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background-color: #f1f5f9;
    border-bottom: none;
    box-shadow: none;
}

.activity-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #f1f5f9;
}

.activity-header-row .section-header {
    margin-bottom: 0;
    padding: 0;
    color: #64748b; /* Ensure color matches default section-header */
    border-bottom: none;
}

.activity-section.notes-section {
    margin-bottom: 0;
    padding-bottom: 0;
    padding-top: 1.25rem; /* Increased top padding */
    background-color: #f1f5f9;
}

.section-separator {
    height: 8px;
    background-color: #f1f5f9;
    margin: 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    display: block;
}

.activity-list {
    padding-top: 0;
    margin-top: 0;
}

/* Mini Header */
/* Collapsing Header Logic */
.collapsing-header {
    /* Opacity controlled by JS directly now */
    transition: opacity 0.1s linear;
}

.persistent-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: white;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-left img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.header-right {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-autosync, .header-date-scroll {
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.header-autosync.hidden, .header-date-scroll.hidden {
    display: none;
    opacity: 0;
}

/* Auto Sync Styles */
.auto-sync-dropdown {
    position: relative;
}

.auto-sync-button {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4b5563;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.auto-sync-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 0.5rem;
    width: 240px;
    z-index: 1000;
}

.sync-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem;
    border: none;
    background: none;
    border-radius: 8px;
    text-align: left;
    font-size: 0.9rem;
    color: #374151;
    cursor: pointer;
}

.sync-option.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.sync-info {
    font-size: 0.75rem;
    color: #6b7280;
    padding: 0.75rem;
    border-top: 1px solid #f3f4f6;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Date Scroll Styles */
.header-date-scroll {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    gap: 0.5rem;
}

.status-pill-mini {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pill-mini.draft { background: #e0f2fe; color: #005B94; }
.status-pill-mini.unsynced { background: #fff7ed; color: #c2410c; }
.status-pill-mini.certified { background: #d1fae5; color: #065f46; }

/* Reduced Tab Height - Segmented Control Style */
.tab {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    flex: 1;
    text-align: center;
    border-radius: 8px;
    color: #64748b;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
}

.tab.active {
    background: #495965; /* Slate */
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.sticky-tabs {
    position: sticky;
    top: 0; /* Sticks at top of scroll container */
    z-index: 110;
    background: #f1f5f9; /* Match page background */
    padding: 0.5rem 1rem;
    margin-top: 0;
    margin-bottom: 0;
    display: flex;
    gap: 0.25rem;
}

/* Seam sealer removed as we want the background to show */
.sticky-tabs::before {
    display: none;
}

/* Adjust sticky top bar in totals to sit at top of scroll container */
.sticky-top-bar {
    position: sticky;
    top: 0; /* Sticks immediately */
    z-index: 100;
    background: #f1f5f9; /* Match page background */
    padding: 0.5rem 1rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: none;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08); /* Added shadow for depth */
}

/* Plug the gap above the sticky bar so content doesn't show through */
.sticky-top-bar::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: #f1f5f9;
    z-index: -1;
}

/* Search input uses .search-input class in sticky-top-bar */
.sticky-top-bar .search-input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid #e2e8f0; /* Added border for contrast */
    border-radius: 999px;
    font-size: 0.9rem;
    background: white; /* White background for input to pop against gray header/bar */
    color: #1f2937;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.sticky-top-bar .search-input:focus {
    outline: none;
    background: white;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.control-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: #f1f5f9;
    border-radius: 50%;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.control-btn.active {
    background: #005B94;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 91, 148, 0.2);
}

.control-btn .filter-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
}

/* Adjust sticky header in activity to sit at top of scroll container */
.activity-sticky-header {
    top: 0;
    z-index: 30;
}

.activity-sticky-header::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: #f1f5f9;
    z-index: -1;
}

/* Action Mode Bottom Bar */
.action-mode-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 1rem;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 1rem;
    z-index: 2147480010;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.action-mode-bottom-bar .action-btn {
    flex: 1;
    flex-direction: row;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem;
    height: auto;
}

.action-mode-bottom-bar .cancel-btn {
    background: white;
    color: #6b7280;
    border-color: #d1d5db;
}

.action-mode-bottom-bar .confirm-btn {
    color: white;
    border: none;
}

/* Action Colors for Confirm Button */
.confirm-btn.action-add { background-color: #059669; }
.confirm-btn.action-install { background-color: #2563eb; }
.confirm-btn.action-scrap { background-color: #dc2626; }
.confirm-btn.action-return { background-color: #d97706; }
.confirm-btn.action-transfer { background-color: #7c3aed; }

.confirm-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Action Colors for SKU Icons */
.total-item.action-add .qty-btn.plus { color: #059669; }
.total-item.action-install .qty-btn.plus { color: #2563eb; }
.total-item.action-scrap .qty-btn.plus { color: #dc2626; }
.total-item.action-return .qty-btn.plus { color: #d97706; }
.total-item.action-transfer .qty-btn.plus { color: #7c3aed; }

/* ===== Case Mode Styles ===== */

/* SKU code row layout for case pill */
.sku-code-row,
.sku-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sku-name-row .sku-name {
    margin-right: 0.25rem;
}

/* Case pill button (clickable when in action mode) */
.case-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.case-pill:hover {
    background: #bae6fd;
    border-color: #38bdf8;
}

.case-pill.active {
    background: #0284c7;
    color: white;
    border-color: #0284c7;
}

.case-pill i {
    font-size: 0.65rem;
}

/* Case Entry - Two stacked rows for ×1 and ×N */
.case-entry {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.case-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.case-row-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    min-width: 36px;
    text-align: right;
}

.case-row-label i {
    font-size: 0.7rem;
}

/* Case rows use same button/input styling as quantity-stepper */
.case-row .qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: transform 0.1s;
}

.case-row .qty-btn:active {
    transform: scale(0.9);
}

.case-row .qty-btn.minus {
    color: #9ca3af;
}

.case-row .qty-btn.plus {
    color: #005B94;
}

.case-row .qty-input {
    width: 45px;
    text-align: center;
    border: none;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.case-row .qty-input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
    background: white;
}

/* =============================================
   NEW NAVIGATION STRUCTURE STYLES
   ============================================= */

/* Back Button in Header */
.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    margin-right: 0.25rem;
}

.back-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.back-button i {
    font-size: 1.25rem;
}

/* Detail Subheader - Row 2 with Date + Status + Actions */
.detail-subheader {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    height: 44px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-bottom: 1px solid #e5e7eb;
    z-index: 119;
}

.subheader-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.date-display {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.status-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pill.draft {
    background: #fef3c7;
    color: #92400e;
}

.status-pill.certified {
    background: #dcfce7;
    color: #166534;
}

.status-pill.unsynced {
    background: #fae8ff;
    color: #86198f;
}

.status-pill.unsynced.tappable {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    animation: pulse-unsynced 2s ease-in-out infinite;
}

.status-pill.unsynced.tappable:hover {
    background: #f5d0fe;
    transform: scale(1.02);
}

.status-pill.unsynced.tappable:active {
    transform: scale(0.98);
}

.status-pill.unsynced.tappable:disabled {
    cursor: default;
    animation: none;
}

.status-pill.unsynced.tappable i {
    font-size: 0.7rem;
}

.status-pill.syncing {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.status-pill i.spinning {
    animation: spin 1s linear infinite;
}

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

@keyframes pulse-unsynced {
    0%, 100% { box-shadow: 0 0 0 0 rgba(134, 25, 143, 0.3); }
    50% { box-shadow: 0 0 0 4px rgba(134, 25, 143, 0); }
}

.subheader-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subheader-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

.subheader-action-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
}

.subheader-action-btn:disabled,
.subheader-action-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.subheader-action-btn.active {
    background: #005B94;
    color: white;
}

.subheader-action-btn.certify {
    color: #16a34a;
}

.subheader-action-btn.certify i {
    background: #dcfce7;
    border: 2px solid #16a34a;
    border-radius: 50%;
    padding: 2px;
}

.subheader-action-btn.certify:hover:not(:disabled) i {
    background: #bbf7d0;
}

.subheader-action-btn.certify.disabled,
.subheader-action-btn.certify:disabled {
    color: #9ca3af;
}

.subheader-action-btn.certify.disabled i,
.subheader-action-btn.certify:disabled i {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.subheader-action-btn.sync {
    color: #3b82f6;
}

.subheader-action-btn i {
    font-size: 1.1rem;
}

/* Search Box - Consistent styling across pages */
.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    background: transparent;
    border: none;
    padding: 0;
    gap: 0;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: #9ca3af;
    font-size: 0.9rem;
}

.search-box input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.9rem;
    background: #f1f5f9;
    color: #1f2937;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    background: white;
    border-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.search-box input::placeholder {
    color: #9ca3af;
}

/* Action Footer - Fixed above Bottom Nav */
.action-footer {
    position: fixed;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    height: 56px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 1rem;
    z-index: 100;
}

.primary-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    min-width: 140px;
    color: white;
    border: none;
    border-radius: 25px 0 0 25px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    height: 44px;
    /* Default color - will be overridden by action classes */
    background: #005B94;
}

.action-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: white;
    border: none;
    border-left: 1px solid rgba(255,255,255,0.3);
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    /* Default color - will be overridden by action classes */
    background: #004d7a;
}

/* Color-coded action buttons - Solid colors matching BottomMenu */
.primary-action-btn.action-install,
.action-dropdown-btn.action-install { background: #2563eb; }

.primary-action-btn.action-add,
.action-dropdown-btn.action-add { background: #10b981; }

.primary-action-btn.action-return,
.action-dropdown-btn.action-return { background: #f59e0b; }

.primary-action-btn.action-scrap,
.action-dropdown-btn.action-scrap { background: #dc2626; }

.primary-action-btn.action-transfer,
.action-dropdown-btn.action-transfer { background: #8b5cf6; }

.primary-action-btn:active,
.action-dropdown-btn:active {
    transform: scale(0.98);
    filter: brightness(0.9);
}

.primary-action-btn i {
    font-size: 1rem;
}

.action-dropdown-btn i {
    font-size: 0.85rem;
}

.action-dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 200px;
    overflow: hidden;
    z-index: 110;
}

.dropdown-action {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.875rem 1rem;
    border: none;
    background: white;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    text-align: left;
}

.dropdown-action:hover {
    background: #f9fafb;
}

.dropdown-action.active {
    background: #f0f9ff;
}

/* Color-coded dropdown items - matching BottomMenu colors */
.dropdown-action.action-install { color: #2563eb; }
.dropdown-action.action-install.active { background: rgba(0, 91, 148, 0.15); }

.dropdown-action.action-add { color: #059669; }
.dropdown-action.action-add.active { background: rgba(5, 150, 105, 0.15); }

.dropdown-action.action-return { color: #d97706; }
.dropdown-action.action-return.active { background: rgba(217, 119, 6, 0.15); }

.dropdown-action.action-scrap { color: #dc2626; }
.dropdown-action.action-scrap.active { background: rgba(220, 38, 38, 0.15); }

.dropdown-action.action-transfer { color: #7c3aed; }
.dropdown-action.action-transfer.active { background: rgba(124, 58, 237, 0.15); }

/* Adjust content-scroll padding for new fixed elements */
.content-scroll {
    padding-top: 0; /* No padding - tabs should start at top */
    padding-bottom: calc(136px + env(safe-area-inset-bottom, 0px)); /* action footer (56px) + bottom nav (60px) + small buffer (20px) */
}

/* Hide old collapsing header padding when new structure is active */
.collapsing-header {
    display: none;
}

/* Auto-sync toggle in persistent header - matching CalendarView style */
.persistent-header .auto-sync-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    position: relative;
}

.persistent-header .auto-sync-toggle .toggle-label {
    font-size: 0.7rem;
    color: #6b7280;
    white-space: nowrap;
}

.persistent-header .auto-sync-toggle .toggle-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.persistent-header .auto-sync-toggle .toggle-btn i {
    font-size: 0.5rem;
}

.persistent-header .auto-sync-toggle .toggle-btn.on {
    background: #dcfce7;
    color: #16a34a;
}

.persistent-header .auto-sync-toggle .toggle-btn.off {
    background: #fee2e2;
    color: #dc2626;
}

/* Auto-sync dropdown menu */
.persistent-header .auto-sync-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 200px;
    overflow: hidden;
    z-index: 200;
}

.persistent-header .sync-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: white;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    text-align: left;
}

.persistent-header .sync-option:hover {
    background: #f9fafb;
}

.persistent-header .sync-option.active {
    background: #f0fdf4;
    color: #16a34a;
}

.persistent-header .sync-option.sync-now {
    background: #fef3c7;
    color: #d97706;
    border-top: 1px solid #fde68a;
    position: relative;
}

.persistent-header .sync-option.sync-now:hover {
    background: #fde68a;
}

.persistent-header .unsynced-badge {
    position: absolute;
    right: 1rem;
    background: #f59e0b;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

.persistent-header .sync-info {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    color: #6b7280;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

