/* ==========================================
   1. GLOBAL BASE STYLES
   ========================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 16px;
    background-color: #f4f6f8;
    color: #333333;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container Elevation (Option 1) */
.container {
    max-width: 1080px;
    margin: 0 auto;
    background: #ffffff;
    padding: 24px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.05),
        0 10px 30px -5px rgba(0, 0, 0, 0.08);
}

/* Header & Navigation Bar */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #eef1f4;
    padding-bottom: 12px;
}

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

h1, h2, h3, h4 {
    margin-top: 0;
    color: #1a252f;
}

/* Navigation Tabs (Option 1) */
.nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid #dcdfe6;
    padding-bottom: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs button {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: #555555;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.nav-tabs button.active {
    background: #0066cc;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 102, 204, 0.3);
    transform: translateY(-1px);
}

/* Form Controls & Recessed Inputs (Option 1) */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #444444;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="file"],
select {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
    background-color: #f8fafc;
    color: #333333;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* WebKit Engine Fixes for Date Inputs */
input[type="date"]::-webkit-date-and-time-value {
    margin: 0;
    padding: 0;
    min-height: auto;
    text-align: left;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    margin-right: 0;
    padding: 0;
}

input[type="date"] {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    appearance: none;
    -webkit-appearance: none;
}

input:focus, select:focus {
    outline: none;
    background-color: #ffffff;
    border-color: #0066cc;
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.03),
        0 0 0 3px rgba(0, 102, 204, 0.2);
}

.flex-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.flex-row > div,
.flex-row .form-group,
.flex-col-item {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
}

.flex-grow-2 {
    flex: 2 1 0% !important;
}

/* Raised Panels & Fieldsets (Option 1) */
.filter-form,
.add-item-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 4px 12px rgba(0, 0, 0, 0.03);
}

.add-item-panel {
    margin: 20px 0;
}

.add-item-panel .panel-heading {
    margin-bottom: 12px;
    font-weight: bold;
    display: block;
}

.add-item-row {
    align-items: flex-end;
}

.add-item-row .search-group {
    flex: 2 1 0%;
    margin-bottom: 0;
}

.add-item-row .qty-group {
    flex: 1 1 0%;
    margin-bottom: 0;
}

/* Buttons */
button {
    background-color: #0066cc;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

button:hover {
    background-color: #0052a3;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #bd2130;
}

.form-actions,
.order-actions,
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Table Row Actions */
.table-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 10px !important;
    font-size: 12px !important;
    min-height: auto !important;
}

/* ==========================================
   OPTION 1: TACTILE AUTOCOMPLETE DROPDOWNS
   ========================================== */

/* 1. Parent Wrapper Depth Anchor */
.autocomplete-wrapper {
    position: relative;
}

/* 2. Floating Tactile Results Panel */
.autocomplete-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.08),
        0 12px 24px -4px rgba(0, 0, 0, 0.12);
    padding: 4px 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* 3. Individual Search Result Items */
.autocomplete-item {
    padding: 10px 14px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

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

/* Hover & Active Keyboard Selection (<Up> / <Down> Arrows) */
.autocomplete-item:hover,
.autocomplete-item.autocomplete-active {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
    font-weight: 600;
    padding-left: 18px;
}

/* 4. Highlighted Matching Text (<mark> or match spans) - Seamless Inline Flow */
.autocomplete-item mark,
.autocomplete-item .highlight-match {
    background-color: #fef08a;
    color: #854d0e;
    padding: 0 1px;
    margin: 0;
    border-radius: 2px;
    font-weight: 700;
    line-height: inherit;
    display: inline;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    box-shadow: none;
}

/* Highlighted match state during row hover */
.autocomplete-item:hover mark,
.autocomplete-item.autocomplete-active mark {
    background-color: #fde047;
    color: #713f12;
}

/* Table Containers & Sticky Header Depth (Option 1) */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.no-scroll-container {
    overflow-x: hidden !important;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    min-width: 600px;
}

.table-fixed {
    table-layout: fixed !important;
    min-width: 100% !important;
    width: 100% !important;
}

.scrollable-cell {
    max-width: 0;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table Cells, Vertical Lines, & Sticky Headers */
th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eef1f4;
    border-right: 1px solid #eef1f4;
    white-space: nowrap;
}

th:last-child, td:last-child {
    border-right: none;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ==========================================
   4. PAGINATION CONTROLS
   ========================================== */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef1f4;
    flex-wrap: nowrap;
    gap: 16px;
    white-space: nowrap;
}

.pagination-info {
    font-size: 14px;
    color: #555555;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination-controls select {
    width: auto;
    padding: 6px 10px;
    font-size: 14px;
    display: inline-block;
}

.pagination-pages {
    display: flex;
    gap: 4px;
}

.pagination-pages button {
    padding: 6px 12px;
    font-size: 13px;
    background-color: #ffffff;
    color: #0066cc;
    border: 1px solid #dcdfe6;
}

.pagination-pages button:hover {
    background-color: #f0f4f8;
}

.pagination-pages button.active {
    background-color: #0066cc;
    color: #ffffff;
    border-color: #0066cc;
}

.pagination-pages button:disabled {
    background-color: #f8f9fa;
    color: #cccccc;
    border-color: #eef1f4;
    cursor: not-allowed;
}

/* Photo Gallery Cards & Accordion Structure */
#photosGalleryContainer {
    display: block !important;
    width: 100%;
}

