:root {
  color-scheme: light;
  --bg: #eef2f6;
  --panel: #ffffff;
  --text: #111827;
  --muted: #667085;
  --line: #d9e0ea;
  --soft: #f6f8fb;
  --blue: #1769e0;
  --blue2: #3b82f6;
  --green: #087443;
  --orange: #b54708;
  --red: #b42318;
  --shadow: 0 12px 34px rgba(24, 39, 75, .12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); letter-spacing: 0; }
button, input, textarea, select { font: inherit; }
a { color: var(--blue); text-decoration: none; }

.mobile-shell { max-width: 720px; margin: 0 auto; padding: 0 12px 84px; }
.hero {
  min-height: 174px;
  margin: 0 -12px;
  padding: 34px 28px 30px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  color: #fff;
  background: linear-gradient(135deg, #1769e0 0%, #2680ef 48%, #25a18e 100%);
}
.eyebrow { margin: 0 0 8px; opacity: .84; font-size: 14px; }
.hero h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.12; }
.hero p:last-child { margin: 0; line-height: 1.55; opacity: .9; }
.doc-stack { position: relative; width: 132px; height: 96px; flex: 0 0 132px; }
.passport-icon, .photo-icon { position: absolute; border-radius: 8px; box-shadow: 0 12px 24px rgba(12, 35, 74, .24); }
.passport-icon {
  left: 8px; top: 6px; width: 72px; height: 90px; padding-top: 15px;
  text-align: center; font-size: 10px; font-weight: 800; background: #123d79;
}
.passport-icon::after {
  content: ""; display: block; width: 32px; height: 32px; margin: 13px auto 0;
  border: 2px solid rgba(255,255,255,.92); border-radius: 50%;
}
.photo-icon {
  right: 4px; top: 22px; width: 60px; height: 72px; border: 5px solid #eef5ff;
  background: radial-gradient(circle at 50% 30%, #f3c6a6 0 13%, transparent 14%),
              radial-gradient(circle at 50% 35%, #182033 0 24%, transparent 25%),
              linear-gradient(#f9d7bd 0 50%, #1e4d8f 51% 100%);
  transform: rotate(5deg);
}

.panel {
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.upload-panel, .history-panel { padding: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 18px; }
.state-text { color: var(--muted); font-size: 13px; }
.form-grid { display: grid; gap: 14px; }
label { display: grid; gap: 7px; }
label span { font-size: 14px; color: #344054; }
label b { color: var(--red); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: 0;
}
input, select { height: 46px; padding: 0 12px; }
textarea { padding: 11px 12px; resize: vertical; min-height: 78px; }
input:focus, textarea:focus, select:focus { border-color: #79aef7; box-shadow: 0 0 0 3px rgba(23,105,224,.12); }

.upload-box {
  min-height: 82px;
  border: 1px dashed #c7d3e3;
  border-radius: 8px;
  background: var(--soft);
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-areas: "plus title" "plus hint";
  align-items: center;
  column-gap: 10px;
  padding: 14px;
  cursor: pointer;
}
.upload-box input { display: none; }
.upload-box .plus { grid-area: plus; width: 34px; height: 34px; display: grid; place-items: center; font-size: 28px; color: #475467; }
.upload-box strong { grid-area: title; font-weight: 700; }
.upload-box em { grid-area: hint; color: var(--muted); font-style: normal; font-size: 12px; }
.preview-box { display: none; gap: 10px; align-items: center; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.preview-box.open { display: flex; }
.preview-box img { width: 58px; height: 58px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); }
.preview-box span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

.primary-button {
  height: 48px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
  font-weight: 700;
}
.primary-button:disabled { opacity: .68; cursor: wait; }
.text-button { border: 0; background: transparent; color: var(--blue); cursor: pointer; padding: 4px 0; }

.history-list { display: grid; gap: 10px; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.history-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.history-card strong { display: block; margin-bottom: 5px; }
.history-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.thumbs { display: flex; gap: 8px; align-items: center; }
.thumbs img, .thumbs a {
  width: 54px; height: 54px; border-radius: 6px; border: 1px solid var(--line);
  object-fit: cover; display: grid; place-items: center; background: var(--soft); font-size: 12px;
}
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.submitted { color: var(--blue); background: #eaf2ff; }
.pill.processing { color: var(--orange); background: #fff4e5; }
.pill.need_more, .pill.rejected { color: var(--red); background: #fff1f0; }
.pill.completed { color: var(--green); background: #ecfdf3; }

.admin-body { background: #f6f8fb; }
.admin-header {
  min-height: 74px; padding: 16px 24px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.admin-header h1 { margin: 0 0 4px; font-size: 22px; }
.admin-header p { margin: 0; color: var(--muted); }
.admin-main { max-width: 1180px; margin: 0 auto; padding: 18px; }
.admin-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.admin-toolbar input { max-width: 380px; }
.admin-toolbar button, .status-select {
  height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 12px;
}
.admin-list { display: grid; gap: 12px; }
.admin-card {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px;
  display: grid; grid-template-columns: minmax(240px, 1fr) 220px 220px 160px; gap: 14px; align-items: start;
}
.admin-card h2 { margin: 0 0 8px; font-size: 18px; }
.admin-card p { margin: 0 0 6px; color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.file-preview { display: grid; gap: 7px; }
.file-preview img { width: 100%; height: 132px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.file-preview a { font-size: 13px; }

@media (max-width: 760px) {
  .hero { padding: 30px 18px 26px; }
  .doc-stack { width: 108px; flex-basis: 108px; transform: scale(.86); transform-origin: right center; }
  .admin-header, .admin-toolbar { display: grid; }
  .admin-card { grid-template-columns: 1fr; }
  .file-preview img { height: 220px; }
}
