/* Pack Service — tablet-friendly styles */

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

:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --primary: #1a73e8;
  --primary-dark: #1558b0;
  --danger: #d93025;
  --warning: #f29900;
  --success: #188038;
  --text: #202124;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── PIN screen ── */
/* NB: no `display` here — it comes from `.screen` / `.screen.active`
   (ID selectors beat class rules and would keep PIN visible after login). */
#screen-pin {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pin-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 32px;
  color: var(--text);
}

.pin-dots {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.pin-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  transition: background .15s, transform .1s;
}
.pin-dot.filled { background: var(--primary); border-color: var(--primary); }

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

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 80px);
  gap: 12px;
}

.pin-btn {
  width: 80px;
  height: 80px;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  font-size: 24px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background .1s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.pin-btn:active { background: var(--border); transform: scale(.95); }

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

/* ── Common screen chrome ── */
.screen { display: none; min-height: 100vh; flex-direction: column; }
.screen.active { display: flex; }

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-title { font-size: 18px; font-weight: 600; }
.header-worker { font-size: 14px; color: var(--text-secondary); }

.content { flex: 1; padding: 20px; max-width: 640px; margin: 0 auto; width: 100%; }

/* ── Task list ── */
.task-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.task-card-header {
  padding: 16px 20px 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.position-row {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
  -webkit-tap-highlight-color: transparent;
}
.position-row:active { background: var(--bg); }

.position-info { flex: 1; }
.position-name { font-size: 16px; font-weight: 500; }
.position-progress { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.progress-bar-fill { height: 100%; background: var(--primary); border-radius: 2px; }

.chevron { color: var(--text-secondary); font-size: 20px; margin-left: 12px; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-text { font-size: 16px; }

/* ── Session screen ── */
.session-step {
  text-align: center;
  padding: 40px 20px;
}
.session-step-icon { font-size: 64px; margin-bottom: 20px; }
.session-step-title { font-size: 22px; font-weight: 600; margin-bottom: 12px; }
.session-step-subtitle { font-size: 16px; color: var(--text-secondary); }

.progress-counter {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.progress-counter-label { font-size: 14px; color: var(--text-secondary); }
.progress-counter-value { font-size: 20px; font-weight: 700; color: var(--primary); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); opacity: .9; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-full    { width: 100%; }

/* ── Alerts ── */
.alert {
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-danger  { background: #fce8e6; color: var(--danger); }
.alert-warning { background: #fef7e0; color: #9d6700; }
.alert-info    { background: #e8f0fe; color: var(--primary-dark); }

/* ── Bottom action bar ── */
.action-bar {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 12px;
}