.gallery-accordion {
    width: 100%;
}

.accordion-sales-group, 
.accordion-store-group {
    margin-bottom: 12px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.accordion-sales-group[open] {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.accordion-sales-header {
    padding: 12px 16px;
    background-color: #eef1f4;
    font-size: 15px;
    font-weight: 600;
    color: #1a252f;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background-color 0.2s ease;
}

.accordion-sales-header:hover {
    background-color: #e2e7ec;
}

.accordion-sales-body {
    padding: 12px;
    background-color: #ffffff;
}

.accordion-store-group {
    border-color: #eef1f4;
}

.accordion-store-header {
    padding: 10px 14px;
    background-color: #f8f9fa;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background-color 0.2s ease;
}

.accordion-store-header:hover {
    background-color: #f0f4f8;
}

.photo-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 12px;
    background-color: #ffffff;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 15px;
}

.photo-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.photo-card:hover {
    border-color: #0066cc;
}

.photo-card.selected {
    border: 2px solid #0066cc;
    background-color: #f0f7ff;
}

.photo-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.photo-card-info {
    padding: 12px;
    font-size: 13px;
    line-height: 1.4;
}

.badge {
    background: #0066cc;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

.badge-sub {
    background: #6c757d;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Modal Windows & Scrolling Structure */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 16px;
    align-items: center;
    justify-content: center;
}

.modal.show,
.modal[style*="display: block"],
.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 24px;
    border-radius: 10px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-header {
    flex-shrink: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef1f4;
    margin-bottom: 12px;
}

.modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    margin-bottom: 12px;
    padding-top: 0;
}

.modal-body .table-container,
.modal-body .no-scroll-container {
    overflow: visible !important;
    border: none;
    margin-bottom: 0;
}

.modal-body table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #ffffff;
    box-shadow: 0 1px 0 #eef1f4;
}

#orderDetailsModal table {
    table-layout: fixed !important;
    width: 100% !important;
}

#orderDetailsModal td:first-child {
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 0;
}

#orderDetailsModal th:nth-child(2),
#orderDetailsModal td:nth-child(2) {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    text-align: center;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #000;
}

.modal-details {
    line-height: 1.6;
}

.modal-actions {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #eef1f4;
}

