/* Order Management - Dark Theme Styles */
/* Matches ModuleGroup / CommissionSetup card UI patterns */
/* Prefix: om- (Order Management) */

/* ── Page Container ─────────────────────────────────────────────── */
.om-page {
    background: #0F1412;
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* ── Stats Bar ────────────────────────────────────────────────────── */
.om-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid #2E2E2E;
}

.om-stat-card {
    background: #1A1D1C;
    border: 1px solid #2E2E2E;
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.om-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.om-stat-icon--active { background: rgba(45, 212, 191, 0.12); color: #2DD4BF; }
.om-stat-icon--pending { background: rgba(245, 158, 11, 0.12); color: #F59E0B; }
.om-stat-icon--today { background: rgba(59, 130, 246, 0.12); color: #3B82F6; }
.om-stat-icon--revenue { background: rgba(34, 197, 94, 0.12); color: #22C55E; }

.om-stat-value {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.om-stat-label {
    color: #6B7280;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* ── Tab Bar ──────────────────────────────────────────────────────── */
.om-tabs {
    display: flex;
    gap: 0;
    padding: 0 1.25rem;
    border-bottom: 2px solid #2E2E2E;
    background: #0F1412;
    overflow-x: auto;
}

.om-tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6B7280;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.om-tab:hover { color: #D1D5DB; }

.om-tab--active {
    color: #2DD4BF;
    border-bottom-color: #2DD4BF;
}

.om-tab i { font-size: 0.813rem; }

.om-tab-count {
    background: #252927;
    color: #9CA3AF;
    font-size: 0.688rem;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 700;
}
.om-tab--active .om-tab-count { background: rgba(45,212,191,0.15); color: #2DD4BF; }

/* ── Header ───────────────────────────────────────────────────────── */
.om-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #0F1412;
    border-bottom: 2px solid #2E2E2E;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.om-header-info { flex: 1; min-width: 0; }

.om-header-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.om-header-title i { color: #2DD4BF; font-size: 1.125rem; }

.om-header-subtitle { color: #6B7280; font-size: 0.813rem; }

/* ── Search Bar ────────────────────────────────────────────────────── */
.om-search-bar {
    padding: 0.75rem 1.25rem;
    border-bottom: 2px solid #2E2E2E;
}

.om-search-wrap { position: relative; max-width: 380px; }

.om-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.813rem;
    color: #6B7280;
    pointer-events: none;
}

.om-search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: #1A1D1C;
    border: 1px solid #2E2E2E;
    border-radius: 0.625rem;
    color: #fff;
    font-size: 0.875rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.om-search-input:focus {
    border-color: #2DD4BF;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.08);
}

/* ── Filter Bar ────────────────────────────────────────────────────── */
.om-filter-bar {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 2px solid #2E2E2E;
    flex-wrap: wrap;
}

.om-filter-select {
    padding: 0.5rem 1rem;
    background: #1A1D1C;
    border: 1px solid #2E2E2E;
    border-radius: 0.5rem;
    color: #fff;
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
}

.om-filter-select:focus { border-color: #2DD4BF; }

.om-filter-bar input[type="date"] { cursor: text; }

/* ── Queue / Card Grid ────────────────────────────────────────────── */
.om-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    padding: 1.25rem;
}

/* ── Order Card ──────────────────────────────────────────────────────── */
.om-card {
    background: #1A1D1C;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    border: none;
    position: relative;
}

.om-card:hover { transform: translateY(-4px); }

/* Hide borders on ALL structural card elements — matches ModuleGroup/CommissionSetup pattern */
.om-card *,
.om-card *::before,
.om-card *::after {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background-image: none !important;
}

.om-card-top,
.om-card-customer,
.om-card-items,
.om-card-meta,
.om-card-actions {
    background: transparent !important;
}

.om-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.om-card-id-wrap { flex: 1; min-width: 0; }

.om-card-id {
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.om-card-time {
    color: #6B7280;
    font-size: 12px;
    margin-top: 3px;
}

.om-card-top-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

/* ── Status Badge ──────────────────────────────────────────────────── */
.om-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.om-status-badge--pending { background: rgba(245, 158, 11, 0.14); color: #F59E0B; }
.om-status-badge--confirmed { background: rgba(59, 130, 246, 0.14); color: #3B82F6; }
.om-status-badge--preparing { background: rgba(168, 85, 247, 0.14); color: #A855F7; }
.om-status-badge--ready { background: rgba(45, 212, 191, 0.14); color: #2DD4BF; }
.om-status-badge--out_for_delivery { background: rgba(14, 165, 233, 0.14); color: #0EA5E9; }
.om-status-badge--delivered { background: rgba(34, 197, 94, 0.14); color: #22C55E; }
.om-status-badge--cancelled { background: rgba(239, 68, 68, 0.14); color: #EF4444; }
.om-status-badge--rejected { background: rgba(239, 68, 68, 0.14); color: #EF4444; }

/* ── SLA Badge ────────────────────────────────────────────────────── */
.om-sla-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.om-sla-badge--on_time { background: rgba(34, 197, 94, 0.12); color: #22C55E; }
.om-sla-badge--warning { background: rgba(245, 158, 11, 0.12); color: #F59E0B; }
.om-sla-badge--breached { background: rgba(239, 68, 68, 0.16); color: #EF4444; }

/* ── Customer Info ────────────────────────────────────────────────── */
.om-card-customer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.om-customer-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(45, 212, 191, 0.10);
    color: #2DD4BF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.om-customer-info { flex: 1; min-width: 0; }

.om-customer-name {
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.om-customer-phone {
    color: #9CA3AF;
    font-size: 12px;
}

.om-type-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    flex-shrink: 0;
}
.om-type-pill--delivery { background: rgba(14, 165, 233, 0.12); color: #0EA5E9; }
.om-type-pill--pickup { background: rgba(168, 85, 247, 0.12); color: #A855F7; }

/* ── Items ────────────────────────────────────────────────────────── */
.om-card-items {
    background: #252927 !important;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
}

.om-items-head {
    display: flex;
    justify-content: space-between;
    color: #9CA3AF;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.om-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    color: #D1D5DB;
    font-size: 13px;
}

.om-item-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.om-item-qty { color: #6B7280; font-size: 12px; }

.om-prep-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
    transition: background 0.15s;
}
.om-prep-badge--pending { background: rgba(107, 114, 128, 0.14); color: #9CA3AF; }
.om-prep-badge--preparing { background: rgba(245, 158, 11, 0.14); color: #F59E0B; }
.om-prep-badge--ready { background: rgba(34, 197, 94, 0.14); color: #22C55E; }
.om-prep-badge:hover { filter: brightness(1.2); }

/* ── Card Meta ─────────────────────────────────────────────────────── */
.om-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.om-card-amount {
    color: #FFFFFF;
    font-size: 1.25rem;
    font-weight: 700;
}

.om-pay-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 8px;
    text-transform: capitalize;
}
.om-pay-badge--pending { background: rgba(245, 158, 11, 0.12); color: #F59E0B; }
.om-pay-badge--paid { background: rgba(34, 197, 94, 0.12); color: #22C55E; }
.om-pay-badge--refunded { background: rgba(239, 68, 68, 0.12); color: #EF4444; }

.om-card-instructions {
    color: #9CA3AF;
    font-size: 12px;
    background: #252927 !important;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    line-height: 1.45;
}
.om-card-instructions::before {
    content: "📝 ";
    margin-right: 4px;
}

/* ── Card Actions ──────────────────────────────────────────────────── */
.om-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.om-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.813rem;
    border-radius: 0.5rem;
    transition: all 0.15s;
    font-family: inherit;
}

.om-btn--primary {
    padding: 0.625rem 1rem;
    border: none;
    background: linear-gradient(135deg, #2DD4BF, #22C55E);
    color: #0F1412;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(45, 212, 191, 0.2);
}
.om-btn--primary:hover { box-shadow: 0 4px 16px rgba(45, 212, 191, 0.3); transform: translateY(-1px); }

.om-btn--confirm {
    flex: 1; padding: 10px;
    background: rgba(34, 197, 94, 0.12); color: #22C55E;
    border-radius: 12px; font-size: 13px; font-weight: 600;
}
.om-btn--confirm:hover { background: rgba(34, 197, 94, 0.22); }

.om-btn--reject {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.10); color: #EF4444;
    border-radius: 12px; font-size: 13px; font-weight: 600;
}
.om-btn--reject:hover { background: rgba(239, 68, 68, 0.20); }

.om-btn--advance {
    flex: 1; padding: 10px;
    background: rgba(45, 212, 191, 0.10); color: #2DD4BF;
    border-radius: 12px; font-size: 13px; font-weight: 600;
}
.om-btn--advance:hover { background: rgba(45, 212, 191, 0.20); }

.om-btn--status {
    padding: 10px 14px;
    background: #252927; color: #D1D5DB;
    border-radius: 12px; font-size: 13px; font-weight: 500;
}
.om-btn--status:hover { background: #2E2E2E; }

.om-btn--cancel {
    padding: 10px 14px;
    background: rgba(245, 158, 11, 0.10); color: #F59E0B;
    border-radius: 12px; font-size: 13px; font-weight: 600;
}
.om-btn--cancel:hover { background: rgba(245, 158, 11, 0.20); }

.om-btn--back {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #252927; border-radius: 10px;
    color: #D1D5DB; font-size: 0.875rem; font-weight: 600;
}
.om-btn--back:hover { background: #2E2E2E; }

.om-btn--ghost {
    padding: 10px 14px;
    background: transparent; color: #9CA3AF;
    border-radius: 12px; font-size: 13px; font-weight: 500;
}
.om-btn--ghost:hover { color: #D1D5DB; }

/* ── Empty State ───────────────────────────────────────────────────── */
.om-empty {
    text-align: center;
    padding: 4rem 1rem;
}

.om-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: #4B5563;
    display: block;
}

.om-empty-icon--large { font-size: 3rem; color: #6B7280; }

.om-empty-title {
    color: #fff;
    font-size: 1.063rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.om-empty-desc {
    color: #6B7280;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

/* ── Tables (All Orders / History / SLA) ──────────────────────────── */
.om-table-wrap {
    padding: 1.25rem;
    overflow-x: auto;
}

.om-table {
    width: 100%;
    border-collapse: collapse;
    background: #1A1D1C;
    border-radius: 14px;
    overflow: hidden;
    min-width: 820px;
}

.om-table thead th {
    background: #252927;
    color: #9CA3AF;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 14px 16px;
    text-align: left;
}

.om-table tbody td {
    padding: 14px 16px;
    color: #D1D5DB;
    font-size: 0.875rem;
    border-top: 1px solid #252927;
}

.om-table tbody tr { cursor: pointer; }
.om-table tbody tr:hover { background: rgba(45, 212, 191, 0.04); }

.om-table-amount { color: #2DD4BF; font-weight: 700; }
.om-table-id { color: #FFFFFF; font-weight: 600; }

.om-table-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

/* ── Detail View ──────────────────────────────────────────────────── */
.om-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid #2E2E2E;
    background: #0F1412;
    position: sticky;
    top: 0;
    z-index: 200;
}

.om-detail-identity { flex: 1; min-width: 0; }
.om-detail-title { color: #fff; font-size: 1.15rem; font-weight: 700; }
.om-detail-subtitle { color: #6B7280; font-size: 0.813rem; }

.om-detail-body { padding: 1.25rem; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

.om-detail-section {
    background: #1A1D1C;
    border-radius: 16px;
    padding: 20px;
}

.om-detail-section-title {
    color: #fff;
    font-size: 0.938rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.om-detail-section-title i { color: #2DD4BF; font-size: 0.875rem; }

.om-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #252927;
    font-size: 14px;
}
.om-detail-row:last-child { border-bottom: none; }
.om-detail-label { color: #9CA3AF; }
.om-detail-value { color: #fff; font-weight: 600; text-align: right; }

.om-detail-amount {
    color: #2DD4BF;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    margin: 4px 0 2px;
}
.om-detail-amount-label { color: #9CA3AF; font-size: 12px; }

/* Detail items table */
.om-detail-items-table {
    width: 100%;
    border-collapse: collapse;
}
.om-detail-items-table th {
    color: #6B7280;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 8px 10px;
    font-weight: 700;
    border-bottom: 1px solid #2E2E2E;
}
.om-detail-items-table td {
    padding: 10px;
    color: #D1D5DB;
    font-size: 13px;
    border-bottom: 1px solid #252927;
}

/* Timeline */
.om-timeline { position: relative; padding-left: 22px; }
.om-timeline::before {
    content: "";
    position: absolute;
    left: 6px; top: 4px; bottom: 4px;
    width: 2px;
    background: #2E2E2E;
}

.om-timeline-item {
    position: relative;
    padding-bottom: 18px;
}
.om-timeline-item:last-child { padding-bottom: 0; }

.om-timeline-dot {
    position: absolute;
    left: -22px; top: 3px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #2DD4BF;
}
.om-timeline-item--pending .om-timeline-dot { background: #6B7280; }

.om-timeline-status {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
}
.om-timeline-time { color: #6B7280; font-size: 12px; margin-top: 2px; }
.om-timeline-notes { color: #9CA3AF; font-size: 12px; margin-top: 3px; }

/* ── Overlay (cancel confirmation) ────────────────────────────────── */
.om-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.om-overlay-card {
    background: #1A1D1C;
    border-radius: 0.875rem;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.om-overlay-icon-wrap {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.25rem;
    color: #EF4444;
}

.om-overlay-title { color: #fff; font-size: 1.063rem; font-weight: 700; margin-bottom: 0.5rem; }
.om-overlay-desc { color: #9CA3AF; font-size: 0.875rem; margin-bottom: 1.5rem; line-height: 1.5; }
.om-overlay-actions { display: flex; gap: 0.75rem; }

.om-btn--cancel-overlay {
    flex: 1; padding: 0.75rem; border-radius: 0.625rem;
    background: #1A1D1C; color: #D1D5DB;
    font-weight: 600; font-size: 0.875rem; cursor: pointer; font-family: inherit;
}
.om-btn--cancel-overlay:hover { background: #252927; }

.om-btn--danger {
    flex: 1; padding: 0.75rem; border-radius: 0.625rem;
    border: none; background: #EF4444; color: #fff;
    font-weight: 700; font-size: 0.875rem; cursor: pointer; font-family: inherit;
}
.om-btn--danger:hover { background: #DC2626; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .om-stats { grid-template-columns: repeat(2, 1fr); }
    .om-detail-body { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .om-stats { grid-template-columns: 1fr; }
    .om-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .om-grid { grid-template-columns: 1fr; }
    .om-card-actions { flex-direction: column; }
    .om-card-actions .om-btn { width: 100%; }
    .om-filter-bar { flex-direction: column; align-items: stretch; }
    .om-filter-select { width: 100%; }
    .om-overlay-card { margin: 1rem; }
}