/* renoboard — dark theme in the estate's house palette (GitHub Primer dark). */
:root {
  --bg: #0d1117;
  --panel: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --amber: #d29922;
  --red: #f85149;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
header.topbar h1 { font-size: 16px; margin: 0; }
header.topbar .crumb { color: var(--muted); }

main { padding: 16px; }

button, .btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 13px;
}
button:hover, .btn:hover { border-color: var(--accent); }
button.primary { background: #1f6feb; border-color: #1f6feb; }
button.danger:hover { border-color: var(--red); color: var(--red); }

input, select, textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }

.muted { color: var(--muted); }

/* --- project index --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.project-tile {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
}
.project-tile:hover { border-color: var(--accent); text-decoration: none; }
.new-project { display: flex; gap: 8px; }
.new-project input[name=name] { width: 240px; }
.new-project input[name=description] { flex: 1; max-width: 420px; }

/* --- board --- */
.board {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 12px;
}
.column {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 260px;
  max-width: 260px;
  padding: 8px;
}
.column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 8px;
  font-weight: 600;
}
.column-head .budget:empty { display: none; }
.cards { min-height: 24px; display: flex; flex-direction: column; gap: 8px; }
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: grab;
}
.card:hover { border-color: var(--accent); }
.card.sortable-ghost { opacity: 0.4; }
.card-title { margin-bottom: 4px; }
.card-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.label-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.new-column { margin-top: 12px; display: flex; gap: 8px; }
.new-card { margin-top: 8px; }
.new-card input { width: 100%; background: transparent; border-style: dashed; }

/* --- card modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(1, 4, 9, 0.7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8vh;
  z-index: 10;
}
.modal-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: min(640px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  padding: 16px;
}
.modal-title { width: 100%; font-size: 16px; font-weight: 600; }
.modal-row { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.modal-row textarea { width: 100%; resize: vertical; }
.modal-foot {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
}
.label-option { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; }
.new-label { margin-top: 6px; display: flex; gap: 6px; }
.new-label input[type=color] { padding: 0 2px; width: 36px; }

/* --- bill of materials --- */
.bom-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 0 0 6px; }
table.bom { width: 100%; border-collapse: collapse; }
table.bom td { padding: 4px 6px; border-top: 1px solid var(--border); }
table.bom tr.purchased .bom-name { text-decoration: line-through; color: var(--muted); }
.bom-add { display: flex; gap: 6px; margin-top: 8px; }
.bom-add input[name=name] { flex: 1; }
.bom-add input[name=qty] { width: 70px; }
.bom-add input[name=price] { width: 90px; }

/* --- merchant search drawer --- */
#search-drawer { margin-top: 12px; }
#search-drawer input[type=search] { width: 100%; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
.search-merchant { margin: 10px 0 4px; font-size: 13px; text-transform: capitalize; }
table.search-results { width: 100%; border-collapse: collapse; }
table.search-results td { padding: 4px 6px; border-top: 1px solid var(--border); }
.degraded { font-style: italic; }
.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  border: 1px solid var(--border);
  color: var(--muted);
}
