:root {
    --orders-primary: #6d28d9;
    --orders-primary-dark: #4c1d95;
    --orders-primary-soft: #f3e8ff;
    --orders-blue: #2563eb;
    --orders-cyan: #0891b2;
    --orders-success: #059669;
    --orders-success-soft: #d1fae5;
    --orders-warning: #d97706;
    --orders-warning-soft: #fef3c7;
    --orders-danger: #dc2626;
    --orders-danger-soft: #fee2e2;
    --orders-ink: #172033;
    --orders-muted: #64748b;
    --orders-border: #e5e7eb;
    --orders-surface: #ffffff;
    --orders-background: #f5f7fb;
    --orders-shadow: 0 14px 40px rgba(30, 41, 59, 0.08);
    --orders-shadow-hover: 0 20px 45px rgba(30, 41, 59, 0.13);
}

body {
    font-family: 'Source Sans 3', sans-serif;
}

.content-wrapper {
    background:
        radial-gradient(
            circle at 100% 0,
            rgba(109, 40, 217, 0.07),
            transparent 30rem
        ),
        var(--orders-background);
}

.orders-app,
.orders-page-heading,
.order-details-modal {
    color: var(--orders-ink);
}

.orders-app *,
.orders-page-heading *,
.order-details-modal * {
    box-sizing: border-box;
}

.orders-app [hidden],
.order-details-modal [hidden],
.receipt-preview-modal [hidden] {
    display: none !important;
}

.orders-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    padding: 4px 0 8px;
}

.orders-page-heading h1 {
    margin: 2px 0 4px;
    color: var(--orders-ink);
    font-size: clamp(1.65rem, 2.4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.04em;
}

.orders-page-heading p {
    margin: 0;
    color: var(--orders-muted);
    font-size: 0.98rem;
}

.orders-eyebrow,
.modal-order-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--orders-primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.orders-eyebrow::before,
.modal-order-eyebrow::before {
    width: 18px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    content: '';
}

.orders-store-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(109, 40, 217, 0.15);
    border-radius: 13px;
    background: var(--orders-surface);
    box-shadow: 0 8px 25px rgba(76, 29, 149, 0.08);
    color: var(--orders-primary);
    font-size: 0.92rem;
    font-weight: 700;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.orders-store-button:hover {
    border-color: rgba(109, 40, 217, 0.35);
    box-shadow: 0 12px 30px rgba(76, 29, 149, 0.14);
    color: var(--orders-primary-dark);
    transform: translateY(-2px);
}

.orders-store-button:focus-visible,
.orders-filter-button:focus-visible,
.orders-reset-button:focus-visible,
.order-action-button:focus-visible,
.orders-pagination a:focus-visible,
.orders-pagination span:focus-visible,
.order-modal-approve:focus-visible,
.order-modal-reject:focus-visible,
.order-modal-close:focus-visible,
.order-public-link:focus-visible {
    outline: 3px solid rgba(109, 40, 217, 0.25);
    outline-offset: 2px;
}

.orders-statistics {
    margin-bottom: 20px;
}

.order-stat-card {
    --stat-color: var(--orders-primary);
    --stat-soft: var(--orders-primary-soft);
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 138px;
    height: 100%;
    padding: 21px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    background: var(--orders-surface);
    box-shadow: var(--orders-shadow);
    transition:
        transform 220ms ease,
        box-shadow 220ms ease,
        border-color 220ms ease;
}

.order-stat-card::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 105px;
    height: 105px;
    border-radius: 0 0 0 100%;
    background: var(--stat-soft);
    opacity: 0.55;
    content: '';
    transform: translate(25%, -25%);
}

.order-stat-card::after {
    position: absolute;
    right: 18px;
    bottom: 0;
    left: 18px;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: var(--stat-color);
    content: '';
    opacity: 0;
    transform: scaleX(0.45);
    transition:
        opacity 220ms ease,
        transform 220ms ease;
}

.order-stat-card:hover {
    border-color: color-mix(in srgb, var(--stat-color) 24%, white);
    box-shadow: var(--orders-shadow-hover);
    transform: translateY(-4px);
}

.order-stat-card:hover::after {
    opacity: 1;
    transform: scaleX(1);
}

.order-stat-review {
    --stat-color: var(--orders-warning);
    --stat-soft: var(--orders-warning-soft);
}

