.mimamenu-status-pill{display:inline-block;padding:2px 8px;border-radius:999px;font-size:12px;background:#eef2ff;color:#3730a3;text-transform:capitalize}
.mimamenu-status-pill.status-pending{background:#fff7ed;color:#9a3412}
.mimamenu-status-pill.status-accepted{background:#ecfdf5;color:#065f46}
.mimamenu-status-pill.status-preparing{background:#eff6ff;color:#1d4ed8}
.mimamenu-status-pill.status-ready{background:#f0fdf4;color:#166534}
.mimamenu-status-pill.status-out_for_delivery{background:#f5f3ff;color:#6d28d9}
.mimamenu-status-pill.status-completed{background:#e0f2fe;color:#075985}
.mimamenu-status-pill.status-rejected,.mimamenu-status-pill.status-cancelled{background:#fef2f2;color:#991b1b}

/* Order History table action alignment */
.em-order-actions{display:flex;flex-direction:column;gap:8px}
.em-order-actions-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.em-order-actions-row select.em-order-status{min-width:170px}
.em-order-actions-row .em-order-view{min-width:70px}
.em-order-actions-row .em-order-save{min-width:80px}

.em-order-modal{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,.55);z-index:99999;display:flex;align-items:center;justify-content:center;padding:24px}
.em-order-modal-card{background:#fff;width:min(920px,92vw);max-height:86vh;overflow:auto;border-radius:14px;padding:0;position:relative;border:1px solid #eef2f7;box-shadow:0 18px 40px rgba(0,0,0,.18)}
.em-order-modal-close{position:absolute;right:12px;top:12px;width:32px;height:32px;border-radius:10px;border:1px solid rgba(0,0,0,0.10);background:#fff;cursor:pointer;font-size:18px;line-height:28px}

/* Modal inner card spacing to match other pages */
#em-order-modal-body{padding:14px}

.mimamenu-adminbar-badge{display:inline-block;margin-left:6px;background:#d63638;color:#fff;border-radius:10px;padding:0 6px;font-size:11px;line-height:18px}

/* Snoonu/Talabat-style pending popup */
#em-pending-overlay{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:999999;display:none;align-items:center;justify-content:center;padding:24px}
#em-pending-card{background:#fff;width:min(720px,96vw);max-height:90vh;overflow:auto;border-radius:14px;padding:16px;box-shadow:0 10px 30px rgba(0,0,0,.25);position:relative}
#em-pending-card .em-popup-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
#em-pending-card .em-popup-title{font-size:18px;font-weight:700}
#em-pending-card .em-popup-sub{color:#6b7280;font-size:12px;margin-top:2px}
#em-pending-card .em-popup-close{border:none;background:transparent;font-size:22px;cursor:pointer;line-height:1}
#em-pending-card .em-popup-meta{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}
#em-pending-card .em-popup-meta .em-meta-box{background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;padding:10px}
#em-pending-card .em-popup-items{margin:0;padding:0;list-style:none;border:1px solid #e5e7eb;border-radius:10px;overflow:hidden}
#em-pending-card .em-popup-items li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-bottom:1px solid #eef2f7}
#em-pending-card .em-popup-items li:last-child{border-bottom:none}
#em-pending-card .em-popup-actions{display:flex;gap:10px;margin-top:14px;position:sticky;bottom:0;background:#fff;padding-top:12px}
#em-pending-card .em-btn{flex:1;border:none;border-radius:12px;padding:14px 12px;font-size:16px;font-weight:700;cursor:pointer}
#em-pending-card .em-btn-accept{background:#16a34a;color:#fff}
#em-pending-card .em-btn-reject{background:#dc2626;color:#fff}
#em-pending-card .em-btn:disabled{opacity:.55;cursor:not-allowed}

/* Live Orders (Snoonu/Talabat-inspired split view) */
.em-live-toolbar{display:flex;gap:8px;align-items:center}
.em-live-toolbar .button{height:34px;line-height:32px}
.em-live-app{margin-top:14px;display:none;gap:14px;align-items:stretch}
.em-live-app.is-open{display:flex}
.em-live-left{width:340px;min-width:300px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;display:flex;flex-direction:column}
.em-live-right{flex:1;background:#fff;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden}
.em-live-left .em-live-head{padding:12px;border-bottom:1px solid #eef2f7;display:flex;gap:10px;align-items:center;justify-content:space-between}
.em-live-left .em-live-head .em-live-title{font-weight:700}
.em-live-left .em-live-search{width:100%;padding:8px 10px;border:1px solid #e5e7eb;border-radius:10px}
.em-live-list{padding:0;margin:0;list-style:none;overflow:auto;max-height:70vh}
.em-live-list li{padding:10px 12px;border-bottom:1px solid #eef2f7;cursor:pointer}
.em-live-list li:hover{background:#f9fafb}
.em-live-list li.is-active{background:#eff6ff}
.em-live-list .em-li-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.em-live-list .em-li-id{font-weight:700}
.em-live-list .em-li-sub{color:#6b7280;font-size:12px;margin-top:2px}
.em-live-empty{padding:18px;color:#6b7280}
.em-live-detail{padding:14px}
.em-live-detail .em-detail-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.em-live-detail .em-detail-title{font-size:18px;font-weight:800}
.em-live-detail .em-detail-actions{display:flex;gap:8px}
.em-live-detail .em-detail-actions .button{min-width:110px}
.em-live-detail .em-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.em-live-detail .em-box{background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;padding:10px}
.em-live-detail .em-box .k{color:#6b7280;font-size:12px}
.em-live-detail .em-box .v{font-weight:700;margin-top:3px}
.em-live-detail .em-items{margin:0;padding:0;list-style:none;border:1px solid #e5e7eb;border-radius:10px;overflow:hidden}
.em-live-detail .em-items li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-bottom:1px solid #eef2f7}
.em-live-detail .em-items li:last-child{border-bottom:none}

/* ------------------------------
   Card-based admin layout (match other MimaMenu pages)
------------------------------ */
.mimamenu-page-wrap{max-width:1280px}
.mimamenu-page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:18px 0 14px}
.mimamenu-page-title{margin:0;font-size:22px;font-weight:700;line-height:1.25}
.mimamenu-subhint{color:#6b7280;font-size:12px;margin-top:6px}
.mimamenu-card{background:#fff;border:1px solid #eef2f7;border-radius:14px;padding:14px;box-shadow:0 1px 2px rgba(0,0,0,.02)}
.mimamenu-card+.mimamenu-card{margin-top:12px}
.mimamenu-card-title{margin:0 0 10px;font-size:14px;font-weight:700}
.mimamenu-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.mimamenu-toolbar select,.mimamenu-toolbar input[type="text"],.mimamenu-toolbar input[type="search"],.mimamenu-toolbar input[type="number"]{height:34px;border:1px solid #cbd5e1;border-radius:10px;padding:6px 10px;background:#fff}
.mimamenu-toolbar select:focus,.mimamenu-toolbar input:focus{outline:0;border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.15)}
.mimamenu-table-wrap .wp-list-table{border:1px solid rgba(0,0,0,0.08);border-radius:12px;overflow:hidden}

/* Buttons (match Items page) */
.em-btn{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border-radius:10px;border:1px solid transparent;cursor:pointer;text-decoration:none;font-weight:600}
.em-btn-green{background:#10b981;color:#fff}
.em-btn-primary{background:#3b82f6;color:#fff}
.em-btn-ghost{background:#fff;color:#334155;border-color:#e5e7eb}
.em-btn-sm{padding:5px 9px;border-radius:8px;border:1px solid #e5e7eb;text-decoration:none}
.em-blue{background:#e0f2fe;color:#0ea5e9;border-color:transparent}
.em-red{background:#fee2e2;color:#ef4444;border-color:transparent}
.em-btn[disabled],.em-btn:disabled{opacity:.55;cursor:not-allowed}

/* Inline status select in Orders table */
.em-order-status{height:30px;border:1px solid #cbd5e1;border-radius:10px;padding:4px 8px;background:#fff}
.em-order-status:focus{outline:0;border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.15)}

/* Make WP .button inside MimaMenu look consistent */
.mimamenu-page-wrap .button{border-radius:10px}

/* Live pill */
.mimamenu-live-pill{display:inline-flex;align-items:center;gap:8px;padding:7px 10px;border-radius:999px;border:1px solid rgba(0,0,0,0.08);background:#fff;font-weight:700}
.mimamenu-live-dot{width:10px;height:10px;border-radius:999px;background:#9ca3af}
.mimamenu-live-pill.is-on .mimamenu-live-dot{background:#16a34a}

/* Ordering helpers */
.em-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.em-muted{color:#6b7280;font-size:12px}
.em-field-inline{display:inline-flex;gap:8px;align-items:center}
.em-field-block{display:flex;gap:8px;align-items:center;margin:6px 0}
.em-section-title{font-weight:700}

/* Live Orders markup alignment (div items + new head class) */
.em-live-left .em-live-left-head{padding:12px;border-bottom:1px solid #eef2f7;display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.em-live-tabs{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.em-live-tab{border:1px solid #e5e7eb;background:#fff;border-radius:10px;padding:7px 10px;cursor:pointer;font-weight:700}
.em-live-tab.is-active{background:#eff6ff;border-color:#c7d2fe}
.em-live-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 6px;border-radius:999px;background:#111827;color:#fff;font-size:11px;margin-left:6px}
.em-live-search input{width:100%;min-width:200px;padding:8px 10px;border:1px solid #e5e7eb;border-radius:10px}
.em-live-list{overflow:auto;max-height:70vh}
.em-live-item{padding:10px 12px;border-bottom:1px solid #eef2f7;cursor:pointer}
.em-live-item:hover{background:#f9fafb}
.em-live-item.is-active{background:#eff6ff}
.em-live-item-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.em-live-item-sub{color:#6b7280;font-size:12px;margin-top:2px}
.em-live-item-total{font-weight:700;color:#111827}
.em-live-detail-meta{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:10px 0}

/* Pending popup markup alignment (no inline styles in JS) */
#em-pending-card .em-pending-close{position:absolute;right:10px;top:10px;width:32px;height:32px;border-radius:10px;border:1px solid rgba(0,0,0,0.10);background:#fff;cursor:pointer;font-size:18px;line-height:28px}
#em-pending-card .em-pending-top{margin-bottom:10px}
#em-pending-card .em-pending-title{font-size:18px;font-weight:800}
#em-pending-card .em-pending-sub{color:#6b7280;font-size:12px;margin-top:2px}
#em-pending-card .em-pending-customer{font-weight:700;margin:8px 0 10px}
#em-pending-card .em-pending-items-list{margin:0;padding:0;list-style:none;border:1px solid #e5e7eb;border-radius:10px;overflow:hidden}
#em-pending-card .em-pending-items-list li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-bottom:1px solid #eef2f7}
#em-pending-card .em-pending-items-list li:last-child{border-bottom:none}
#em-pending-card .em-pending-total{display:flex;justify-content:space-between;font-weight:900;margin-top:10px}
#em-pending-card .em-pending-actions{display:flex;gap:10px;margin-top:14px;position:sticky;bottom:0;background:#fff;padding-top:12px}
#em-pending-card .em-pending-actions .em-btn{flex:1;justify-content:center;padding:12px 12px;border-radius:12px;font-size:15px;font-weight:800}

/* Ordering page tables inside cards */
.mimamenu-card .wp-list-table{border:1px solid #eef2f7;border-radius:12px;overflow:hidden}
.mimamenu-card .wp-list-table th{background:#f8fafc}
.mimamenu-card .wp-list-table td input[type="text"],
.mimamenu-card .wp-list-table td input[type="number"],
.mimamenu-card .wp-list-table td select{width:100%;border:1px solid #cbd5e1;border-radius:10px;padding:8px 10px}
.mimamenu-card .wp-list-table td input:focus,
.mimamenu-card .wp-list-table td select:focus{outline:0;border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.15)}

/* Restaurant Status card (top-right) */
.ezm-admin .em-restaurant-status{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:10px 12px;
  border:1px solid rgba(0,0,0,.06);
  background:#fff;
  border-radius:12px;
  min-width:190px;
  box-shadow:0 1px 0 rgba(0,0,0,.02);
}

.ezm-admin .em-restaurant-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.ezm-admin .em-restaurant-label{
  font-size:12px;
  color:#6b7280;
  font-weight:600;
}

.ezm-admin .em-restaurant-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background:#94a3b8;
}

.ezm-admin .em-restaurant-status.is-open .em-restaurant-dot{
  background:#22c55e;
}

.ezm-admin .em-restaurant-bottom{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.ezm-admin .em-restaurant-text{
  font-size:13px;
  font-weight:700;
  color:#111827;
}

/* Ensure overlay is centered */
#em-pending-overlay{ align-items:center; justify-content:center; }
#em-pending-popup{ margin:0 auto; }

/* Order History actions alignment */
.em-order-actions{display:flex;flex-direction:column;gap:6px}
.em-order-actions-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.em-order-actions-row select.em-order-status{width:160px;max-width:160px;padding:6px 10px}
.em-order-actions-row .em-btn{white-space:nowrap}

/* Pre-order emphasis (mild, red, bold) */
.em-pending-preorder{
  margin-top:6px;
  color:#b91c1c;
  font-weight:700;
  font-size:13px;
}

.em-pending-preorder .em-preorder-time{
  color:#b91c1c;
  font-weight:700;
}

@keyframes em-preorder-pulse{
  0%,100%{opacity:1}
  50%{opacity:.6}
}

.em-preorder-badge{
  display:inline-flex;
  align-items:center;
  padding:3px 8px;
  border-radius:999px;
  background:#ffe3e3;
  color:#c92a2a;
  font-weight:700;
  font-size:12px;
  letter-spacing:.25px;
  animation: em-preorder-pulse 1.6s ease-in-out infinite;
}


/* Order History modal uses the same card system as Live Orders */
.em-order-modal-card{
  width:min(1120px, 96vw);
}

.em-order-history-modal-wrap{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.em-order-history-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  padding:4px 0 0;
}

#em-order-modal-body .em-live-detail-stack{
  padding:0;
}


/* Order History redesign */
.ezm-order-history-page .mimamenu-page-header{align-items:center}
.ezm-order-history-summary{display:flex;flex-direction:column;align-items:flex-end;gap:4px;background:#fff;border:1px solid #eef2f7;border-radius:14px;padding:12px 16px;min-width:140px}
.ezm-order-history-summary-label{font-size:12px;color:#6b7280;font-weight:600}
.ezm-order-filters-card{margin-bottom:12px}
.ezm-order-filters-form{display:flex;flex-direction:column;gap:14px}
.ezm-filter-row-top{display:grid;grid-template-columns:minmax(260px,340px) minmax(320px,1fr) auto;gap:14px;align-items:end}
.ezm-filter-date-wrap{position:relative}
.ezm-date-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;height:44px;padding:0 14px;border:1px solid #d7dee8;border-radius:12px;background:#22c55e;color:#fff;font-size:15px;font-weight:700;cursor:pointer;box-shadow:0 2px 6px rgba(34,197,94,.18)}
.ezm-date-trigger .dashicons{font-size:18px;line-height:18px;width:18px;height:18px}
.ezm-date-trigger-text{flex:1;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ezm-date-panel{position:absolute;top:54px;left:0;z-index:30;width:min(720px,92vw);padding:14px;background:#fff;border:1px solid #e5e7eb;border-radius:16px;box-shadow:0 20px 40px rgba(15,23,42,.12)}
.ezm-date-tabs{display:flex;gap:0;flex-wrap:wrap;background:#443f56;border-radius:10px;overflow:hidden}
.ezm-date-tab{appearance:none;border:0;background:transparent;color:#fff;padding:14px 18px;font-size:14px;cursor:pointer}
.ezm-date-tab.is-active{background:#2b2738;font-weight:700}
.ezm-date-fields{display:grid;grid-template-columns:1fr 1fr;gap:22px;padding:26px 4px 8px}
.ezm-date-field{display:flex;flex-direction:column;gap:10px}
.ezm-date-field label{font-size:14px;font-weight:600;color:#475569}
.ezm-date-field input[type="date"]{height:46px;border:1px solid #d7dee8;border-radius:10px;padding:0 12px;font-size:14px;background:#fff}
.ezm-date-actions{display:flex;justify-content:flex-end;gap:10px;padding-top:12px}
.ezm-filter-grid{display:grid;grid-template-columns:minmax(220px,260px) minmax(260px,1fr);gap:14px}
.ezm-filter-field{display:flex;flex-direction:column;gap:8px}
.ezm-filter-field label{font-size:13px;color:#475569;font-weight:700}
.ezm-select-wrap{position:relative}
.ezm-select-wrap select{-webkit-appearance:none;appearance:none;width:100%;height:44px;padding:0 40px 0 14px;border:1px solid #d7dee8;border-radius:12px;background:#fff;color:#0f172a;font-size:14px;font-weight:600}
.ezm-select-wrap .dashicons{position:absolute;right:12px;top:50%;transform:translateY(-50%);pointer-events:none;color:#64748b;width:18px;height:18px;font-size:18px}
.ezm-filter-field input[type="search"]{height:44px;border:1px solid #d7dee8;border-radius:12px;padding:0 14px;background:#fff}
.ezm-filter-actions{display:flex;gap:10px;align-items:center;justify-content:flex-end}
.ezm-select-wrap-inline{min-width:220px;max-width:220px}
.ezm-select-wrap-inline select.em-order-status{width:100%;max-width:none;min-width:0;height:36px;padding:0 36px 0 12px;border-radius:10px;font-size:14px;line-height:1.2}
.ezm-order-history-table-wrap .wp-list-table th{padding:14px 12px;background:#f8fafc;border-bottom:1px solid #e5e7eb;font-size:13px;font-weight:800;color:#334155}
.ezm-order-history-table-wrap .wp-list-table td{padding:12px;vertical-align:middle}
.ezm-empty-cell{text-align:center;color:#6b7280;padding:28px 16px !important}
.ezm-order-pagination{margin-top:16px}
.ezm-order-pagination .page-numbers{display:inline-flex;align-items:center;justify-content:center;min-width:36px;height:36px;padding:0 10px;border:1px solid #e5e7eb;border-radius:10px;margin-right:6px;background:#fff;color:#334155;text-decoration:none}
.ezm-order-pagination .page-numbers.current{background:#3b82f6;border-color:#3b82f6;color:#fff}
.em-order-actions-row{flex-wrap:nowrap}
.em-order-actions-row .em-btn{height:36px}
@media (max-width: 1200px){.ezm-filter-row-top{grid-template-columns:1fr}.ezm-filter-actions{justify-content:flex-start}.ezm-filter-grid{grid-template-columns:1fr 1fr}}
@media (max-width: 782px){.ezm-order-history-summary{align-items:flex-start}.ezm-date-panel{width:min(96vw,720px)}.ezm-date-fields,.ezm-filter-grid{grid-template-columns:1fr}.em-order-actions-row{flex-wrap:wrap}.ezm-select-wrap-inline{min-width:180px;max-width:100%}}
