/* ==========================================================================
   Super Kaichon — Seller Orders Management (orders.css)
   Clean, Modern Minimal, Production-Ready Layout
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & Base Surfaces
   -------------------------------------------------------------------------- */
:root {
    --order-green-primary: #17653D;
    --order-green-hover: #14532d;
    --order-green-active: #0e3d21;
    --order-green-subtle: #f0fdf4;
    --order-green-border: #bbf7d0;

    --order-text-dark: #0f172a;
    --order-text-normal: #1e293b;
    --order-text-muted: #64748b;
    --order-text-light: #94a3b8;

    --order-border-light: #e2e8f0;
    --order-border-subtle: #f1f5f9;
    --order-surface-card: #ffffff;
    --order-surface-page: #f7f8f9;

    --order-font: "Prompt", "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body.orders-page-body {
    background-color: var(--order-surface-page);
    color: var(--order-text-normal);
    font-family: var(--order-font);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* Fix main content position relative to fixed 270px sidebar */
.dashboard-main.orders-page {
    min-height: 100vh;
    margin-left: var(--sidebar-width, 270px) !important;
    margin-right: 0 !important;
    padding: 24px 32px 60px;
    box-sizing: border-box;
    transition: margin-left 0.3s ease;
    max-width: none;
}

@media (max-width: 900px) {
    .dashboard-main.orders-page {
        margin-left: 0 !important;
        padding: 16px 16px 40px;
    }
}

.orders-skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: #0f172a;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    z-index: 1000;
    text-decoration: none;
    font-weight: 600;
}
.orders-skip-link:focus {
    top: 16px;
}

/* Visually hidden screen reader status (takes 0px height) */
.orders-live-status {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* --------------------------------------------------------------------------
   2. Page Header
   -------------------------------------------------------------------------- */
.orders-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    background: transparent;
    padding: 0;
}

.topbar-quick-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.orders-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.orders-title-group h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--order-text-dark);
    letter-spacing: -0.02em;
}

.orders-title-group p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--order-text-muted);
}

