* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: #f2f2f2;
  color: #222;
  font-size: 16px;
}
header.topbar {
  position: sticky; top: 0; z-index: 10;
  background: #1a7a3c; color: #fff;
  padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
}
header.topbar h1 { font-size: 18px; margin: 0; }
header.topbar button {
  background: rgba(255,255,255,0.15); color: #fff; border: none;
  padding: 6px 12px; border-radius: 6px; font-size: 14px;
}
main { padding: 12px; max-width: 640px; margin: 0 auto; }
.card {
  background: #fff; border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card:active { background: #f7f7f7; }
.muted { color: #888; font-size: 13px; }
.badge {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: #eee; color: #555;
}
.badge.new { background: #fde8d8; color: #b5560f; }
.badge.dispatching { background: #dbeafe; color: #1d4ed8; }
.badge.shipped { background: #dcfce7; color: #15803d; }
.btn {
  display: inline-block; width: 100%; padding: 14px; font-size: 16px;
  border: none; border-radius: 8px; background: #1a7a3c; color: #fff;
  margin-top: 10px; text-align: center;
}
.btn.secondary { background: #eee; color: #333; }
.btn:disabled { opacity: 0.5; }
input, textarea {
  width: 100%; padding: 10px; font-size: 16px; border: 1px solid #ccc;
  border-radius: 8px; margin-bottom: 10px;
}
.error { color: #c0392b; margin: 8px 0; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #222; color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 0.95; }
/* 日期／客戶名稱查詢列(首頁、訂單清單共用) */
.filter-bar { background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.filter-row { display: flex; align-items: center; gap: 6px; }
.filter-row + .filter-row { margin-top: 6px; }
.filter-row input { margin-bottom: 0; padding: 8px; font-size: 14px; min-width: 0; flex: 1 1 0; }
.filter-row .sep { flex-shrink: 0; color: #888; font-size: 13px; }
.filter-row button { flex-shrink: 0; background: #eee; color: #555; border: none; border-radius: 6px; padding: 8px 12px; font-size: 14px; }
.filter-hint { margin-top: 6px; font-size: 12px; }
.filter-tag { flex-shrink: 0; font-size: 11px; color: #888; margin-left: 6px; }

.raw-text { white-space: pre-wrap; }
.stock-row { display: flex; justify-content: space-between; align-items: center; }
.draft-line { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #eee; }
.draft-line button { background: none; border: none; color: #c0392b; font-size: 14px; }

/* 自訂確認對話框(取代瀏覽器原生 confirm()，見 app.js 的 OL.confirm) */
.ol-confirm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.ol-confirm-box { background: #fff; border-radius: 10px; padding: 16px; max-width: 340px; width: 100%; box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
.ol-confirm-message { font-size: 14px; color: #222; margin-bottom: 14px; white-space: pre-wrap; word-break: break-word; }
.ol-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ol-confirm-actions button { padding: 8px 16px; border: none; border-radius: 6px; font-size: 14px; }
.ol-confirm-actions .ol-confirm-ok { background: #c0392b; color: #fff; }
.ol-confirm-actions .ol-confirm-cancel { background: #eee; color: #333; }
.ol-pw-form input { margin-bottom: 8px; }
.ol-confirm-actions .ol-pw-ok { background: #1a7a3c; color: #fff; }
.ol-confirm-actions .ol-pw-ok:disabled { opacity: 0.5; }
header.topbar .topbar-actions { display: flex; gap: 6px; }
