:root {
  --kn-blue: #002060;
  --kn-orange: #F28C00;
  --bg: #f5f7fa;
  --text: #0f172a;
  --muted: #64748b;
  --white: #ffffff;
  --border: #d8e0ea;
  --success: #0b7a43;
  --danger: #c0392b;
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, rgba(0,59,122,0.06), transparent 180px), var(--bg);
}
a { color: var(--kn-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  background: var(--white);
  border-bottom: 4px solid var(--kn-blue);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand-wrap {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.brand-wrap.compact { justify-content: space-between; }
.brand-logo { height: 56px; width: auto; display: block; }
.brand-logo.small { height: 42px; }
.brand-placeholder {
  width: 56px; height: 56px; border-radius: 12px; background: var(--kn-blue); color: white;
  display: grid; place-items: center; font-weight: bold;
}
.topbar h1 { margin: 0 0 .25rem 0; font-size: 1.45rem; color: var(--kn-blue); }
.subtitle { margin: 0; color: var(--muted); }
.topnav { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.topnav a {
  display: inline-block; padding: .65rem 1rem; border-radius: 999px; background: #eef3f8; font-weight: 600;
}
.topnav a.active { background: var(--kn-blue); color: var(--white); }
.container { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }
.container.narrow { max-width: 900px; }
.card {
  background: var(--white); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  padding: 1.25rem; margin-bottom: 1rem;
}
.intro-card { border-left: 6px solid var(--kn-orange); }
.form-grid { display: grid; gap: 1rem; }
.grid { display: grid; gap: 1rem; }
.two-col { grid-template-columns: repeat(2, minmax(0,1fr)); }
label, fieldset { display: block; border: 0; padding: 0; margin: 0; }
legend, label span { display: block; margin-bottom: .45rem; font-weight: 700; }
input[type="text"], input[type="date"], input[type="time"], input[type="file"], textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: .85rem .95rem; font-size: 1rem; background: #fff;
}
input[readonly] { background: #f8fafc; }
textarea { resize: vertical; min-height: 100px; }
.options-inline { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.checkbox-row { display: flex; gap: .65rem; align-items: center; min-height: 46px; }
.assessment-row { padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 14px; margin-bottom: .75rem; }
.result-box { margin-top: 1rem; padding: 1rem; border-radius: 14px; background: rgba(242,140,0,0.08); border: 1px dashed var(--kn-orange); }
.muted { color: var(--muted); }
.signature-wrap { border: 2px dashed var(--kn-blue); border-radius: 16px; overflow: hidden; background: #fff; }
#signaturePad { width: 100%; height: 260px; display: block; touch-action: none; background: linear-gradient(180deg, #fff, #f8fbff); }
.signature-actions { margin-top: .75rem; }
.btn {
  display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 12px;
  padding: .9rem 1.2rem; font-weight: 700; cursor: pointer; transition: .2s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--kn-blue); color: var(--white); }
.btn-secondary { background: #eef3f8; color: var(--kn-blue); }
.submit-card { text-align: right; }
.success-card { text-align: center; border-top: 8px solid var(--success); }
.button-row { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; margin-top: 1rem; }
.summary-grid, .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .75rem 1rem; margin-top: 1rem; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .9rem .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--kn-blue); background: #f9fbfd; position: sticky; top: 0; }
.badge { display: inline-block; padding: .35rem .7rem; border-radius: 999px; font-weight: 700; }
.badge-ok { background: rgba(11,122,67,0.12); color: var(--success); }
.badge-bad { background: rgba(192,57,43,0.12); color: var(--danger); }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.gallery img { width: 100%; height: 160px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); }
.signature-image { width: min(100%, 560px); border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.detail-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
@media (max-width: 820px) {
  .two-col, .summary-grid, .detail-grid { grid-template-columns: 1fr; }
  .submit-card { text-align: stretch; }
  .btn { width: 100%; }
  .button-row { justify-content: stretch; }
  .topbar { padding: 1rem; }
  .brand-logo { height: 42px; }
}
