/* ---------- Side drawer (shared by Orders and Customers) ---------- */
body.drawer-open { overflow: hidden; }
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer[hidden] { display: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); animation: drawerFade 0.2s ease; }
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 410px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  animation: drawerSlide 0.25s ease;
}
@keyframes drawerSlide { from { transform: translateX(100%); } to { transform: none; } }
@keyframes drawerFade { from { opacity: 0; } to { opacity: 1; } }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.drawer-head h2 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -0.2px; }
.drawer-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.drawer-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

.drawer-scroll { flex: 1; overflow-y: auto; }
.drawer-badges { display: flex; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer-badges .pill { height: 24px; }

.drawer-sec { padding: 20px; border-bottom: 1px solid var(--border); }
.drawer-sec h3 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.drawer-last { border-bottom: 0; }

.d-item { display: flex; align-items: center; gap: 12px; }
.d-item + .d-item { margin-top: 12px; }
.d-tile {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #F4F6F5;
  color: #1F1F1F;
}
.d-item-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.d-item-info strong { font-size: 15px; font-weight: 500; }
.d-item-info small { font-size: 13px; color: var(--muted); }
.d-item-price { font-size: 15px; font-weight: 600; }

.d-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.d-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 16px;
  font-weight: 600;
}
.d-total span:last-child { font-size: 18px; font-weight: 700; }

.d-cust { display: flex; align-items: center; gap: 10px; }
.d-cust img, .d-cust .ph {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: #EDEFEE;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #4A4A4A;
}
.d-cust strong { display: block; font-size: 15px; font-weight: 500; }
.d-cust small { display: block; margin-top: 1px; font-size: 13px; color: var(--muted); }
.d-addr { margin-top: 16px; }
.d-addr small { display: block; font-size: 12.5px; color: var(--muted); }
.d-addr span { display: block; margin-top: 4px; font-size: 15px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E5E5E7;
}
.timeline li.done::before { background: var(--primary); }
.timeline li:has(+ .done).done::after {
  content: "";
  position: absolute;
  left: 3.5px;
  top: 17px;
  bottom: 3px;
  width: 1px;
  background: var(--divider);
}
.timeline strong { display: block; font-size: 14.5px; font-weight: 500; }
.timeline small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.timeline li:not(.done) strong { color: var(--text-secondary); }

.drawer-foot { display: flex; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--border); }
.drawer-foot .btn { flex: 1; justify-content: center; }
.drawer-foot .btn:disabled { opacity: 0.45; cursor: default; }

@media print {
  body.drawer-open > *:not(.drawer) { display: none !important; }
  .drawer-backdrop, .drawer-foot, .drawer-close { display: none !important; }
  .drawer { position: static; }
  .drawer-panel { position: static; width: auto; box-shadow: none; animation: none; }
  .drawer-scroll { overflow: visible; }
}

/* Customer drawer extras */
.d-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.d-stat { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.d-stat small { display: block; font-size: 12.5px; color: var(--muted); }
.d-stat strong { display: block; margin-top: 4px; font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.d-contact { display: flex; align-items: center; gap: 12px; }
.d-contact + .d-contact { margin-top: 12px; }
.d-contact .d-tile { width: 36px; height: 36px; flex-shrink: 0; }
.d-contact div { min-width: 0; }
.d-contact small { display: block; font-size: 12.5px; color: var(--muted); }
.d-contact div span { display: block; margin-top: 1px; font-size: 15px; overflow-wrap: anywhere; }
.d-order { display: flex; align-items: center; gap: 12px; }
.d-order .d-item-info small { display: block; }
.d-head-cust { display: flex; align-items: center; gap: 12px; min-width: 0; }
.d-head-cust img, .d-head-cust .ph {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; object-fit: cover; background: #EDEFEE;
  display: grid; place-items: center; font-size: 15px; font-weight: 600; color: #4A4A4A;
}
.d-head-cust p { overflow-wrap: anywhere; }
a.btn { text-decoration: none; }