/* Alerts & Utilities */
.alert {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 6px;
    display: none;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.text-center { text-align: center; }
.text-muted { color: #888888; }
.margin-bottom-sm { margin-bottom: 15px; }
.margin-bottom-md { margin-bottom: 20px; }
.border-none { border: none !important; }

.mobile-only {
    display: none !important;
}

/* ==========================================
   2. DARK MODE STYLES (Cleaned Specificity)
   ========================================== */
body.dark-mode {
    background-color: #121212;
}

body.dark-mode,
body.dark-mode label,
body.dark-mode td,
body.dark-mode th,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode span,
body.dark-mode p,
body.dark-mode div,
body.dark-mode .panel-heading {
    color: #ffffff;
}

body.dark-mode .text-muted {
    color: #cccccc !important;
}

/* Option 1 Surface Tints in Dark Mode */
body.dark-mode .container {
    background-color: #1a1d21 !important;
    border-color: #2d3239 !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
}

body.dark-mode input[type="text"],
body.dark-mode input[type="password"],
body.dark-mode input[type="email"],
body.dark-mode input[type="date"],
body.dark-mode input[type="number"],
body.dark-mode select {
    background-color: #121417 !important;
    border-color: #2d3239 !important;
    color: #ffffff !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode input:focus, 
body.dark-mode select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.3),
        0 0 0 3px rgba(59, 130, 246, 0.3) !important;
}

body.dark-mode .add-item-panel,
body.dark-mode .filter-form {
    background-color: #22262c !important;
    border-color: #2d3239 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .modal-content,
body.dark-mode table,
body.dark-mode .photo-card,
body.dark-mode .accordion-sales-group,
body.dark-mode .accordion-store-group {
    background-color: #1e1e1e;
    border-color: #2d3239;
}

body.dark-mode .modal-header,
body.dark-mode .modal-actions {
    border-color: #333333;
}

body.dark-mode .modal-body table th {
    background-color: #2a2a2a;
    box-shadow: 0 1px 0 #333333;
}

body.dark-mode .accordion-sales-header {
    background-color: #2a2a2a;
    color: #ffffff !important;
}

body.dark-mode .accordion-sales-header:hover {
    background-color: #333333;
}

body.dark-mode .accordion-sales-body,
body.dark-mode .photo-grid-container {
    background-color: #1e1e1e;
}

body.dark-mode .accordion-store-header {
    background-color: #252525;
    color: #ffffff !important;
}

body.dark-mode .accordion-store-header:hover {
    background-color: #2e2e2e;
}

body.dark-mode .photo-card.selected {
    border-color: #0066cc;
    background-color: #1a2a3a;
}

body.dark-mode .header-bar {
    border-bottom-color: #333333;
}

body.dark-mode th {
    background-color: #2a2a2a;
}

body.dark-mode th,
body.dark-mode td {
    border-bottom-color: #333333;
    border-right-color: #333333;
}

body.dark-mode th:last-child,
body.dark-mode td:last-child {
    border-right: none;
}

body.dark-mode .nav-tabs button {
    background: #2a2a2a;
    color: #e0e0e0 !important;
    border-color: #333333;
}

body.dark-mode .nav-tabs button.active {
    background: #0066cc;
    color: #ffffff !important;
}

/* Dark Mode Autocomplete Overrides */
body.dark-mode .autocomplete-results {
    background: #1e2227 !important;
    border-color: #333a45 !important;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.5),
        0 16px 32px rgba(0, 0, 0, 0.6) !important;
}

body.dark-mode .autocomplete-item {
    color: #e2e8f0 !important;
    border-bottom-color: #2a3038 !important;
}

body.dark-mode .autocomplete-item:hover,
body.dark-mode .autocomplete-item.autocomplete-active {
    background-color: #0c4a6e !important;
    color: #38bdf8 !important;
}

body.dark-mode .autocomplete-item mark,
body.dark-mode .autocomplete-item .highlight-match {
    background-color: #854d0e !important;
    color: #fef08a !important;
}

body.dark-mode .close-modal {
    color: #ccc;
}

body.dark-mode .close-modal:hover {
    color: #fff;
}

/* Dark Mode Pagination */
body.dark-mode .pagination-container {
    border-bottom-color: #333333;
}

body.dark-mode .pagination-info {
    color: #cccccc !important;
}

body.dark-mode .pagination-pages button {
    background-color: #2a2a2a;
    color: #ffffff !important;
    border-color: #444444;
}

body.dark-mode .pagination-pages button:hover {
    background-color: #3a3a3a;
}

body.dark-mode .pagination-pages button.active {
    background-color: #0066cc;
    border-color: #0066cc;
}

body.dark-mode .pagination-pages button:disabled {
    background-color: #1a1a1a;
    color: #666666 !important;
    border-color: #333333;
}

/* ==========================================
   3. RESPONSIVE MOBILE MEDIA QUERIES & EXTENSION
   ========================================== */
@media screen and (max-width: 768px) {
    body {
        padding: 8px;
    }

    .container {
        padding: 16px;
        border-radius: 8px;
    }

    .header-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions button {
        flex: 1;
    }

    .flex-row {
        flex-direction: column;
        gap: 10px;
    }

    .add-item-row {
        align-items: stretch;
    }

    .add-btn-wrapper {
        width: 100%;
        margin-top: 10px;
    }

    .add-btn-wrapper button {
        width: 100%;
    }

    /* Mobile Order Filter Form Compression */
    #orderFilterForm {
        display: none;
        padding: 10px 12px;
        margin-bottom: 12px;
    }

    #orderFilterForm .flex-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    #orderFilterForm .form-group {
        margin-bottom: 0;
    }

    #orderFilterForm label {
        font-size: 0.75rem;
        margin-bottom: 2px;
    }

    #orderFilterForm input,
    #orderFilterForm select {
        padding: 4px 8px;
        font-size: 0.85rem;
        min-height: 34px !important;
    }

    #orderFilterForm .form-actions {
        margin-top: 8px;
        padding-top: 4px;
        gap: 6px;
    }

    #orderFilterForm .form-actions button {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .photo-grid,
    .photo-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
        padding: 8px;
    }

    .accordion-sales-header {
        padding: 10px 12px;
        font-size: 14px;
    }

    .accordion-store-header {
        padding: 8px 10px;
        font-size: 13px;
    }

    .accordion-sales-body {
        padding: 8px 4px;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="date"],
    input[type="number"],
    input[type="file"],
    select,
    button {
        min-height: 44px;
        font-size: 16px;
    }

    /* Soften Inset Shadows on Mobile Inputs */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="date"],
    input[type="number"],
    select {
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08) !important;
        border-radius: 8px !important;
    }

    /* Touch Active Tap Elevation */
    button:active,
    .nav-tabs button:active,
    .photo-card:active {
        transform: scale(0.97) translateY(1px) !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
        transition: transform 0.05s ease, box-shadow 0.05s ease !important;
    }

    .form-actions,
    .order-actions,
    .modal-actions {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .form-actions button,
    .order-actions button,
    .modal-actions button {
        width: 100%;
        margin: 0;
    }

    .filter-form .form-actions {
        flex-direction: row !important;
        gap: 8px;
    }

    .filter-form .form-actions button {
        flex: 1;
        width: auto !important;
        padding: 8px 10px;
        font-size: 13px;
    }

    /* Force Table Action Buttons Horizontal on Mobile */
    td .table-actions,
    td > div {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        white-space: nowrap !important;
    }

    td button,
    .table-actions button {
        width: auto !important;
        flex: initial !important;
        margin: 0 !important;
        min-height: auto !important;
        font-size: 12px !important;
        padding: 4px 8px !important;
        display: inline-block !important;
    }

    /* Bottom-Drawer Style Modals for Mobile */
    .modal-content {
        width: 100%;
        margin: auto;
        padding: 16px;
        max-height: 90vh;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2) !important;
        border: none !important;
    }

    .mobile-only {
        display: inline-block !important;
    }

    .toggle-filter-btn {
        min-height: auto !important;
    }
    
    /* Mobile adjustments for pagination */
    .pagination-container {
        flex-wrap: wrap !important;
        justify-content: center !important;
        text-align: center;
        gap: 10px !important;
        white-space: normal !important;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        font-size: 13px;
        margin-bottom: 2px;
    }

    .pagination-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .pagination-pages {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        max-width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    
    /* Dynamic Soft Fade-Out Indicator & Mobile Table Depth */
    .table-container {
        position: relative;
        border-radius: 8px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    }

    .table-container.has-scroll-right {
        -webkit-mask-image: linear-gradient(to right, #000 85%, transparent 100%);
        mask-image: linear-gradient(to right, #000 85%, transparent 100%);
        transition: mask-image 0.2s ease, -webkit-mask-image 0.2s ease;
    }

    /* Raised Mobile Accordion Cards */
    .accordion-sales-group,
    .accordion-store-group {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
        border: 1px solid #e2e8f0 !important;
    }

    .accordion-sales-header {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    }

    /* Sticky Store # Column with Grid Border Alignment */
    #sectionViewOrders .table-container {
        overflow-x: auto;
        position: relative;
    }

    #sectionViewOrders td:nth-child(2) {
        position: sticky;
        left: 0;
        z-index: 5;
        width: 90px !important;
        min-width: 90px !important;
        max-width: 90px !important;
        background-color: #ffffff;
        box-shadow: none !important;
        border-bottom: 1px solid #eef1f4 !important;
        border-right: 1px solid #eef1f4 !important;
        background-clip: padding-box !important;
    }

    #sectionViewOrders th:nth-child(2) {
        position: sticky;
        left: 0;
        z-index: 6;
        width: 90px !important;
        min-width: 90px !important;
        max-width: 90px !important;
        background-color: #f8f9fa;
        box-shadow: none !important;
        border-bottom: 1px solid #eef1f4 !important;
        border-right: 1px solid #eef1f4 !important;
        background-clip: padding-box !important;
    }

    /* Dark Mode Sticky Column Overrides */
    body.dark-mode #sectionViewOrders td:nth-child(2) {
        background-color: #1e1e1e !important;
        box-shadow: none !important;
        border-bottom: 1px solid #333333 !important;
        border-right: 1px solid #333333 !important;
    }

    body.dark-mode #sectionViewOrders th:nth-child(2) {
        background-color: #2a2a2a !important;
        box-shadow: none !important;
        border-bottom: 1px solid #333333 !important;
        border-right: 1px solid #333333 !important;
    }

    body.dark-mode .modal-content {
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.8) !important;
        border-top: 1px solid #2d3239 !important;
    }
}

/* Header Brand & Logo Alignment */
.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand h2 {
    margin: 0;
}

.header-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    vertical-align: middle;
}

/* Optional: Slight padding around JPG logo in dark mode for clean contrast */
[data-theme="dark"] .header-logo {
    background-color: #ffffff;
    padding: 2px 4px;
}

/* Staged Order Panel Enhancements */
.staged-order-panel {
    margin-top: 15px;
}

.staged-order-panel .table-container {
    margin-top: 8px;
    background: transparent;
    box-shadow: none;
}

.staged-order-panel table {
    margin-bottom: 0;
}