* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: #f4f2ee;
  color: #2b2b2b;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #2b2530;
  color: #fff;
}
.topbar h1 { font-size: 18px; margin: 0; display: flex; align-items: center; gap: 10px; }
.badge-mock {
  font-size: 11px;
  font-weight: normal;
  background: #b5654d;
  padding: 3px 8px;
  border-radius: 10px;
}

.layout { display: flex; min-height: calc(100vh - 56px); }

.filter-rail {
  width: 260px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e2ddd4;
  padding: 16px;
  overflow-y: auto;
}
.filter-rail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.filter-rail-head h2 { font-size: 14px; margin: 0; color: #6b6258; text-transform: uppercase; letter-spacing: .04em; }

.filter-group { margin-bottom: 18px; }
.filter-group h3 { font-size: 13px; margin: 0 0 6px; color: #2b2530; }
.filter-option {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 13px;
  padding: 3px 0;
  cursor: pointer;
}
.filter-option input { margin-right: 6px; }
.filter-option .count { color: #9a9186; }
.filter-option.flag-warn .fname { color: #a25772; font-weight: 600; }

.content { flex: 1; padding: 16px 20px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.toolbar input[type="text"], #batch-name-input {
  padding: 8px 10px;
  border: 1px solid #d8d1c6;
  border-radius: 6px;
  font-size: 13px;
  min-width: 240px;
}
.group-by-label { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.result-count { font-size: 13px; color: #6b6258; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; }

button { font-family: inherit; cursor: pointer; border: none; border-radius: 6px; font-size: 13px; }
.btn-primary { background: #7c9885; color: #fff; padding: 8px 14px; }
.btn-primary:disabled { background: #c7cec8; cursor: not-allowed; }
.btn-ghost { background: #eee7db; color: #2b2530; padding: 8px 12px; }
.btn-link { background: none; color: #a25772; padding: 0; font-size: 12px; }

.group-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2ddd4;
}
.group-heading h3 { margin: 0; font-size: 15px; }
.group-heading .count { color: #6b6258; font-size: 13px; }
.group-heading button { background: #eee7db; padding: 4px 10px; font-size: 12px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.card {
  background: #fff;
  border: 1px solid #e2ddd4;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.card img { width: 100%; height: 160px; object-fit: cover; display: block; background: #ddd; }
.card .card-body { padding: 8px 10px; }
.card .card-title { font-size: 13px; font-weight: 600; margin: 0 0 4px; line-height: 1.3; }
.card .card-meta { font-size: 11px; color: #6b6258; margin: 0 0 6px; }
.card .checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  z-index: 2;
}
.card .badges { display: flex; flex-wrap: wrap; gap: 4px; }
.pill {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #eee7db;
  color: #4b3f2f;
}
.pill.risk { background: #f4dcd4; color: #8a3b24; }
.pill.competitor { background: #dbe7de; color: #2f5b41; }
.pill.published { background: #dceee2; color: #1f6b3f; }
.pill.st-pending { background: #e6e2da; color: #6b6258; }
.pill.st-ok { background: #dceee2; color: #1f6b3f; }
.pill.st-warn { background: #fbe8cf; color: #8a5a17; }
.pill.st-error { background: #f6d6d6; color: #9c2b2b; }

.btn-workshop { width: 100%; margin-top: 8px; text-align: center; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
}
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 10px; padding: 22px; width: 360px; }
.modal-box-wide { width: 520px; max-height: 70vh; overflow-y: auto; }
.modal-box h2 { margin-top: 0; font-size: 16px; }
.modal-box input { width: 100%; padding: 8px; margin: 10px 0; border: 1px solid #d8d1c6; border-radius: 6px; }
.modal-box .hint { font-size: 12px; color: #6b6258; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.batch-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #eee;
}
.batch-row .batch-meta { font-size: 12px; color: #6b6258; }

.modal-box-workshop { width: 640px; max-height: 85vh; overflow-y: auto; }
.workshop-head { display: flex; justify-content: space-between; align-items: flex-start; }
.workshop-head h2 { margin: 0 0 4px; }
.workshop-mock-note {
  font-size: 12px; color: #6b6258; background: #f4efe6; border-radius: 6px;
  padding: 8px 10px; margin: 10px 0 16px;
}

.workshop-step {
  border: 1px solid #e2ddd4; border-radius: 8px; padding: 12px; margin-bottom: 10px;
}
.workshop-step.store-affecting {
  border-color: #d9a37a; background: #fdf6ef;
  border-top: 3px solid #b5654d;
}
.workshop-step.store-affecting:first-of-type { margin-top: 4px; }
.workshop-step-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-detail { font-size: 13px; color: #4b3f2f; margin: 6px 0; }
.blocked-note { font-size: 12px; color: #8a5a17; margin: 6px 0; }
.result-list { font-size: 12px; color: #4b3f2f; margin: 6px 0; padding-left: 18px; }
.result-list .k { font-weight: 600; }
.workshop-step-actions { display: flex; gap: 10px; margin-top: 8px; align-items: center; }
.manual-form { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.manual-form.hidden { display: none; }
.manual-form textarea {
  font-family: monospace; font-size: 12px; padding: 6px; border: 1px solid #d8d1c6;
  border-radius: 6px;
}
.manual-form input { padding: 6px; border: 1px solid #d8d1c6; border-radius: 6px; font-size: 12px; }
