:root {
  --bg: #efeff2;
  --panel: #ffffff;
  --text: #1b1b22;
  --muted: #636379;
  --line: #ddddee;
  --purple: #6a1bff;
  --purple-2: #8d4bff;
  --ok: #30a46c;
  --warn: #f0ad2c;
  --bad: #d34f4f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 12px;
}

#landingScreen[hidden],
#appShell[hidden],
.scan-modal[hidden] {
  display: none !important;
}

.landing-screen {
  min-height: calc(100vh - 32px);
}

.landing-shell {
  min-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.landing-header {
  display: grid;
  gap: 12px;
  padding-top: 8px;
}

.landing-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.landing-filter-row.has-tag-filter {
  grid-template-columns: minmax(124px, 0.8fr) minmax(0, 1.8fr);
}

.landing-select,
.landing-search input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: #4d4d66;
  font-size: 18px;
}

.landing-select {
  text-align: center;
  font-weight: 700;
}

.tag-select[hidden] {
  display: none !important;
}

.landing-empty[hidden] {
  display: none !important;
}

.landing-search {
  position: relative;
  display: block;
}

.landing-search input {
  padding: 0 14px 0 44px;
}

.landing-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #b6b6c8;
  font-size: 22px;
  pointer-events: none;
}

.landing-empty {
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  gap: 16px;
  color: #636379;
  padding: 12px 20px 40px;
}

.landing-empty h1 {
  margin: 0;
  font-size: 30px;
  color: #4f4f71;
}

.landing-empty p {
  margin: 0;
  max-width: 320px;
  line-height: 1.7;
  font-size: 20px;
  font-weight: 600;
}

.landing-results {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 4px 2px 0;
}

.landing-results-head h2 {
  margin: 0;
  font-size: 28px;
  color: #4f4f71;
  font-weight: 700;
}

.landing-results-list {
  display: grid;
  gap: 12px;
}

.assignment-members-panel {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.assignment-members-head h3 {
  margin: 0;
  font-size: 22px;
  color: #4f4f71;
  font-weight: 800;
}

.assignment-members-list {
  display: grid;
  gap: 8px;
}

.assignment-member-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 14px 16px;
  color: #34344b;
  font-size: 17px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(74, 65, 120, 0.06);
}

.landing-result-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px 18px;
  display: grid;
  gap: 8px;
  text-align: right;
  color: var(--text);
  box-shadow: 0 10px 22px rgba(74, 65, 120, 0.08);
  cursor: pointer;
}

.landing-result-card.detailed {
  border-radius: 10px;
  gap: 10px;
}

.landing-result-card.is-selected {
  border-color: #8b65ff;
  box-shadow: 0 10px 22px rgba(108, 77, 201, 0.16);
}

.landing-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.landing-result-tag {
  font-size: 24px;
  color: #2c2c43;
}

.landing-result-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  background: #8b65ff;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.landing-result-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(182, 161, 239, 0.15) 0%, rgba(182, 161, 239, 0.9) 50%, rgba(182, 161, 239, 0.15) 100%);
}

.landing-result-role,
.landing-result-location {
  color: #4f4f67;
  font-size: 19px;
}

.landing-result-role strong {
  font-weight: 800;
  color: #2f2f46;
}

.landing-result-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: #8b77c8;
  font-size: 18px;
  background: #f5f1ff;
  border-radius: 10px;
  padding: 10px 12px;
}

.landing-result-serial {
  font-weight: 700;
}

.landing-result-date {
  color: #9d8acb;
}

.landing-result-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.landing-result-main strong {
  font-size: 20px;
}

.landing-result-main span,
.landing-result-meta span {
  color: var(--muted);
  font-size: 15px;
}

.landing-result-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.landing-no-results {
  border: 1px dashed #cfcfe4;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  padding: 18px;
  text-align: center;
  color: #5f5f79;
}

.landing-no-results strong {
  display: block;
  margin-bottom: 8px;
  color: #3f3f5a;
}

.landing-create-btn {
  width: 100%;
  border: 1px solid #e0d6f8;
  border-radius: 16px;
  background: #fff;
  color: #7b4fe8;
  min-height: 52px;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}

.landing-create-btn[hidden] {
  display: none !important;
}

