/* ============================================
   LAKSHERA ADMIN — BILLING PAGE
   ============================================ */

/* ---------- Toolbar (reuses .products-toolbar patterns) ---------- */
.bills-panel { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; }
.bills-table { width: 100%; border-collapse: collapse; }
.bills-table th {
  text-align: left; font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--ink-soft); padding: 14px 22px; font-weight: 600; background: var(--aubergine-pale); white-space: nowrap;
}
.bills-table td { padding: 14px 22px; font-size: 13.5px; border-top: 1px solid var(--border); color: var(--ink); vertical-align: middle; }
.bills-table tr:hover td { background: var(--aubergine-pale); }

.bill-id-cell b { color: var(--aubergine); }
.bill-customer-link { font-weight: 600; color: var(--aubergine); cursor: pointer; }
.bill-customer-link:hover { text-decoration: underline; color: var(--gold-dark); }
.bill-customer-link small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 11.5px; margin-top: 1px; text-decoration: none; }

/* ---------- Modal box variants ---------- */
.modal-box.wide { max-width: 620px; }

/* ---------- Print report modal ---------- */
.report-mode-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: var(--aubergine-pale); padding: 5px; border-radius: 12px; margin-bottom: 20px;
}
.report-mode-tab {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 8px; border-radius: 9px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-soft); background: transparent; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.report-mode-tab i { font-size: 12px; }
.report-mode-tab:hover { color: var(--aubergine); }
.report-mode-tab.active { background: var(--white); color: var(--aubergine); box-shadow: var(--shadow-sm); }

.report-mode-panel { display: none; margin-bottom: 18px; }
.report-mode-panel.active { display: block; }

.report-range-hint {
  font-size: 12.5px; color: var(--aubergine); font-weight: 600;
  background: var(--aubergine-pale); padding: 10px 14px; border-radius: 9px; margin-top: 4px;
}

.report-filters {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  padding-top: 16px; margin-top: 4px; border-top: 1px dashed var(--border);
}

.report-preview {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px;
}
.report-preview-stat {
  background: var(--aubergine-pale); border-radius: 10px; padding: 14px; text-align: center;
}
.report-preview-stat .rp-val {
  font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--aubergine);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.report-preview-stat .rp-lbl {
  font-size: 10.5px; color: var(--ink-soft); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.4px;
}
.report-preview-stat.empty .rp-val { color: var(--danger); }

@media (max-width: 640px) {
  .report-filters { grid-template-columns: 1fr; }
  .report-preview { grid-template-columns: 1fr; }
}

/* ---------- Line item builder (create bill) ---------- */
.item-builder-row { display: grid; grid-template-columns: 1fr 90px auto; gap: 10px; align-items: end; margin-bottom: 14px; }
.item-builder-row .field { margin-bottom: 0; }
.add-item-btn {
  height: 44px; width: 44px; border-radius: 10px;
  background: var(--aubergine); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.add-item-btn:hover { background: var(--aubergine-light); }

.line-items-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.line-items-table th {
  text-align: left; font-size: 10.5px; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--ink-soft); padding: 8px 10px; font-weight: 600; border-bottom: 1.5px solid var(--border);
}
.line-items-table td { padding: 9px 10px; font-size: 13px; border-bottom: 1px solid var(--border); }
.line-items-table .remove-item-btn { color: var(--danger); font-size: 13px; }
.line-items-table .remove-item-btn:hover { opacity: 0.7; }
.line-items-empty { text-align: center; padding: 20px 10px; color: var(--ink-soft); font-size: 12.5px; }

.bill-total-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--aubergine-pale); border-radius: 10px; margin-bottom: 4px;
}
.bill-total-row .lbl { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.bill-total-row .val { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--aubergine); }

