/* ============================================================================
   LISTING PAGES STYLES (Pending & ToPick)
   Shared styles for order listing pages with compact headers
   ============================================================================ */

/* ============================================================================
   COMPACT PAGE HEADER
   ============================================================================ */

.page-header-compact {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Header Row 1: Count + Updated + Refresh */
.header-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* Force single line */
    gap: 0.5rem;
}

.order-count-compact {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 0.8rem; /* Smaller to prevent wrapping */
    color: var(--text-secondary);
    flex-shrink: 1; /* Allow to shrink */
    min-width: 0; /* Allow shrinking below content size */
}

.count-number {
    font-size: 1.2rem; /* Smaller to prevent wrapping */
    font-weight: 700;
    color: var(--primary-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.4rem; /* Tighter spacing */
    flex-shrink: 0; /* Don't shrink the right side */
    white-space: nowrap;
}

.last-updated-compact {
    font-size: 0.75rem; /* Smaller to prevent wrapping */
    color: var(--text-secondary);
    white-space: nowrap;
}

.refresh-btn-plain {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    background: transparent;
    color: var(--text-secondary);
    border: none !important;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 32px;
    min-height: 32px;
    flex-shrink: 0; /* Never shrink the button */
}

.refresh-btn-plain:active {
    transform: scale(0.95);
    outline: none;
}

.refresh-btn-plain:focus {
    outline: none;
}

.refresh-btn-plain img {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.refresh-btn-plain:hover img {
    opacity: 1;
}

/* Header Row 2: Sort Chips */
.header-row-2 {
    display: flex;
    gap: 0.4rem; /* Reduced from 0.5rem */
    flex-wrap: wrap;
}

/* Sort chip styles now in components.css */

/* Header Row 3: Search Filters */
.header-row-3 {
    display: flex;
    gap: 0.4rem; /* Reduced from 0.5rem */
    flex-wrap: wrap;
    align-items: center;
}

.search-icon-decorator {
    display: flex;
    align-items: center;
    opacity: 0.4;
    margin-right: 0.15rem;
}

.search-icon-decorator img {
    width: 18px;
    height: 18px;
}

/* Filter chip styles now in components.css */

/* Header Row 4: Active Filter Badges */
.header-row-4 {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-value-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    background: var(--primary-color);
    color: white;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
}

.filter-value-badge-label {
    opacity: 0.9;
}

.filter-value-badge-value {
    font-weight: 700;
}

.filter-value-badge-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    margin-left: 0.2rem;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.filter-value-badge-remove:hover {
    opacity: 1;
}

/* Count Display (for modal) */
.count-display {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color: #1f2937;
    padding: 1.5rem 1rem;
    margin: 0.5rem 0;
    background: #f9fafb;
    border-radius: 12px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================================
   ORDERS CONTAINER
   ============================================================================ */

.orders-container {
    min-height: 200px;
    padding-bottom: 1.25rem; /* Extra clearance for bottom navigation */
}

/* ============================================================================
   ORDER CARDS
   ============================================================================ */

.order-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.order-card:active {
    transform: scale(0.98);
    border-color: var(--primary-color);
}

/* Order Header Section */
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.order-id {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

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

/* Customer Section */
.order-customer {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.customer-id {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Order Statistics */
.order-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.stat-item {
    text-align: center;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Bin Locations Section */
.order-bins {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.bins-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

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

/* Bin badge styles now in components.css */

/* ============================================================================
   ACTION BUTTONS (ToPick page)
   ============================================================================ */

.order-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Action button styles now in components.css */

.action-btn.view-only {
    grid-column: 1 / -1;
}

/* ============================================================================
   STATE MESSAGES
   ============================================================================ */

/* State message styles now in components.css */

.empty-state-icon {
    width: 64px;
    height: 64px;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* ============================================================================
   ICON SIZING
   ============================================================================ */

/* Icon sizing styles now in components.css */

/* ============================================================================
   RESPONSIVE STYLES
   ============================================================================ */

@media (max-width: 480px) {
    /* Header adjustments - FORCE SINGLE LINE */
    .header-row-1 {
        gap: 0.35rem; /* Even tighter */
    }
    
    .order-count-compact {
        font-size: 0.75rem; /* Even smaller on mobile */
    }
    
    .count-number {
        font-size: 1.1rem; /* Even smaller on mobile */
    }
    
    .last-updated-compact {
        font-size: 0.7rem; /* Even smaller on mobile */
    }
    
    /* Order card adjustments */
    .order-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .stat-item:last-child {
        grid-column: 1 / -1;
    }
    
    /* Action buttons stack on very small screens */
    .order-actions {
        grid-template-columns: 1fr;
    }
}

/* Tablet and up */
@media (min-width: 768px) {
    .page-header-compact {
        padding: 1.25rem;
    }
    
    .order-card {
        padding: 1.25rem;
    }
}