/* Shell ------------------------------------------------------------ */

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.page-head { margin-bottom: 22px; }

.page-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 38px;
  line-height: 1.1;
  margin: 10px 0 6px;
}

.page-sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 62ch;
}

/* Rollup ----------------------------------------------------------- */

.rollup {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 34px;
  align-items: baseline;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 26px;
}

.rollup-item { display: flex; align-items: baseline; gap: 9px; }

.rollup-value {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 21px;
  color: var(--ink);
}

.rollup-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Cards ------------------------------------------------------------ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 20px;
}

.machine {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.machine-head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.machine-location {
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.2;
  margin: 0 0 6px;
}

.machine-meta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-faint);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.machine-meta b { color: var(--blue-deep); font-weight: 600; }

/* The stored row is reference, not input: quiet, and always visible so
   the numbers you type have something to be checked against. */
.stored {
  display: flex;
  align-items: baseline;
  gap: 8px 16px;
  flex-wrap: wrap;
  padding: 11px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-muted);
}

.stored-label {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.denoms { padding: 18px 22px 6px; }

.denom {
  display: grid;
  grid-template-columns: 46px 1fr 82px;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.denom-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-deep);
  background: var(--blue-pale);
  border-radius: 8px;
  padding: 6px 0;
  text-align: center;
}

.denom-input {
  width: 100%;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -moz-appearance: textfield;
}

.denom-input::-webkit-outer-spin-button,
.denom-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.denom-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-pale);
  background: var(--white);
}

.denom-sub {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-faint);
  text-align: right;
}

.denom-sub.is-set { color: var(--ink-mid); }

/* Counted ---------------------------------------------------------- */

.counted {
  margin: 8px 22px 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.counted-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.counted-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue-deep);
}

.counted-values {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 19px;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.counted-bills { font-size: 13px; color: var(--ink-muted); }

.drift {
  margin-top: 11px;
  font-size: 13px;
  line-height: 1.45;
  border-radius: 10px;
  padding: 9px 12px;
  display: flex;
  gap: 8px;
}

.drift-ok { background: var(--good-bg); color: var(--good); }
.drift-off { background: var(--warn-bg); color: var(--warn); }

/* Actions ---------------------------------------------------------- */

.actions {
  margin-top: auto;
  padding: 18px 22px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.actions .btn { font-size: 14.5px; padding: 10px 18px; }

.unsaved {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--warn);
  margin-left: auto;
}

.status {
  padding: 0 22px 18px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-top: -6px;
}

.status-good { color: var(--good); }
.status-bad { color: var(--bad); }
.status-busy { color: var(--ink-muted); }

/* Export ----------------------------------------------------------- */

.export {
  margin-top: 40px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}

.export-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.export-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 3px;
}

.export-note { margin: 0; font-size: 13.5px; color: var(--ink-muted); }

.export-body {
  margin: 0;
  padding: 20px 22px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-mid);
  background: var(--surface);
  white-space: pre;
  overflow-x: auto;
}

/* Empty ------------------------------------------------------------ */

.empty {
  background: var(--white);
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  padding: 56px 24px;
  text-align: center;
  color: var(--ink-muted);
}

@media (max-width: 560px) {
  .wrap { padding: 24px 16px 64px; }
  .page-title { font-size: 30px; }
  .grid { grid-template-columns: 1fr; }
}
