:root {
  --ros: #e3000f;
  --bg: #f5f6f8;
  --card: #fff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
header {
  background: var(--ros);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
header h1 { font-size: 18px; margin: 0; }
header a { color: #fff; text-decoration: none; }
.stats { margin-left: auto; font-size: 13px; opacity: .9; }
.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
}
.toolbar input, .toolbar select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; background: #fff;
}
.toolbar input[type=search] { flex: 1; min-width: 160px; }
label.check { display: flex; align-items: center; gap: 6px; font-size: 14px; }
label.daterange { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
label.daterange input { color: var(--text); }

/* ── Lista wielokrotnego wyboru (multiselect) ── */
.ms { position: relative; }
.ms-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-width: 150px;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; font-size: 14px; cursor: pointer; color: var(--text);
}
.ms.has-sel .ms-toggle { border-color: var(--ros); color: var(--ros); font-weight: 600; }
.ms-toggle .ms-text { flex: 1; text-align: left; white-space: nowrap; }
.ms-toggle .ms-caret { font-size: 11px; color: var(--muted); }
.ms.open .ms-caret { transform: rotate(180deg); }
.ms-panel {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 240px; max-width: 340px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 8px;
}
.ms-filter {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; margin-bottom: 6px;
}
.ms-options { max-height: 280px; overflow-y: auto; }
.ms-opt {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px;
  font-size: 14px; cursor: pointer;
}
.ms-opt:hover { background: #fafafa; }
.ms-opt input { flex-shrink: 0; }
.ms-opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-empty { padding: 10px 8px; color: var(--muted); font-size: 13px; }

/* ── Pasek odświeżania danych ── */
.refreshbar { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; flex-wrap: wrap; }
.refresh-btn {
  padding: 9px 16px; border: 1px solid var(--ros); border-radius: 8px;
  background: var(--ros); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.refresh-btn:hover { background: #c4000d; }
.refresh-btn:disabled { opacity: .55; cursor: default; }
.progress { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 240px; }
.progress-track {
  flex: 1; height: 10px; background: var(--border); border-radius: 999px; overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0; background: var(--ros); border-radius: 999px;
  transition: width .4s ease;
}
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: #fafafa; font-weight: 600; color: var(--muted); }
tr:hover td { background: #fafafa; }
td.price { font-weight: 700; white-space: nowrap; }
.old { color: var(--muted); text-decoration: line-through; font-weight: 400; margin-left: 6px; font-size: 12px; }
.badge { background: var(--ros); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 999px; }
.muted { color: var(--muted); font-size: 12px; }
a.product { color: var(--ros); text-decoration: none; font-weight: 600; }
a.product:hover { text-decoration: underline; }
.card { background: var(--card); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.pager { display: flex; gap: 8px; justify-content: center; margin: 18px 0; }
.pager button { padding: 8px 14px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: default; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.export {
  padding: 9px 14px; border: 1px solid var(--ros); border-radius: 8px;
  background: #fff; color: var(--ros); font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
  white-space: nowrap;
}
.export:hover { background: var(--ros); color: #fff; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { margin: 0; }