.orders-mobile-menu {
    display: none;
    background: #fff;
    border: 1px solid var(--order-border-light);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 20px;
    color: var(--order-text-normal);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .orders-mobile-menu {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    .dashboard-topbar.orders-topbar {
        position: static !important;
        top: auto !important;
        background: transparent !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-rows: 44px auto !important;
        align-items: center !important;
        gap: 12px 8px !important;
        width: 100% !important;
        margin-bottom: 16px !important;
        padding: 0 !important;
    }

    .orders-title-group {
        display: contents !important;
    }

    .orders-mobile-menu {
        grid-column: 1 !important;
        grid-row: 1 !important;
        justify-self: start !important;
        display: inline-grid !important;
        place-items: center !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 12px !important;
        background: #ffffff !important;
        color: #111827 !important;
        border: 1px solid #e3e9e5 !important;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05) !important;
        font-size: 20px !important;
        cursor: pointer !important;
    }

    .orders-title-group > div {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        margin-top: 2px !important;
        min-width: 0 !important;
    }

    .orders-title-group h1 {
        font-size: clamp(20px, 5.8vw, 24px) !important;
        font-weight: 700 !important;
        line-height: 1.25 !important;
        margin: 0 !important;
        color: #111827 !important;
    }

    .orders-title-group p {
        font-size: 13px !important;
        margin: 3px 0 0 0 !important;
        color: #6b7280 !important;
    }

    .orders-topbar .topbar-actions {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: end !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        width: auto !important;
        min-width: 0 !important;
    }

    .orders-topbar .topbar-quick-actions {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 6px !important;
        width: auto !important;
    }

    .orders-topbar .topbar-quick-actions .icon-btn,
    .orders-topbar .topbar-quick-actions .user-profile {
        flex: 0 0 38px !important;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .orders-topbar .topbar-quick-actions .icon-btn {
        font-size: 15px !important;
    }

    .orders-topbar .topbar-quick-actions .user-profile {
        display: grid !important;
        place-items: center !important;
        border-radius: 50% !important;
    }

    .orders-topbar .topbar-quick-actions .user-avatar {
        flex: none !important;
        width: 38px !important;
        height: 38px !important;
    }

    .orders-topbar .topbar-quick-actions .user-info {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
   3. One Summary Surface (KPI Summary Strip — 1 Horizontal Row)
   -------------------------------------------------------------------------- */
.orders-summary-surface {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    background: transparent;
    border: none;
    box-shadow: none;
    margin-bottom: 24px;
    overflow: visible;
}

.orders-summary-surface .summary-divider {
    display: none;
}

.orders-summary-cell {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    min-height: 100px;
    font-family: inherit;
}

.orders-summary-cell:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.orders-summary-cell.is-active {
    background: #17653D !important;
    border-color: #17653D !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(23, 101, 61, 0.24) !important;
}

.orders-summary-cell.is-active .summary-label,
.orders-summary-cell.is-active .summary-count,
.orders-summary-cell.is-active .summary-sub {
    color: #ffffff !important;
}

.orders-summary-cell .summary-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    order: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.orders-summary-cell .summary-count {
    font-size: 26px;
    font-weight: 750;
    color: #0f172a;
    line-height: 1.1;
    order: 1;
    margin: 0;
    font-family: "Prompt", sans-serif;
    letter-spacing: -0.02em;
}

.orders-summary-cell .summary-sub {
    font-size: 11px;
    color: #94a3b8;
    order: 3;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .orders-summary-surface {
        display: flex !important;
        flex-flow: row nowrap !important;
        align-items: stretch !important;
        justify-content: center !important;
        gap: 6px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 16px !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .orders-summary-surface .summary-divider {
        display: none !important;
    }

    .orders-summary-cell {
        position: relative !important;
        display: flex !important;
        flex: 1 1 0 !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        width: auto !important;
        min-width: 0 !important;
        min-height: 84px !important;
        padding: 8px 3px !important;
        border: 1px solid #e3e9e5 !important;
        border-radius: 12px !important;
        background: #ffffff !important;
        color: #171b18 !important;
        box-shadow: 0 4px 12px rgba(22, 35, 27, 0.05) !important;
        text-align: center !important;
        overflow: hidden !important;
    }

    .orders-summary-cell:hover {
        transform: none !important;
    }

    .orders-summary-cell.is-active {
        border-color: #17653D !important;
        background: #17653D !important;
        color: #ffffff !important;
        box-shadow: 0 5px 14px rgba(23, 101, 61, 0.2) !important;
    }

    .orders-summary-cell .summary-label {
        font-size: 10px !important;
        font-weight: 600 !important;
        line-height: 1.15 !important;
        white-space: normal !important;
        word-break: break-word !important;
        text-align: center !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        max-height: 2.4em !important;
        overflow: hidden !important;
        max-width: 100% !important;
        color: #64748b !important;
        order: 2 !important;
        margin-top: 2px !important;
    }

    .orders-summary-cell.is-active .summary-label {
        color: rgba(255, 255, 255, 0.9) !important;
    }

    .orders-summary-cell .summary-count {
        font-size: 19px !important;
        font-weight: 750 !important;
        line-height: 1.05 !important;
        color: #171b18 !important;
        order: 1 !important;
        margin: 0 !important;
    }

    .orders-summary-cell.is-active .summary-count {
        color: #ffffff !important;
    }

    .orders-summary-cell .summary-sub {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
   4. Section Header (Immediately following KPI)
   -------------------------------------------------------------------------- */
.orders-list-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 12px;
}

.orders-list-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--order-text-dark);
    letter-spacing: -0.01em;
}

.orders-list-header p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--order-text-muted);
}

/* --------------------------------------------------------------------------
   5. Master Filter Toolbar (Single Row Desktop)
   -------------------------------------------------------------------------- */
.orders-toolbar {
    margin-bottom: 16px;
    position: relative;
    z-index: 10;
}

/* Ensure filter toolbar is compact flex row */
.dashboard-filter-toolbar {
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Transparent flex wrappers on desktop (>= 769px) */
.dashboard-filter-top-bar,
.dashboard-filter-collapsible,
.dashboard-filter-collapsible-inner {
    display: contents;
}

.orders-mobile-filter-toggle {
    display: none !important;
}

/* Override custom-dropdown.css [data-custom-dropdown] width: 100% */
.dashboard-filter-capsule,
[data-custom-dropdown].dashboard-filter-capsule,
.custom-dropdown.dashboard-filter-capsule {
    position: relative !important;
    z-index: 1;
    flex: 0 0 auto !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.dashboard-filter-capsule.is-open,
[data-custom-dropdown].dashboard-filter-capsule.is-open,
.custom-dropdown.dashboard-filter-capsule.is-open {
    z-index: 100 !important;
}

/* Capsules Buttons */
.dashboard-filter-capsule > .custom-dropdown-toggle,
.custom-dropdown.dashboard-filter-capsule > .custom-dropdown-toggle,
.orders-date-filter > summary.custom-dropdown-toggle {
    width: auto !important;
    min-width: 0 !important;
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 999px !important;
    background: #f5f5f5 !important;
    color: #242424 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(17, 17, 17, 0.04) !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    list-style: none !important;
    transition: background-color 0.15s ease, border-color 0.15s ease !important;
}

.orders-date-filter > summary::-webkit-details-marker {
    display: none !important;
}

.dashboard-filter-capsule > .custom-dropdown-toggle:hover,
.dashboard-filter-capsule.is-open > .custom-dropdown-toggle,
.orders-date-filter > summary.custom-dropdown-toggle:hover,
.orders-date-filter[open] > summary.custom-dropdown-toggle {
    background: #ebebeb !important;
    border-color: #d8d8d8 !important;
    color: #111111 !important;
}

.custom-dropdown-chevron {
    font-size: 11px !important;
    color: #6b7280 !important;
    transition: transform 0.2s ease !important;
}

.dashboard-filter-capsule.is-open .custom-dropdown-chevron,
.orders-date-filter[open] .custom-dropdown-chevron {
    transform: rotate(180deg) !important;
}

/* Filter Dropdown Thai Text (Item 5: 1 Line, min-width: max-content, safe max-width) */
.orders-toolbar .custom-dropdown-menu,
.dashboard-filter-capsule .custom-dropdown-menu {
    min-width: max-content !important;
    width: auto !important;
    max-width: calc(100vw - 32px) !important;
    white-space: nowrap !important;
    left: 0 !important;
    right: auto !important;
    box-sizing: border-box !important;
}

.orders-toolbar .custom-dropdown-option,
.dashboard-filter-capsule .custom-dropdown-option {
    white-space: nowrap !important;
    padding: 8px 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
}

.orders-toolbar .orders-sort-control .custom-dropdown-menu {
    left: auto !important;
    right: 0 !important;
}

/* Reset Filter Button */
.reset-filter-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 14px !important;
    background: #ffffff !important;
    border: 1px solid #e3e9e5 !important;
    border-radius: 10px !important;
    color: #475569 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
    white-space: nowrap !important;
    transition: all 0.15s ease !important;
}

.reset-filter-btn:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: var(--order-text-dark) !important;
}

/* Date Popover */
.orders-date-filter {
    position: relative !important;
}

.orders-date-popover {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    left: 0 !important;
    width: 320px !important;
    background: #ffffff !important;
    border: 1px solid var(--order-border-light) !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14) !important;
    padding: 16px !important;
    z-index: 100 !important;
}

.orders-date-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--order-border-subtle);
}