.landing-badge {
  position: relative;
  width: 168px;
  height: 178px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 24px 18px rgba(82, 66, 142, 0.18));
}

.landing-badge::before {
  content: "";
  width: 132px;
  height: 148px;
  background: linear-gradient(180deg, #8b65ff 0%, #5e36df 100%);
  clip-path: polygon(50% 0%, 92% 22%, 92% 78%, 50% 100%, 8% 78%, 8% 22%);
}

.landing-badge-core {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #fff 0 18%, #d9cbff 19% 40%, #7b55ee 41% 56%, #ffffff 57% 100%);
  top: 46px;
}

.landing-badge-ribbon {
  position: absolute;
  top: 102px;
  min-width: 150px;
  padding: 8px 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #6a46db;
  font-weight: 900;
  font-size: 24px;
  box-shadow: 0 6px 12px rgba(62, 43, 122, 0.08);
}

.landing-actions {
  display: grid;
  align-content: end;
}

.auth-screen {
  display: grid;
  place-items: start center;
  min-height: 75vh;
  padding-top: 18px;
}

.auth-phone {
  width: min(360px, 100%);
  border: 2px solid #7f32ff;
  border-radius: 22px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 12px 28px rgba(72, 37, 126, 0.15);
}

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-brand {
  color: #2361cf;
  font-size: 30px;
  font-weight: 800;
}

.auth-logo {
  color: #f3c92d;
  font-size: 28px;
}

.auth-sub {
  margin: 8px 0 14px;
  color: #5d6e87;
  border-bottom: 1px solid #75a5f1;
  padding-bottom: 8px;
}

.auth-next-btn {
  width: 100%;
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  font-weight: 800;
  font-size: 20px;
  cursor: pointer;
  color: #5a4500;
  background: #f2cd48;
}

.auth-note {
  margin-top: 14px;
  background: #f3f3f5;
  border: 1px solid #e2e2e9;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
}

.auth-note p {
  margin: 6px 0;
}

.auth-status {
  margin: 12px 0 0;
  color: #31568a;
  font-weight: 700;
  text-align: center;
}

.top h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
}

.top p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.controls {
  display: grid;
  gap: 12px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  font-size: 16px;
}

.scan-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mode-btn,
.btn {
  border: 0;
  border-radius: 10px;
  min-height: 44px;
  font-weight: 800;
  cursor: pointer;
}

.mode-btn {
  background: #ece7ff;
  color: #41208f;
}

.mode-btn.mode-active {
  background: linear-gradient(145deg, var(--purple), var(--purple-2));
  color: #fff;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.list-head h2 { margin: 0; }
.summary { color: var(--muted); font-weight: 700; }

.member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.member-item {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.member-main strong { display: block; }
.member-main small { color: var(--muted); }

.tag {
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 800;
}

.tag-ok { background: #dff5e9; color: #176b46; }
.tag-warn { background: #fff2d6; color: #805200; }
.tag-bad { background: #fde1e1; color: #892f2f; }

.member-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.footer-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(145deg, var(--purple), var(--purple-2));
}

.btn-muted {
  color: #fff;
  background: #717192;
}

.btn:disabled,
.mode-btn:disabled,
.icon-btn:disabled {
  opacity: 0.45;
  filter: grayscale(0.35);
  cursor: not-allowed;
}

.scan-modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 16, 26, 0.58);
  display: grid;
  place-items: center;
  padding: 16px;
}

.scan-card {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 16px;
  text-align: center;
}

.scan-card h3 { margin: 0 0 4px; }
.scan-card p { margin: 0 0 10px; color: var(--muted); }

.progress-wrap {
  position: relative;
  width: 120px;
  margin: 0 auto 12px;
}

.progress-ring {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.progress-bg {
  fill: none;
  stroke: #e8e8f6;
  stroke-width: 10;
}

.progress-fg {
  fill: none;
  stroke: #4a7bff;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 0.25s ease;
}

.progress-value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.status {
  margin: 0;
  font-weight: 700;
  color: #323255;
}

@media (max-width: 720px) {
  .landing-empty h1 {
    font-size: 24px;
  }

  .landing-empty p {
    font-size: 17px;
  }

  .member-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .footer-actions {
    grid-template-columns: 1fr;
  }
}
