/*===========================================================================
  Easy Order Manager - Complete Admin Stylesheet v1.0.0
  ===========================================================================*/

/* ---- Layout & Typography ---- */
.eom-dashboard-wrap {
    margin: 10px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}
.eom-dashboard-wrap h1 {
    font-size: 23px;
    font-weight: 400;
    margin-bottom: 15px;
    padding: 9px 0 4px;
    line-height: 1.3;
    color: #1e293b;
}
.eom-version {
    font-size: 13px;
    color: #64748b;
    font-weight: 400;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 10px;
    vertical-align: middle;
}

/* ---- Status Summary Bar ---- */
.eom-status-summary {
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
}
.eom-status-pill {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
    transition: all 0.2s ease;
    user-select: none;
    border: 1px solid transparent;
    background: #f1f5f9;
    color: #475569;
}
.eom-status-pill:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.eom-status-pill.active {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}
.eom-status-pill .count {
    font-weight: 700;
    margin-left: 4px;
}

/* ---- Bulk Action Bar ---- */
.eom-bulk-action-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.eom-bulk-action-bar select {
    min-width: 200px;
}
.eom-bulk-count {
    margin-left: auto;
    font-size: 13px;
    color: #64748b;
}
.eom-bulk-count strong {
    color: #1e293b;
}

/* ---- Filter Bar ---- */
.eom-filter-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin: 10px 0;
}
.eom-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.eom-filter-item {
    display: flex;
    flex-direction: column;
    min-width: 140px;
}
.eom-filter-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 12px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.eom-filter-item input,
.eom-filter-item select {
    height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 13px;
    background: #fff;
    min-width: 130px;
}
.eom-filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding-bottom: 1px;
}

