/* Closed Orders — one line per finished order */
.closed-main { padding: 16px 20px 60px; max-width: 1100px; margin: 0 auto; }
.closed-main .empty { color: var(--muted); text-align: center; padding: 60px 20px; }
.closed-row {
  display: grid; grid-template-columns: auto 1.2fr 2fr auto auto auto auto; align-items: center; gap: 14px;
  background: #fff; border: 1px solid rgba(31,61,43,0.12); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 8px; box-shadow: 0 3px 10px rgba(31,61,43,0.05);
}
.cr-time { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.cr-name { font-weight: 700; color: var(--green-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-items { color: #46531f; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-cost { font-weight: 800; color: var(--green-700); white-space: nowrap; }
.cr-paid { font-size: 0.82rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.cr-paid.hp-cash { background: #d8ffe4; color: #1f6b3a; }
.cr-paid.hp-shopscan { background: #dbe9f7; color: #24557f; }
.cr-paid.hp-line { background: #d9f5df; color: #06843a; }
.cr-paid.hp-none { background: #eee; color: #888; }
.cr-print { border: none; background: #b8901f; color: #fff; font-weight: 700; border-radius: 10px; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.cr-print:hover { filter: brightness(1.06); }
.cr-arch { border: none; background: #7a8574; color: #fff; font-weight: 700; border-radius: 10px; padding: 8px 12px; cursor: pointer; white-space: nowrap; }
.cr-arch:hover { filter: brightness(1.08); }
.closed-archivebar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.closed-archiveall { border: none; background: #7a8574; color: #fff; font-weight: 700; border-radius: 10px; padding: 9px 16px; cursor: pointer; }
.closed-archiveall:hover { filter: brightness(1.08); }
.closed-row { cursor: pointer; transition: box-shadow 0.15s ease, transform 0.05s ease; }
.closed-row:hover { box-shadow: 0 6px 18px rgba(31,61,43,0.14); }

/* Closed-order detail popup */
.op-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(20,30,22,0.55); display: grid; place-items: center; padding: 20px; }
.op-card { background: #fff; border-radius: 16px; width: min(440px, 94vw); max-height: 90vh; overflow: auto; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0,0,0,0.35); }
.op-head { display: flex; align-items: center; justify-content: space-between; }
.op-ref { font-weight: 800; font-size: 1.3rem; color: var(--green-900); }
.op-close { border: none; background: #eef2ec; width: 34px; height: 34px; border-radius: 50%; font-size: 1rem; cursor: pointer; color: #444; }
.op-meta { color: var(--muted); font-size: 0.9rem; margin: 4px 0 10px; }
.op-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.op-badge { font-size: 0.75rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.op-badge.pickup { background: #dbe9f7; color: #24557f; }
.op-badge.delivery { background: #efdcf7; color: #6a3a7a; }
.op-badge.instore { background: #e2f0d9; color: #3a6a1f; }
.op-badge.paid { background: #d8ffe4; color: #1f6b3a; }
.op-badge.buzzer { background: #ffe4bd; color: #7a4a12; }
.op-cust { font-weight: 700; color: var(--green-900); font-size: 1.05rem; margin-top: 2px; }
.op-phone { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
.op-line-id { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.op-av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #e2ece5; }
.op-av.ph { display: grid; place-items: center; }
.op-line-tag { font-size: 0.65rem; font-weight: 800; color: #fff; background: #06c755; padding: 2px 7px; border-radius: 999px; }
.op-line-nm { font-weight: 600; color: var(--green-900); }
.op-when { color: var(--muted); font-size: 0.88rem; margin: 4px 0; }
.op-note { background: #fff8e6; border-radius: 8px; padding: 6px 10px; font-size: 0.9rem; margin: 8px 0; }
.op-items { border-top: 1px solid rgba(31,61,43,0.1); }
.op-line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(31,61,43,0.08); }
.op-info { min-width: 0; }
.op-name { font-weight: 600; color: var(--green-900); }
.op-detail { display: block; font-size: 0.83rem; color: var(--muted); margin-top: 2px; }
.op-price { font-weight: 600; white-space: nowrap; }
.op-row { display: flex; justify-content: space-between; padding: 8px 0; }
.op-total { font-size: 1.15rem; font-weight: 800; color: var(--green-900); border-top: 2px solid rgba(31,61,43,0.15); margin-top: 4px; }
.op-receipt { margin-top: 16px; width: 100%; border: none; background: #b8901f; color: #fff; font-weight: 700; border-radius: 12px; padding: 13px; cursor: pointer; font-size: 1rem; }
.op-receipt:hover { filter: brightness(1.06); }

@media (max-width: 720px) {
  .closed-row { grid-template-columns: 1fr auto; grid-auto-rows: min-content; gap: 4px 12px; }
  .cr-time { grid-column: 1 / -1; }
  .cr-items { grid-column: 1 / -1; white-space: normal; }
  .cr-print { grid-column: 2; grid-row: 3; }
}
