/* ── Full-screen landscape layout ── */
.timeio-screen {
  min-height: calc(100vh - 56px);
  display: flex;
  background: var(--unit4-dark);
}

.timeio-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  width: 100%;
  min-height: calc(100vh - 56px);
}

/* ── LEFT PANEL: Dark brand + status ── */
.timeio-brand-panel {
  background: var(--unit4-dark);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid rgba(255,255,255,0.07);
  position: relative;
}

/* Subtle orange glow at bottom */
.timeio-brand-panel::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: linear-gradient(to top, rgba(244,114,30,0.12), transparent);
  pointer-events: none;
}

/* Logo */
.timeio-brand-top {
  margin-bottom: 4px;
}

.timeio-logo {
  height: 30px;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* Live clock */
.timeio-clock-block {
  margin-top: 8px;
}

.timeio-time {
  font-size: 68px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  margin: 0;
  letter-spacing: -2px;
}

.timeio-ampm {
  font-size: 26px;
  font-weight: 400;
  color: rgba(255,255,255,0.45);
  margin-left: 6px;
  letter-spacing: 0;
  vertical-align: middle;
}

.timeio-date {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  margin: 6px 0 0;
  letter-spacing: 0.02em;
}

/* Divider */
.timeio-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
}

/* Attendant identity */
.timeio-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.timeio-avatar {
  width: 40px;
  height: 40px;
  background: var(--unit4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}

.timeio-identity-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.timeio-identity-role {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin: 2px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Shift status card */
.timeio-status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 18px;
}

.timeio-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-in {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.dot-out {
  background: rgba(255,255,255,0.25);
  box-shadow: none;
}

.timeio-status-label {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.timeio-status-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin: 3px 0 0;
}

/* Stale warning */
.timeio-stale-banner {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: 10px;
  padding: 14px 16px;
}

.timeio-stale-msg {
  font-size: 13px;
  color: #fcd34d;
  line-height: 1.55;
  margin: 0;
}

/* Error */
.timeio-error {
  font-size: 13px;
  font-weight: 700;
  color: #fca5a5;
  margin: 0;
}

/* ── RIGHT PANEL: Camera + Action ── */
.timeio-action-panel {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 48px;
}

/* Camera content wrapper */
.timeio-camera-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 540px;
}

/* Camera viewport */
.timeio-camera-frame {
  background: #0f172a;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  max-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 2px solid rgba(255,255,255,0.04);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.timeio-camera-frame.captured {
  background: var(--soft);
  border-color: var(--line);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.timeio-camera-frame video,
.timeio-camera-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder inside camera frame */
.timeio-cam-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.25);
  font-size: 13px;
  text-align: center;
  user-select: none;
}

.timeio-cam-icon {
  font-size: 44px;
  opacity: 0.3;
  display: block;
}

/* Spinner */
.timeio-cam-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.6);
  border-radius: 50%;
  animation: timeio-spin 0.8s linear infinite;
  display: block;
}

@keyframes timeio-spin {
  to { transform: rotate(360deg); }
}

/* "✓ Ready" badge overlay on captured photo */
.timeio-cam-captured-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(22,132,92,0.9);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

/* Camera controls row */
.timeio-cam-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 40px;
}

.timeio-cam-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  padding: 0 20px;
  cursor: pointer;
  white-space: nowrap;
}

.timeio-cam-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.timeio-cam-btn.cam-capture {
  background: var(--unit4);
  border-color: var(--unit4);
  color: #fff;
}

.timeio-cam-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  flex: 1;
  text-align: right;
}

.timeio-cam-note.cam-error {
  color: var(--red);
  font-weight: 700;
}

/* Main clock-in / clock-out button */
.timeio-action-btn {
  width: 100%;
  min-height: 72px;
  font-size: 24px;
  font-weight: 900;
  border: none;
  border-radius: 16px;
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: transform 0.1s, box-shadow 0.1s;
}

.timeio-action-btn:not(:disabled):active {
  transform: scale(0.985);
}

.btn-clock-in {
  background: var(--unit4);
  box-shadow: 0 6px 24px rgba(244,114,30,0.38);
}

.btn-clock-out {
  background: var(--red);
  box-shadow: 0 6px 24px rgba(167,58,49,0.32);
}

.timeio-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ── Success screen ── */
.timeio-success-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.timeio-success-icon {
  width: 80px;
  height: 80px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(22,132,92,0.35);
}

.timeio-success-msg {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.timeio-redirect-msg {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}

/* ── Responsive: tablet portrait / small ── */
@media (max-width: 860px) {
  .timeio-layout {
    grid-template-columns: 300px 1fr;
  }

  .timeio-brand-panel {
    padding: 28px 24px;
    gap: 18px;
  }

  .timeio-time { font-size: 52px; }
  .timeio-ampm { font-size: 20px; }

  .timeio-action-panel {
    padding: 28px 32px;
  }
}

/* Stack vertically on phones / portrait tablets */
@media (max-width: 640px) {
  .timeio-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .timeio-brand-panel {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 24px 20px;
    gap: 14px;
  }

  .timeio-brand-panel::after { display: none; }

  .timeio-clock-block { margin-top: 0; }
  .timeio-time { font-size: 44px; }

  .timeio-action-panel {
    padding: 24px 20px;
    align-items: flex-start;
  }

  .timeio-camera-wrap {
    max-width: 100%;
  }

  .timeio-camera-frame {
    max-height: 260px;
  }
}
