:root {
  --bg: #f7f3ec;
  --card: #fffdf8;
  --text: #2d2722;
  --muted: #70675d;
  --line: #e6ddd0;
  --accent: #6b4f36;
  --accent-dark: #523b27;
  --soft: #efe4d3;
  --danger: #7a2d2d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  width: min(1400px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, #fff7e7, #f4dfbd);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(64, 44, 21, 0.08);
}

.eyebrow { font-weight: 800; letter-spacing: 0.1em; color: var(--accent); text-transform: uppercase; }
h1 { margin: 6px 0 8px; font-size: clamp(28px, 4vw, 46px); }
p { margin: 0; color: var(--muted); }

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(64, 44, 21, 0.05);
}
.card h2 { margin: 0 0 14px; }
.warning { margin-top: 16px; color: var(--accent-dark); background: #fff4dc; }

label { display: block; font-weight: 700; margin: 12px 0 6px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--text);
  padding: 12px 14px;
  font-size: 15px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  font-weight: 600;
}
.chips input { width: auto; }

button {
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  padding: 12px 18px;
  cursor: pointer;
  margin-top: 14px;
  white-space: nowrap;
}
button:hover { background: var(--accent-dark); }
button:disabled { opacity: .6; cursor: wait; }
button.secondary {
  background: var(--soft);
  color: var(--accent-dark);
}
button.secondary:hover { background: #e4d3bc; }

.toolbar {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.table-card { margin-top: 16px; padding: 0; overflow: hidden; }
.table-wrap { overflow: auto; max-height: 70vh; }
table { width: 100%; border-collapse: collapse; min-width: 1200px; }
th, td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  vertical-align: top;
  text-align: left;
  font-size: 14px;
}
th {
  position: sticky;
  top: 0;
  background: #fff8ec;
  z-index: 1;
}
td small { color: var(--muted); display: block; margin-top: 4px; }
.priority-high { color: #16713b; font-weight: 800; }
.priority-medium { color: #895e00; font-weight: 800; }
.priority-low { color: #8c3b3b; font-weight: 800; }
.source-link { color: var(--accent); font-weight: 700; }
.status-select { min-width: 150px; padding: 8px; }

@media (max-width: 850px) {
  .hero, .toolbar { flex-direction: column; align-items: stretch; }
  .grid.two { grid-template-columns: 1fr; }
}

.filters-card { margin-top: 16px; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}
.filter-grid label { margin: 0; }
.filter-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.filter-actions button { margin-top: 0; }
.pagination-info { color: var(--muted); font-weight: 700; }
.pagination-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}
.page-btn {
  margin-top: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--accent-dark);
}
.page-btn.active {
  background: var(--accent);
  color: white;
}
.page-btn:disabled { cursor: not-allowed; opacity: 0.45; }
.page-ellipsis { color: var(--muted); padding: 0 4px; }
.business-link {
  color: var(--accent-dark);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 180px;
}
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.link-btn:hover { background: #e4d3bc; }
.muted { color: var(--muted); }

@media (max-width: 1100px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .filter-grid { grid-template-columns: 1fr; }
}