.order-stat-paid {
    --stat-color: var(--orders-success);
    --stat-soft: var(--orders-success-soft);
}

.order-stat-rejected {
    --stat-color: var(--orders-danger);
    --stat-soft: var(--orders-danger-soft);
}

.order-stat-icon {
    position: relative;
    z-index: 1;
    display: grid;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border-radius: 17px;
    background: var(--stat-soft);
    color: var(--stat-color);
    font-size: 1.45rem;
    place-items: center;
}

.order-stat-card > div:last-child {
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.order-stat-card span {
    color: var(--orders-muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.order-stat-card strong {
    margin: 1px 0 0;
    color: var(--orders-ink);
    font-size: 1.95rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.order-stat-card small {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 0.75rem;
}

.orders-panel {
    margin-bottom: 20px;
    overflow: visible;
    border-radius: 20px;
    background: var(--orders-surface);
    box-shadow: var(--orders-shadow);
}

.orders-panel > .card-body {
    padding: 19px;
}

.orders-filter-form {
    display: grid;
    grid-template-columns:
        minmax(260px, 1.6fr)
        minmax(175px, 0.7fr)
        minmax(175px, 0.7fr)
        auto
        auto;
    align-items: end;
    gap: 12px;
}

.orders-search-field {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 48px;
    border: 1px solid var(--orders-border);
    border-radius: 14px;
    background: #f8fafc;
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        background 180ms ease;
}

.orders-search-field:focus-within {
    border-color: rgba(109, 40, 217, 0.55);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.09);
}

.orders-search-field > i {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
}

.orders-search-field input {
    width: 100%;
    min-height: 46px;
    padding: 0 44px 0 45px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--orders-ink);
    font: inherit;
    font-size: 0.91rem;
}

.orders-search-field input::placeholder {
    color: #94a3b8;
}

.orders-search-field input::-webkit-search-cancel-button {
    display: none;
}

.orders-clear-search {
    position: absolute;
    right: 10px;
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: #e9edf3;
    color: var(--orders-muted);
    place-items: center;
    transition:
        background 160ms ease,
        color 160ms ease;
}

.orders-clear-search:hover {
    background: var(--orders-danger-soft);
    color: var(--orders-danger);
}

.orders-filter-select {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.orders-filter-select label {
    margin: 0 0 0 2px;
    color: var(--orders-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.orders-filter-select select {
    width: 100%;
    min-height: 48px;
    padding: 0 39px 0 13px;
    border: 1px solid var(--orders-border);
    border-radius: 14px;
    outline: 0;
    background-color: #f8fafc;
    color: var(--orders-ink);
    font: inherit;
    font-size: 0.89rem;
    cursor: pointer;
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        background 180ms ease;
}

.orders-filter-select select:focus {
    border-color: rgba(109, 40, 217, 0.55);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.09);
}

.orders-filter-button,
.orders-reset-button,
.orders-empty-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 17px;
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        background 180ms ease;
}

.orders-filter-button {
    border: 0;
    background: linear-gradient(
        135deg,
        var(--orders-primary),
        var(--orders-primary-dark)
    );
    box-shadow: 0 10px 24px rgba(109, 40, 217, 0.2);
    color: #ffffff;
}

.orders-filter-button:hover {
    box-shadow: 0 13px 28px rgba(109, 40, 217, 0.3);
    color: #ffffff;
    transform: translateY(-2px);
}

.orders-reset-button {
    border: 1px solid var(--orders-border);
    background: #ffffff;
    color: var(--orders-muted);
}

.orders-reset-button:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: var(--orders-ink);
}

.orders-list-panel {
    overflow: hidden;
}

.orders-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 19px 21px;
    border-bottom: 1px solid #eef2f7;
}

.orders-panel-header > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.orders-panel-icon {
    display: grid;
    flex: 0 0 43px;
    width: 43px;
    height: 43px;
    border-radius: 13px;
    background: var(--orders-primary-soft);
    color: var(--orders-primary);
    font-size: 1.13rem;
    place-items: center;
}

.orders-panel-header h2 {
    margin: 0;
    color: var(--orders-ink);
    font-size: 1.08rem;
    font-weight: 700;
}

.orders-panel-header p {
    margin: 2px 0 0;
    color: var(--orders-muted);
    font-size: 0.81rem;
}

.orders-result-count {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--orders-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.orders-table-container {
    position: relative;
    min-height: 160px;
}

.orders-loading-overlay {
    position: absolute;
    z-index: 20;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 11px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--orders-muted);
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
    backdrop-filter: blur(3px);
}

.orders-table-container.is-loading .orders-loading-overlay {
    opacity: 1;
    pointer-events: auto;
}

.orders-spinner {
    width: 37px;
    height: 37px;
    border: 3px solid rgba(109, 40, 217, 0.16);
    border-top-color: var(--orders-primary);
    border-radius: 50%;
    animation: orders-spin 700ms linear infinite;
}

@keyframes orders-spin {
    to {
        transform: rotate(360deg);
    }
}

.orders-table {
    min-width: 1120px;
    color: var(--orders-ink);
    font-size: 0.88rem;
}

.orders-table thead th {
    padding: 13px 16px;
    border: 0;
    border-bottom: 1px solid #e9eef5;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.71rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.orders-table tbody td {
    padding: 15px 16px;
    border: 0;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.orders-table tbody tr {
    transition:
        background 160ms ease,
        box-shadow 160ms ease;
}

.orders-table tbody tr:hover {
    background: #fbfaff;
    box-shadow: inset 3px 0 0 var(--orders-primary);
}

.orders-table tbody tr:last-child td {
    border-bottom: 0;
}

.order-number-cell,
.order-total-cell {
    display: flex;
    flex-direction: column;
}

.order-number-cell strong {
    color: var(--orders-primary-dark);
    font-size: 0.89rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.order-number-cell span {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    color: var(--orders-muted);
    font-size: 0.74rem;
}

.order-number-cell small {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 0.7rem;
}

.order-customer-cell,
.order-payment-method {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 185px;
}

.order-customer-avatar {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(
        135deg,
        var(--orders-primary-soft),
        #dbeafe
    );
    color: var(--orders-primary);
    font-size: 0.94rem;
    font-weight: 700;
    place-items: center;
}

.order-customer-cell > div,
.order-payment-method > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.order-customer-cell strong,
.order-payment-method strong {
    max-width: 180px;
    overflow: hidden;
    color: var(--orders-ink);
    font-size: 0.84rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-customer-cell span:not(.order-customer-avatar),
.order-customer-cell small,
.order-payment-method small {
    max-width: 190px;
    overflow: hidden;
    color: var(--orders-muted);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-payment-method > span {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 0.94rem;
    place-items: center;
}

.order-total-cell strong {
    color: var(--orders-ink);
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
}

.order-total-cell span {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.order-status-badge,
.order-payment-badge,
.order-delivery-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 29px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.order-status-badge > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px currentColor;
    opacity: 0.8;
}

.order-status-badge.is-pending,
.order-payment-badge.is-pending {
    background: #f1f5f9;
    color: #64748b;
}

.order-status-badge.is-review,
.order-payment-badge.is-review {
    background: var(--orders-warning-soft);
    color: #a65f05;
}

.order-status-badge.is-processing {
    background: #dbeafe;
    color: #1d4ed8;
}

.order-status-badge.is-completed,
.order-payment-badge.is-paid {
    background: var(--orders-success-soft);
    color: #047857;
}

.order-status-badge.is-cancelled,
.order-payment-badge.is-rejected {
    background: var(--orders-danger-soft);
    color: #b91c1c;
}

.order-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.order-action-button {
    display: inline-grid;
    flex: 0 0 35px;
    width: 35px;
    height: 35px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 11px;
    text-decoration: none;
    place-items: center;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease,
        color 160ms ease;
}

.order-action-button:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.order-action-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.order-action-button.is-view {
    background: #eef2ff;
    color: #4f46e5;
}

.order-action-button.is-view:hover {
    background: #4f46e5;
    box-shadow: 0 7px 16px rgba(79, 70, 229, 0.25);
    color: #ffffff;
}

.order-action-button.is-receipt {
    background: #e0f2fe;
    color: #0369a1;
}

.order-action-button.is-receipt:hover {
    background: #0284c7;
    box-shadow: 0 7px 16px rgba(2, 132, 199, 0.25);
    color: #ffffff;
}

.order-action-button.is-approve {
    background: var(--orders-success-soft);
    color: var(--orders-success);
}

.order-action-button.is-approve:hover {
    background: var(--orders-success);
    box-shadow: 0 7px 16px rgba(5, 150, 105, 0.25);
    color: #ffffff;
}

.order-action-button.is-reject {
    background: var(--orders-danger-soft);
    color: var(--orders-danger);
}

.order-action-button.is-reject:hover {
    background: var(--orders-danger);
    box-shadow: 0 7px 16px rgba(220, 38, 38, 0.23);
    color: #ffffff;
}

.orders-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 20px;
    border-top: 1px solid #eef2f7;
    background: #fbfcfe;
}

.orders-table-footer p {
    margin: 0;
    color: var(--orders-muted);
    font-size: 0.78rem;
}

.orders-table-footer p strong {
    color: var(--orders-ink);
}

.orders-pagination {
    display: flex;
    align-items: center;
    gap: 5px;
}

.orders-pagination a,
.orders-pagination span {
    display: grid;
    width: 34px;
    height: 34px;
    border: 1px solid var(--orders-border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--orders-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    place-items: center;
    transition:
        border-color 160ms ease,
        background 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.orders-pagination a:hover {
    border-color: var(--orders-primary);
    color: var(--orders-primary);
    transform: translateY(-1px);
}

.orders-pagination .is-active {
    border-color: var(--orders-primary);
    background: var(--orders-primary);
    color: #ffffff;
}

.orders-pagination .is-disabled {
    background: #f8fafc;
    color: #cbd5e1;
    cursor: not-allowed;
}

.orders-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    padding: 40px 20px;
    flex-direction: column;
    text-align: center;
}

.orders-empty-state > span {
    display: grid;
    width: 76px;
    height: 76px;
    margin-bottom: 17px;
    border-radius: 24px;
    background: var(--orders-primary-soft);
    color: var(--orders-primary);
    font-size: 2rem;
    place-items: center;
    transform: rotate(-4deg);
}

.orders-empty-state h3 {
    margin: 0;
    color: var(--orders-ink);
    font-size: 1.18rem;
    font-weight: 700;
}

.orders-empty-state p {
    max-width: 390px;
    margin: 7px 0 18px;
    color: var(--orders-muted);
    font-size: 0.9rem;
}

.orders-empty-reset {
    border: 0;
    background: var(--orders-primary-soft);
    color: var(--orders-primary);
}

.orders-empty-reset:hover {
    background: var(--orders-primary);
    color: #ffffff;
}

/* Modal de detalle */

.order-details-modal .modal-dialog {
    max-width: 1120px;
}

.order-details-modal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.28);
}

.order-details-modal .modal-header {
    align-items: center;
    padding: 20px 23px;
    border: 0;
    background:
        radial-gradient(
            circle at 90% 0,
            rgba(255, 255, 255, 0.18),
            transparent 15rem
        ),
        linear-gradient(
            135deg,
            var(--orders-primary-dark),
            var(--orders-primary)
        );
    color: #ffffff;
}

.order-details-modal .modal-order-eyebrow {
    color: rgba(255, 255, 255, 0.72);
}

.order-details-modal .modal-title {
    margin: 2px 0 0;
    color: #ffffff;
    font-size: 1.38rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.order-details-modal .btn-close {
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border-radius: 11px;
    background-color: rgba(255, 255, 255, 0.13);
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.85;
}

.order-details-modal .btn-close:hover {
    background-color: rgba(255, 255, 255, 0.22);
    opacity: 1;
}

.order-details-modal .modal-body {
    min-height: 390px;
    padding: 20px;
    background: #f6f8fc;
}

.order-details-modal .modal-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e9eef5;
    background: #ffffff;
}

.order-detail-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 355px;
    flex-direction: column;
    text-align: center;
}

.order-detail-loading strong {
    margin-top: 15px;
    color: var(--orders-ink);
    font-size: 1rem;
}

.order-detail-loading span {
    margin-top: 3px;
    color: var(--orders-muted);
    font-size: 0.82rem;
}

.order-detail-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 15px;
    border: 1px solid #e7ebf2;
    border-radius: 15px;
    background: #ffffff;
}

.order-detail-status-bar > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.order-detail-status-bar > span {
    color: var(--orders-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.order-detail-card,
.order-products-card,
.order-note-card {
    border: 1px solid #e7ebf2;
    border-radius: 17px;
    background: #ffffff;
    box-shadow: 0 9px 25px rgba(30, 41, 59, 0.045);
}

.order-detail-card {
    padding: 16px;
}

.order-detail-card-title,
.order-products-heading > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-detail-card-title > span,
.order-products-heading > div > span {
    display: grid;
    flex: 0 0 39px;
    width: 39px;
    height: 39px;
    border-radius: 12px;
    background: var(--orders-primary-soft);
    color: var(--orders-primary);
    font-size: 0.98rem;
    place-items: center;
}

.order-detail-card-title h3,
.order-products-heading h3,
.order-note-card h3 {
    margin: 0;
    color: var(--orders-ink);
    font-size: 0.91rem;
    font-weight: 700;
}

.order-detail-card-title p,
.order-products-heading p {
    margin: 1px 0 0;
    color: var(--orders-muted);
    font-size: 0.71rem;
}

.order-detail-list,
.order-total-list {
    display: flex;
    margin: 15px 0 0;
    flex-direction: column;
}

.order-detail-list > div,
.order-total-list > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 9px 0;
    border-bottom: 1px dashed #e6eaf0;
}

.order-detail-list > div:last-child,
.order-total-list > div:last-child {
    border-bottom: 0;
}

.order-detail-list dt,
.order-total-list dt {
    color: var(--orders-muted);
    font-size: 0.73rem;
    font-weight: 600;
}

.order-detail-list dd,
.order-total-list dd {
    max-width: 66%;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--orders-ink);
    font-size: 0.77rem;
    font-weight: 700;
    text-align: right;
}

.order-receipt-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--orders-primary);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.order-receipt-link:hover {
    color: var(--orders-primary-dark);
    text-decoration: underline;
}