.orders-date-popover-header strong {
    font-size: 14px;
    color: var(--order-text-dark);
}

.orders-date-close-btn {
    border: none;
    background: transparent;
    color: var(--order-text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
}

.orders-date-close-btn:hover {
    color: var(--order-text-dark);
    background: #f1f5f9;
}

.orders-date-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.orders-date-presets button {
    border: 1px solid var(--order-border-light);
    background: #ffffff;
    color: var(--order-text-normal);
    padding: 7px 10px;
    font-size: 12px;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.orders-date-presets button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.orders-date-presets button.is-active {
    background: var(--order-green-subtle);
    border-color: var(--order-green-border);
    color: var(--order-green-primary);
    font-weight: 600;
}

.orders-date-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.orders-date-fields label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--order-text-muted);
}

.orders-date-fields input {
    height: 38px;
    border: 1px solid var(--order-border-light);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.orders-date-fields input:focus {
    border-color: var(--order-green-primary);
}

.orders-date-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.orders-date-actions button {
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
}

.orders-date-actions button.is-secondary {
    border: 1px solid var(--order-border-light);
    background: #ffffff;
    color: var(--order-text-normal);
}

.orders-date-actions button.is-primary {
    border: none;
    background: var(--order-green-primary);
    color: #ffffff;
}

/* Responsive filter wrap (<= 768px) */
@media (max-width: 768px) {
    .dashboard-filter-toolbar {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        position: relative !important;
    }

    .dashboard-filter-top-bar {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .dashboard-filter-search-slot,
    .dashboard-filter-search-slot:hover,
    .dashboard-filter-search-slot:focus-within,
    .dashboard-filter-search-slot.is-open {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 44px !important;
        box-sizing: border-box !important;
    }

    .dashboard-filter-search,
    .dashboard-filter-search-slot:hover .dashboard-filter-search,
    .dashboard-filter-search-slot:focus-within .dashboard-filter-search {
        position: relative !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 44px !important;
        min-height: 44px !important;
        background: #ffffff !important;
        border: 1.5px solid #e2e8f0 !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    }

    .dashboard-filter-search:focus-within {
        border-color: #166534 !important;
        box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.12) !important;
    }

    .dashboard-filter-search-button,
    #search-btn.dashboard-filter-search-button {
        color: #166534 !important;
        flex: 0 0 42px !important;
        width: 42px !important;
        height: 42px !important;
    }

    .dashboard-filter-search-button i {
        color: #166534 !important;
        font-size: 16px !important;
    }

    .dashboard-filter-search input[type="search"],
    #orders-search-input {
        width: 100% !important;
        height: 42px !important;
        color: #0f172a !important;
        -webkit-text-fill-color: #0f172a !important;
        font-size: 13.5px !important;
        font-weight: 500 !important;
        padding: 0 14px 0 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        box-sizing: border-box !important;
    }

    .dashboard-filter-search input[type="search"]::placeholder,
    #orders-search-input::placeholder {
        color: #94a3b8 !important;
        -webkit-text-fill-color: #94a3b8 !important;
        opacity: 1 !important;
        font-size: 13px !important;
    }

    /* Mobile Filter Toggle Button */
    .orders-mobile-filter-toggle {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 14px !important;
        background: #ffffff !important;
        border: 1.5px solid #e2e8f0 !important;
        border-radius: 12px !important;
        font-family: inherit !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        color: #334155 !important;
        cursor: pointer !important;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .orders-mobile-filter-toggle:hover {
        background: #f8fafc !important;
        border-color: #cbd5e1 !important;
    }

    .orders-mobile-filter-toggle:active {
        transform: scale(0.97) !important;
    }

    .orders-mobile-filter-toggle i.bi-sliders2 {
        font-size: 15px !important;
        color: #166534 !important;
    }

    .orders-mobile-filter-chevron {
        font-size: 11px !important;
        color: #64748b !important;
        transition: transform 0.25s ease !important;
    }

    .orders-mobile-filter-toggle[aria-expanded="true"] .orders-mobile-filter-chevron {
        transform: rotate(180deg) !important;
    }

    .orders-mobile-filter-toggle[aria-expanded="true"],
    .orders-mobile-filter-toggle.is-active-filter {
        background: #f0fdf4 !important;
        border-color: #86efac !important;
        color: #166534 !important;
    }

    .orders-mobile-filter-badge {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #166534 !important;
        color: #ffffff !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        border-radius: 999px !important;
        min-width: 18px !important;
        height: 18px !important;
        padding: 0 5px !important;
        line-height: 1 !important;
    }

    /* Collapsible Filter Panel on Mobile */
    .dashboard-filter-collapsible {
        display: none !important;
        width: 100% !important;
    }

    .dashboard-filter-collapsible.is-open {
        display: block !important;
        animation: ordersFilterSlideDown 0.22s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    }

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

    .dashboard-filter-collapsible-inner {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
        padding: 10px !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 14px !important;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03) !important;
        box-sizing: border-box !important;
    }

    .dashboard-filter-capsule,
    [data-custom-dropdown].dashboard-filter-capsule,
    .custom-dropdown.dashboard-filter-capsule,
    .orders-date-filter {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex: none !important;
        box-sizing: border-box !important;
        position: relative !important;
        margin: 0 !important;
    }

    .dashboard-filter-capsule > .custom-dropdown-toggle,
    .orders-date-filter > summary.custom-dropdown-toggle {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: 44px !important;
        height: 44px !important;
        padding: 0 12px !important;
        font-size: 12.5px !important;
        font-weight: 600 !important;
        border-radius: 12px !important;
        background: #ffffff !important;
        border: 1.5px solid #e2e8f0 !important;
        color: #1e293b !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 6px !important;
        box-shadow: 0 2px 5px rgba(15, 23, 42, 0.03) !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        transition: all 0.15s ease !important;
    }

    .dashboard-filter-capsule > .custom-dropdown-toggle:hover,
    .dashboard-filter-capsule.is-open > .custom-dropdown-toggle,
    .orders-date-filter > summary.custom-dropdown-toggle:hover,
    .orders-date-filter[open] > summary.custom-dropdown-toggle {
        background: #f8fafc !important;
        border-color: #cbd5e1 !important;
        color: #0f172a !important;
    }

    .dashboard-filter-capsule .custom-dropdown-label,
    .orders-date-filter .custom-dropdown-label {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        text-align: left !important;
        font-size: 12.5px !important;
        line-height: 1.2 !important;
        color: #334155 !important;
    }

    .dashboard-filter-capsule .custom-dropdown-chevron,
    .orders-date-filter .custom-dropdown-chevron {
        flex: 0 0 auto !important;
        font-size: 11px !important;
        color: #64748b !important;
        margin-left: 2px !important;
    }

    .orders-date-summary-icon {
        flex: 0 0 auto !important;
        margin-right: 4px !important;
        color: #166534 !important;
    }

    /* Left column (odd children 1, 3, 5): menu anchors left */
    .dashboard-filter-collapsible-inner .dashboard-filter-capsule:nth-child(odd) .custom-dropdown-menu {
        left: 0 !important;
        right: auto !important;
        min-width: 200px !important;
        max-width: calc(100vw - 24px) !important;
        border-radius: 14px !important;
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08) !important;
        z-index: 2000 !important;
    }

    /* Right column (even children 2, 4): menu anchors right */
    .dashboard-filter-collapsible-inner .dashboard-filter-capsule:nth-child(even) .custom-dropdown-menu {
        left: auto !important;
        right: 0 !important;
        min-width: 200px !important;
        max-width: calc(100vw - 24px) !important;
        border-radius: 14px !important;
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08) !important;
        z-index: 2000 !important;
    }

    .dashboard-filter-toolbar .custom-dropdown-option {
        min-height: 44px !important;
        padding: 10px 14px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }

    .dashboard-filter-toolbar:has(.custom-dropdown.is-open),
    .dashboard-filter-toolbar:has(.orders-date-filter[open]) {
        z-index: 1050 !important;
    }

    .orders-date-filter[open] {
        z-index: 1100 !important;
    }

    .orders-date-popover {
        position: absolute !important;
        top: calc(100% + 6px) !important;
        right: 0 !important;
        left: auto !important;
        transform: none !important;
        width: min(330px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 40px) !important;
        z-index: 2100 !important;
        border-radius: 16px !important;
        padding: 14px !important;
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08) !important;
    }

    .reset-filter-btn {
        grid-column: auto !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: 44px !important;
        height: 44px !important;
        border-radius: 12px !important;
        background: #ffffff !important;
        border: 1.5px solid #e2e8f0 !important;
        color: #475569 !important;
        justify-content: center !important;
        font-size: 12.5px !important;
        font-weight: 600 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        box-shadow: 0 2px 5px rgba(15, 23, 42, 0.03) !important;
        transition: all 0.15s ease !important;
    }

    .reset-filter-btn:hover {
        background: #f8fafc !important;
        border-color: #cbd5e1 !important;
        color: #0f172a !important;
    }
}

