/* POS's Cash drawer (#3779): float, petty cash and IOUs, the count at close.
   Shown in the dashboard's modal (components/cash-drawer.js). */

.cash-drawer { display: flex; flex-direction: column; gap: 0.75rem; }
/* Not upper case: "IOUs out" would read "IOUS OUT". */
.cash-drawer .section-label {
    font-size: 0.85rem; font-weight: 700; color: var(--text-muted); margin-top: 0.25rem;
}
/* The modal sits outside #page-till-order, so POS's own .link-btn rule
   doesn't reach it. Tall enough to tap. */
.cash-drawer .link-btn {
    background: none; border: none; color: var(--accent); font: inherit; font-weight: 600;
    cursor: pointer; padding: 0.5rem 0.25rem; min-height: 44px;
}
.cash-drawer small { color: var(--text-muted); font-size: 0.8rem; }
.cash-drawer input[type="number"], .cash-drawer input[type="text"] {
    min-height: 44px; padding: 0.4rem 0.6rem; font-size: 1rem;
    border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg-input, var(--bg-card, transparent)); color: inherit;
}
.cash-drawer input[type="number"] { width: 8rem; }

.drawer-row, .drawer-line {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.drawer-row { justify-content: space-between; }
.drawer-ask { display: flex; flex-direction: column; gap: 0.35rem; }
.drawer-ask label { font-weight: 600; }
.drawer-inline.hidden { display: none; }

.drawer-sum { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.drawer-sum td { padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.drawer-sum td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.drawer-sum .drawer-total td { font-weight: 700; font-size: 1.1rem; border-bottom: 0; padding-top: 0.5rem; }

/* The day's cash and card payments, behind the two figures (#4463). */
.drawer-pays-box summary { cursor: pointer; padding: 0.3rem 0; font-weight: 600; }
.drawer-pays { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.drawer-pays td { padding: 0.25rem 0.5rem 0.25rem 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.drawer-pays td:nth-child(2) { overflow-wrap: anywhere; }
.drawer-pays td.num { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Past cash-ups, and a past day on the sheet (#4465). */
.drawer-days td { vertical-align: middle; }
.drawer-days td:first-child { white-space: nowrap; }
.drawer-day-on td { font-weight: 700; }
.drawer-past {
    padding: 0.25rem 0.75rem; border-radius: 8px; border-left: 4px solid var(--warning);
    background: rgba(161, 98, 7, 0.08); font-weight: 600;
}
.drawer-result .drawer-moved { color: var(--danger); font-weight: 600; }

.drawer-list { list-style: none; margin: 0; padding: 0; }
.drawer-list li {
    display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
    padding: 0.45rem 0; border-bottom: 1px solid var(--border);
}
.drawer-list li > span:first-child { min-width: 0; overflow-wrap: anywhere; }

.drawer-form { display: flex; flex-direction: column; gap: 0.5rem; }
.drawer-form input[type="number"] { width: 100%; }

.drawer-count { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; }
.drawer-count label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; color: var(--text-muted); }
.drawer-count input[type="text"] { flex: 1 1 12rem; }

/* The card machine's end-of-day total, checked at cash-up (#4561). */
.drawer-card-check { display: flex; flex-direction: column; gap: 0.35rem; flex: 1 1 100%; min-width: 0; }
.drawer-card-label { font-size: 0.85rem; color: var(--text-muted); }
.drawer-card-check p { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.drawer-card-check p:empty { display: none; }
.drawer-card-live, .drawer-card-saved { font-weight: 700; }
.drawer-card-saved { display: block; }
.drawer-card-over, .drawer-card-warn { color: var(--warning); }
.drawer-card-short { color: var(--danger); }
.drawer-card-ok { color: var(--success); }
.drawer-card-unchecked { color: var(--text-muted); }

.drawer-result {
    display: flex; flex-direction: column; gap: 0.2rem;
    padding: 0.6rem 0.75rem; border-radius: 8px; border-left: 4px solid var(--border);
}
.drawer-result b { font-size: 1.15rem; }
.drawer-ok    { border-left-color: var(--success); background: rgba(22, 163, 74, 0.08); }
.drawer-unchecked { border-left-color: var(--text-muted); background: rgba(100, 116, 139, 0.10); }
.drawer-over  { border-left-color: var(--warning); background: rgba(161, 98, 7, 0.08); }
.drawer-short { border-left-color: var(--danger);  background: rgba(198, 40, 40, 0.08); }

.drawer-note { color: var(--text-muted); margin: 0; }
.drawer-error { color: var(--danger); margin: 0; }
.drawer-error:empty { display: none; }

@media (max-width: 480px) {
    .drawer-count label, .drawer-count button { flex: 1 1 100%; }
    .cash-drawer input[type="number"] { width: 100%; }
}
