:root {
  --ink: #18202b;
  --muted: #657286;
  --line: #d9e0e8;
  --paper: #ffffff;
  --soft: #f4f7fa;
  --primary: #0f5f8f;
  --primary-dark: #0a466b;
  --green: #14715c;
  --danger: #c23535;
  --warning: #a86608;
  --shadow: 0 16px 40px rgba(24, 32, 43, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--soft);
  letter-spacing: 0;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; }
.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 12px; align-items: center; font-weight: 700; }
.mark {
  width: 34px; height: 34px; border-radius: 6px;
  background: linear-gradient(135deg, var(--primary), var(--green));
}
.subtle { color: var(--muted); font-size: 13px; }
.layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 68px); }
.sidebar {
  background: #102233;
  color: #d9e8f4;
  padding: 22px 16px;
}
.side-title { color: #8fb4cf; font-size: 12px; text-transform: uppercase; margin: 6px 10px 12px; }
.nav-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 11px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
}
.nav-btn.active, .nav-btn:hover { background: rgba(255,255,255,.10); }
.main { padding: 28px; max-width: 1360px; width: 100%; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 0; }
.btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 6px;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.panel-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.panel-body { padding: 20px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 12px; color: var(--muted); background: #f8fafc; }
.status {
  display: inline-flex; align-items: center;
  padding: 4px 8px; border-radius: 999px;
  font-size: 12px; background: #e8eef5; color: #334155;
}
.status.Submitted { background: #dff3ea; color: #12604d; }
.status.Draft { background: #fff2d9; color: #7b4b03; }
.status.Archived { background: #eceff3; color: #596273; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { font-size: 13px; color: #344256; font-weight: 600; }
.req { color: var(--danger); margin-left: 3px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  min-height: 39px;
}
textarea { min-height: 96px; resize: vertical; }
input[readonly], textarea[readonly], select:disabled {
  background: #f2f5f8;
  color: #576174;
}
.choices { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.choice {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.choice input { width: auto; min-height: auto; }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.step {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 10px;
  min-height: 58px;
}
.step.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.step strong { display: block; font-size: 13px; }
.step span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-box { width: min(420px, 100%); }
.notice {
  padding: 12px 14px;
  background: #edf7fb;
  border: 1px solid #c9e5f0;
  color: #24556a;
  border-radius: 6px;
  margin-bottom: 16px;
}
.review { display: grid; gap: 18px; }
.review-section { border-top: 1px solid var(--line); padding-top: 16px; }
.review-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
.review-item b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.file-list { display: grid; gap: 8px; margin-top: 10px; }
.file-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; }
.file-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-main a { overflow-wrap: anywhere; }
.upload-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.file-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.thumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.thumb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  background: #fff;
  font-size: 13px;
}
.thumb-item span { overflow-wrap: anywhere; }
.thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f8fafc;
}
.file-icon {
  display: inline-flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.linkbox {
  display: flex; gap: 8px; align-items: center;
  padding: 10px;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.linkbox input { min-width: 0; }
.print-only { display: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: flex; gap: 8px; overflow-x: auto; padding: 10px; }
  .side-title { display: none; }
  .nav-btn { width: auto; white-space: nowrap; }
  .main { padding: 18px; }
  .grid, .review-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .toolbar, .panel-head { align-items: flex-start; flex-direction: column; }
}
@media print {
  .topbar, .sidebar, .steps, .btn-row, .no-print { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; max-width: none; }
  .panel { border: 0; box-shadow: none; }
  .print-only { display: block; }
}
