:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-2: #f1f5f7;
  --text: #111827;
  --muted: #5b6472;
  --border: #d7dde4;
  --border-strong: #b8c3cc;
  --accent: #0060a9;
  --accent-dark: #004a83;
  --brand-orange: #f58220;
  --danger: #b42318;
  --shadow: 0 14px 36px rgba(16, 24, 40, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea,
.report-card {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

a.report-card {
  color: inherit;
  text-decoration: none;
}

button:hover {
  border-color: var(--border-strong);
  background: #f8fafc;
}

button:active {
  transform: translateY(1px);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  display: block;
  width: 128px;
  height: 42px;
  object-fit: contain;
  object-position: left center;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.is-hidden {
  display: none !important;
}

.landing-view {
  min-height: calc(100vh - 85px);
  padding: 32px 28px;
}

.landing-inner {
  display: grid;
  gap: 22px;
  max-width: 980px;
}

.landing-copy {
  display: grid;
  gap: 6px;
}

.landing-copy h2 {
  color: #182230;
  font-size: 1.35rem;
}

.landing-copy p {
  color: var(--muted);
}

.report-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.report-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 132px;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.report-card:hover {
  border-color: var(--border-strong);
  background: #f8fafc;
}

.report-card:active {
  transform: translateY(1px);
}

.card-action {
  align-self: end;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.report-card span {
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.report-card small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.brand p,
.preview-toolbar p,
.section-heading p {
  color: var(--muted);
  font-size: 0.88rem;
}

.header-meta {
  display: flex;
  align-items: end;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: #354052;
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  outline: none;
  padding: 9px 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus,
.drop-zone:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 96, 169, 0.14);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(520px, 0.92fr);
  min-height: calc(100vh - 85px);
}

.form-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px 28px 26px;
}

.back-button {
  justify-self: start;
  min-height: 34px;
  padding-inline: 12px;
}

.form-section {
  display: grid;
  gap: 12px;
}

.form-section h2,
.preview-toolbar h2 {
  color: #182230;
  font-size: 0.98rem;
  line-height: 1.2;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.single {
  max-width: 340px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.counter {
  justify-self: end;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  transform: translateY(-30px);
  padding-right: 10px;
  pointer-events: none;
}

[data-counter-for] {
  transform: translateY(-30px);
}

.test-block .counter {
  transform: translateY(-28px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.ghost-button {
  padding-inline: 14px;
}

.test-blocks {
  display: grid;
  gap: 14px;
}

.test-block {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.test-block-head,
.block-image-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.test-block h3 {
  margin: 0;
  color: #182230;
  font-size: 0.94rem;
}

.test-block textarea {
  min-height: 132px;
}

.block-images {
  display: grid;
  gap: 10px;
}

.block-image-toolbar strong {
  color: #354052;
  font-size: 0.78rem;
}

.drop-zone {
  display: grid;
  min-height: 104px;
  place-items: center;
  gap: 5px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.drop-zone.dragging {
  border-color: var(--accent);
  background: #f3f7fb;
}

.drop-zone svg {
  width: 33px;
  height: 33px;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.drop-zone strong {
  color: var(--text);
}

.image-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.handover-image-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.handover-image-slot {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.handover-image-slot h3 {
  margin: 0;
  color: #182230;
  font-size: 0.94rem;
}

.handover-image-slot input[type="text"] {
  min-height: 36px;
}

.handover-image-preview {
  display: grid;
  min-height: 140px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.handover-image-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
}

.handover-image-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.empty-images {
  color: var(--muted);
  font-size: 0.8rem;
}

.image-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--surface-2);
}

.image-card footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
  padding: 8px;
}

.image-card strong,
.report-shot strong {
  overflow: hidden;
  color: #1f2937;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-card small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.remove-image {
  display: grid;
  width: 28px;
  min-height: 28px;
  place-items: center;
  padding: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 2px;
}

.actions button {
  padding-inline: 18px;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.danger-button {
  color: var(--danger);
}

.checkbox-label {
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  max-width: 760px;
  color: #1f2937;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
}

.checkbox-label input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.preview-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  padding: 22px 26px;
  border-left: 1px solid var(--border);
  background: #eef2f5;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.preview-toolbar button {
  min-height: 36px;
  padding-inline: 12px;
}

.report-page {
  align-self: start;
  min-height: 760px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 28px 30px;
}

.report-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}

.report-brand {
  display: grid;
  gap: 8px;
}

.report-brand img {
  display: block;
  width: 118px;
  height: 38px;
  object-fit: contain;
  object-position: left center;
}

.report-head h2 {
  font-size: 1.45rem;
}

.report-head p {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.5;
  text-align: right;
}

.report-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 18px;
}

.ticket-only {
  max-width: 360px;
}

.report-block {
  margin-top: 18px;
}

.report-block:first-child {
  margin-top: 0;
}

.report-block h3 {
  margin: 0 0 8px;
  color: #172033;
  font-size: 0.88rem;
}

.report-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  margin: 0 0 6px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.handover-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
}

.handover-support-grid {
  display: grid;
  gap: 6px;
}

.handover-support-grid .report-row {
  grid-template-columns: 130px 1fr;
}

.sla-breakdown {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.sla-breakdown h4 {
  margin: 0;
  color: #172033;
  font-size: 0.82rem;
}

.sla-breakdown-table {
  display: grid;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.sla-breakdown-table p {
  display: grid;
  grid-template-columns: minmax(190px, 1.6fr) minmax(90px, 0.7fr);
  gap: 8px;
  margin: 0;
  padding: 5px 8px;
  border-top: 1px solid var(--border);
  color: #1f2937;
  font-size: 0.72rem;
  line-height: 1.25;
}

.sla-breakdown-table p:first-child {
  border-top: 0;
}

.sla-breakdown-table strong {
  color: #101828;
}

.confirmation-box {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  padding: 12px;
}

.confirmation-box strong {
  display: block;
  margin-bottom: 6px;
  color: #101828;
}

.report-row strong {
  color: #101828;
}

.report-text {
  white-space: pre-wrap;
  color: #1f2937;
  font-size: 0.82rem;
  line-height: 1.45;
}

.report-shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.evidence-report-block {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.evidence-report-block .report-shots {
  margin-top: 10px;
}

.report-shot {
  display: grid;
  gap: 6px;
  text-align: center;
}

.report-shot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f8fafc;
}

.report-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding-top: 10px;
  border-top: 2px solid var(--accent);
  color: var(--muted);
  font-size: 0.76rem;
}

.empty-report {
  display: grid;
  min-height: 680px;
  place-content: center;
  gap: 8px;
  text-align: center;
}

.empty-report h2 {
  font-size: 1.25rem;
}

.empty-report p {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 760px) {
  .app-header,
  .section-heading,
  .preview-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .header-meta,
  .grid.two,
  .grid.three,
    .report-cards,
  .handover-grid {
    grid-template-columns: 1fr;
  }

  .header-meta {
    display: grid;
  }

  .form-panel,
  .preview-panel {
    padding: 18px 16px;
  }

  .image-list,
  .handover-image-slots,
  .report-shots,
  .report-columns {
    grid-template-columns: 1fr;
  }

  .report-page {
    padding: 20px 18px;
  }

  .report-head,
  .report-footer {
    flex-direction: column;
  }

  .report-head p {
    text-align: left;
  }
}

@media print {
  html,
  body {
    background: #ffffff;
    margin: 0;
    padding: 0;
  }

  .app-header,
  .form-panel,
  .preview-toolbar {
    display: none;
  }

  .workspace,
  .preview-panel {
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    background: #ffffff;
  }

  .report-page {
    min-height: 0;
    width: 100%;
    border: 0;
    box-shadow: none;
    padding: 12mm;
  }

  @page {
    size: A4;
    margin: 0;
  }
}