.order-total-card {
    background:
        radial-gradient(
            circle at 100% 0,
            rgba(109, 40, 217, 0.11),
            transparent 13rem
        ),
        #ffffff;
}

.order-total-list .is-total {
    align-items: center;
    margin-top: 3px;
    padding: 12px;
    border: 0;
    border-radius: 12px;
    background: var(--orders-primary-soft);
}

.order-total-list .is-total dt {
    color: var(--orders-primary-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

.order-total-list .is-total dd {
    color: var(--orders-primary-dark);
    font-size: 1.05rem;
}

.order-products-card {
    overflow: hidden;
}

.order-products-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 17px;
    border-bottom: 1px solid #edf1f6;
}

.order-products-heading > strong {
    padding: 6px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--orders-muted);
    font-size: 0.7rem;
    font-weight: 700;
}

.order-detail-products {
    min-width: 690px;
    color: var(--orders-ink);
}

.order-detail-products thead th {
    padding: 10px 15px;
    border: 0;
    border-bottom: 1px solid #edf1f6;
    background: #f8fafc;
    color: var(--orders-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.order-detail-products tbody td {
    padding: 13px 15px;
    border: 0;
    border-bottom: 1px solid #f0f3f7;
    color: var(--orders-ink);
    font-size: 0.77rem;
    vertical-align: middle;
}

.order-detail-products tbody tr:last-child td {
    border-bottom: 0;
}

.order-detail-product-name {
    display: flex;
    min-width: 180px;
    flex-direction: column;
}

.order-detail-product-name strong {
    font-size: 0.8rem;
    font-weight: 700;
}

.order-detail-product-name span {
    margin-top: 2px;
    color: var(--orders-muted);
    font-size: 0.68rem;
}

.order-delivery-badge {
    min-height: 27px;
    background: #eef2ff;
    color: #4f46e5;
}

.order-note-card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-height: 100%;
    padding: 14px;
    border-color: #dbeafe;
    background: #eff6ff;
}

.order-note-card > span {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #dbeafe;
    color: #2563eb;
    place-items: center;
}

.order-note-card p {
    margin: 3px 0 0;
    color: #475569;
    font-size: 0.78rem;
    line-height: 1.45;
    white-space: pre-line;
}

.order-note-card.is-admin {
    border-color: #d1fae5;
    background: #ecfdf5;
}

.order-note-card.is-admin > span {
    background: #d1fae5;
    color: var(--orders-success);
}

.order-note-card.is-rejection {
    border-color: #fecaca;
    background: #fff1f2;
}

.order-note-card.is-rejection > span {
    background: var(--orders-danger-soft);
    color: var(--orders-danger);
}

.order-public-link,
.order-modal-approve,
.order-modal-reject,
.order-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 41px;
    padding: 0 15px;
    border-radius: 12px;
    font-size: 0.81rem;
    font-weight: 700;
    transition:
        transform 170ms ease,
        box-shadow 170ms ease,
        background 170ms ease;
}

