:root { color-scheme: light; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f4f5f7;
  color: #1c1e21;
}
header {
  background: #1c2b3a;
  color: #fff;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
header h1 { margin: 0; font-size: 1.2rem; }
header nav { display: flex; gap: 1rem; flex: 1; }
header nav a { color: #cfd8e3; text-decoration: none; font-size: 0.9rem; }
header nav a:hover { color: #fff; }
.who { font-size: 0.85rem; color: #cfd8e3; }
.who a { color: #fff; }
main { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }

h2 { margin-top: 0; }
.hint { color: #666; font-size: 0.88rem; margin-top: -0.5rem; }

.card {
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 1.25rem;
  max-width: 480px;
}

.form-group { margin-bottom: 0.75rem; }
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
input[type=text], input[type=password], input[type=number], input:not([type]), select, textarea {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid #ccd0d5;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

button {
  padding: 0.5rem 0.9rem;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #ccd0d5;
  background: #fff;
  font-size: 0.88rem;
}
button.primary { background: #1c6f2b; color: #fff; border-color: #1c6f2b; }
button.primary:hover { background: #185d24; }
button.secondary { background: #fff; color: #1c1e21; }
button.danger { background: #c0392b; color: #fff; border-color: #c0392b; }
button.danger:hover { background: #a33025; }
button:disabled { opacity: 0.5; cursor: default; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.75rem; }
.filters a { margin-right: 0.75rem; color: #555; text-decoration: none; font-size: 0.88rem; padding-bottom: 2px; }
.filters a.active { color: #1c2b3a; font-weight: 700; border-bottom: 2px solid #1c2b3a; }
.filters .sep { color: #ccc; margin-right: 0.75rem; }
.actions { display: flex; gap: 0.5rem; }

table.data-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e1e4e8; border-radius: 8px; overflow: hidden; font-size: 0.88rem; }
table.data-table.small { font-size: 0.82rem; margin-top: 0.5rem; }
.data-table th, .data-table td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid #eee; vertical-align: middle; }
.data-table th { color: #555; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; background: #fafbfc; }

.pill { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: #eef1f4; color: #444; }
.pill-manual, .pill-csv { background: #e8eef7; color: #2a4d8f; }
.pill-auto { background: #e5f6e8; color: #1c6f2b; }
.pill-rep_request { background: #fff3cd; color: #8a6d00; }
.pill-weekly_refresh { background: #f1e4fb; color: #6b2fa6; }
.pill-pending { background: #fff3cd; color: #8a6d00; }
.pill-fulfilled { background: #e5f6e8; color: #1c6f2b; }
.pill-expired { background: #f1f1f1; color: #888; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 8px; padding: 1.5rem; width: 420px; max-width: 92vw; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }

.msg { font-size: 0.85rem; margin-top: 0.5rem; min-height: 1.1em; }
.msg.error { color: #c0392b; }
.msg.ok { color: #1c6f2b; }
.flash { padding: 0.6rem 0.9rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.flash.error { background: #fdecea; color: #c0392b; }

.login-box { max-width: 340px; margin: 4rem auto; background: #fff; padding: 2rem; border-radius: 8px; border: 1px solid #e1e4e8; }
.login-box h2 { margin-top: 0; }

.batch-list { display: flex; flex-direction: column; gap: 0.75rem; }
.batch-card { background: #fff; border: 1px solid #e1e4e8; border-radius: 8px; padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; }
.batch-card.status-claimed { border-left: 4px solid #1c6f2b; }
.batch-card.status-assigned { border-left: 4px solid #8a6d00; }
.batch-card.status-unclaimed { border-left: 4px solid #ccc; }
.batch-keyword { font-weight: 700; font-size: 1.02rem; }
.batch-meta { color: #666; font-size: 0.85rem; margin-top: 0.2rem; }
.batch-owner { margin-top: 0.4rem; font-size: 0.88rem; }
.batch-owner.unclaimed { color: #888; }
.batch-actions { display: flex; gap: 0.5rem; align-self: center; }
.batch-leads { flex-basis: 100%; }
.batch-leads.hidden { display: none; }

.cutoff-banner { padding: 0.6rem 0.9rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; font-weight: 600; }
.cutoff-banner.open { background: #e5f6e8; color: #1c6f2b; }
.cutoff-banner.closed { background: #fdecea; color: #c0392b; }

.hidden { display: none; }
