﻿@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&display=swap");

:root {
  --bg: #f3f7fb;
  --card: #ffffff;
  --line: #dce5ee;
  --text: #172533;
  --muted: #647386;
  --accent: #0b6f66;
  --accent-ink: #ffffff;
  --danger: #b3252f;
  --ok: #0f7d58;
  --shadow: 0 10px 30px rgba(16, 36, 56, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% -20%, #d7e9f8 0%, transparent 34%),
    radial-gradient(circle at 100% 0%, #d7f0ec 0%, transparent 36%),
    var(--bg);
  overflow-x: hidden;
}

.app {
  width: min(760px, 100% - 16px);
  margin: 8px auto 14px;
  display: grid;
  gap: 10px;
}

.app-header {
  position: sticky;
  top: 6px;
  z-index: 20;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  padding: 10px;
  box-shadow: var(--shadow);
}

.title-wrap h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

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

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  min-height: 34px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 700;
}

.btn:active {
  transform: translateY(1px);
}

.btn.ghost {
  background: #f8fbff;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.panel-head-stack {
  flex-direction: column;
  align-items: stretch;
}

.panel h2 {
  margin: 0;
  font-size: 15px;
}

.hint {
  font-size: 11px;
  color: var(--muted);
}

.employee-list {
  display: grid;
  gap: 7px;
}

.employee-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px;
  background: linear-gradient(160deg, #ffffff, #f9fcff);
}

.emp-main {
  min-width: 0;
}

.emp-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  word-break: break-word;
}

.emp-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.2;
  word-break: break-word;
}

.check-btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 9px;
  height: 32px;
  min-width: 86px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.check-btn:disabled {
  opacity: 0.6;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.seg-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #f7f9fc;
  color: #395065;
  border-radius: 9px;
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
}

.seg-btn.active {
  background: #e6f3f1;
  border-color: #9ed5cd;
  color: #11443f;
}

.log-list {
  display: grid;
  gap: 7px;
}

.log-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fbfdff;
}

.log-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.log-name {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.log-badge {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 7px;
  background: #edf3f8;
  color: #355068;
  white-space: nowrap;
}

.log-meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.log-meta strong {
  color: var(--text);
  font-weight: 700;
}

.hidden {
  display: none;
}

body.camera-open {
  overflow: hidden;
}

.camera-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 14px;
}

.camera-dialog.hidden {
  display: none;
}

.camera-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 22, 32, 0.72);
}

.camera-panel {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  max-height: calc(100vh - 28px);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
}

.camera-panel h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.camera-copy,
.camera-name,
.camera-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.camera-name {
  font-weight: 700;
  color: var(--text);
}

.camera-error {
  min-height: 16px;
  color: var(--danger);
}

.camera-video {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  margin-top: 10px;
  border-radius: 10px;
  background: #101820;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.camera-capture {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.status-badge {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 50;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 700;
  background: #ecf8f4;
  color: var(--ok);
  border: 1px solid #a8d9c8;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.18s ease;
}

.status-badge.show {
  opacity: 1;
  transform: translateY(0);
}

.status-badge.err {
  background: #fff2f3;
  color: var(--danger);
  border-color: #f1b5ba;
}

@media (min-width: 720px) {
  .app {
    width: min(920px, 100% - 24px);
  }

  .app-header {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .actions {
    grid-template-columns: auto auto;
  }

  .btn {
    min-height: 36px;
    padding: 8px 12px;
  }

  .employee-list {
    grid-template-columns: 1fr 1fr;
  }

  .status-badge {
    left: auto;
    right: 12px;
    width: min(480px, calc(100vw - 24px));
  }
}