/* ---------- View bill modal ---------- */
.bill-view-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px dashed var(--border); }
.bill-view-head .bv-id { font-family: var(--font-display); font-size: 22px; color: var(--aubergine); font-weight: 700; }
.bill-view-head .bv-date { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.bill-view-cust { margin-bottom: 18px; }
.bill-view-cust .lbl { font-size: 10.5px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; margin-bottom: 4px; }
.bill-view-cust .name { font-weight: 600; color: var(--ink); font-size: 14px; }
.bill-view-cust .phone { font-size: 12.5px; color: var(--ink-soft); }

.bill-view-items th { text-align: left; font-size: 10.5px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ink-soft); padding: 8px 4px; border-bottom: 1.5px solid var(--border); }
.bill-view-items td { padding: 10px 4px; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.bill-view-items { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.bill-view-items td.num, .bill-view-items th.num { text-align: right; }

/* ---------- Customer history modal ---------- */
.history-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.history-stat { background: var(--aubergine-pale); border-radius: 10px; padding: 14px; text-align: center; }
.history-stat .h-val { font-family: var(--font-display); font-size: 21px; font-weight: 700; color: var(--aubergine); }
.history-stat .h-lbl { font-size: 10.5px; color: var(--ink-soft); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.4px; }

.history-list { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; }
.history-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
}
.history-item .hi-id { font-weight: 700; color: var(--aubergine); font-size: 13px; }
.history-item .hi-date { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
.history-item .hi-amount { font-weight: 700; font-size: 14px; color: var(--ink); }

@media (max-width: 640px) {
  .item-builder-row { grid-template-columns: 1fr; }
  .history-summary { grid-template-columns: 1fr 1fr; }
  .bills-table th:nth-child(3), .bills-table td:nth-child(3) { display: none; }
}

/* ---------- Status pills (self-contained) ---------- */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap;
}
.status-pill.paid, .status-pill.delivered { background: var(--success-bg); color: var(--success); }
.status-pill.pending { background: var(--pending-bg); color: var(--pending); }
.status-pill.confirmed { background: rgba(43,0,59,0.08); color: var(--aubergine); }
.status-pill.processing { background: rgba(201,151,74,0.14); color: var(--gold-dark); }
.status-pill.packed { background: rgba(43,0,59,0.12); color: var(--aubergine); }
.status-pill.ready-to-dispatch { background: rgba(201,151,74,0.22); color: var(--gold-dark); }
.status-pill.dispatched { background: rgba(43,0,59,0.16); color: var(--aubergine); }
.status-pill.cancelled, .status-pill.inactive { background: var(--danger-bg); color: var(--danger); }


/* ---------- Order tracking stepper (view modal) ---------- */
.order-stepper { display: flex; align-items: flex-start; margin-bottom: 22px; padding: 4px 2px; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 0 0 auto; width: 15%; }
.step-item .step-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  background: var(--aubergine-pale); color: var(--ink-soft);
  transition: background 0.2s ease, color 0.2s ease;
}
.step-item.done .step-icon { background: var(--success); color: var(--white); }
.step-item.active .step-icon { background: var(--gold-dark); color: var(--white); box-shadow: 0 0 0 4px rgba(201,151,74,0.18); }
.step-item .step-label { font-size: 10px; font-weight: 600; color: var(--ink-soft); text-align: center; line-height: 1.3; }
.step-item.done .step-label, .step-item.active .step-label { color: var(--ink); }
.step-line { flex: 1 1 auto; height: 2px; background: var(--border); margin-top: 17px; min-width: 6px; }
.step-line.done { background: var(--success); }

.order-cancelled-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--danger-bg); color: var(--danger); font-weight: 600; font-size: 13.5px;
  padding: 12px 16px; border-radius: 10px; margin-bottom: 20px;
}

.bill-view-cust .addr { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; display: flex; gap: 7px; align-items: flex-start; }
.bill-view-cust .addr i { color: var(--gold-dark); margin-top: 2px; }

@media (max-width: 640px) {
  .bills-table th:nth-child(4), .bills-table td:nth-child(4) { display: none; }
}
/* ---------- Delivery details (read-only) ---------- */
.ship-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 16px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: 12px; }
.ship-info span { display: block; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.ship-info b { font-size: 13px; color: var(--ink); }
