:root {
  --navy: #253551;
  --navy-2: #1b2840;
  --green: #2e9e4f;
  --green-2: #23803f;
  --blue: #1f7fc0;
  --ink: #253551;
  --muted: #6b7686;
  --line: #e3e7ee;
  --bg: #f4f6f9;
  --card: #ffffff;
  --danger: #c0392b;
  --amber: #b7791f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: Poppins, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--blue); }

/* ---------- top bar ---------- */
.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-weight: 600; font-size: 15px; letter-spacing: .2px; }
.brand-text small { color: #b8c4d8; font-size: 12px; }
nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
nav a {
  color: #dbe3ef; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.who { color: #b8c4d8; font-size: 13px; margin-left: 8px; }
button.link { background: none; border: 0; color: #dbe3ef; cursor: pointer; font: inherit; font-size: 13px; text-decoration: underline; }

/* ---------- layout ---------- */
main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 32px) 48px; }
.hero { margin: 0 0 24px; }
.hero h1 { margin: 0 0 6px; font-size: 26px; font-weight: 600; }
.hero p { margin: 0; color: var(--muted); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 32px);
}
.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 18px clamp(16px, 4vw, 40px); color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); background: #fff;
}

/* ---------- sign in ---------- */
.signin-wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); background: #fff; margin-top: 12px; }
.signin-art {
  background: linear-gradient(150deg, var(--navy) 0%, #2b4870 55%, var(--green-2) 140%);
  color: #fff; padding: 44px 40px; display: flex; flex-direction: column; justify-content: space-between; min-height: 420px;
}
.signin-art h2 { font-size: 28px; line-height: 1.25; margin: 0 0 12px; font-weight: 600; }
.signin-art p { color: #d4ddea; margin: 0; }
.signin-art ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.signin-art li { display: flex; gap: 10px; align-items: flex-start; color: #e8eef6; font-size: 14px; }
.signin-art li::before { content: ""; flex: 0 0 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: #6fd38f; }
.signin-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.signin-form h3 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.signin-form .sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.code-input { letter-spacing: 10px; font-size: 24px !important; text-align: center; font-weight: 600; }

/* ---------- forms ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.full { grid-column: 1 / -1; }
.section-title { grid-column: 1 / -1; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 10px 0 -6px; padding-top: 12px; border-top: 1px solid var(--line); }
.section-title:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
label .req { color: var(--danger); }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #cfd6e1; border-radius: 8px;
  padding: 10px 12px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,127,192,.15); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 14.5px;
  border: 0; border-radius: 8px; padding: 11px 20px; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-2); }
.btn-secondary { background: #eef2f7; color: var(--navy); }
.btn-secondary:hover { background: #e2e8f0; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.error { background: #fdecea; color: #8a1f15; border: 1px solid #f5c6c0; padding: 10px 12px; border-radius: 8px; font-size: 14px; margin: 0 0 16px; }
.note { background: #eaf6ee; color: #1d5e33; border: 1px solid #c7e7d1; padding: 10px 12px; border-radius: 8px; font-size: 14px; margin: 0 0 16px; }

/* ---------- drop zone ---------- */
.drop {
  border: 2px dashed #c4cdda; border-radius: 10px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; background: #fafbfd;
  transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--green); background: #f1faf4; }
.drop strong { color: var(--ink); }
.files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.files li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fff; font-size: 14px; }
.files .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .size { color: var(--muted); font-size: 12.5px; }
.files .state { font-size: 12.5px; color: var(--muted); }
.files .state.done { color: var(--green-2); }
.files .state.fail { color: var(--danger); }
.files button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }

/* ---------- requests table ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.search { max-width: 280px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; text-transform: uppercase; letter-spacing: .6px; padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
.list td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tr.row { cursor: pointer; }
.list tr.row:hover td { background: #f8fafc; }
.list .rid { font-weight: 600; }
.list .proj { color: var(--muted); font-size: 12.5px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.s-submitted, .pill.s-received { background: #eaf1fb; color: #1c5a92; }
.pill.s-in-progress { background: #fff4e0; color: var(--amber); }
.pill.s-on-hold { background: #f1f1f4; color: #5b6270; }
.pill.s-complete { background: #e6f5ea; color: var(--green-2); }
.ready { color: var(--green-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); margin: 0 0 6px; font-weight: 600; }

/* ---------- detail ---------- */
.back { display: inline-block; margin-bottom: 14px; text-decoration: none; font-size: 14px; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.detail-head h1 { margin: 0; font-size: 22px; font-weight: 600; }
.detail-head .proj { color: var(--muted); }
dl.facts { display: grid; grid-template-columns: 180px 1fr; gap: 10px 20px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 24px; }
.step { height: 6px; border-radius: 3px; background: #e3e7ee; }
.step.on { background: var(--green); }
.steps-labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: -18px; margin-bottom: 24px; }
.downloads { margin-top: 24px; }
.downloads h2 { font-size: 16px; margin: 0 0 10px; font-weight: 600; }
.dl { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; text-decoration: none; color: var(--ink); }
.dl:hover { border-color: var(--green); background: #f6fbf7; }
.dl .name { flex: 1; font-weight: 500; }
.dl .size { color: var(--muted); font-size: 12.5px; }

/* ---------- misc ---------- */
.spinner { width: 22px; height: 22px; border: 3px solid #d9e0ea; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; margin: 48px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px;
  border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; z-index: 20;
}
.success { text-align: center; padding: 20px 8px; }
.success .check { width: 64px; height: 64px; border-radius: 50%; background: #e6f5ea; color: var(--green-2); display: grid; place-items: center; font-size: 32px; margin: 0 auto 16px; }
.success h2 { margin: 0 0 6px; font-weight: 600; }
.success p { color: var(--muted); margin: 0 0 4px; }

@media (max-width: 760px) {
  .signin-wrap { grid-template-columns: 1fr; }
  .signin-art { min-height: 0; padding: 28px 24px; }
  .signin-form { padding: 28px 24px; }
  .grid { grid-template-columns: 1fr; }
  dl.facts { grid-template-columns: 1fr; gap: 2px; }
  dl.facts dd { margin-bottom: 10px; }
  .list .hide-sm { display: none; }
  .who { display: none; }
}
