/* Base layout */
:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --border: #dcdfe6;
  --text: #1a1a1a;
  --muted: #555;
  --brand: #1f4aa2;
  --accent: #0a7;
}
* { box-sizing: border-box }
body { margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif; color: var(--text); background: var(--bg); }

.app-header { display:flex; justify-content: space-between; align-items: flex-end; padding: 16px 24px; background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top:0; z-index:10 }
.app-header .brand h1 { margin:0; color: var(--brand); font-size: 20px; letter-spacing: 0.5px; }
.app-header .brand p { margin:2px 0; font-size: 12px; color: var(--muted) }
.app-header .brand .addr, .app-header .brand .contact { font-size: 12px }

.auth input { padding:8px; margin:0 4px; }
.auth button { padding:8px 12px; margin:0 4px; }
.auth .link { background: none; border: none; color: var(--brand); cursor: pointer }
.hidden { display:none }

.main { display:grid; grid-template-columns: 560px 1fr; gap: 16px; padding: 16px }
.form-panel, .preview-panel { background: var(--panel); border:1px solid var(--border); border-radius: 8px; }
.form-panel .panel-header { display:flex; justify-content: space-between; align-items:center; padding: 12px 16px; border-bottom:1px solid var(--border) }
.form-panel .actions button { margin-left:8px }

fieldset { border:1px solid var(--border); border-radius:8px; margin:12px 16px; padding:10px }
legend { padding:0 6px; font-weight:600; color: var(--brand) }
label { display:flex; flex-direction: column; font-size: 12px; margin: 6px 0 }
input, textarea, select { padding:8px; border:1px solid var(--border); border-radius:6px; font-size: 13px; }
textarea { resize: vertical }
.inline { display:flex; align-items:center; gap:8px }
.list { list-style: none; padding-left: 0; margin: 8px 0 }
.list li { display:flex; justify-content: space-between; align-items:center; border:1px dashed var(--border); padding:6px 8px; border-radius:6px; margin-bottom:6px }
.list button { border:none; background:none; color:#c00; cursor:pointer }

.grid.two { display:grid; grid-template-columns: 1fr 1fr; gap: 8px }
.grid.three { display:grid; grid-template-columns: repeat(3, 1fr); gap: 8px }
.grid.four { display:grid; grid-template-columns: repeat(4, 1fr); gap: 8px }

/* LR Preview (A4 landscape area) */
.lr-a4.landscape { --page-w: 297mm; --page-h: 210mm; background: #fff; width: var(--page-w); height: var(--page-h); margin: 12px auto; border: 1px solid #000; padding: 8mm; color:#000 }
.lr-header { display:flex; justify-content: space-between; border-bottom:1px solid #000; padding-bottom: 6px; }
.lr-header h2 { margin:0; font-size: 18px; }
.lr-header p { margin:0; font-size: 11px }
.lr-meta { min-width: 180mm; font-size: 11px }
.lr-meta .row { display:flex; justify-content: space-between; border-bottom:1px dotted #444; padding:2px 0 }
.lr-body { font-size: 11px }
.caution { border:1px solid #000; padding:4px; margin:6px 0 }
.insurance, .notice, .packing, .freight, .route { border:1px solid #000; padding:4px; margin:6px 0 }
.span2 { grid-column: span 2 }
.sign-row { margin-top:8px }
.consignee-copy { border-top:2px solid #000; margin-top:6px; padding-top:6px }
.consignee-copy h3 { margin:0 0 4px 0; }

/* Print button visibility */
@media print {
  .app-header, .form-panel { display:none !important }
  .preview-panel { border:none }
  body { background:#fff }
}
