/*
 * OrderWithMe Namibia — dashboard.css
 * Vendor, Driver & Customer Dashboard specific styles
 */

/* ============================================================
   DASHBOARD COMMON OVERRIDES
============================================================ */
body.owm-dashboard { background: var(--owm-bg); }
body.owm-dashboard .site-nav { display: none; }

/* ============================================================
   SIDEBAR RESPONSIVE COLLAPSE
============================================================ */
.sidebar-toggle {
  display: none; position: fixed; bottom: 20px; left: 20px; z-index: 800;
  width: 52px; height: 52px; background: var(--owm-primary);
  border-radius: 50%; border: none; color: white;
  font-size: 22px; cursor: pointer; box-shadow: var(--owm-shadow);
  align-items: center; justify-content: center;
}
@media (max-width: 1024px) {
  .sidebar-toggle { display: flex; }
  .dashboard__layout { grid-template-columns: 1fr !important; }
  .dashboard__sidebar {
    position: fixed !important; top: 0; left: -280px; height: 100vh !important;
    width: 270px; z-index: 900; transition: left .3s ease;
    box-shadow: var(--owm-shadow-lg);
  }
  .dashboard__sidebar.open { left: 0; }
  .dashboard__main { padding: 20px 16px; }
}

/* ============================================================
   DRIVER ONLINE INDICATOR PULSE
============================================================ */
.driver-online-pulse {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; background: var(--owm-green);
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 102, 51, .5); }
  50%       { box-shadow: 0 0 0 8px rgba(0, 102, 51, 0); }
}

/* ============================================================
   EARNINGS BREAKDOWN TABLE
============================================================ */
.earnings-breakdown {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.earnings-breakdown tr { border-bottom: 1px solid var(--owm-border); }
.earnings-breakdown tr:last-child { border-bottom: none; font-weight: 700; }
.earnings-breakdown td { padding: 10px 0; }
.earnings-breakdown td:last-child { text-align: right; font-weight: 600; }
.earnings-breakdown .subtotal td { color: var(--owm-text-secondary); }
.earnings-breakdown .total td { font-size: 18px; color: var(--owm-primary); border-top: 2px solid var(--owm-border); padding-top: 16px; }

/* ============================================================
   DELIVERY STATUS STEPPER
============================================================ */
.delivery-stepper {
  display: flex; align-items: center; gap: 0;
  padding: 20px 0; overflow-x: auto;
}
.delivery-stepper__step { flex: 1; text-align: center; position: relative; min-width: 80px; }
.delivery-stepper__step + .delivery-stepper__step::before {
  content: ''; position: absolute; top: 20px; right: 50%;
  width: 100%; height: 2px; background: var(--owm-border); z-index: 0;
}
.delivery-stepper__step.done + .delivery-stepper__step::before { background: var(--owm-green); }
.delivery-stepper__dot {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--owm-border); border: 3px solid var(--owm-white);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; margin: 0 auto 8px; position: relative; z-index: 1;
  transition: var(--owm-transition);
}
.delivery-stepper__step.done .delivery-stepper__dot { background: var(--owm-green); }
.delivery-stepper__step.active .delivery-stepper__dot { background: var(--owm-primary); animation: pulse 1.6s infinite; }
.delivery-stepper__label { font-size: 12px; font-weight: 600; color: var(--owm-text-muted); }
.delivery-stepper__step.done .delivery-stepper__label,
.delivery-stepper__step.active .delivery-stepper__label { color: var(--owm-text); }

/* ============================================================
   PRODUCT MANAGEMENT TABLE
============================================================ */
.product-table img { width: 48px; height: 48px; object-fit: cover; border-radius: var(--owm-radius-sm); }
.product-table .product-title { font-weight: 600; font-size: 14px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-indicator { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.stock-indicator::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock-in    { color: var(--owm-green); }
.stock-low   { color: #F59E0B; }
.stock-out   { color: var(--owm-red); }

/* ============================================================
   ANALYTICS CARDS
============================================================ */
.analytics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.analytics-card {
  background: var(--owm-white); border: 1px solid var(--owm-border);
  border-radius: var(--owm-radius-lg); padding: 20px;
  display: flex; align-items: center; gap: 16px;
}
.analytics-card__icon {
  width: 52px; height: 52px; border-radius: var(--owm-radius);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  flex-shrink: 0;
}
.analytics-card__label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--owm-text-muted); margin-bottom: 4px; }
.analytics-card__value { font-size: 24px; font-weight: 800; color: var(--owm-dark); font-family: var(--owm-font-heading); }
.analytics-card__trend { font-size: 12px; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.analytics-card__trend--up { color: var(--owm-green); }
.analytics-card__trend--down { color: var(--owm-red); }

/* ============================================================
   CHART WRAPPER
============================================================ */
.chart-wrapper { position: relative; }
.chart-loading {
  position: absolute; inset: 0; background: rgba(255,255,255,.8);
  display: flex; align-items: center; justify-content: center; border-radius: var(--owm-radius);
}
.chart-legend { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.chart-legend__item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--owm-text-secondary); }
.chart-legend__dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

/* ============================================================
   ORDER DETAIL MODAL
============================================================ */
.order-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 600px) { .order-detail-grid { grid-template-columns: 1fr; } }
.order-items-list .order-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--owm-border); }
.order-items-list .order-item:last-child { border-bottom: none; }
.order-items-list .order-item img { width: 52px; height: 52px; object-fit: cover; border-radius: var(--owm-radius-sm); }
.order-items-list .order-item .qty { background: var(--owm-dark); color: white; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; margin-left: auto; }

