/* Drawer Ledger production stylesheet (Phase 7B-1 shell foundation).
   Visual language adapted from the approved Interactive Guide prototype;
   production-only subset, no prototype sample styling. */

:root {
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --attention: #b45309;
  --danger: #b91c1c;
  --radius: 6px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06);
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body.app {
  margin: 0;
  font-family: var(--font-stack);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-main);
  background: var(--bg-app);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--accent-dark);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* Header and navigation */
.app-header {
  background: #0f172a;
  color: #f8fafc;
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 56px;
}
.brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
}
.primary-nav { flex: 1; }
.nav-list {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}
.nav-link {
  color: #cbd5e1;
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  font-weight: 500;
}
.nav-link:hover, .nav-link:focus { color: #fff; background: #1e293b; }
.nav-link.is-active {
  color: #fff;
  background: var(--accent-dark);
}
/* Account menu: click/tap-activated disclosure, not a hover menu. */
.account-menu {
  position: relative;
}
.account-trigger {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
}
.account-trigger:hover,
.account-trigger:focus-visible,
.account-trigger[aria-expanded="true"] {
  color: #fff;
  background: #1e293b;
}
.account-trigger:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.account-caret { font-size: 0.7rem; line-height: 1; }
.account-menu-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 11rem;
  max-width: calc(100vw - 1.5rem);
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  z-index: 50;
}
.account-menu-panel[hidden] {
  display: none;
}
.account-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  color: var(--text-main);
  text-decoration: none;
  padding: 0.55rem 0.7rem;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
}
.account-menu-item:hover,
.account-menu-item:focus-visible {
  background: var(--bg-app);
}
.account-menu-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.account-menu-item-button { margin: 0; }
.logout-form { margin: 0; }
@media (max-width: 480px) {
  .account-menu-panel { right: -0.5rem; }
}
.btn-link {
  background: none;
  border: none;
  color: #cbd5e1;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.btn-link:hover, .btn-link:focus { color: #fff; }

/* Content */
.main-content {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  outline: none;
}
.page-header { margin-bottom: 1.25rem; }
.page-title { font-size: 1.45rem; margin: 0 0 0.25rem; }
.page-subtitle { color: var(--text-muted); max-width: 60ch; margin: 0; }
.section-heading { font-size: 1.05rem; margin: 1rem 0 0.5rem; }

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.card-title {
  font-size: 1.05rem;
  margin: 0;
  padding: 0.9rem 1.25rem 0;
}
.card-body { padding: 0.9rem 1.25rem 1.25rem; }
.card-body:last-child { padding-bottom: 1.25rem; }
.empty-state { padding: 1.25rem; color: var(--text-muted); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  background: #e2e8f0;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-attention { background: #fef3c7; color: var(--attention); }

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table thead th { font-size: 0.85rem; color: var(--text-muted); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody th[scope="row"] { font-weight: 600; width: 45%; }

/* Financial truth states */
.truth { display: inline-block; }
.truth-known { font-weight: 700; font-variant-numeric: tabular-nums; }
.truth-unavailable { color: var(--danger); font-style: italic; }
.truth-not-calculable { color: var(--attention); font-style: italic; }
.truth-absent { color: var(--text-muted); font-style: italic; }
.truth-not-yet-entered { color: var(--attention); font-style: italic; }

.truth-legend { display: grid; grid-template-columns: 180px 1fr; gap: 0.5rem 1rem; }
.truth-legend dd { margin: 0; color: var(--text-muted); }

/* Forms */
.field-label {
  display: block;
  font-weight: 600;
  margin: 0.9rem 0 0.25rem;
}
input[type="text"], input[type="password"], input[type="date"] {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 16rem;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  margin-top: 1rem;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-block { width: 100%; text-align: center; }
.inline-form { display: flex; align-items: flex-end; gap: 0.75rem; flex-wrap: wrap; }
.inline-form .btn { margin-top: 1.6rem; }
.form-error {
  background: #fee2e2;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  margin: 0.9rem 0;
}

/* Django messages */
.message-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.message {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  margin-bottom: 0.5rem;
}
.message-error { border-color: var(--danger); color: var(--danger); background: #fee2e2; }

.auth-panel {
  max-width: 24rem;
  margin: 3rem auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.plain-list { margin: 0 0 0.75rem 1.15rem; padding: 0; }
.plain-list li { margin: 0.3rem 0; }
.fine-print { color: var(--text-muted); font-size: 0.85rem; }
.worksheet-identity { margin: 0.4rem 0 0.8rem; }

.app-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: center;
}

@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; padding: 0.5rem 1rem; }
  .truth-legend { grid-template-columns: 1fr; }
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }

/* Shared money input (worksheet and correction forms). */
.money-input {
  font-size: 1.05rem;
  padding: 0.4rem 0.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  max-width: 9.5rem;
}
.money-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Status words never rely on color alone: text is always present. */
.status-chip {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
}
.status-complete { border-color: #86efac; background: #f0fdf4; color: #166534; }
.status-attention { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.status-pending { color: var(--text-muted); }
.status-unavailable { border-color: #fca5a5; background: #fef2f2; color: var(--danger); }
/* Closing-day variance pills in Deposits: text always states the exact
   amount; colors are supplementary (green = balanced, blue = over,
   red = short). */
.status-over { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.status-short { border-color: #fca5a5; background: #fef2f2; color: var(--danger); }

/* ===== Closing Worksheet =====
   A financial worksheet, not a stack of Bootstrap-style forms: tight
   ledger rows, right-aligned tabular money, and a visually dominant
   Daily Totals panel. */

.main-content--worksheet { max-width: 1440px; }

.worksheet-date-form { margin-bottom: 1.25rem; }
.btn-small { padding: 0.35rem 0.7rem; font-size: 0.85rem; margin-top: 0; }
.btn-link-danger { color: var(--danger); }
.btn-link-danger:hover, .btn-link-danger:focus-visible { color: #7f1d1d; }

/* Edit Closing Day: the Draft-Deposit-gated correction banner on an
   otherwise completed, normally read-only business day. */
.worksheet-correction-banner { border: 2px solid var(--accent-dark); background: #eff6ff; }

/* Desktop / laptop: three full-width columns, Drawer 1 | Drawer 2 | Totals. */
.worksheet-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(300px, 0.9fr);
  gap: 1.25rem;
  align-items: start;
}

.worksheet-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem 1.25rem;
}
.worksheet-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.drawer-status-badge { font-size: 0.72rem; }

/* Field-level validation (front-end only; no calculation/model change).
   Neutral until the operator interacts with a field, then red/green
   based on whether a required value is present. */
.ledger-row--input .money-input,
.ledger-row--input input[type="number"],
.worksheet-checks-add input {
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.field-invalid {
  border-color: var(--danger) !important;
  background: #fef2f2 !important;
}
.field-valid {
  border-color: #16a34a !important;
}
.field-error-text {
  color: var(--danger);
  font-size: 0.78rem;
  margin: 0.15rem 0 0.4rem;
  text-align: right;
}

/* Ledger rows: label left, tabular figure right, shared height/border so
   equivalent rows in Drawer #1 and Drawer #2 line up horizontally. */
.ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.35rem;
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--border);
}
.ledger-row:last-child { border-bottom: none; }
.ledger-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.ledger-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.ledger-row--fixed .ledger-value { color: var(--text-muted); font-weight: 600; }
.ledger-row--calc { background: #f8fafc; margin: 0 -1.15rem; padding: 0.3rem 1.15rem; border-bottom: 1px solid var(--border); }
.ledger-row--calc .ledger-label { color: var(--text-main); }
.ledger-row--emphasis .ledger-value { font-size: 1.05rem; }
.ledger-row--input .money-input,
.ledger-row--input input[type="number"] {
  width: 9.5rem;
  max-width: 100%;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding: 0.35rem 0.5rem;
}
/* Let an inline error message wrap onto its own line under the label
   and input, rather than squeezing into the same flex row. */
.ledger-row--input { flex-wrap: wrap; }
.ledger-row--input .field-error-text,
.worksheet-checks-add .field-error-text { flex: 1 0 100%; }

/* Checks: integrated into the drawer, not a separate top section.
   Collapsed by default via the native <details>/<summary> element - no
   JavaScript required to expand/collapse, and it degrades gracefully. */
.worksheet-checks {
  margin: 0.4rem 0 0.6rem;
  padding: 0.5rem 0.75rem;
  background: #fafaf9;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.worksheet-checks[open] { padding-bottom: 0.6rem; }
.worksheet-checks-summary {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  cursor: pointer;
  list-style: none;
  padding: 0.1rem 0;
}
.worksheet-checks-summary::-webkit-details-marker { display: none; }
.worksheet-checks-summary::before {
  content: '\25B6';
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-right: 0.4rem;
  transition: transform 0.15s ease;
  display: inline-block;
}
.worksheet-checks[open] .worksheet-checks-summary::before {
  content: '\25BC';
}
.worksheet-checks-summary .ledger-label { flex: 1; }
.worksheet-checks-body { margin-top: 0.5rem; }
.worksheet-checks-list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  max-height: 6.5rem;
  overflow-y: auto;
}
.worksheet-checks-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.85rem;
  border-bottom: 1px dashed var(--border);
}
.worksheet-checks-list li:last-child { border-bottom: none; }
.check-number { color: var(--text-muted); flex: 1; }
.check-amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.worksheet-checks-add {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.worksheet-checks-add input[type="text"] { width: 6rem; padding: 0.35rem 0.5rem; }
.worksheet-checks-add input[type="number"] { width: 6.5rem; padding: 0.35rem 0.5rem; text-align: right; }

/* Daily Totals: the primary decision panel - visually dominant. */
.worksheet-totals {
  background: #0f172a;
  color: #f1f5f9;
  border: 1px solid #0f172a;
  position: sticky;
  top: 1rem;
}
.worksheet-totals .worksheet-card-title { border-bottom-color: rgba(255, 255, 255, 0.18); color: #fff; }
.worksheet-totals .ledger-label { color: #cbd5e1; }
.worksheet-totals .ledger-value { color: #f8fafc; }
.worksheet-totals .ledger-row { border-bottom-color: rgba(255, 255, 255, 0.12); }
.worksheet-total-deposit {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0.75rem -1.15rem;
  padding: 0.85rem 1.15rem;
  background: rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.worksheet-total-deposit-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: #94a3b8; font-weight: 700; }
.worksheet-total-deposit-value { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; }
.worksheet-status-banner {
  display: block;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.55rem;
  margin: 0.85rem 0 0.25rem;
  border-radius: 6px;
}
.worksheet-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.85rem; }
.worksheet-actions .btn { margin-top: 0; }

.worksheet-sticky-footer { display: none; }

/* Tablet: Drawer #1 | Drawer #2 on top, Daily Totals full width below -
   an intentional layout, not desktop squeezed smaller. */
@media (max-width: 1100px) {
  .worksheet-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "drawer1 drawer2" "totals totals";
  }
  .worksheet-grid .worksheet-drawer:nth-of-type(1) { grid-area: drawer1; }
  .worksheet-grid .worksheet-drawer:nth-of-type(2) { grid-area: drawer2; }
  .worksheet-grid .worksheet-totals { grid-area: totals; position: static; }
}

/* Phone: Drawer #1, Drawer #2, Daily Totals stacked, plus a sticky
   footer dock so the deposit total, balance state, and finishing action
   stay reachable while scrolling through either drawer. */
@media (max-width: 720px) {
  .worksheet-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "drawer1" "drawer2" "totals"; }
  .worksheet-card { padding: 0.85rem 0.9rem 1rem; }
  .ledger-row--calc { margin: 0 -0.9rem; padding: 0.3rem 0.9rem; }
  .worksheet-total-deposit { margin: 0.75rem -0.9rem; padding: 0.75rem 0.9rem; }
  .worksheet-sheet { padding-bottom: 5.5rem; }

  .worksheet-sticky-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 20;
    background: #0f172a;
    color: #fff;
    padding: 0.6rem 0.9rem;
    box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.25);
  }
  .worksheet-sticky-info { display: flex; flex-direction: column; line-height: 1.15; }
  .worksheet-sticky-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; }
  .worksheet-sticky-value { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
  .worksheet-sticky-footer .worksheet-status-banner { margin: 0; flex: 1; }
  .worksheet-sticky-footer .btn { margin-top: 0; white-space: nowrap; }
}

/* ===== Deposits =====
   Available Closing Days selection, the Deposit Details workspace, and
   the Bank Deposit Slip evidence card. Reuses the worksheet's ledger-row/
   status-chip/dark-totals language so Deposits feels like the same
   application, not a bolted-on feature. */

.main-content--deposits { max-width: 1440px; }

.ledger-value--emphasis { font-size: 1.1rem; }

/* Available Closing Days */
.deposits-select-all {
  display: flex; align-items: center; gap: 0.5rem; font-weight: 600;
  margin-bottom: 0.75rem;
}
.deposits-day-list { display: flex; flex-direction: column; gap: 0.75rem; }
.deposits-day-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.75rem 1rem; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: 0.75rem;
}
.deposits-day-checkbox {
  display: flex; align-items: center; gap: 0.6rem; font-weight: 700;
  min-height: 2.75rem;
}
.deposits-day-checkbox input[type="checkbox"] { width: 1.25rem; height: 1.25rem; }
.deposits-day-figures {
  display: grid; grid-template-columns: repeat(3, auto) auto; gap: 0.35rem 1.25rem;
  align-items: center; font-size: 0.85rem;
}
.deposits-day-figures .ledger-value { font-size: 0.95rem; }
.deposits-selection-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem;
  margin-top: 1rem; padding: 0.85rem 1rem; background: #0f172a; color: #f8fafc;
  border-radius: var(--radius);
}
.deposits-selection-summary .ledger-label { color: #cbd5e1; }
.deposits-selection-summary .ledger-value { color: #fff; }
.deposits-selection-summary .btn { margin-top: 0; margin-left: auto; }
.deposits-selection-summary .btn:disabled { opacity: 0.5; cursor: not-allowed; }

.deposits-table td, .deposits-table th { white-space: nowrap; }

/* Deposits list: the Total Bank Deposit value is the strongest money
   figure in each row - size and weight only, never variance-colored. */
.deposits-table .deposit-total-value {
  font-size: 1.075rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Deposit Details: main content + sticky totals side panel */
.deposit-detail-header .page-title { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.deposit-finalize-confirm {
  border: 2px solid var(--accent-dark); background: #eff6ff;
}
.deposit-finalize-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.75rem; }
.deposit-finalize-actions .btn { margin-top: 0; }

.deposit-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.55fr);
  gap: 1.25rem; align-items: start;
}
.deposit-side { position: sticky; top: 1rem; }
.deposit-totals { position: static; }

.deposit-metadata-form .inline-form input[type="date"],
.deposit-metadata-form .inline-form input[type="text"] { min-width: 12rem; }

/* Draft save-state chip: text plus visual styling (never color alone).
   Sits in the action panel directly above the single Save Draft button. */
.deposit-save-status {
  display: block; text-align: center; margin: 0 0 0.25rem;
  padding: 0.3rem 0.6rem;
}
.worksheet-actions .deposit-save-status { margin-top: 0; }

/* Finalize-as-Deposited native confirmation dialog. */
.finalize-dialog {
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
  padding: 0; max-width: 34rem; width: calc(100vw - 2rem);
  color: var(--text-main);
}
.finalize-dialog::backdrop { background: rgb(15 23 42 / 0.5); }
.finalize-dialog-body { padding: 1.25rem 1.5rem 1.5rem; }
.finalize-dialog-body h2 { margin: 0 0 0.6rem; font-size: 1.1rem; }
.finalize-dialog-actions {
  display: flex; justify-content: flex-end; gap: 0.75rem;
  margin-top: 1rem; flex-wrap: wrap;
}

/* Included Closing Days: Edit Closing Day and Remove stay visually
   distinct, separate actions (never merged into one ambiguous link). */
.deposit-day-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.deposit-day-actions form { margin: 0; }

.deposit-add-days { margin-top: 1rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 0.75rem; }
.deposit-add-days-body { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.5rem; }
.deposit-add-day-option { display: flex; align-items: center; gap: 0.5rem; }
.deposit-add-days-actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; }
.deposit-add-days-actions .btn { margin-top: 0; }

/* Bank Deposit Slip evidence card */
.deposit-slip-preview-row { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: flex-start; margin: 0.75rem 0; }
.deposit-slip-preview-link { display: inline-block; flex: 0 0 auto; }
.deposit-slip-preview-image {
  max-width: 260px; max-height: 260px; width: auto; height: auto;
  object-fit: contain; border: 1px solid var(--border); border-radius: var(--radius);
  background: #f8fafc;
}
.deposit-slip-meta { margin: 0; flex: 1 1 16rem; }
.deposit-slip-meta dt { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; margin-top: 0.4rem; }
.deposit-slip-meta dd { margin: 0 0 0.1rem; }
.deposit-slip-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.5rem; }
.deposit-slip-actions .btn { margin-top: 0; }
.deposit-slip-replace { margin-top: 0.85rem; }
.deposit-slip-replace-body { margin-top: 0.6rem; }

.deposit-slip-upload-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.deposit-slip-upload-actions .btn { margin-top: 0; cursor: pointer; }
/* Desktop/laptop: Choose File only. Camera capture is shown starting at
   the tablet breakpoint below; desktop never renders a webcam flow. */
.deposit-slip-camera-action { display: none; }
.deposit-slip-filename:empty { display: none; }

/* Full-size dedicated Bank Deposit Slip page */
.deposit-slip-full-figure { text-align: center; margin: 1rem 0; }
.deposit-slip-full-image {
  max-width: 100%; max-height: 80vh; width: auto; height: auto;
  object-fit: contain; border: 1px solid var(--border); border-radius: var(--radius);
}

/* Print-adjacent screens: hide screen-only controls when printing even
   though these pages are rendered through the normal application shell
   (the dedicated /print/ route is fully standalone and needs no rule
   here). */
@media print {
  .no-print, .app-header, .app-footer, .skip-link { display: none !important; }
}

/* Tablet: two columns collapse to one; totals panel goes full width and
   un-stickies; Take Photo becomes available alongside Choose File. */
@media (max-width: 1100px) {
  .deposit-grid { grid-template-columns: minmax(0, 1fr); }
  .deposit-side { position: static; }
  .deposit-slip-camera-action { display: inline-block; }
}

/* Phone: Included Closing Days / Itemized Checks tables become stacked
   financial cards (no horizontal scrolling); the Bank Deposit Slip
   actions and Take Photo / Choose File buttons go full width, with
   Take Photo listed first. */
@media (max-width: 720px) {
  .deposits-day-card { flex-direction: column; align-items: stretch; }
  .deposits-day-figures { grid-template-columns: repeat(2, auto); }
  .deposits-selection-summary { flex-direction: column; align-items: stretch; }
  .deposits-selection-summary .btn { margin-left: 0; }

  .deposit-days-table thead { display: none; }
  .deposit-days-table, .deposit-days-table tbody, .deposit-days-table tr,
  .deposit-days-table td { display: block; width: 100%; }
  .deposit-days-table tr {
    border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 0.75rem; padding: 0.5rem 0.75rem;
  }
  .deposit-days-table td {
    border-bottom: none; display: flex; justify-content: space-between;
    padding: 0.25rem 0;
  }
  .deposit-days-table td[data-label]::before {
    content: attr(data-label); font-weight: 600; color: var(--text-muted);
    margin-right: 0.75rem;
  }
  .deposit-days-table td.num { text-align: right; }

  .deposit-slip-preview-row { flex-direction: column; }
  .deposit-slip-preview-image { max-width: 100%; }
  .deposit-slip-upload-actions { flex-direction: column; }
  .deposit-slip-upload-actions .deposit-slip-camera-action { order: -1; }
  .deposit-slip-full-image { max-height: 60vh; }
}

/* Complete Day review dialog (native <dialog> opened by
   closing-worksheet.js). Mirrors the deposits finalize-dialog look:
   existing card/totals-box patterns in a modal shell. */
.worksheet-complete-review {
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
  padding: 0; max-width: 38rem; width: calc(100vw - 2rem);
  max-height: calc(100vh - 4rem); overflow-y: auto;
  color: var(--text-main);
}
.worksheet-complete-review::backdrop { background: rgb(15 23 42 / 0.5); }
.worksheet-complete-review .card-body { padding: 1.25rem 1.5rem 1.5rem; }
.worksheet-complete-review h2 { margin: 0 0 0.6rem; font-size: 1.1rem; }
.worksheet-complete-reminder {
  margin: 0 0 0.9rem; padding: 0.6rem 0.8rem;
  border-left: 4px solid var(--accent-dark); background: #eff6ff;
}
.worksheet-complete-drawer-review { margin-bottom: 1rem; }
.worksheet-complete-drawer-review h3.card-title { font-size: 1rem; margin: 0 0 0.4rem; }
.worksheet-complete-drawer-review dl {
  display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 1rem;
  margin: 0; font-variant-numeric: tabular-nums;
}
.worksheet-complete-drawer-review dt { color: var(--text-muted); }
.worksheet-complete-drawer-review dd { margin: 0; text-align: right; }
.worksheet-complete-actions {
  display: flex; justify-content: flex-end; gap: 0.75rem;
  margin-top: 1rem; flex-wrap: wrap;
}
.worksheet-complete-actions .btn { margin-top: 0; }

/* Available-day correction: Business Date input inside the banner. */
.correction-business-date {
  display: flex; align-items: center; gap: 0.6rem; margin: 0.6rem 0;
}
.correction-business-date label { font-weight: 600; }
.correction-business-date input[type="date"] { min-width: 12rem; }
