:root {
  --bg: #f1f1f1;
  --panel: #ffffff;
  --line: #d7d7d7;
  --text: #1a1a1a;
  --soft: #4b4b4b;
  --accent: #d72d2d;
  --shadow: 0 18px 35px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  gap: 24px;
  padding: 28px;
  align-items: flex-start;
  justify-content: center;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.form-panel {
  width: min(100%, 360px);
  padding: 22px;
}

.form-panel h1 {
  margin: 0 0 18px;
  font-size: 1.6rem;
  text-align: center;
  letter-spacing: 0.03em;
}

.field-group {
  margin-bottom: 12px;
}

.field-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.9rem;
}

.field-group input,
.field-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  color: var(--text);
}

.field-group input:focus,
.field-group textarea:focus {
  outline: 2px solid rgba(17, 17, 17, 0.12);
  border-color: #b6b6b6;
}

.preview-panel {
  width: min(100%, 860px);
  padding: 18px;
}

.preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}

button {
  border: none;
  border-radius: 8px;
  background: #111;
  color: #fff;
  padding: 10px 16px;
  cursor: pointer;
  transition: 0.2s ease;
}

button:hover {
  opacity: 0.94;
}

button.secondary {
  background: #5a5a5a;
}

.po-preview {
  width: 100%;
  min-height: 720px;
  background: #fff;
  border: 1px solid #dcdcdc;
  padding: 40px 50px 24px;
  color: var(--text);
  font-family: 'Times New Roman', Times, serif;
}

.po-header {
  text-align: center;
  margin-bottom: 22px;
}

.po-preview h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
}

.po-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.po-specs {
  display: grid;
  gap: 10px;
}

.spec-row {
  font-size: 1.05rem;
}

.value-text {
  font-weight: 700;
  text-decoration: underline;
}

.deadline-row {
  margin-top: 6px;
}

.deadline {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
}

.po-images {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  gap: 60px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.image-card {
  position: relative;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  min-height: 0;
  width: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.image-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.image-card img[style*="display: none"] {
  display: none !important;
}

. image-caption:empty{
  display: none !important;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: underline;
  margin-bottom: 8px;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .app-shell {
    flex-direction: column;
    padding: 16px;
  }

  .form-panel,
  .preview-panel {
    width: 100%;
  }

  .po-images {
    grid-template-columns: 1fr;
  }
}

@media print {

    body {
        background: #fff;
    }


    * {
        text-decoration: none !important;
    }


    .form-panel,
    .preview-actions {
        display: none !important;
    }


    .app-shell {
        display: block;
        padding: 0;
        margin: 0;
    }


    .preview-panel {
        width: 100%;
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
    }


    .po-preview {
        border: none;
        min-height: auto;
        padding: 0;
        margin: 0;
        box-shadow: none;

        font-family: "Times New Roman", Times, serif;

        color: #000;
    }


    /* =================================
       JUDUL
    ================================= */

    .po-header {
        margin-bottom: 30px;
    }


    .po-preview h2 {
        font-size: 20pt;
        color: #000;
    }


    /* =================================
       DETAIL
    ================================= */

    .po-specs {
        padding-left: 0;
        gap: 12px;
    }


    .spec-row {
        font-size: 14pt;
    }


    .label-text,
    .value-text {
        color: #000;
        font-weight: bold;
        font-style: normal;
    }


    .deadline {
        color: #000 !important;
        font-weight: bold;
    }


    /* =================================
       AREA GAMBAR
    ================================= */

    .po-images {

        display: flex !important;

        justify-content: center !important;

        align-items: flex-start !important;

        gap: 45px;

        width: 100%;

        margin-top: 65px;

        flex-wrap: nowrap;

    }


    /* =================================
       KARTU GAMBAR
    ================================= */

    .image-card {

        position: relative !important;

        width: 42% !important;

        min-height: auto !important;

        display: flex !important;

        flex-direction: column;

        align-items: center;

        justify-content: flex-start;

        border: none !important;

        background: transparent !important;

    }


    /* =================================
       GAMBAR
    ================================= */

    .image-card img {

        width: 100% !important;

        max-width: 260px;

        height: auto !important;

        object-fit: contain !important;

        display: block !important;

        visibility: visible !important;

    }


    /*
       Hanya sembunyikan jika benar-benar
       belum upload
    */

    .image-card img[data-uploaded="false"] {
        display: none !important;
    }


    /* =================================
       TEXTURE / CATATAN
       TEPAT DI ATAS GAMBAR KANAN
    ================================= */

    .right-card .image-caption {

        position: absolute !important;

        top: -38px !important;

        left: 0 !important;

        width: 100% !important;

        text-align: center !important;

        font-size: 13pt !important;

        font-weight: bold !important;

        color: #000 !important;

        background: transparent !important;

        border: none !important;

        padding: 0 !important;

        margin: 0 !important;

        z-index: 20;

    }


    .image-caption:empty {
        display: none !important;
    }


    /* =================================
       A4
    ================================= */

    @page {
        size: A4 portrait;
        margin: 20mm;
    }

}