/* --------------------------------------------------------------------------
   6. Streamlined Order Table (7 Columns)
   -------------------------------------------------------------------------- */
.orders-table-wrap {
    background: var(--order-surface-card);
    border: 1px solid var(--order-border-light);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow-x: auto;
    margin-bottom: 24px;
}

.orders-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
    min-width: 960px;
}

.orders-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.orders-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 12px;
    padding: 16px 14px;
    border-bottom: 1px solid var(--order-border-light);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.orders-table th.th-order { width: 14.0%; min-width: 125px; }
.orders-table th.th-buyer { width: 10.5%; min-width: 95px; }
.orders-table th.th-chicken { width: 21.0%; min-width: 180px; }
.orders-table th.th-amount { width: 8.5%; min-width: 80px; text-align: left; }
.orders-table th.th-status { width: 15.5%; min-width: 145px; }
.orders-table th.th-delivery { width: 16.5%; min-width: 150px; }
.orders-table th.th-action { width: 14.0%; min-width: 130px; text-align: right; }

.orders-table td {
    padding: 22px 14px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    background: #ffffff;
}

.orders-table td.td-order,
.orders-table td:nth-child(1) {
    padding-right: 16px;
}

.orders-table td.td-buyer,
.orders-table td:nth-child(2) {
    padding-left: 16px;
}

