:root{
  --accent:#1f6feb;
  --bg:#f4f6fb;
  --card:#ffffff;
  --ink:#1b2330;
  --muted:#6b7686;
  --line:#e4e8f0;
  --ok-bg:#e6f8ee; --ok-ink:#136a39; --ok-line:#9fe0bd;
  --err-bg:#fdeaea; --err-ink:#a02020; --err-line:#f3b6b6;
  --radius:14px;
}
*{box-sizing:border-box}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"PingFang SC","Microsoft YaHei",sans-serif;
  line-height:1.5;
}
a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}

/* header */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; padding:12px 22px; background:#0f1c33; color:#fff;
  position:sticky; top:0; z-index:20;
}
.brand{display:flex; align-items:center; gap:12px; color:#fff; font-weight:700; font-size:19px}
.brand:hover{text-decoration:none}
.brand small{font-weight:500; opacity:.7; font-size:12px; display:block; margin-top:-2px}
.logo{height:38px; width:auto; background:#fff; border-radius:8px; padding:3px}
.topbar nav{display:flex; gap:6px; flex-wrap:wrap}
.topbar nav a{color:#cdd7e6; padding:7px 13px; border-radius:9px; font-size:14px}
.topbar nav a:hover{background:rgba(255,255,255,.12); color:#fff; text-decoration:none}

.wrap{max-width:980px; margin:26px auto; padding:0 18px}
.foot{text-align:center; color:var(--muted); font-size:13px; padding:30px 10px 40px}

/* flashes */
.flashes{margin-bottom:18px; display:grid; gap:10px}
.flash{padding:12px 16px; border-radius:11px; border:1px solid; font-size:15px}
.flash.ok{background:var(--ok-bg); color:var(--ok-ink); border-color:var(--ok-line)}
.flash.error{background:var(--err-bg); color:var(--err-ink); border-color:var(--err-line)}

/* cards */
.card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:24px; box-shadow:0 1px 3px rgba(20,30,50,.05)}
.card + .card{margin-top:20px}
h1{font-size:26px; margin:.1em 0 .4em}
h2{font-size:19px; margin:0 0 14px}
.sub{color:var(--muted); margin-top:0}

/* landing choice cards */
.choices{display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:22px}
@media(max-width:680px){.choices{grid-template-columns:1fr}}
.choice{display:block; background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:26px; text-align:center; box-shadow:0 1px 3px rgba(20,30,50,.05); transition:.15s}
.choice:hover{text-decoration:none; transform:translateY(-3px); box-shadow:0 8px 22px rgba(20,30,50,.12)}
.choice .ic{font-size:42px; line-height:1}
.choice h2{margin:14px 0 6px; font-size:22px}
.choice .desc{color:var(--muted); font-size:14px; min-height:38px}
.choice .prog{margin-top:14px; font-size:13px; color:var(--muted)}
.bar{height:8px; border-radius:6px; background:#eef1f6; overflow:hidden; margin-top:8px}
.bar > i{display:block; height:100%; background:var(--accent)}

/* forms */
label{display:block; font-weight:600; margin:14px 0 6px; font-size:14px}
.req{color:#c0392b}
select, input[type=text], input[type=password], input[type=date], input[type=file]{
  width:100%; padding:11px 13px; border:1px solid #cdd5e2; border-radius:10px; font-size:15px; background:#fff; color:var(--ink)
}
select:focus, input:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent)}
.hint{color:var(--muted); font-size:13px; margin-top:5px}
.btn{display:inline-flex; align-items:center; gap:8px; background:var(--accent); color:#fff; border:none;
  padding:12px 20px; border-radius:11px; font-size:15px; font-weight:600; cursor:pointer}
.btn:hover{filter:brightness(1.07); text-decoration:none; color:#fff}
.btn.sec{background:#eef1f6; color:var(--ink)}
.btn.sec:hover{background:#e3e8f1}
.btn.sm{padding:7px 13px; font-size:13.5px; border-radius:9px}
.btn.gray{background:#5b6678}
.row{display:flex; gap:12px; flex-wrap:wrap; align-items:center}
.spacer{flex:1}

.badge{display:inline-block; padding:3px 10px; border-radius:20px; font-size:12.5px; font-weight:600}
.badge.done{background:var(--ok-bg); color:var(--ok-ink)}
.badge.todo{background:#fff3e0; color:#9a6209}
.pill{display:inline-block; background:#eef1f6; color:#475063; border-radius:7px; padding:2px 9px; font-size:12.5px}

/* person banner */
.you{display:flex; align-items:center; gap:14px; background:color-mix(in srgb, var(--accent) 8%, #fff);
  border:1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius:12px; padding:14px 18px; margin-bottom:18px}
.you .nm{font-weight:700; font-size:17px}
.you .rk{color:var(--muted); font-size:13px}

/* reference templates */
.refs{display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:14px; margin-top:8px}
.ref{border:1px solid var(--line); border-radius:11px; overflow:hidden; background:#fafbfd; text-align:center}
.ref img{width:100%; height:180px; object-fit:contain; background:#fff; display:block; border-bottom:1px solid var(--line)}
.ref .cap{padding:8px 6px; font-size:12.5px; color:var(--muted)}

/* current submission preview */
.preview-box{margin-top:10px; border:1px solid var(--line); border-radius:11px; padding:14px; background:#fafbfd; text-align:center}
.preview-box img{max-width:100%; max-height:420px; border-radius:8px; border:1px solid var(--line); background:#fff}

/* admin table */
table{width:100%; border-collapse:collapse; font-size:14px}
th, td{text-align:left; padding:10px 10px; border-bottom:1px solid var(--line); vertical-align:middle}
th{font-size:12.5px; text-transform:uppercase; letter-spacing:.03em; color:var(--muted); background:#f8fafc}
tbody tr:hover{background:#f8fafc}
.thumb{width:74px; height:74px; object-fit:cover; border-radius:8px; border:1px solid var(--line); background:#fff; cursor:zoom-in; display:block}
.nofile{color:var(--muted); font-size:13px}
.tabs{display:flex; gap:8px; margin-bottom:18px}
.tab{padding:9px 18px; border-radius:10px; background:#eef1f6; color:var(--ink); font-weight:600}
.tab.active{background:var(--accent); color:#fff}
.tab:hover{text-decoration:none}
.stat{display:flex; gap:22px; flex-wrap:wrap; margin:6px 0 2px}
.stat .n{font-size:24px; font-weight:700}
.stat .l{font-size:12.5px; color:var(--muted)}
.toolbar{display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin:14px 0}

/* lightbox */
.lb{position:fixed; inset:0; background:rgba(8,12,22,.85); display:none; align-items:center; justify-content:center; z-index:50; padding:24px}
.lb.open{display:flex}
.lb img{max-width:94vw; max-height:90vh; border-radius:10px; box-shadow:0 10px 40px rgba(0,0,0,.5)}
.lb .x{position:absolute; top:18px; right:24px; color:#fff; font-size:34px; cursor:pointer; line-height:1}
.lb iframe{width:92vw; height:90vh; border:none; border-radius:10px; background:#fff}
