/* Wydaho BOH — Tablet-first dark theme */
:root {
  --bg: #111110;
  --surface: #1a1a19;
  --surface2: #242423;
  --border: #333332;
  --text: #f0efe9;
  --muted: #888883;
  --accent: #d1432a;
  --green: #3ecf8e;
  --accent2: #c8a86b;
  --yellow: #f7c948;
  --orange: #f6993f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1.5;
  height: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ── Login Screen ─────────────────────────────────────────────── */

.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
}

.login-screen .brand {
  margin-bottom: 32px;
  text-align: center;
}

.login-screen .brand img {
  height: 48px;
  margin-bottom: 8px;
}

.login-screen .brand-sub {
  display: block;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
}

.team-btn {
  background: var(--surface2);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 20px 16px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}

.team-btn:active {
  background: var(--accent);
  border-color: var(--accent);
}

/* PIN Pad */
.pin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.pin-pad {
  background: var(--surface);
  border-radius: 20px;
  padding: 32px;
  max-width: 340px;
  width: 90%;
}

.pin-pad h3 {
  text-align: center;
  margin-bottom: 16px;
  font-size: 20px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.pin-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  transition: background 0.1s;
}

.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
}

.pin-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pin-key {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 18px;
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.1s;
}

.pin-key:active { background: var(--accent); }
.pin-key.fn { font-size: 16px; }

.pin-error {
  color: var(--accent);
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
  min-height: 20px;
}

/* ── Lock Screen ──────────────────────────────────────────────── */
.lock-screen {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
}
.lock-content {
  text-align: center;
  width: 320px;
}
.lock-pin-dots {
  display: flex; justify-content: center; gap: 16px;
  margin-bottom: 20px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.shake { animation: shake 0.4s ease-in-out; }

/* ── App Shell ────────────────────────────────────────────────── */

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.app-header .logo { height: 32px; }
.app-header .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.app-header .logout-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ── Bottom Nav ───────────────────────────────────────────────── */

.bottom-nav {
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: color 0.15s;
  gap: 2px;
}

.bottom-nav a.active { color: var(--accent); }
.bottom-nav a .nav-icon { font-size: 24px; }

/* ── Pages ────────────────────────────────────────────────────── */

.page { display: none; }
.page.active { display: block; }

/* ── Cards ────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title { font-weight: 700; font-size: 18px; }

/* ── Checklist ────────────────────────────────────────────────── */

.checklist-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.checklist-tab {
  flex: 1;
  padding: 14px;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  min-width: 100px;
}

.checklist-tab.active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface);
}

.checklist-progress {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  margin-bottom: 16px;
  overflow: hidden;
}

.checklist-progress-bar {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.3s;
}

.checklist-item-wrapper {
  border-bottom: 1px solid var(--border);
}
.checklist-item-wrapper:last-child { border-bottom: none; }

.checklist-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  transition: background 0.1s;
  min-height: 56px;
}

.check-box {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  transition: all 0.15s;
  cursor: pointer;
}

.check-box:active { transform: scale(0.9); }

.checklist-item.done .check-box {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.checklist-item.done .item-desc { color: var(--muted); text-decoration: line-through; }

.item-desc { flex: 1; font-size: 16px; }
.item-meta { font-size: 12px; color: var(--muted); text-align: right; }

.checklist-detail {
  display: none;
  padding: 0 20px 16px 68px;
}

.checklist-item-wrapper.open .checklist-detail {
  display: block;
}

/* ── Production Log / EOD Counts ─────────────────────────────── */

.eod-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.eod-item:last-child { border-bottom: none; }

.eod-item-name {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  min-width: 120px;
}

.eod-item-info {
  width: 100%;
  margin-top: -4px;
  margin-bottom: 4px;
}

.eod-item-inputs {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.eod-input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.eod-input-group label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.eod-input {
  width: 70px;
  padding: 10px 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  -moz-appearance: textfield;
}

.eod-input::-webkit-inner-spin-button,
.eod-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.eod-input:focus {
  outline: none;
  border-color: var(--accent);
}

.eod-input-carry:focus {
  border-color: var(--orange);
}

/* ── Backstock ───────────────────────────────────────────────── */

.backstock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  font-size: 15px;
}

.backstock-item:last-child { border-bottom: none; }
.backstock-item:active { background: var(--surface2); }

/* ── Recipes ─────────────────────────────────────────────────── */

.recipe-category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ── Handbook ─────────────────────────────────────────────────── */

.handbook-section { margin-bottom: 20px; }
.handbook-section-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--accent2);
  margin-bottom: 8px;
  padding: 0 4px;
}