.orders-table td.td-action,
.orders-table td:nth-child(7) {
    padding-right: 16px;
}

.orders-table tr:last-child td {
    border-bottom: none;
}

.orders-table tbody tr {
    transition: background-color 0.12s ease;
}

.orders-table tbody tr:hover td {
    background-color: #fafafa;
}

/* Cell Specific Styling */
.cell-order,
.cell-buyer,
.cell-chicken,
.cell-amount,
.cell-status,
.cell-delivery,
.cell-action {
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cell-order {
    gap: 8px;
    overflow: hidden;
}

.order-code-text {
    font-weight: 700;
    color: var(--order-text-dark);
    font-size: 13.5px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    line-height: 1.25;
}

.order-datetime-sub {
    font-size: 12px;
    color: #64748b;
    line-height: 1.35;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 4px;
    row-gap: 2px;
    max-width: 100%;
}

.order-date-part,
.order-time-part {
    white-space: nowrap;
}

@media (min-width: 1440px) {
    .order-datetime-sub {
        flex-wrap: nowrap;
    }
}

.cell-buyer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.buyer-name-text {
    font-weight: 600;
    color: var(--order-text-dark);
    font-size: 13.5px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.buyer-sub-text {
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chicken Thumbnail & Meta */
.cell-chicken {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.chicken-thumb-wrap {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid var(--order-border-light);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--order-text-light);
    font-size: 18px;
}

.chicken-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chicken-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.chicken-name-text {
    font-weight: 600;
    color: var(--order-text-dark);
    font-size: 13.5px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

.chicken-code-sub {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    color: #64748b;
    letter-spacing: 0.02em;
    line-height: 1.25;
}

.chicken-sub-text {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Amount Column - Aligned Left */
.cell-amount {
    text-align: left;
}

.order-amount-text {
    font-weight: 700;
    font-size: 15.5px;
    font-variant-numeric: tabular-nums;
    color: var(--order-text-dark);
    font-family: "Prompt", sans-serif;
    white-space: nowrap;
    line-height: 1.2;
}

/* Status Column */
.cell-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.order-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    line-height: 1.3;
    white-space: nowrap;
}

.order-badge.is-awaiting {
    background-color: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.order-badge.is-review {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.order-badge.is-preparing {
    background-color: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.order-badge.is-delivering {
    background-color: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.order-badge.is-confirming {
    background-color: #f0fdfa;
    color: #0f766e;
    border-color: #99f6e4;
}

.order-badge.is-complete {
    background-color: #f0fdf4;
    color: #15803d;
    border-color: #dcfce7;
}

.order-badge.is-failed {
    background-color: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.order-badge.is-unavailable {
    background-color: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

.order-sub-payment {
    font-size: 11px;
    color: var(--order-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.order-sub-payment i {
    font-size: 11px;
}

.order-sub-payment.is-paid {
    color: #15803d;
    font-weight: 500;
}

/* Delivery Column */
.cell-delivery {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.delivery-method-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 500;
    color: var(--order-text-dark);
    white-space: nowrap;
    line-height: 1.3;
}

.delivery-method-pill i {
    font-size: 12px;
    color: var(--order-text-muted);
}

.delivery-method-pill.is-none {
    color: var(--order-text-light);
    border-style: dashed;
}

.delivery-meta-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

.delivery-meta-sub {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.35;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 4px;
    row-gap: 2px;
    max-width: 100%;
}

.delivery-carrier-text {
    font-size: 11.5px;
    color: #475569;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.delivery-code-badge {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 10.5px;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 1px 6px;
    border-radius: 4px;
    width: fit-content;
    letter-spacing: 0.02em;
}

/* Action Area (Organized Action Cluster) */
.cell-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.action-cluster {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
}

.action-cluster:not(.has-primary) {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
}

.action-primary-row {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.action-secondary-row {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.order-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 32px;
    height: 32px;
    padding: 0 11px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.12s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.order-action-btn.is-compact {
    min-height: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
    gap: 4px;
    border-radius: 7px;
}

.order-action-btn.is-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.order-action-btn.is-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.order-action-btn.is-primary {
    min-height: 40px;
    height: 40px;
    padding: 0 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 8px;
    background: var(--order-green-primary);
    border: 1px solid var(--order-green-primary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(23, 101, 61, 0.14);
}

.order-action-btn.is-primary:hover {
    background: var(--order-green-hover);
    border-color: var(--order-green-hover);
    box-shadow: 0 4px 8px rgba(23, 101, 61, 0.22);
}

.order-action-btn.is-icon-only {
    padding: 0;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.order-action-btn.is-icon-only i {
    font-size: 14px;
}

.order-status-hint {
    font-size: 12px;
    color: var(--order-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Hide Table on Mobile */
@media (max-width: 900px) {
    .orders-table-wrap {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   7. Mobile Card List (< 900px)
   -------------------------------------------------------------------------- */
.orders-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

@media (min-width: 901px) {
    .orders-mobile-list {
        display: none !important;
    }
}

.order-mobile-card {
    background: var(--order-surface-card);
    border: 1px solid var(--order-border-light);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-mobile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid var(--order-border-subtle);
    padding-bottom: 10px;
}

.order-mobile-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-mobile-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-mobile-chicken {
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-mobile-subinfo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
}

.order-mobile-buyer {
    color: var(--order-text-normal);
}

.order-mobile-amount strong {
    font-size: 14px;
    color: var(--order-text-dark);
}

.order-mobile-delivery-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.order-mobile-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--order-border-subtle);
}

.order-mobile-foot .order-action-btn {
    flex: 1 1 auto;
}

.order-mobile-foot .order-action-btn.is-icon-only {
    flex: 0 0 36px;
}

/* Item 9: Mobile Actions <= 480px (No button crowding, thumb-friendly tap targets) */
@media (max-width: 480px) {
    .order-mobile-foot {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding-top: 12px;
    }

    .order-mobile-actions-stack {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .order-mobile-foot .order-action-btn {
        width: 100%;
        min-height: 42px;
        height: 42px;
        font-size: 13px;
        justify-content: center;
    }

    .order-mobile-sub-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .order-mobile-sub-actions .order-action-btn.is-secondary {
        flex: 1 1 auto;
        width: auto;
    }

    .order-mobile-sub-actions .order-action-btn.is-icon-only {
        flex: 0 0 42px;
        min-width: 42px;
        width: 42px;
        height: 42px;
    }

    .order-mobile-foot .order-status-hint {
        width: 100%;
        justify-content: center;
        padding: 4px 0;
    }
}

/* --------------------------------------------------------------------------
   7b. Frontend Pagination (10 Items Per Page)
   -------------------------------------------------------------------------- */
.orders-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid var(--order-border-light);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    margin-top: 16px;
    margin-bottom: 24px;
}

.orders-pagination[hidden] {
    display: none !important;
}

.orders-pagination-info {
    font-size: 13px;
    color: var(--order-text-muted);
    font-weight: 500;
}

.orders-pagination-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    min-height: 36px;
    padding: 0 12px;
    background: #ffffff;
    border: 1px solid var(--order-border-light);
    border-radius: 8px;
    color: var(--order-text-dark);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--order-text-dark);
}

.pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.pagination-pages {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--order-text-normal);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pagination-page:hover:not(.is-active) {
    background: #f1f5f9;
    color: var(--order-text-dark);
}

.pagination-page.is-active {
    background: var(--order-green-primary);
    color: #ffffff;
    border-color: var(--order-green-primary);
    box-shadow: 0 2px 6px rgba(23, 101, 61, 0.2);
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 36px;
    color: var(--order-text-light);
    font-size: 13px;
}

@media (max-width: 640px) {
    .orders-pagination {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
    }

    .orders-pagination-info {
        text-align: center;
        width: 100%;
    }

    .orders-pagination-controls {
        width: 100%;
        justify-content: space-between;
    }

    .pagination-pages {
        flex: 1 1 auto;
        justify-content: center;
    }
}

/* --------------------------------------------------------------------------
   8. Master Modal Design (Detail & Delivery)
   -------------------------------------------------------------------------- */
.order-detail-modal,
.delivery-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.order-detail-modal[hidden],
.delivery-modal[hidden] {
    display: none !important;
}

.order-detail-backdrop,
.delivery-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    border: none;
    cursor: pointer;
    z-index: 1;
}

.order-detail-dialog,
.delivery-dialog {
    position: relative;
    z-index: 2;
    background: #ffffff;
    border: 1px solid var(--order-border-light);
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.16);
    width: 100%;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.order-detail-dialog {
    max-width: 680px;
}

.delivery-dialog {
    max-width: 560px;
}

/* Master X Close Button */
.modal-close-button,
.order-detail-close,
.delivery-close {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--order-border-light);
    color: var(--order-text-dark);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
    padding: 0;
}

.modal-close-button:hover,
.order-detail-close:hover,
.delivery-close:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: rotate(90deg);
}

.modal-close-button:active,
.order-detail-close:active,
.delivery-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* Header & Footers */
.order-detail-header,
.delivery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--order-border-subtle);
    flex-shrink: 0;
}

.order-detail-header h2,
.delivery-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--order-text-dark);
}

.order-detail-header p,
.delivery-header p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--order-text-muted);
}

.order-detail-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.delivery-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

.delivery-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.order-detail-footer,
.delivery-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    background: #ffffff;
    border-top: 1px solid var(--order-border-subtle);
    flex-shrink: 0;
}

.order-detail-footer-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--order-text-light);
    margin-right: auto;
}

.definition-muted {
    color: #94a3b8;
    font-size: 13px;
}

/* Order Detail Sections (6 Sections) */
.order-detail-section {
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--order-border-subtle);
}

.order-detail-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.order-detail-section h3 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--order-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.order-detail-definition {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 16px;
    margin: 0;
}

.order-detail-definition > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-detail-definition dt {
    font-size: 12px;
    color: var(--order-text-muted);
}

.order-detail-definition dd {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--order-text-dark);
}

.order-detail-definition dd.full-width,
.order-detail-definition > div.full-width {
    grid-column: span 2;
}

/* Buyer Quick Action Utility Buttons */
.buyer-quick-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.order-action-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.4;
    font-family: inherit;
}

.order-action-tool-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.order-action-tool-btn.is-print {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.order-action-tool-btn.is-print:hover {
    background: #dcfce7;
    border-color: #86efac;
    color: #14532d;
}

.order-action-tool-btn.is-pedigree {
    background: #fefce8;
    border-color: #fde047;
    color: #854d0e;
}

.order-action-tool-btn.is-pedigree:hover {
    background: #fef08a;
    border-color: #eab308;
    color: #713f12;
}

/* Timeline in Detail Modal */
.order-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    padding-left: 20px;
}

.order-timeline::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 6px;
    width: 2px;
    background: var(--order-border-light);
}

