/* Shared components used by the operational modules and their dialogs. */
.stack {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
}

.panel {
  min-width: 0;
  margin: 0;
  padding: clamp(15px, 2vw, 23px);
  border: 1px solid var(--line, #dce1ea);
  border-radius: 8px;
  background: var(--panel, #fff);
  color: var(--ink, #1d2746);
  box-shadow: 0 2px 6px rgb(38 48 83 / 3%);
}
.panelHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-width: 0;
  margin: 0 0 15px;
}
.section-title {
  margin: 0;
  color: var(--ink, #1d2746);
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.panel h3, #dialogBody h3 { font-size: 1rem; margin: .25em 0; }
.panel p, #dialogBody p { line-height: 1.55; }
.panel p:first-child, #dialogBody p:first-child { margin-top: 0; }
.panel p:last-child, #dialogBody p:last-child { margin-bottom: 0; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px 14px;
  min-width: 0;
  padding: 12px 0;
}
.row + .row { border-top: 1px solid var(--line, #dce1ea); }
.row > div, .panelHead > div { min-width: 0; overflow-wrap: anywhere; }
.row strong, .row b { font-weight: 650; }
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.row .actions { justify-content: flex-end; }
.actions:empty { display: none; }
.btn, .photoBtns label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  vertical-align: middle;
  max-width: 100%;
  min-height: 39px;
  padding: 8px 13px;
  border: 1px solid var(--line, #d7ddec);
  border-radius: 6px;
  background: #fff;
  color: var(--ink, #1d2746);
  font: inherit;
  font-size: .875rem;
  font-weight: 620;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
.btn:hover, .photoBtns label:hover { color: var(--brand, #8d200c); border-color: var(--brand-line); background: var(--brand-wash); }
.btn.primary { color: #fff; background: var(--brand, #8d200c); border-color: var(--brand, #8d200c); }
.btn.primary:hover { color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); }
.btn[disabled], .btn[aria-disabled="true"] { cursor: default; opacity: .55; }
.btn svg, .photoBtns svg { flex: none; width: 16px; height: 16px; }
.btn:focus-visible, .photoBtns label:focus-within,
.field :is(input, select, textarea):focus-visible { outline: 2px solid var(--brand, #8d200c); outline-offset: 2px; }
.pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 5px;
  background: #eef0f7;
  color: #44516a;
  font-size: .75rem;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.pill:is(.green,.good,.success,.sv-active) { color: #205b45; background: #e3f3e9; }
.pill:is(.amber,.warn,.sv-pending) { color: #704c18; background: #fff1d6; }
.pill:is(.red,.danger,.sv-expired) { color: #8e3c40; background: #fae8e9; }
.pill:is(.blue,.indigo) { color: #3547a0; background: #e8edff; }
.muted, .photoStatus { color: var(--muted, #5e6a7f); }
.row .muted, .panelHead .muted { margin-top: 3px; font-size: .86rem; line-height: 1.45; }
.field { display: grid; align-content: start; min-width: 0; gap: 6px; }
.field > span, .photos legend, .photo legend {
  color: var(--ink, #1d2746);
  font-size: .84rem;
  font-weight: 620;
}
.field :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 41px;
  margin: 0;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink, #1d2746);
  border: 1px solid #bbc4d8;
  border-radius: 5px;
  font: inherit;
  line-height: 1.4;
}
.field textarea { resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #68758b; }
:is(.field,.peopleCheck,.ops-check) :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--brand, #8d200c); }
fieldset.photo, fieldset.photos {
  display: grid;
  min-width: 0;
  gap: 7px;
  margin: 0;
  padding: 10px 12px 12px;
  border: 1px dashed var(--brand-line);
  border-radius: 6px;
  background: var(--brand-wash);
}
.photos legend, .photo legend { padding: 0 4px; }
.photoBtns { display: flex; flex-wrap: wrap; gap: 7px; }
.photoBtns label { position: relative; overflow: hidden; }
.photoBtns input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.photoStatus:empty { display: none; }
#dialogBody { min-width: 0; overflow-wrap: anywhere; }
#dialogBody form:not(.stack) { display: grid; gap: 14px; }
#dialogBody .stack { gap: 14px; }
#dialogBody > .stack > .actions:last-child, #dialogBody form > .actions:last-child { margin-top: 4px; }
#dialogBody .panel { box-shadow: none; padding: 13px 15px; }
.cash-panel .cash-line, #dialogBody .cash-line { flex-wrap: nowrap; font-variant-numeric: tabular-nums; }
.cash-line > :last-child { flex-shrink: 0; text-align: right; }
.cash-panel .cash-line:first-of-type { border-top: 0; }
.cash-panel .cash-line:last-child { padding-bottom: 0; }
.cash-columns > *, .cash-form-grid > *, .cash-denoms > * { min-width: 0; }
#dialogBody .cash-denoms { grid-template-columns: repeat(3,minmax(0,1fr)); }
#dialogBody .cash-example { border-color: #c9d3e9; border-radius: 6px; background: #f4f6fc; }
#dialogBody .cash-notes span { border-color: #97a8c4; border-radius: 4px; background: #fff; color: #3a4e71; }
#dialogBody .cash-total { align-items: baseline; gap: 12px; font-variant-numeric: tabular-nums; }
.cash-thumbs .cash-thumb { overflow: hidden; border-radius: 5px; cursor: zoom-in; }

@media(max-width: 640px) {
  .stack { gap: 13px; }
  .panel { padding: 15px 13px; }
  .panelHead { margin-bottom: 12px; }
  .row { padding: 10px 0; }
  .actions { gap: 6px; }
  .btn, .photoBtns label { min-height: 42px; }
  .field :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select) { font-size: 16px; }
  #dialogBody .panel { padding: 12px; }
  #dialogBody .stack, #dialogBody form:not(.stack) { gap: 12px; }
}
@media(max-width: 400px) {
  #dialogBody .cash-denoms { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #dialogBody .cash-form-grid { grid-template-columns: minmax(0,1fr); }
  .cash-line .muted { font-size: .78rem; }
}
