/* Niko Warehouse PWA — "for dummies": big targets, high contrast, no clutter */
:root {
  --bg: #101418;
  --card: #1a2129;
  --text: #f2f5f7;
  --muted: #8a97a3;
  --accent: #2f81f7;
  --green: #2ea04326;
  --green-text: #4ac26b;
  --red: #f8514926;
  --red-text: #ff7b72;
  --radius: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
}

#topbar {
  display: flex; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
}
#topbar-title { flex: 1; font-size: 18px; font-weight: 600; }
#sync-dot { color: var(--green-text); font-size: 14px; }
#sync-dot.pending { color: #d29922; }
.icon-btn {
  background: var(--card); color: var(--text); border: 0;
  font-size: 28px; line-height: 1; width: 44px; height: 44px;
  border-radius: 12px;
}

.screen {
  flex: 1; display: flex; flex-direction: column;
  padding: 18px; gap: 14px; overflow-y: auto;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red-text); text-align: center; font-weight: 600; }
.hello { font-size: 20px; margin: 6px 4px; }

/* PIN */
.pin-header { text-align: center; margin-top: 8vh; }
.logo { width: 72px; height: 72px; border-radius: 18px; }
.pin-header h1 { margin: 10px 0 2px; font-size: 24px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 18px 0; }
.pin-dots span {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--muted);
}
.pin-dots span.on { background: var(--accent); border-color: var(--accent); }
.keypad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  max-width: 320px; width: 100%; margin: 0 auto;
}
.keypad button {
  font-size: 28px; padding: 18px 0; border-radius: var(--radius);
  border: 0; background: var(--card); color: var(--text); font-weight: 600;
}
.keypad button:active { background: #26303b; }

/* Giant home buttons */
.giant {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 10px; font-size: 24px; font-weight: 700;
  background: var(--card); color: var(--text);
  border: 0; border-radius: var(--radius); width: 100%;
}
.giant:disabled { opacity: 0.45; }
.giant-icon { font-size: 40px; }
.soon { font-size: 13px; font-weight: 400; color: var(--muted); }

.big {
  padding: 18px; font-size: 20px; font-weight: 700; width: 100%;
  background: var(--accent); color: #fff; border: 0; border-radius: var(--radius);
}
.link-btn {
  background: none; border: 0; color: var(--muted);
  font-size: 15px; margin-top: auto; padding: 14px;
}

/* Scanner */
#scanner-box {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: #000; aspect-ratio: 3/4; max-height: 52vh;
}
#preview { width: 100%; height: 100%; object-fit: cover; }
.scan-frame {
  position: absolute; inset: 18% 12%;
  border: 3px solid rgba(255,255,255,0.85); border-radius: 14px;
  box-shadow: 0 0 0 999px rgba(0,0,0,0.35);
}
.scan-hint {
  position: absolute; bottom: 8px; width: 100%; text-align: center;
  color: #fff; text-shadow: 0 1px 3px #000; font-size: 14px; margin: 0;
}
.or-row { text-align: center; color: var(--muted); }
#sku-form { display: flex; gap: 10px; }
#sku-input {
  flex: 1; font-size: 22px; padding: 14px; border-radius: var(--radius);
  border: 2px solid #2a3542; background: var(--card); color: var(--text);
}
#sku-form .big { width: auto; padding: 14px 22px; }

/* Item card */
.item-card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.item-title { font-size: 22px; font-weight: 700; margin: 0; }
.item-sku { color: var(--muted); font-size: 16px; }
.badge {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  font-weight: 700; font-size: 15px;
}
.badge.pass { background: var(--green); color: var(--green-text); }
.badge.fail { background: var(--red); color: var(--red-text); }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 16px; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; font-weight: 600; max-width: 60%; }

.big.secondary { background: var(--card); color: var(--text); }

/* Wizard */
.wizard-progress { display: flex; gap: 6px; }
.wizard-progress span { flex: 1; height: 6px; border-radius: 3px; background: #2a3542; }
.wizard-progress span.done { background: var(--accent); }
.wizard-q { font-size: 26px; margin: 10px 4px 0; }
.wizard-sub { margin: 0 4px; }
.wizard-body { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.choice {
  padding: 20px 14px; font-size: 19px; font-weight: 600; text-align: left;
  background: var(--card); color: var(--text); border: 2px solid transparent;
  border-radius: var(--radius); width: 100%;
}
.choice:active { border-color: var(--accent); }
.choice.yes { border-left: 6px solid var(--green-text); }
.choice.no { border-left: 6px solid var(--red-text); }
.wizard-body input[type="text"] {
  font-size: 22px; padding: 14px; border-radius: var(--radius);
  border: 2px solid #2a3542; background: var(--card); color: var(--text);
}
.wizard-body textarea {
  font-size: 18px; padding: 14px; border-radius: var(--radius); min-height: 90px;
  border: 2px solid #2a3542; background: var(--card); color: var(--text);
}
.photo-row { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-thumb {
  width: 84px; height: 84px; object-fit: cover; border-radius: 12px;
  border: 2px solid #2a3542;
}
.photo-add {
  width: 84px; height: 84px; border-radius: 12px; border: 2px dashed #2a3542;
  background: none; color: var(--muted); font-size: 30px;
}

/* Verdict */
.verdict-card {
  border-radius: var(--radius); padding: 28px 18px; text-align: center;
  display: flex; flex-direction: column; gap: 10px;
}
.verdict-card.pass { background: var(--green); }
.verdict-card.service { background: #d2992226; }
.verdict-card.scope { background: var(--red); }
.verdict-emoji { font-size: 56px; }
.verdict-title { font-size: 26px; font-weight: 800; margin: 0; }
.verdict-card.pass .verdict-title { color: var(--green-text); }
.verdict-card.service .verdict-title { color: #d29922; }
.verdict-card.scope .verdict-title { color: var(--red-text); }
.verdict-detail { font-size: 16px; color: var(--text); }

/* Loading */
.loading {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.spinner {
  width: 54px; height: 54px; border-radius: 50%;
  border: 5px solid #ffffff33; border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