.order-timeline-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.order-timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--order-border-light);
}

.order-timeline-item.is-current .order-timeline-dot {
    background: var(--order-green-primary);
    border-color: var(--order-green-primary);
    box-shadow: 0 0 0 3px rgba(23, 101, 61, 0.18);
}

.order-timeline-item.is-passed .order-timeline-dot {
    background: #bbf7d0;
    border-color: var(--order-green-primary);
}

.order-timeline-item strong {
    font-size: 13px;
    color: var(--order-text-dark);
}

.order-timeline-item small {
    font-size: 11px;
    color: var(--order-text-muted);
}

/* --------------------------------------------------------------------------
   9. Delivery Modal Method Selector (3 Cards)
   -------------------------------------------------------------------------- */
.delivery-field-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--order-text-dark);
    margin-bottom: 8px;
}

.delivery-method-locked-card {
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.delivery-method-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--order-text-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

/* Delivery Form Fields */
.delivery-full-field {
    margin-bottom: 14px;
}

.delivery-full-field > span {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--order-text-muted);
    margin-bottom: 5px;
}

.delivery-field-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.delivery-field-grid .delivery-full-field {
    grid-column: span 2;
    margin-bottom: 0;
}

.delivery-field-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--order-text-muted);
}

.delivery-form input[type="text"],
.delivery-form input[type="tel"],
.delivery-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--order-border-light);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease;
}

