/* Patent Labeler — Minimal, clean CSS */

:root {
  --bg: #f5f6f8;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e2e5ea;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --yellow-bg: #fef9c3;
  --highlight: #dbeafe;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--text);
}
.nav-info { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; }
.nav-sep { color: var(--text-muted); }
.nav-group { color: var(--text-muted); }
.nav-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.nav-link:hover { text-decoration: underline; }

/* Container */
.container {
  max-width: 820px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

/* Forms */
label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin: 0.75rem 0 0.25rem;
  color: var(--text);
}
select, input[type="email"], input[type="text"], textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
textarea { resize: vertical; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, opacity 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #d1d5db; }
.btn-small { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.btn-small.active { background: var(--primary); color: #fff; }

.btn-fits {
  background: var(--green-bg);
  color: var(--green);
  border: 2px solid var(--green);
  padding: 0.75rem 2rem;
  font-size: 1.05rem;
}
.btn-fits:hover { background: var(--green); color: #fff; }

.btn-incorrect {
  background: var(--red-bg);
  color: var(--red);
  border: 2px solid var(--red);
  padding: 0.75rem 2rem;
  font-size: 1.05rem;
}
.btn-incorrect:hover { background: var(--red); color: #fff; }

.btn-submit {
  background: var(--primary);
  color: #fff;
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
}
.btn-submit:hover { background: var(--primary-hover); }

.btn.dimmed { opacity: 0.35; pointer-events: none; }
.btn.selected { color: #fff; }
.btn-fits.selected { background: var(--green); }
.btn-incorrect.selected { background: var(--red); }

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: var(--red-bg); color: var(--red); }
.alert-warn { background: var(--yellow-bg); color: #92400e; }

/* Login */
.login-card { max-width: 440px; margin: 3rem auto; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.subtitle { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.9rem; }
.login-card .btn-primary { width: 100%; margin-top: 1.25rem; }

/* Progress bar */
.progress-bar-container {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.progress-text { font-size: 0.85rem; color: var(--text-muted); }
.progress-text strong { color: var(--text); }

/* Context panel */
.context-panel { font-size: 0.9rem; }
.context-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--bg);
}
.context-row:last-child { border-bottom: none; }
.context-label {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 100px;
}
.context-value { font-weight: 500; }
.context-value.highlight {
  background: var(--highlight);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
}
.definition {
  width: 100%;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-left: 100px;
  margin-top: 0.15rem;
  font-style: italic;
}

/* Patent card */
.patent-card { }
.patent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.patent-id { font-weight: 700; font-size: 1rem; }
.match-channel { font-size: 0.8rem; color: var(--text-muted); }

.patent-text {
  max-height: 250px;
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.patent-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.meta-label { font-weight: 600; }

.current-labels {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}
.label-chip {
  background: var(--highlight);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
}
.chip-label { font-weight: 600; font-size: 0.8rem; }

/* Decision */
.decision-buttons {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
}
.decision-buttons .btn { flex: 1; }

/* Incorrect panel */
.incorrect-panel { margin-top: 0.5rem; }
.incorrect-panel h3 { margin-bottom: 0.25rem; font-size: 1rem; }

/* Keyboard hint */
.keyboard-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
kbd {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  font-size: 0.8rem;
  font-family: inherit;
}

/* Milestone / Done */
.milestone-card, .done-card {
  text-align: center;
  max-width: 480px;
  margin: 4rem auto;
  padding: 2rem;
}
.milestone-card h1, .done-card h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.milestone-buttons, .done-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.hint { color: var(--text-muted); font-size: 0.85rem; margin-top: 1rem; }

/* Admin */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-header h1 { font-size: 1.5rem; }
.admin-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}
.stat { text-align: center; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
.data-table th, .data-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
}
.data-table tr.inactive { opacity: 0.5; }

.inline-form {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}
.inline-form input { flex: 1; }