.handbook-item {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.handbook-item:last-child { border-bottom: none; }
.handbook-item:active { background: var(--surface2); }

.handbook-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 600;
}

.handbook-chevron {
  color: var(--muted);
  font-size: 14px;
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 12px;
}

.handbook-item.open .handbook-chevron {
  transform: rotate(90deg);
}

.handbook-a {
  display: none;
  padding: 0 20px 16px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

.handbook-item.open .handbook-a {
  display: block;
}

/* ── Training ────────────────────────────────────────────────── */

.training-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.training-member-selector select {
  min-width: 180px;
}

.training-progress-summary {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.training-summary-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 100px;
  justify-content: center;
}

.training-summary-chip .chip-pct {
  color: var(--green);
}

.training-position { margin-bottom: 20px; }

.training-position-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--accent2);
  margin-bottom: 8px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.training-position-progress {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.training-item-wrapper {
  border-bottom: 1px solid var(--border);
}

.training-item-wrapper:last-child { border-bottom: none; }

.training-item-wrapper.expandable { cursor: pointer; }
.training-item-wrapper.expandable:active { background: var(--surface2); }

.training-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  min-height: 56px;
}

.training-check {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
}

.training-check:active { opacity: 0.7; }

.training-check.self-checked {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #000;
}

.training-check.verified {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.training-item-info {
  flex: 1;
  min-width: 0;
}

.training-item-desc {
  font-size: 16px;
}

.training-item-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.training-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

.training-video-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}

.training-video-btn:active { background: var(--surface2); }

.training-verify-btn {
  background: none;
  border: 1px solid var(--green);
  color: var(--green);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s;
}

.training-verify-btn:active { background: rgba(62,207,142,0.15); }

.training-uncheck-btn {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s;
}

.training-uncheck-btn:active { background: rgba(209,67,42,0.15); }

/* Training expandable detail */
.training-chevron {
  color: var(--muted);
  font-size: 13px;
  margin-left: 8px;
  transition: transform 0.2s;
  display: inline-block;
}

.training-item-wrapper.open .training-chevron {
  transform: rotate(90deg);
}

.training-detail {
  display: none;
  padding: 0 16px 16px 60px;
}

.training-item-wrapper.open .training-detail {
  display: block;
}

.training-detail-text {
  background: var(--surface2);
  border-radius: 10px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 12px;
}

.training-video-btn-large {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  transition: background 0.1s;
}

.training-video-btn-large:active { background: rgba(209,67,42,0.15); }

.training-video-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.training-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ── Modals / Picker Overlay ─────────────────────────────────── */

.picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 60px;
  z-index: 100;
}

.picker-panel {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 70vh;
  overflow-y: auto;
}

/* ── Toast ────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  z-index: 200;
  transition: transform 0.3s;
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--accent); }

/* ── Utilities ────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  font-size: 16px;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Shift Notes ────────────────────────────────────────── */
.shift-note-form { margin-bottom: 14px; }

.shift-note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.45;
}
.shift-note-card.mgmt {
  border-left: 3px solid var(--accent2);
  background: #1f1d18;
}
.shift-note-header {
  display: inline;
  margin-right: 6px;
  white-space: nowrap;
}
.shift-note-author { font-weight: 700; font-size: 14px; }
.shift-note-author.mgmt { color: var(--accent2); }
.shift-note-time {
  font-size: 12px;
  color: var(--muted);
  margin-left: 4px;
}
.shift-note-body {
  display: inline;
  white-space: pre-wrap;
}
.shift-note-card.own { cursor: pointer; }
.shift-note-card.own:active { opacity: 0.85; }

.shift-note-translation {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  white-space: pre-wrap;
}
.shift-note-lang-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--surface2);
  color: var(--accent2);
  padding: 1px 5px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 4px;
  font-style: normal;
}

.note-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.mention-tag {
  display: inline-block;
  background: rgba(209, 67, 42, 0.15);
  color: var(--accent);
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 600;
}

.mention-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 4px;
}
.mention-opt {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.mention-opt:last-child { border-bottom: none; }
.mention-opt:hover { background: var(--surface2); }

/* Logging view switcher (Morning / End of Day / Galette Dough). These had no
   styling at all, so the selected view looked the same as the others. */
button[data-prod-view] {
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
}
button[data-prod-view].active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