.delivery-form input:focus,
.delivery-form textarea:focus {
    border-color: var(--order-green-primary);
    box-shadow: 0 0 0 2px rgba(23, 101, 61, 0.12);
}

.delivery-time-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.delivery-time-group input {
    width: 60px;
    height: 38px;
    text-align: center;
    border: 1px solid var(--order-border-light);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    outline: none;
}

.delivery-time-sep {
    font-weight: 700;
    color: var(--order-text-muted);
}

.delivery-time-unit {
    font-size: 13px;
    color: var(--order-text-muted);
}

.delivery-form-error {
    color: #dc2626;
    font-size: 12px;
    margin: 4px 0 0;
    min-height: 16px;
}

.delivery-cancel {
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--order-border-light);
    background: #ffffff;
    color: var(--order-text-normal);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.delivery-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 20px;
    border: none;
    background: var(--order-green-primary);
    color: #ffffff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}

.delivery-submit:hover {
    background: var(--order-green-hover);
}

/* --------------------------------------------------------------------------
   10. Feedback & Toast Region
   -------------------------------------------------------------------------- */
.orders-loading,
.orders-error,
.orders-empty {
    background: #ffffff;
    border: 1px solid var(--order-border-light);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    margin-bottom: 24px;
}

.orders-empty-icon {
    font-size: 36px;
    color: var(--order-text-light);
    display: block;
    margin-bottom: 12px;
}

