/* ============================================================
   Orders pages — scoped under .fx-order-page
   Reuses the kit variables from fiberx-kit.css.
   All custom classes are prefixed `fx-order-`.
   ============================================================ */

.fx-order-page {
    width: 100%;
    max-width: none;
    margin: 0;
}

.fx-order-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.fx-order-title-block .fx-order-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary-500);
    padding: 4px 12px;
    background: rgba(123, 82, 209, 0.10);
    border-radius: 100px;
    border: 1px solid rgba(123, 82, 209, 0.22);
    margin-bottom: 8px;
}

.fx-order-title-block .fx-order-kicker .fx-order-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.fx-order-title-block h1 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 28px;
    color: var(--text);
    line-height: 1.2;
}

.fx-order-title-block h1 em {
    font-style: italic;
    background: linear-gradient(135deg, var(--primary-500), var(--accent));
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
}

.fx-order-title-block p {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.fx-order-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.fx-order-search.mud-input-control { min-width: 280px; max-width: 360px; }
.fx-order-filter.mud-input-control { min-width: 180px; }

.fx-order-search .mud-input-outlined .mud-input-slot,
.fx-order-filter .mud-input-outlined .mud-input-slot {
    background-color: #fff !important;
}

.fx-order-search .mud-input-outlined,
.fx-order-filter .mud-input-outlined {
    background-color: #fff !important;
    border-radius: var(--radius-md);
}

/* Card + table */
.fx-order-card {
    background: var(--surface, #fff);
    border-radius: var(--radius-md);
    border: 1px solid var(--border, rgba(0,0,0,0.08));
    padding: 6px;
    overflow: hidden;
}

.fx-order-table .mud-table-cell { font-size: 13px; }

.fx-order-number {
    font-family: var(--font-mono, monospace);
    font-weight: 600;
    color: var(--text);
}

.fx-order-customer { display: flex; flex-direction: column; gap: 2px; }
.fx-order-customer-name { font-weight: 600; color: var(--text); }
.fx-order-customer-mobile {
    font-family: var(--font-mono, monospace);
    color: var(--text-muted);
    font-size: 12px;
}

.fx-order-product {
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fx-order-amount { font-weight: 700; color: var(--text); }
.fx-order-amount-cur { font-size: 11px; color: var(--text-muted); margin-left: 3px; }

.fx-order-row-actions {
    display: inline-flex;
    gap: 4px;
    justify-content: flex-end;
}

.fx-order-act-view.mud-icon-button   { color: var(--primary-500); }
.fx-order-act-status.mud-icon-button { color: #1d4ed8; }

/* Order status pills */
.fx-order-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}

.fx-order-status-pending      { background: rgba(245, 158, 11, 0.14); color: #b45309; border-color: rgba(245, 158, 11, 0.28); }
.fx-order-status-awaiting     { background: rgba(59, 130, 246, 0.14); color: #1d4ed8; border-color: rgba(59, 130, 246, 0.30); }
.fx-order-status-paid         { background: rgba(99, 102, 241, 0.14); color: #4338ca; border-color: rgba(99, 102, 241, 0.30); }
.fx-order-status-fulfilling   { background: rgba(168, 85, 247, 0.14); color: #7c3aed; border-color: rgba(168, 85, 247, 0.30); }
.fx-order-status-completed    { background: rgba(16, 185, 129, 0.14); color: #047857; border-color: rgba(16, 185, 129, 0.30); }
.fx-order-status-partial      { background: rgba(13, 148, 136, 0.14); color: #0f766e; border-color: rgba(13, 148, 136, 0.30); }
.fx-order-status-failed       { background: rgba(239, 68, 68, 0.14);  color: #b91c1c; border-color: rgba(239, 68, 68, 0.30); }
.fx-order-status-refunded     { background: rgba(107, 114, 128, 0.14); color: #4b5563; border-color: rgba(107, 114, 128, 0.30); }
.fx-order-status-cancelled    { background: rgba(148, 163, 184, 0.16); color: #64748b; border-color: rgba(148, 163, 184, 0.28); }

/* Fulfillment pills */
.fx-order-ff {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
}

.fx-order-ff-pending   { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.26); }
.fx-order-ff-fulfilled { background: rgba(16, 185, 129, 0.12); color: #047857; border-color: rgba(16, 185, 129, 0.26); }
.fx-order-ff-failed    { background: rgba(239, 68, 68, 0.12);  color: #b91c1c; border-color: rgba(239, 68, 68, 0.26); }
.fx-order-ff-refunded  { background: rgba(107, 114, 128, 0.12); color: #4b5563; border-color: rgba(107, 114, 128, 0.26); }

/* Payment method pills */
.fx-order-pay {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}

.fx-order-pay .mud-icon-root { width: 14px; height: 14px; }
.fx-order-pay-wallet   { background: rgba(56, 30, 114, 0.10);  color: var(--primary-500, #381e72); border-color: rgba(56, 30, 114, 0.28); }
.fx-order-pay-zaincash { background: rgba(220, 38, 38, 0.10);  color: #b91c1c; border-color: rgba(220, 38, 38, 0.26); }
.fx-order-pay-qicard   { background: rgba(13, 148, 136, 0.10); color: #0f766e; border-color: rgba(13, 148, 136, 0.26); }

/* Empty state */
.fx-order-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px;
    color: var(--text-muted);
}

.fx-order-empty .mud-icon-root { width: 36px; height: 36px; color: var(--primary-500); opacity: 0.6; }
.fx-order-empty-title { font-weight: 600; color: var(--text); font-size: 14px; }

/* Dialog shell */
.fx-order-dialog .mud-dialog-title { padding: 18px 20px 8px; }

.fx-order-dialog-title-row { display: flex; align-items: center; gap: 12px; }

.fx-order-dialog-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(123, 82, 209, 0.10);
    border: 1px solid rgba(123, 82, 209, 0.22);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--primary-500);
}

.fx-order-dialog-icon .mud-icon-root { width: 18px; height: 18px; }

.fx-order-dialog-title-text { font-weight: 700; color: var(--text); font-size: 16px; line-height: 1.2; }
.fx-order-dialog-subtitle { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.fx-order-dialog-cancel.mud-button-root {
    color: var(--text-dim) !important; text-transform: none !important; font-weight: 600 !important;
}

.fx-order-dialog-confirm.mud-button-root {
    background: linear-gradient(135deg, var(--primary-500), var(--primary)) !important;
    color: #fff !important; text-transform: none !important;
    border-radius: var(--radius-md) !important; padding: 6px 18px !important; font-weight: 600 !important;
}

/* Status change dialog */
.fx-order-status-current { margin-bottom: 12px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 8px; }
.fx-order-status-select { margin-top: 6px; }

/* Details dialog grid */
.fx-order-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 18px;
}

.fx-order-details .fx-order-section {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-500);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-top: 4px;
}

.fx-order-details .fx-order-section::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(123, 82, 209, 0.25), transparent);
}

.fx-order-field { display: flex; flex-direction: column; gap: 2px; }
.fx-order-field-wide { grid-column: 1 / -1; }

.fx-order-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

.fx-order-value { color: var(--text); font-size: 14px; }
.fx-order-value-mono { font-family: var(--font-mono, monospace); word-break: break-all; }

/* Card-material callout (serial / pin) */
.fx-order-card-material {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(16, 185, 129, 0.06);
    border: 1px dashed rgba(16, 185, 129, 0.40);
}

.fx-order-card-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 120px;
}

.fx-order-card-chip .fx-order-label { color: #047857; }
.fx-order-card-chip .fx-order-value { font-family: var(--font-mono, monospace); font-weight: 600; }

@media (max-width: 720px) {
    .fx-order-details { grid-template-columns: 1fr; }
    .fx-order-search.mud-input-control { min-width: 0; flex: 1; max-width: none; }
    .fx-order-filter.mud-input-control { min-width: 0; flex: 1; }
}
