/* Everra Dock Scanning — brand: teal #007C91, forest #32645C, gold #F2A900. System sans-serif stack. */
:root {
  --teal: #007C91;
  --forest: #32645C;
  --gold: #F2A900;
  --orange: #BE5400;
  --light-teal: #5CB8B2;
  --tint: #E8F4F7;
  --gray: #97999B;
  --dark-gray: #646566;
  --warning: #FBEFC7;
  --error: #F4D5D5;
  --ink: #1d2a2e;
  --font: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background: var(--tint);
  -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}

/* White band: the Everra logo only ever sits on white. */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 3px solid var(--teal);
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--teal); }
.brand-logo { height: 32px; width: auto; display: block; }
.brand-wordmark { font-weight: 700; font-size: 24px; color: var(--teal); letter-spacing: .5px; }
.brand-title { font-weight: 700; color: var(--forest); font-size: 15px; border-left: 1px solid var(--gray); padding-left: 10px; }

.tabs { display: flex; background: #fff; border-bottom: 1px solid #cfe3e8; }
.tabs a { flex: 1; text-align: center; padding: 12px 0; font-weight: 700; text-decoration: none; color: var(--dark-gray); border-bottom: 4px solid transparent; }
.tabs a.active { color: var(--teal); border-bottom-color: var(--teal); }

main { padding: 12px; max-width: 640px; margin: 0 auto; }
h1 { font-size: 20px; margin: 0 0 10px; color: var(--teal); }
h2.section-title { font-size: 16px; margin: 18px 4px 6px; color: var(--forest); }
h3 { font-size: 16px; margin: 10px 0 4px; color: var(--forest); }
h4 { font-size: 14px; margin: 12px 0 4px; color: var(--dark-gray); }

.card { background: #fff; border-radius: 8px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.card.narrow { max-width: 420px; margin: 24px auto; }
details.card > summary { font-weight: 700; cursor: pointer; color: var(--forest); }

.muted { color: var(--dark-gray); font-size: 14px; }
.small { font-size: 13px; }
.prewrap { white-space: pre-wrap; }

.facts { display: grid; grid-template-columns: 45% 55%; gap: 6px 8px; margin: 8px 0 12px; }
.facts dt { color: var(--dark-gray); font-size: 14px; }
.facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

.stack { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 14px; color: var(--dark-gray); }
input[type=text], input[type=password], select {
  font: inherit; font-size: 18px; padding: 12px; border: 1px solid var(--gray); border-radius: 6px; background: #fff; color: var(--ink); width: 100%;
}
input[readonly] { background: var(--tint); }
input:focus, select:focus { outline: 3px solid var(--light-teal); border-color: var(--teal); }

.btn, .btn-primary, .btn-danger {
  display: block; width: 100%; text-align: center; text-decoration: none; font: inherit; font-weight: 700;
  padding: 14px; border-radius: 6px; border: 2px solid var(--teal); background: #fff; color: var(--teal); cursor: pointer; margin-top: 8px;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-danger { border-color: var(--orange); color: var(--orange); }
.btn-small { display: inline-block; width: auto; padding: 8px 12px; margin: 0; font-size: 14px; }
.btn[disabled], .btn-primary[disabled] { opacity: .5; }
.btn-link { background: none; border: 0; font: inherit; font-weight: 700; color: var(--teal); text-decoration: underline; padding: 8px; cursor: pointer; }
.app-header form { margin: 0; }

.flash { margin: 0 0 12px; padding: 12px; border-radius: 6px; font-weight: 700; }
.flash-alert { background: var(--error); }
.flash-notice { background: #d6efe8; color: var(--forest); }

.lot { border-radius: 6px; padding: 8px; margin: 6px 0; background: var(--tint); }
.lot.row-warning { background: var(--warning); }
.lot summary { cursor: pointer; font-weight: 700; }
.picking-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid rgba(0,0,0,.08); }
.picking-item .btn-small { margin-left: auto; }

.scan-input { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; } /* receives scanner keystrokes */
.mode-banner { background: var(--error); border-left: 6px solid var(--orange); padding: 10px; font-weight: 700; margin: 12px 0 0; }
.actions { margin-top: 8px; }
.switch { flex-direction: row; align-items: center; gap: 10px; font-size: 16px; }
.switch input { width: 26px; height: 26px; }

.sync-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 14px; font-weight: 700; font-size: 14px; }
.sync-bar[hidden] { display: none; }
.sync-warn { background: var(--warning); color: #5b4300; }
.sync-error { background: var(--error); color: #6b1d1d; }

.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 50;
  max-width: 85vw; padding: 18px 22px; border-radius: 12px; font-weight: 700; text-align: center; white-space: pre-line;
  background: rgba(29, 42, 46, .92); color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.toast[hidden] { display: none; }
.toast-warn { background: var(--gold); color: #3d2b00; }
.toast-error { background: var(--orange); color: #fff; }

.camera-panel { margin: 8px 0 12px; }
.camera-panel video { width: 100%; max-height: 40vh; object-fit: cover; border-radius: 8px; background: #000; display: block; }