.orders-empty h3 {
    margin: 0 0 6px;
    font-size: 16px;
    color: var(--order-text-dark);
}

.orders-empty p {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--order-text-muted);
}

.orders-skeleton-row {
    height: 48px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 10px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.orders-toast-region {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.orders-toast {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: #0f172a;
    color: #ffffff;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
    pointer-events: auto;
    animation: toast-in 0.2s ease-out;
}

.orders-toast.is-error {
    background: #dc2626;
}

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

/* =========================================================
   Order Details Modal - Payment Proof & Slip Card Styles
========================================================= */
.order-payment-slip-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.order-payment-slip-card:hover {
    background: transparent;
    border: none;
    box-shadow: none;
}

.slip-thumb-wrap {
    position: relative;
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #0f172a;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.slip-thumb-wrap:hover,
.slip-thumb-wrap:focus-visible {
    transform: scale(1.04);
    border-color: #16a34a;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
    outline: none;
}

.slip-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.slip-thumb-wrap:hover .slip-thumb-img {
    filter: brightness(0.85);
    transform: scale(1.05);
}

.slip-thumb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    color: #ffffff;
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(1px);
}

.slip-thumb-wrap:hover .slip-thumb-overlay,
.slip-thumb-wrap:focus-visible .slip-thumb-overlay {
    opacity: 1;
}

.slip-info-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.slip-meta-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.slip-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.slip-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.slip-status-tag i {
    font-size: 11px;
}

.slip-hint {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.slip-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.btn-slip-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    line-height: 1.4;
    font-family: inherit;
}

.btn-slip-view {
    background: #ffffff;
    color: #15803d;
    border: 1px solid #bbf7d0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-slip-view:hover {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
    transform: translateY(-1px);
}

.btn-slip-newtab {
    background: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-slip-newtab:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.order-payment-slip-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
}

.slip-empty-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.slip-empty-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.slip-empty-title {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.slip-empty-sub {
    font-size: 11.5px;
    color: #94a3b8;
}

@media (max-width: 540px) {
    .order-payment-slip-card {
        padding: 12px;
        gap: 12px;
    }
    .slip-thumb-wrap {
        width: 58px;
        height: 58px;
    }
    .slip-action-row {
        gap: 6px;
    }
    .btn-slip-action {
        padding: 4px 10px;
        font-size: 11.5px;
    }
}

