:root {
  --border: #d8dee6;
  --muted: #666;
  --accent: #2454ff;
  --bg-alt: #f4f6f9;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  color: #1a1a1a;
  background: #fff;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  flex-wrap: wrap;
}
.brand { font-weight: 700; }
.v1-badge { font-size: 0.7rem; background: var(--accent); color: #fff; padding: 0.1rem 0.4rem; border-radius: 3px; }
.mainnav a { margin-right: 1rem; text-decoration: none; color: #1a1a1a; }
.mainnav a:hover { color: var(--accent); }
.project-selector { margin-left: auto; }
.content { padding: 1.5rem; max-width: 1200px; margin: 0 auto; }
.footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 2rem 0 1rem; }

h1 { margin-top: 0; }

.panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  background: #fff;
}
.panel > summary { cursor: pointer; }

.stat-grid { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1.25rem;
  min-width: 100px;
  text-align: center;
  background: var(--bg-alt);
}
.stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 0.8rem; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); text-align: left; }
.data-table thead th { background: var(--bg-alt); }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.35rem 1rem; margin-bottom: 0.5rem; }
.checkbox-grid label { font-size: 0.9rem; }

.inline-form { display: inline-flex; gap: 0.5rem; align-items: center; }
.stacked-form { display: flex; flex-direction: column; gap: 0.5rem; max-width: 500px; }
textarea, input[type=text], input[type=number], input[type=file], select {
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
}
button {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}
button:hover { opacity: 0.9; }
.btn {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: #1a1a1a;
  font-size: 0.85rem;
  background: var(--bg-alt);
}

.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filter-bar .spacer { flex: 1 1 auto; }
.bulk-bar { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; flex-wrap: wrap; }

.badge { padding: 0.1rem 0.4rem; border-radius: 3px; background: var(--bg-alt); font-size: 0.75rem; border: 1px solid var(--border); }
.badge-status-selected { background: #e3f6e3; border-color: #8fce8f; }
.badge-status-rejected { background: #fbe3e3; border-color: #e08f8f; }
.badge-status-researched { background: #e3ecfb; border-color: #8fb0e0; }

.flash { padding: 0.6rem 1rem; border-radius: 4px; margin-bottom: 1rem; }
.flash-ok { background: #e3f6e3; border: 1px solid #8fce8f; }
.flash-error { background: #fbe3e3; border: 1px solid #e08f8f; }

.muted { color: var(--muted); font-size: 0.85rem; }
.estimate-bar { margin: 0.75rem 0; }
.pagination { display: flex; gap: 0.3rem; margin-top: 1rem; }
.pagination a { padding: 0.3rem 0.6rem; border: 1px solid var(--border); border-radius: 4px; text-decoration: none; color: #1a1a1a; }
.pagination a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.workflow { padding-left: 1.2rem; }

.table-scroll { overflow-x: auto; }
.progress-outer { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 4px; height: 1.25rem; overflow: hidden; max-width: 500px; }
.progress-inner { background: var(--accent); height: 100%; transition: width 0.3s ease; }
