:root {
  --navy: #010c68;
  --blue: #123b91;
  --blue-soft: #e8eefc;
  --text: #1a1a1a;
  --muted: #5b6475;
  --line: #d7deea;
  --bg: #f4f6fb;
  --white: #ffffff;
  --danger: #b42318;
  --warn: #9a6700;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

h1 {
  margin: 4px 0 6px;
  color: var(--navy);
  font-size: 28px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  gap: 20px;
  align-items: start;
}

.report-form, .preview-pane {
  min-width: 0;
}

.card, .preview-pane {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(1, 12, 104, 0.06);
}

.card {
  padding: 18px 18px 16px;
  margin-bottom: 14px;
}

.card h2, .preview-toolbar h2 {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

label span { color: #c9372c; }

label small {
  font-weight: 400;
  color: var(--muted);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"] {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  background: #fbfcff;
}

input:focus {
  outline: 2px solid #9bb4ee;
  border-color: var(--blue);
}

.check-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
}

.check-row input { width: 16px; height: 16px; }

.file-label input { padding-top: 7px; }

.image-preview {
  margin-top: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
}

.image-preview img {
  display: block;
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  margin: 0 auto;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

button, .download-link, .ghost-btn {
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.primary-btn { background: var(--navy); color: white; }
.secondary-btn { background: var(--blue-soft); color: var(--navy); }
.ghost-btn { background: white; color: var(--navy); border: 1px solid var(--line); }
.download-link { background: var(--navy); color: white; font-size: 13px; }

button:disabled { opacity: 0.65; cursor: wait; }

.warn {
  color: var(--warn);
  font-size: 13px;
  margin: 8px 0;
}

.status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.status.error { background: #fdecec; color: var(--danger); }
.status.ok { background: #eaf7ee; color: #17663a; }
.status.info { background: var(--blue-soft); color: var(--navy); }

.preview-pane {
  position: sticky;
  top: 16px;
  min-height: 860px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 0;
}

.preview-pane iframe {
  flex: 1;
  width: 100%;
  border: 0;
  min-height: 780px;
  background: #e9edf5;
}

.preview-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 40px;
  text-align: center;
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .preview-pane { position: static; min-height: 700px; }
  .grid { grid-template-columns: 1fr; }
}