.order-public-link {
    border: 1px solid #ddd6fe;
    background: var(--orders-primary-soft);
    color: var(--orders-primary);
}

.order-public-link:hover {
    background: #e9d5ff;
    color: var(--orders-primary-dark);
}

.order-modal-approve {
    border: 0;
    background: var(--orders-success);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.18);
    color: #ffffff;
}

.order-modal-approve:hover {
    background: #047857;
    box-shadow: 0 11px 25px rgba(5, 150, 105, 0.25);
    color: #ffffff;
    transform: translateY(-1px);
}

.order-modal-reject {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: var(--orders-danger);
}

.order-modal-reject:hover {
    background: var(--orders-danger);
    color: #ffffff;
}

.order-modal-close {
    border: 1px solid var(--orders-border);
    background: #ffffff;
    color: var(--orders-muted);
}

.order-modal-close:hover {
    background: #f8fafc;
    color: var(--orders-ink);
}

/* Vista previa del comprobante */

.receipt-preview-modal .modal-dialog {
    max-width: 1050px;
}

.receipt-preview-modal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.32);
}

.receipt-preview-modal .modal-header {
    align-items: center;
    padding: 18px 22px;
    border: 0;
    background:
        radial-gradient(
            circle at 88% 0,
            rgba(255, 255, 255, 0.16),
            transparent 15rem
        ),
        linear-gradient(135deg, #111827, #312e81);
    color: #ffffff;
}

.receipt-preview-modal .modal-order-eyebrow {
    color: #c4b5fd;
}

.receipt-preview-modal .modal-title {
    margin: 2px 0 0;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.receipt-preview-modal .btn-close {
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border-radius: 11px;
    background-color: rgba(255, 255, 255, 0.13);
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.9;
}

.receipt-preview-modal .btn-close:hover {
    background-color: rgba(255, 255, 255, 0.22);
    opacity: 1;
}

.receipt-preview-modal .modal-body {
    position: relative;
    height: min(72vh, 720px);
    min-height: 430px;
    padding: 0;
    overflow: hidden;
    background:
        linear-gradient(45deg, #111827 25%, transparent 25%),
        linear-gradient(-45deg, #111827 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #111827 75%),
        linear-gradient(-45deg, transparent 75%, #111827 75%),
        #1f2937;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
}

.receipt-preview-loading {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: #f8fafc;
    text-align: center;
}

.receipt-preview-loading strong {
    margin-top: 14px;
    color: var(--orders-ink);
    font-size: 0.96rem;
}

.receipt-preview-loading span {
    margin-top: 3px;
    color: var(--orders-muted);
    font-size: 0.79rem;
}

.receipt-preview-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    background: #ffffff;
}

.receipt-preview-modal .modal-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 19px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.receipt-security-message {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--orders-muted);
    font-size: 0.77rem;
    font-weight: 600;
}

.receipt-security-message i {
    color: var(--orders-success);
    font-size: 1rem;
}

.receipt-download-button,
.receipt-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    transition:
        transform 170ms ease,
        box-shadow 170ms ease,
        background 170ms ease;
}

.receipt-download-button {
    border: 0;
    background: linear-gradient(
        135deg,
        var(--orders-primary),
        var(--orders-primary-dark)
    );
    box-shadow: 0 9px 22px rgba(109, 40, 217, 0.2);
    color: #ffffff;
}

.receipt-download-button:hover {
    box-shadow: 0 12px 26px rgba(109, 40, 217, 0.3);
    color: #ffffff;
    transform: translateY(-1px);
}

.receipt-close-button {
    border: 1px solid var(--orders-border);
    background: #ffffff;
    color: var(--orders-muted);
}

.receipt-close-button:hover {
    background: #f8fafc;
    color: var(--orders-ink);
}

/* SweetAlert2 */

.swal2-popup.compris-alert {
    width: min(92vw, 470px);
    padding: 25px;
    border-radius: 22px;
    font-family: 'Source Sans 3', sans-serif;
}

.compris-alert .swal2-title {
    color: var(--orders-ink);
    font-size: 1.42rem;
    font-weight: 700;
}

.compris-alert .swal2-html-container {
    color: var(--orders-muted);
    font-size: 0.93rem;
}

.swal2-popup.compris-alert .swal2-actions {
    width: 100%;
    gap: 12px;
    margin: 24px 0 0;
    padding: 0;
    flex-wrap: wrap;
    align-items: stretch;
}

.swal2-popup.compris-alert .swal2-actions > button:is(
    .swal-confirm,
    .swal-cancel,
    .swal-reject,
    .swal-delete
) {
    --alert-focus-color: #7c3aed;
    appearance: none;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 125px;
    max-width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: #f1f5f9;
    color: #334155;
    box-shadow: none;
    font-family: 'Source Sans 3', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    white-space: normal;
    cursor: pointer;
    transition: background 160ms ease, box-shadow 160ms ease;
}

.swal2-popup.compris-alert .swal2-actions > button.swal-confirm {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    box-shadow: 0 6px 16px rgb(109 40 217 / 20%);
}

.swal2-popup.compris-alert .swal2-actions > button:is(.swal-delete, .swal-reject) {
    --alert-focus-color: #dc2626;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    box-shadow: 0 6px 16px rgb(220 38 38 / 20%);
}

.swal2-popup.compris-alert .swal2-actions > button.swal-cancel {
    border-color: #dbe3ed;
    background: #fff;
    color: #475569;
}

.swal2-popup.compris-alert .swal2-actions > button.swal-confirm:not(:disabled):hover {
    background: linear-gradient(135deg, #6d28d9, #4c1d95);
}

.swal2-popup.compris-alert .swal2-actions > button:is(.swal-delete, .swal-reject):not(:disabled):hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
}

.swal2-popup.compris-alert .swal2-actions > button.swal-cancel:not(:disabled):hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #172033;
}

.swal2-popup.compris-alert .swal2-actions > button:is(
    .swal-confirm, .swal-cancel, .swal-reject, .swal-delete
):focus-visible {
    outline: 3px solid var(--alert-focus-color, #7c3aed);
    outline-offset: 3px;
}

.swal2-popup.compris-alert .swal2-actions > button:is(
    .swal-confirm, .swal-cancel, .swal-reject, .swal-delete
):disabled {
    opacity: .6;
    box-shadow: none;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .swal2-popup.compris-alert .swal2-actions > button:is(
        .swal-confirm, .swal-cancel, .swal-reject, .swal-delete
    ) {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .swal2-popup.compris-alert .swal2-actions > button:is(
        .swal-confirm, .swal-cancel, .swal-reject, .swal-delete
    ) {
        transition: none;
    }
}

.swal2-textarea.swal-notes-input {
    min-height: 112px;
    margin: 12px 0 0;
    border: 1px solid var(--orders-border);
    border-radius: 13px;
    box-shadow: none;
    color: var(--orders-ink);
    font: 400 0.9rem 'Source Sans 3', sans-serif;
    resize: vertical;
}

.swal2-textarea.swal-notes-input:focus {
    border-color: rgba(109, 40, 217, 0.55);
    box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.09);
}

@media (max-width: 1199.98px) {
    .orders-filter-form {
        grid-template-columns: minmax(250px, 1.5fr) repeat(2, minmax(165px, 1fr));
    }

    .orders-filter-button,
    .orders-reset-button {
        width: 100%;
    }

    .orders-filter-button {
        grid-column: 2;
    }

    .orders-reset-button {
        grid-column: 3;
    }
}

@media (max-width: 991.98px) {
    .orders-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .orders-search-field {
        grid-column: 1 / -1;
    }

    .orders-filter-button,
    .orders-reset-button {
        grid-column: auto;
    }

    .order-details-modal .modal-dialog {
        max-width: calc(100% - 24px);
        margin-right: auto;
        margin-left: auto;
    }
}

@media (max-width: 767.98px) {
    .orders-page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .orders-store-button {
        width: 100%;
    }

    .order-stat-card {
        min-height: 120px;
    }

    .orders-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .orders-result-count {
        align-self: flex-start;
    }

    .orders-table-container > .table-responsive {
        overflow: visible;
    }

    .orders-table {
        display: block;
        min-width: 0;
        padding: 12px;
        background: #f6f8fc;
    }

    .orders-table thead {
        display: none;
    }

    .orders-table tbody,
    .orders-table tr,
    .orders-table td {
        display: block;
        width: 100%;
    }

    .orders-table tbody tr {
        margin-bottom: 12px;
        overflow: hidden;
        border: 1px solid #e5eaf1;
        border-radius: 17px;
        background: #ffffff;
        box-shadow: 0 8px 22px rgba(30, 41, 59, 0.055);
    }

    .orders-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .orders-table tbody tr:hover {
        background: #ffffff;
        box-shadow: 0 10px 25px rgba(30, 41, 59, 0.08);
    }

    .orders-table tbody td {
        display: grid;
        grid-template-columns: 105px minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        border-bottom: 1px solid #eef2f7;
        text-align: left !important;
    }

    .orders-table tbody td::before {
        color: var(--orders-muted);
        content: attr(data-label);
        font-size: 0.69rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .orders-table tbody td:last-child {
        border-bottom: 0;
    }

    .order-customer-cell,
    .order-payment-method {
        min-width: 0;
    }

    .order-customer-cell strong,
    .order-customer-cell span:not(.order-customer-avatar),
    .order-customer-cell small,
    .order-payment-method strong,
    .order-payment-method small {
        max-width: 100%;
    }

    .order-actions {
        justify-content: flex-start;
    }

    .orders-table-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .orders-pagination {
        width: 100%;
        justify-content: center;
    }

    .order-details-modal .modal-dialog {
        max-width: calc(100% - 16px);
        margin: 8px auto;
    }

    .receipt-preview-modal .modal-dialog {
        max-width: calc(100% - 16px);
        margin: 8px auto;
    }

    .order-details-modal .modal-content {
        max-height: calc(100vh - 16px);
        border-radius: 18px;
    }

    .order-details-modal .modal-header,
    .order-details-modal .modal-body,
    .order-details-modal .modal-footer {
        padding-right: 15px;
        padding-left: 15px;
    }

    .order-detail-status-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .order-details-modal .modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .order-details-modal .modal-footer > .ms-auto {
        width: 100%;
        margin-left: 0 !important;
    }

    .receipt-preview-modal .modal-content {
        max-height: calc(100vh - 16px);
        border-radius: 18px;
    }

    .receipt-preview-modal .modal-header,
    .receipt-preview-modal .modal-footer {
        padding-right: 15px;
        padding-left: 15px;
    }

    .receipt-preview-modal .modal-body {
        height: 67vh;
        min-height: 350px;
    }

    .receipt-preview-modal .modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .receipt-preview-modal .modal-footer > .ms-auto {
        width: 100%;
        margin-left: 0 !important;
    }

    .receipt-download-button,
    .receipt-close-button {
        flex: 1 1 auto;
    }

    .order-public-link,
    .order-modal-approve,
    .order-modal-reject,
    .order-modal-close {
        flex: 1 1 auto;
    }
}

@media (max-width: 575.98px) {
    .orders-filter-form {
        grid-template-columns: 1fr;
    }

    .orders-search-field,
    .orders-filter-button,
    .orders-reset-button {
        grid-column: auto;
    }

    .orders-panel > .card-body {
        padding: 14px;
    }

    .orders-panel-header {
        padding: 16px;
    }

    .orders-table {
        padding: 9px;
    }

    .orders-table tbody td {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .orders-table tbody td::before {
        margin-bottom: 1px;
    }

    .order-actions {
        flex-wrap: wrap;
    }

    .orders-table-footer {
        padding: 14px;
    }

    .orders-pagination a,
    .orders-pagination span {
        width: 32px;
        height: 32px;
    }

    .order-products-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .order-details-modal .modal-footer > .ms-auto {
        flex-direction: column;
    }

    .receipt-preview-modal .modal-body {
        height: 62vh;
        min-height: 310px;
    }

    .receipt-preview-modal .modal-footer > .ms-auto {
        flex-direction: column;
    }

    .swal2-popup.compris-alert {
        padding: 20px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .orders-app *,
    .orders-page-heading *,
    .order-details-modal * {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
