* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: #1f2933; background: #f4f6f8; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; background: #1d4ed8; color: #fff; }
.brand { font-size: 17px; font-weight: 600; }
.tag { font-size: 12px; background: rgba(255,255,255,.2); padding: 1px 8px; border-radius: 10px; margin-left: 6px; }
.who { font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.who select { max-width: 180px; }
.who a { color: #fff; cursor: pointer; text-decoration: underline; }
.layout { display: flex; min-height: calc(100vh - 48px); }
.nav { width: 170px; background: #fff; border-right: 1px solid #e3e8ee; padding: 10px 0; flex-shrink: 0; }
.nav a { display: block; padding: 9px 18px; color: #334155; cursor: pointer; text-decoration: none; }
.nav a.active { background: #e8efff; color: #1d4ed8; font-weight: 600; border-right: 3px solid #1d4ed8; }
.nav .sep { font-size: 12px; color: #94a3b8; padding: 12px 18px 4px; }
.main { flex: 1; padding: 18px 22px; max-width: 1100px; overflow-x: auto; }
.card { background: #fff; border: 1px solid #e3e8ee; border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.card h3 { margin: 14px 0 8px; font-size: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 10px; }
label.f { display: flex; flex-direction: column; font-size: 12px; color: #52606d; gap: 3px; }
label.c { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid #cbd2d9; border-radius: 5px; background: #fff; }
input[type=number] { width: 90px; }
textarea { width: 100%; min-height: 90px; }
button { font: inherit; padding: 6px 14px; border-radius: 5px; border: 1px solid #1d4ed8; background: #1d4ed8; color: #fff; cursor: pointer; }
button.sec { background: #fff; color: #1d4ed8; }
button.warn { background: #b45309; border-color: #b45309; }
button.link { background: none; border: none; color: #1d4ed8; padding: 0 4px; text-decoration: underline; }
button:disabled { opacity: .5; cursor: not-allowed; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { border-bottom: 1px solid #edf0f3; padding: 6px 8px; text-align: left; vertical-align: top; }
th { background: #f8fafc; color: #52606d; font-weight: 600; }
.muted { color: #7b8794; font-size: 12px; }
.ok { color: #047857; } .bad { color: #b91c1c; } .mid { color: #b45309; }
.pill { display: inline-block; font-size: 12px; padding: 0 8px; border-radius: 10px; background: #e5e7eb; }
.pill.archived { background: #d1fae5; color: #065f46; } .pill.needs_review { background: #fef3c7; color: #92400e; }
.pill.pending_server { background: #dbeafe; color: #1e40af; } .pill.rejected, .pill.missing { background: #fee2e2; color: #991b1b; }
.warnbox { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 6px; padding: 8px 12px; margin: 8px 0; font-size: 13px; }
.infobox { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px; padding: 8px 12px; margin: 8px 0; font-size: 13px; }
.grid-answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.grid-answers label { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.grid-answers input { width: 64px; padding: 3px 6px; }
.grid-answers .flag input { border-color: #f59e0b; background: #fffbeb; }
.thumb { max-width: 100%; max-height: 70vh; border: 1px solid #e3e8ee; }
.hidden { display: none !important; }
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: #fff; border-radius: 8px; padding: 18px; max-width: min(960px, 96vw); max-height: 92vh; overflow: auto; position: relative; min-width: 300px; }
.modal-close { position: absolute; right: 12px; top: 10px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 9px 18px; border-radius: 6px; z-index: 60; max-width: 90vw; }
.toast.err { background: #b91c1c; }
.login { max-width: 360px; margin: 60px auto; }
.login input { width: 100%; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin: 3px 0; }
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .nav { width: 100%; display: flex; overflow-x: auto; padding: 0; border-right: none; border-bottom: 1px solid #e3e8ee; }
  .nav a { white-space: nowrap; padding: 10px 12px; }
  .nav a.active { border-right: none; border-bottom: 3px solid #1d4ed8; }
  .nav .sep { display: none; }
  .main { padding: 12px; }
}
@media print { .topbar, .nav { display: none; } }
