/* Issues-PosDayClose-001: POS "Day Close" screen. Self-contained, like
   admin/day-close.html — a standalone manager-only page, not part of the
   main pos.css/shell.css cart chrome. Light theme, Figma "End of Day Close"
   reference (node-id=476-94). */

* { box-sizing: border-box; }

body.dc-body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
}

.dc-shell { min-height: 100vh; display: flex; flex-direction: column; }

.dc-topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}
.dc-brand { font-weight: 800; letter-spacing: 0.5px; font-size: 15px; }
.dc-topnav { display: flex; gap: 18px; flex: 1; }
.dc-topnav a { color: #64748b; text-decoration: none; font-size: 14px; font-weight: 600; padding: 6px 2px; }
.dc-topnav a.active { color: #0891b2; border-bottom: 2px solid #0891b2; }
.dc-top-right { display: flex; align-items: center; gap: 12px; }
.cashier-name { font-size: 13px; color: #475569; }
.dc-logout {
    background: transparent; border: 1px solid #cbd5e1; border-radius: 6px;
    padding: 6px 12px; font-size: 13px; cursor: pointer; color: #334155;
}

.dc-restricted { max-width: 480px; margin: 80px auto; text-align: center; padding: 24px; }

.dc-main { padding: 20px 28px 60px; max-width: 1400px; margin: 0 auto; width: 100%; }

.dc-title-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; }
.dc-title-row h1 { margin: 0; font-size: 24px; }
.dc-date { margin: 2px 0 0; color: #64748b; font-size: 13px; }

.dc-btn {
    border-radius: 8px; padding: 9px 16px; font-size: 13px; font-weight: 600;
    cursor: pointer; border: 1px solid transparent;
}
.dc-btn.primary { background: #0891b2; color: #fff; }
.dc-btn.secondary { background: #fff; border-color: #cbd5e1; color: #334155; }
.dc-btn.outline { background: #fff; border-color: #0891b2; color: #0891b2; width: 100%; margin-top: 14px; }
.dc-btn-row { display: flex; gap: 10px; }
.dc-btn-row .dc-btn.outline { width: auto; flex: 1; margin-top: 14px; }
.dc-link { display: block; margin-top: 10px; font-size: 13px; color: #0891b2; text-decoration: none; font-weight: 600; }
.dc-link:hover { text-decoration: underline; }
.dc-btn.tiny { padding: 4px 10px; font-size: 12px; background: #fff; border-color: #cbd5e1; }

.dc-grid-3 { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr; gap: 16px; margin-bottom: 16px; }
.dc-grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) {
    .dc-grid-3, .dc-grid-2 { grid-template-columns: 1fr; }
}

.dc-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 18px;
}
.dc-card h3 { margin: 0 0 12px; font-size: 15px; }
.dc-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dc-card-head h3 { margin: 0; }
.dc-badge {
    background: #dbeafe; color: #1d4ed8; font-weight: 700; font-size: 12px;
    border-radius: 999px; padding: 2px 9px;
}
.dc-subtle { color: #94a3b8; font-size: 12px; margin: -6px 0 12px; }

.dc-checklist { display: flex; flex-direction: column; gap: 10px; }
.dc-check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.dc-hint { font-size: 12px; color: #64748b; margin: 10px 0 0; }

.dc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dc-table th { text-align: left; color: #94a3b8; font-weight: 600; font-size: 11px; text-transform: uppercase; padding: 4px 6px; border-bottom: 1px solid #e2e8f0; }
.dc-table td { padding: 8px 6px; border-bottom: 1px solid #f1f5f9; }
.dc-empty { color: #94a3b8; font-size: 13px; padding: 10px 2px; }

.dc-status { padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.dc-status.ok { background: #dcfce7; color: #15803d; }
.dc-status.warn { background: #fef3c7; color: #92400e; }
.dc-status.late { background: #fee2e2; color: #b91c1c; }

.dc-metric-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.dc-metric-card {
    flex: 1 1 120px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 10px 12px; display: flex; flex-direction: column; gap: 4px;
}
.dc-metric-card.primary { background: #ecfdf5; border-color: #a7f3d0; }
.dc-metric-label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.4px; }
.dc-metric-value { font-size: 18px; font-weight: 700; color: #0f172a; }

.dc-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dc-two-col h4 { font-size: 11px; color: #94a3b8; text-transform: uppercase; margin: 0 0 8px; }
.dc-linelist { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.dc-line { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid #f1f5f9; }
.dc-line.neg span:last-child { color: #b91c1c; }
.dc-line.bold { font-weight: 700; border-top: 1px solid #e2e8f0; border-bottom: none; padding-top: 8px; margin-top: 4px; }
.dc-footnote { font-size: 12px; color: #0891b2; margin: 14px 0 0; }
/* POS-DAYCLOSE-REPORT-001: one-line Net Sales / Total Collected definition */
.dc-legend { font-size: 11px; color: #64748b; margin: 6px 0 0; font-style: italic; }
.dc-print-view .dc-legend { font-size: 10px; color: #444; margin: 4px 0 0; }
.dc-notice { font-size: 12px; margin: 8px 0 0; padding: 6px 10px; border-radius: 6px; }
.dc-notice.warn { background: #fef3c7; color: #92400e; }

.dc-label { display: block; font-size: 12px; color: #475569; margin: 14px 0 4px; }
.dc-input, textarea#dcNotes, input#dcClosingBank, input#dcAuditName {
    width: 100%; padding: 9px 11px; font-size: 14px; border: 1px solid #cbd5e1; border-radius: 6px;
}
/* Bug fix: #dcAuditName is read-only (closedBy always comes from the JWT,
   not this field) but looked identically editable — nothing communicated
   that typing here does nothing. */
.dc-input:read-only { background: #f1f5f9; color: #64748b; cursor: default; }
.dc-input-with-unit { display: flex; align-items: center; gap: 8px; }
.dc-input-with-unit input { flex: 1; font-size: 17px; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 6px; }
.dc-input-with-unit span { color: #64748b; font-size: 13px; }
.dc-charcount { text-align: right; font-size: 11px; color: #94a3b8; margin: 2px 0 0; }
.dc-error { color: #b91c1c; font-size: 13px; margin-top: 10px; }

.dc-bottom-bar {
    display: flex; justify-content: space-between; align-items: center;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 16px 20px; margin-bottom: 20px;
}
.dc-bottom-right { text-align: right; }
.dc-bottom-right .dc-hint { margin-top: 6px; }

.dc-history-card table { margin-top: 4px; }
.dc-history-actions { display: flex; gap: 6px; white-space: nowrap; }

/* ── Approver modal (bug fix — see day-close.html for why this exists) ── */

.dc-modal {
    position: fixed; inset: 0; background: rgba(15,23,42,0.5);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.dc-modal-content {
    background: #fff; border-radius: 10px; padding: 22px; width: 360px; max-width: 90vw;
}
.dc-modal-content h3 { margin: 0 0 6px; font-size: 16px; }
.dc-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ── Print ───────────────────────────────────────────────────────────── */

.dc-print-view { display: none; }
.dc-print-view h1 { font-size: 20px; margin-bottom: 4px; }
.dc-print-view h2 { font-size: 14px; margin: 16px 0 6px; border-bottom: 1px solid #000; }
.dc-print-view table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 6px; }
.dc-print-view td { padding: 3px 6px; border-bottom: 1px solid #ddd; }
.dc-print-view th { padding: 3px 6px; border-bottom: 1px solid #000; text-align: left; font-size: 11px; text-transform: uppercase; }

@media print {
    /* Bug fix: "body.dc-body *" has HIGHER specificity (0,1,1 — the "body"
       type selector counts) than ".dc-print-view *" (0,1,0), so the
       hide-everything rule was silently winning over the show-print-view
       rule regardless of source order — the printed page came out fully
       blank (but still sized/paginated, since visibility:hidden preserves
       layout). Dropping the "body" qualifier makes both rules (0,1,0), so
       the later declaration (show) wins as intended; !important removes
       any doubt. */
    .dc-body * { visibility: hidden !important; }
    .dc-print-view, .dc-print-view * { visibility: visible !important; }
    .dc-print-view {
        display: block; position: absolute; top: 0; left: 0; width: 100%;
        padding: 20px; color: #000; background: #fff;
    }
}