/* ---- DataTable Customization ---- */
.eom-table-container {
    margin-top: 15px;
    overflow-x: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0;
}
table.display {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}
table.dataTable.display tbody tr { background-color: #fff; }
table.dataTable.display tbody tr:nth-child(odd) { background-color: #fafbfc; }
table.dataTable.display tbody tr:hover { background-color: #eef2ff; }
table.dataTable thead th {
    background-color: #f1f5f9;
    border-bottom: 2px solid #cbd5e1;
    font-weight: 600;
    white-space: nowrap;
    padding: 12px 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #475569;
}
table.dataTable tbody td {
    padding: 10px;
    font-size: 13px;
    border-top: 1px solid #f1f5f9;
    vertical-align: middle;
}
table.dataTable tbody td.eom-col-actions {
    white-space: nowrap;
}

/* ---- DataTables length/processing overrides ---- */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-top: 8px !important;
}
.dataTables_wrapper .dataTables_info {
    padding-top: 12px !important;
    font-size: 13px;
    color: #64748b;
}
.dataTables_wrapper .dataTables_paginate {
    padding-top: 10px !important;
}

/* ---- Status Badges ---- */
.eom-status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.6;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-processing { background: #dbeafe; color: #1e40af; }
.status-on-hold { background: #fef3c7; color: #92400e; }
.status-completed { background: #dcfce7; color: #166534; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-refunded { background: #f3e8ff; color: #6b21a8; }
.status-failed { background: #fee2e2; color: #991b1b; }
.status-trash { background: #f1f5f9; color: #475569; }
.status-wc-eom-awaiting-shipment { background: #fff7ed; color: #9a3412; }
.status-wc-eom-return-requested { background: #fce7f3; color: #9d174d; }
.status-wc-eom-confirmed { background: #dbeafe; color: #1e40af; }
.status-wc-eom-courier-assigned { background: #f3e8ff; color: #6b21a8; }
.status-wc-eom-in-transit { background: #e0e7ff; color: #3730a3; }

/* ---- Action Buttons ---- */
.eom-action-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.eom-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    transition: all 0.15s ease;
    text-decoration: none;
}
.eom-action-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.eom-action-btn-primary { border-color: #2563eb; color: #2563eb; }
.eom-action-btn-primary:hover { background: #eff6ff; }
.eom-action-btn-danger { border-color: #dc2626; color: #dc2626; }
.eom-action-btn-danger:hover { background: #fef2f2; }
.eom-action-btn-success { border-color: #16a34a; color: #16a34a; }
.eom-action-btn-success:hover { background: #f0fdf4; }

/* ---- Inline Editor ---- */
.eom-inline-editor-wrap {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    max-height: 85vh;
    overflow-y: auto;
}
.eom-inline-editor-wrap h3 {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 16px;
    color: #1e293b;
}
.eom-inline-field {
    margin-bottom: 12px;
}
.eom-inline-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    margin-bottom: 4px;
}
.eom-inline-field input,
.eom-inline-field select,
.eom-inline-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
}
.eom-inline-field textarea { min-height: 60px; }

/* ---- Modal ---- */
.eom-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}
.eom-modal-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.eom-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: eomFadeIn 0.2s ease;
}
.eom-modal-content h3 {
    margin-top: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 17px;
    color: #1e293b;
}
.eom-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    margin-top: 16px;
}

/* ---- Summary Cards ---- */
.eom-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.eom-card h3 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.eom-card p {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}
.eom-card .trend { font-size: 13px; margin-top: 4px; }
.eom-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.eom-higher { color: #dc2626 !important; }
.eom-lower  { color: #16a34a !important; }

/* ---- Profit/Loss Page ---- */
.eom-profit-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.eom-profit-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}
.eom-profit-card .label {
    font-size: 13px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.eom-profit-card .value {
    font-size: 28px;
    font-weight: 700;
}
.eom-profit-card .value.positive { color: #16a34a; }
.eom-profit-card .value.negative { color: #dc2626; }

/* ---- Inventory Page ---- */
.eom-inv-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.eom-inv-table th {
    background: #f1f5f9;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #475569;
}
.eom-low-stock { background: #fef2f2 !important; }
.eom-low-stock td { color: #991b1b; }
.eom-out-of-stock { background: #fef2f2 !important; }
.eom-out-of-stock td { color: #dc2626; font-weight: 600; }

/* ---- Team Management ---- */
.eom-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.eom-team-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    transition: box-shadow 0.2s;
}
.eom-team-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.eom-team-card .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}
.eom-team-card h4 {
    margin: 0 0 4px;
    font-size: 15px;
    color: #1e293b;
}
.eom-team-card .role {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}
.eom-team-card .stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #64748b;
}
.eom-team-card .stats strong {
    color: #1e293b;
}

/* ---- Urgent Orders ---- */
.eom-urgent-filter {
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.eom-urgent-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* ---- Return Minimizer ---- */
.eom-return-cards {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}
.eom-return-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s;
}
.eom-return-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.eom-return-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}
.eom-return-card-header h3 { margin: 0; font-size: 15px; color: #1e293b; }
.eom-return-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.eom-customer-chip {
    background: #f1f5f9;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid #e2e8f0;
}
.eom-customer-chip:hover { background: #e2e8f0; }

/* ---- Activity Log ---- */
.eom-activity-log td { font-size: 12px; }
.eom-activity-log .action-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
}

/* ---- Delivery Charge Alert ---- */
.eom-charge-alert {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 0 6px 6px 0;
}
.eom-charge-ok {
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 0 6px 6px 0;
}

/* ---- Settings Page ---- */
.eom-settings-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 2px solid #e2e8f0;
    background: #fff;
    border-radius: 8px 8px 0 0;
    overflow-x: auto;
}
.eom-settings-tab {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    white-space: nowrap;
}
.eom-settings-tab:hover { color: #1e293b; background: #f8fafc; }
.eom-settings-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}
.eom-settings-panel { display: none; padding: 20px; background: #fff; border: 1px solid #e2e8f0; border-top: none; border-radius: 0 0 8px 8px; }
.eom-settings-panel.active { display: block; }

/* ---- Toast Notifications ---- */
.eom-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    animation: eomSlideIn 0.3s ease;
    max-width: 400px;
}
.eom-toast-success { background: #16a34a; color: #fff; }
.eom-toast-error { background: #dc2626; color: #fff; }
.eom-toast-info { background: #2563eb; color: #fff; }
.eom-toast-warning { background: #d97706; color: #fff; }

/* ---- Loading Spinner ---- */
.eom-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: eomSpin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes eomSpin {
    to { transform: rotate(360deg); }
}

/* ---- Animations ---- */
@keyframes eomFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes eomSlideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---- Print ---- */
@media print {
    body { font-family: Arial, sans-serif; font-size: 12px; margin: 0; padding: 0; }
    .invoice-page { page-break-after: always; padding: 20px; }
    #adminmenumain, #wpadminbar, .notice, .eom-bulk-action-bar, .eom-filter-bar, .eom-status-summary { display: none !important; }
    .eom-dashboard-wrap { margin: 0; }
    table.dataTable tbody td { border-color: #ddd; }
}

/* ---- Steadfast Import Section ---- */
.eom-import-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 15px 0;
    overflow: hidden;
}
.eom-import-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.eom-import-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}
.eom-import-body {
    padding: 16px;
}
.eom-import-body .description {
    margin: 0 0 8px;
    color: #475569;
    font-size: 13px;
}
.eom-import-steps {
    margin: 0 0 16px 20px;
    padding: 0;
    font-size: 13px;
    color: #64748b;
}
.eom-import-steps li {
    margin-bottom: 4px;
}
.eom-import-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px;
    background: #f1f5f9;
    border-radius: 6px;
}
.eom-import-form input[type="file"] {
    max-width: 300px;
    font-size: 13px;
}
.eom-import-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
}
#eom-import-results {
    margin-top: 12px;
    font-size: 13px;
}
.eom-import-results-success,
.eom-import-results-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 500;
}
.eom-import-results-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}
.eom-import-results-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.eom-import-result-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}
.eom-import-details {
    margin-top: 12px;
    font-size: 13px;
}
.eom-import-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #475569;
    padding: 8px 0;
}
.eom-import-details table {
    margin-top: 8px;
    font-size: 12px;
}
.eom-import-status-ok td:first-child {
    border-left: 3px solid #16a34a;
}
.eom-import-status-no td:first-child {
    border-left: 3px solid #dc2626;
}
.eom-import-status-skip td:first-child {
    border-left: 3px solid #f59e0b;
}

/* ---- Mobile ---- */
@media screen and (max-width: 782px) {
    .eom-action-buttons { flex-direction: column; }
    .eom-filter-row { flex-direction: column; }
    .eom-filter-item { width: 100%; min-width: auto; }
    .eom-summary-cards { grid-template-columns: 1fr 1fr; }
    .eom-inv-summary { grid-template-columns: 1fr 1fr; }
    .eom-team-grid { grid-template-columns: 1fr; }
    .eom-bulk-action-bar { flex-wrap: wrap; }
    .eom-bulk-action-bar select { min-width: 100%; }
    .eom-settings-tabs { overflow-x: auto; }
}

/* ==========================================================================
   EOM Customer Stats & Fraud Protection Styles
   ========================================================================== */
.eom-customer-stats-wrap {
    max-width: 1100px;
    margin: 20px 20px 0 0;
}
.eom-stats-search-bar input[type="text"]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}
.eom-profile-card {
    animation: eomFadeIn 0.3s ease;
}
.eom-compact-view {
    font-size: 13px;
}
.eom-compact-view h2 {
    font-size: 16px !important;
}
.eom-stats-empty-state {
    transition: all 0.2s ease;
}
.eom-stats-empty-state:hover {
    border-color: #94a3b8;
}
#eom-customer-stats-modal .eom-modal-dialog {
    background: #f8fafc;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
}
.eom-stats-btn {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #166534 !important;
    font-weight: 600;
}
.eom-stats-btn:hover {
    background: #dcfce7 !important;
    border-color: #4ade80 !important;
}

