:root {
  --primary: #0077cc;
  --bg: #ffffff;
  --text: #1e2a36;
  --muted: #6c7a89;
  --font-stack: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

* { box-sizing:border-box; }
html, body { margin:0; font-family:var(--font-stack); background:#f5f8fb; color:var(--text); }

.app { max-width:1400px; margin:20px auto; padding:12px; }

header h1 { margin:0; font-size:1.8rem; color:var(--primary); }
.muted { color:var(--muted); font-size:0.85rem; }

/* GRID */
.grid { display:flex; flex-direction:column; gap:16px; }

/* PANEL */
.panel { background:white; border-radius:16px; padding:16px; box-shadow:0 8px 20px rgba(0,0,0,0.05); }

.form-panel label { display:block; margin-bottom:12px; font-size:0.95rem; font-weight:500; color:#334; }
.form-panel input[type=text], .form-panel textarea, .form-panel input[type=datetime-local] { width:100%; padding:10px; border:1px solid #cfd9e0; border-radius:10px; margin-top:6px; font-family:inherit; }

.actions { display:flex; flex-direction:column; gap:10px; margin-top:12px; }
.actions button { padding:10px 12px; border:none; border-radius:10px; cursor:pointer; background:var(--primary); color:white; font-weight:600; transition:0.2s; }
.actions button:hover { opacity:0.9; }
.actions button#resetBtn { background:#e6e6e6; color:#222; }

/* PREVIEW FRAME */
.preview-frame { display:flex; justify-content:center; align-items:center; background:#f9fbfd; padding:8px; overflow:auto; height:100%; }

/* PREVIEW A4 */
.brief-doc {
  width:210mm;
  height:297mm;
  background:var(--bg);
  border:1px solid #e3ebf2;
  border-radius:16px;
  padding:20px;
  display:flex;
  flex-direction:column;
  flex-shrink:0;
  transform-origin:top center;
}

.doc-header { border-bottom:3px solid var(--primary); padding-bottom:10px; margin-bottom:16px; }
.doc-header h2 { margin:0; color:var(--primary); }
.doc-header .meta { font-size:0.85rem; color:var(--muted); }

.brief-body { display:flex; flex-direction:column; gap:12px; flex-grow:1; }
.brief-row { display:flex; flex-direction:column; gap:12px; flex-grow:1; }
.brief-col { width:100%; background:#f4f9ff; border:1px solid #dce8f6; border-radius:12px; padding:14px; display:flex; flex-direction:column; flex-grow:1; }
.brief-col h3 { margin:0 0 6px 0; font-size:1rem; color:var(--primary); }
.brief-col p { margin:0; color:var(--text); line-height:1.5; }

.doc-footer { margin-top:20px; font-size:0.85rem; color:var(--muted); border-top:1px solid #dce4ec; padding-top:6px; text-align:center; }
.page-footer { text-align:center; margin-top:10px; color:var(--muted); font-size:0.85rem; }

/* RESPONSIVE HP */
@media (max-width:900px) {
  .grid { flex-direction:column; }
  .brief-doc { width:100%; height:auto; aspect-ratio: 210/297; }
}

/* DESKTOP: SPLIT SCREEN RAPIH */
@media (min-width:901px) {
  .grid { flex-direction:row; gap:20px; align-items:flex-start; }
  .preview-panel { flex:0 0 65%; display:flex; justify-content:center; }
  .form-panel { flex:0 0 35%; max-height:calc(100vh - 80px); overflow-y:auto; }
}
