:root {
  --brand: #1d4ed8;
  --brand-dark: #1e3a8a;
  --ok: #16a34a;
  --error: #dc2626;
  --bg: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  text-align: center;
  gap: 16px;
}

.screen h1 {
  font-size: 22px;
  margin: 0;
}

.screen p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  max-width: 320px;
}

.status-line {
  color: var(--text);
  font-size: 18px;
}

/* --- великі кнопки --- */

.big-buttons {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 400px;
  margin-top: 8px;
}

.big-btn {
  flex: 1;
  padding: 28px 12px;
  font-size: 20px;
  font-weight: 600;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.big-btn:active {
  transform: scale(0.98);
}

.big-btn.recommended {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.big-btn-link {
  display: inline-block;
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 600;
  background: var(--brand);
  color: #fff;
  border-radius: 12px;
  text-decoration: none;
}

.link {
  color: var(--brand);
  font-size: 15px;
  text-decoration: none;
}

.link-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 16px;
  padding: 8px;
  cursor: pointer;
}

/* --- таймер прямого сканування --- */

.timer-bar {
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  background: var(--brand);
  width: 100%;
  transition: width 0.2s linear;
}

/* --- сканер --- */

.screen-scanner {
  position: relative;
  padding: 0;
  background: #000;
  justify-content: flex-start;
}

.screen-scanner video {
  width: 100%;
  height: 100dvh;
  object-fit: cover;
}

.scan-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70vw;
  max-width: 280px;
  aspect-ratio: 1;
  border: 3px solid #fff;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
}

.scan-hint {
  position: absolute;
  bottom: 110px;
  left: 0;
  right: 0;
  color: #fff;
  font-size: 16px;
}

.screen-scanner .link-btn {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  color: #fff;
  font-size: 17px;
}

/* --- результат --- */

.result-icon {
  font-size: 56px;
  line-height: 1;
}

.result-ok .result-icon {
  color: var(--ok);
}

.result-error .result-icon {
  color: var(--error);
}

.result-message {
  color: var(--text);
  font-size: 19px;
  max-width: 320px;
}

/* --- табель --- */

.screen-timesheet {
  justify-content: flex-start;
  padding-top: 16px;
  align-items: stretch;
}

.timesheet-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.timesheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.timesheet-table th,
.timesheet-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.timesheet-table th {
  color: var(--muted);
  font-weight: 500;
}