/* ============================================================
   DRIVER MAP CARD
============================================================ */
.driver-map-card {
  background: var(--owm-white); border: 1px solid var(--owm-border);
  border-radius: var(--owm-radius-lg); overflow: hidden; margin-bottom: 20px;
}
.driver-map-header { padding: 16px 20px; border-bottom: 1px solid var(--owm-border); display: flex; justify-content: space-between; align-items: center; }
.driver-map-body { height: 300px; background: #e8f0e8; position: relative; overflow: hidden; }
.driver-map-placeholder-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.driver-map-placeholder-inner .map-icon { font-size: 48px; opacity: .4; }
.driver-map-placeholder-inner p { font-size: 14px; color: var(--owm-text-muted); }

/* ============================================================
   VENDOR PLAN BADGE
============================================================ */
.plan-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.plan-freemium { background: var(--owm-bg);          color: var(--owm-text-secondary); border: 1.5px solid var(--owm-border); }
.plan-starter  { background: var(--owm-primary-fade); color: var(--owm-primary-dark);  border: 1.5px solid var(--owm-primary); }
.plan-growth   { background: var(--owm-green-light);  color: var(--owm-green-dark);    border: 1.5px solid var(--owm-green); }

/* ============================================================
   AVAILABILITY CALENDAR
============================================================ */
.availability-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.avail-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: var(--owm-radius-sm); font-size: 12px; font-weight: 600; cursor: pointer; transition: var(--owm-transition); }
.avail-day--header { font-size: 11px; color: var(--owm-text-muted); cursor: default; }
.avail-day--available { background: var(--owm-green-light); color: var(--owm-green); }
.avail-day--busy      { background: var(--owm-red-light);   color: var(--owm-red); }
.avail-day--today     { border: 2px solid var(--owm-primary); }
.avail-day:hover:not(.avail-day--header) { opacity: .8; transform: scale(1.05); }

/* ============================================================
   CUSTOMER DASHBOARD SPECIFIC
============================================================ */
.order-history-item {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: 16px; align-items: center; padding: 16px 20px;
  border-bottom: 1px solid var(--owm-border); transition: var(--owm-transition);
}
.order-history-item:hover { background: var(--owm-bg); }
.order-history-item:last-child { border-bottom: none; }
.order-history-item__img { width: 56px; height: 56px; border-radius: var(--owm-radius-sm); object-fit: cover; background: var(--owm-bg); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.order-history-item__title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.order-history-item__meta  { font-size: 12px; color: var(--owm-text-muted); }
.order-history-item__price { font-weight: 800; font-size: 16px; color: var(--owm-primary); white-space: nowrap; }

/* ============================================================
   PAYOUT METHOD SELECTOR
============================================================ */
.payout-method-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 2px solid var(--owm-border); border-radius: var(--owm-radius);
  cursor: pointer; transition: var(--owm-transition); margin-bottom: 10px;
}
.payout-method-card.selected { border-color: var(--owm-primary); background: var(--owm-primary-fade); }
.payout-method-card__icon { font-size: 28px; }
.payout-method-card__label { font-weight: 700; font-size: 14px; }
.payout-method-card__desc  { font-size: 12px; color: var(--owm-text-muted); }
.payout-method-card__check { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--owm-border); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.payout-method-card.selected .payout-method-card__check { background: var(--owm-primary); border-color: var(--owm-primary); color: white; }

/* ============================================================
   RESPONSIVE DASHBOARD TABLE
============================================================ */
@media (max-width: 768px) {
  .dash-table { display: block; overflow-x: auto; white-space: nowrap; }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .order-detail-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
  .delivery-stepper { padding: 12px 0; }
  .delivery-stepper__dot { width: 32px; height: 32px; font-size: 13px; }
  .delivery-stepper__label { font-size: 10px; }
}
