/* 離線 App 專屬樣式（在 style.css / sheet.css 之後載入） */

.wsbar .offline-badge {
  font-size: 12px; padding: 2px 9px; border-radius: 10px;
  background: rgba(255, 255, 255, .14); color: #d6ead8; margin-right: auto;
}
.wsbar button, .wsbar .filebtn {
  padding: 6px 13px; border-radius: 4px; font-size: 13px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #fff;
}
.wsbar .filebtn { background: #2563c9; border-color: #2563c9; }
.wsbar input[type=file] { display: none; }
.wsbar .version { font-size: 12px; color: #9fb4d0; }

#helpDialog { max-width: 720px; max-height: 88vh; overflow-y: auto; }
#helpDialog h4 { margin: 16px 0 4px; font-size: 14px; color: var(--accent); }
#helpDialog p { margin: 0; color: #444; }
#helpDialog .swatch {
  display: inline-block; width: 11px; height: 11px; border: 1px solid var(--line);
  vertical-align: -1px; margin: 0 2px;
}
#helpDialog .swatch.auto { background: var(--auto-bg); }
#helpDialog .swatch.builtin { background: var(--default-bg); }

/* 對話框 */
dialog {
  border: none; border-radius: 6px; padding: 18px 20px; max-width: 900px; width: 92vw;
  max-height: 90vh;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .28); color: var(--text);
  font: 14px/1.55 "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}
dialog::backdrop { background: rgba(0, 0, 0, .35); }
dialog h3 { margin: 0 0 12px; font-size: 16px; }
dialog .scroll-box { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 4px; }
dialog table { border-collapse: collapse; width: 100%; font-size: 13px; }
dialog th, dialog td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
dialog th { background: #f2f4f7; position: sticky; top: 0; }
dialog input[type=text] { width: 100%; padding: 4px 7px; border: 1px solid var(--line); border-radius: 3px; font: inherit; }
dialog .filebtn {
  display: inline-block; padding: 7px 16px; border: 1px solid var(--accent); border-radius: 3px;
  background: #fff; color: var(--accent); cursor: pointer; font-size: 14px;
}
dialog .filebtn input { display: none; }
dialog .actions { margin-top: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-actions a { margin-right: 10px; cursor: pointer; }

/* 列印：只留出貨明細表本身 */
@media print {
  @page { size: A4 landscape; margin: 0; }
  body.workspace { height: auto; overflow: visible; display: block; }
  .wsbar, .pane-form, .pane-preview .bar, dialog { display: none !important; }
  .split, .pane-preview, .pane-preview .scroll { display: block; height: auto; overflow: visible; background: #fff; }
  .pane-preview .scroll { padding: 0; }
  .a4-wrap { transform: none !important; box-shadow: none; width: auto; }
  .a4 { width: 297mm; height: 210mm; }
}

/* 新版本提示 */
.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 6px;
  background: #16233a; color: #fff; font-size: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .3);
}
.toast[hidden] { display: none; }
.toast button {
  padding: 5px 13px; border-radius: 4px; cursor: pointer; font: inherit;
  border: 1px solid #2563c9; background: #2563c9; color: #fff;
}
.toast button.link { border-color: transparent; background: transparent; color: #cfe0f7; }
