/* Maker Portal — minimal styling, matches the rest of the sbf-tools suite */
:root {
  --fg: #1a1a1a;
  --muted: #666;
  --bg: #fafafa;
  --card: #ffffff;
  --border: #e0e0e0;
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --danger: #c0392b;
  --success: #2e7d32;
  --warning: #b26a00;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f0f0f0; padding: 1px 4px; border-radius: 3px; font-size: 0.9em; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #1a1a1a;
  color: #fff;
}
.topbar a { color: #fff; margin-left: 16px; }
.topbar .brand { font-weight: bold; margin-left: 0; font-size: 1.1em; }

.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.page-head h1 { margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}
.card.danger { border-color: var(--danger); }

.form label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.9em;
  color: var(--muted);
}
.form input, .form select, .form textarea {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1em;
  font-family: inherit;
  color: var(--fg);
  background: #fff;
}
.form textarea { font-family: ui-monospace, "SF Mono", monospace; font-size: 0.95em; }
.form fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.form fieldset legend { padding: 0 6px; font-size: 0.85em; color: var(--muted); }

button, .btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--fg);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95em;
  font-family: inherit;
}
button:hover, .btn:hover { background: #f5f5f5; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-small { padding: 4px 8px; font-size: 0.85em; }
.btn-link { background: none; border: none; color: var(--primary); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { font-size: 0.85em; color: var(--muted); font-weight: 600; }
.table td.actions { white-space: nowrap; }
.table td.actions form { margin-right: 4px; }

.muted { color: var(--muted); }
.small { font-size: 0.85em; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8em;
  background: #eee;
  color: #444;
}
.badge-draft { background: #fff3cd; color: #806000; }
.badge-published { background: #d4edda; color: #155724; }
.badge-archived { background: #e0e0e0; color: #555; }
.badge-error { background: #f8d7da; color: #721c24; }

.flash {
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 12px;
}
.flash-success { background: #d4edda; color: #155724; }
.flash-error { background: #f8d7da; color: #721c24; }

.tabs { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.tabs a { padding: 4px 10px; border-radius: 4px; }
.tabs a:hover { background: #f0f0f0; text-decoration: none; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.photo-grid figure {
  margin: 0;
  background: #f5f5f5;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.photo-grid img { display: block; width: 100%; height: 140px; object-fit: cover; }
.photo-grid figcaption { padding: 6px 8px; font-size: 0.8em; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Compact proposal table styling */
.proposal-table { font-size: 0.85em; }
.proposal-table td { padding: 8px 6px; vertical-align: top; line-height: 1.35; }
.proposal-table .product-name { font-weight: 600; max-width: 280px; }
.proposal-table .url-line { font-family: ui-monospace, "SF Mono", monospace; font-size: 0.9em; word-break: break-all; max-width: 260px; }
.proposal-table .url-line .label { color: var(--muted); margin-right: 4px; }
.proposal-table .url-line .arrow { color: var(--muted); margin: 0 4px; }
.proposal-table .reason { font-size: 0.85em; color: #444; max-width: 320px; }
.proposal-table .asin { background: #fff3cd; padding: 1px 5px; border-radius: 3px; font-family: ui-monospace, monospace; font-size: 0.85em; }
.proposal-table .short-code { background: #e3f2fd; padding: 1px 5px; border-radius: 3px; font-family: ui-monospace, monospace; font-size: 0.85em; }
.autonomy-banner { padding: 10px 14px; background: #e8f5e9; border-left: 4px solid #2e7d32; border-radius: 4px; margin-bottom: 14px; font-size: 0.95em; }
.autonomy-banner.off { background: #fff8e1; border-left-color: #b26a00; }
.tabs-row { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs-row a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs-row a.active { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.tabs-row a:hover { background: #f5f5f5; text-decoration: none; }

.comment-row.own { background: #f0fdf4 !important; }
.comment-row.unread { font-weight: normal; }

/* Project status strip — happy-path signpost on project_detail */
.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.status-strip .step {
  flex: 1 1 0;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f6f7f9;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--fg);
}
.status-strip .step:hover { background: #eef0f3; text-decoration: none; }
.status-strip .step .label { font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.status-strip .step .value { font-size: 0.95em; font-weight: 600; }
.status-strip .step.done { background: #e8f5e9; }
.status-strip .step.done .value { color: var(--success); }
.status-strip .step.warn { background: #fff8e1; }
.status-strip .step.warn .value { color: var(--warning); }
.status-strip .step.error { background: #fef2f2; }
.status-strip .step.error .value { color: var(--danger); }
.status-strip .step.todo .value { color: #666; }

/* Agents page controls + section headings */
.agents-controls { display: flex; gap: 8px; }
.agents-controls form { margin: 0; }
.btn-pause  { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-pause:hover  { background: #fef2f2; }
.btn-resume { background: var(--success); color: #fff; border-color: var(--success); }
.btn-resume:hover { background: #1f5d23; border-color: #1f5d23; }

.paused-banner {
  padding: 14px 18px;
  background: #fee2e2;
  border-left: 4px solid var(--danger);
  border-radius: 4px;
  margin-bottom: 16px;
}

.section-heading {
  margin: 28px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-size: 1.15em;
  font-weight: 600;
}
.section-heading a { font-weight: normal; }
.section-head { margin-bottom: 8px; }
h3.flush, h2.flush { margin: 0; }

/* Inline form display — used in lots of action cells */
.actions form, .agents-controls form, .section-head form { display: inline; }

/* Compact proposal table extras */
.proposal-table .col-third { width: 32%; }
.proposal-table .new-url-row { margin-top: 3px; }
.proposal-table .search-tag { background: #fce4ec; padding: 1px 5px; border-radius: 3px; }

/* Navbar paused badge */
.badge-paused {
  background: var(--danger);
  color: #fff;
  font-size: 0.65em;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 3px;
}

/* Inline forms — used to keep buttons on the same line as siblings */
form.inline { display: inline; }

/* Card variants with a color stripe — pending review / success states */
.card-stripe-warn    { border-left: 4px solid var(--warning); }
.card-stripe-success { border-left: 4px solid var(--success); }

/* Bulk import table */
.bulk-controls { display: flex; align-items: center; gap: 16px; margin: 12px 0; }
.bulk-controls label { display: flex; align-items: center; gap: 6px; }
.bulk-import-table .num { text-align: right; white-space: nowrap; }
.bulk-import-table .row-existing { background: #f5f9ff; }

/* AI-excluded rows on the projects list */
tr.row-ai-excluded td { background: #f5f5f5; color: #888; }
tr.row-ai-excluded a strong { color: #666; }
.ai-cell { white-space: nowrap; }
.ai-toggle { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.ai-toggle-label { font-size: 0.85em; color: var(--muted); }

/* Type cell: inline category picker */
.type-cell { min-width: 130px; }
.type-select { font-size: 0.85em; padding: 2px 4px; }
.type-select-none { color: var(--muted); }
