:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --border: #e1e4e8;
  --text: #1f2328;
  --muted: #6b7280;
  --primary: #2b7cff;
  --primary-hover: #1e63d6;
  --danger: #d73a49;
}

* { box-sizing: border-box; }

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

body.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin: 12px 0;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 13px;
}

input[type="email"], input[type="text"], select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43,124,255,0.15);
}

button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

button:hover { background: var(--primary-hover); }
button:disabled { background: #c7cdd6; cursor: not-allowed; }

button.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}
button.secondary:hover { background: #f3f4f6; }

button.link {
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-weight: 400;
  font-size: 13px;
  text-decoration: underline;
}

.card form button { width: 100%; margin-top: 6px; }

/* App layout */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
header h1 { font-size: 16px; font-weight: 600; }
.user-bar { display: flex; align-items: center; gap: 12px; }
.user-bar .user { color: var(--muted); font-size: 13px; }
form.inline { display: inline; }

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.search-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.search-form .row {
  display: grid;
  grid-template-columns: 140px 130px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.search-form .row label { margin: 0; }
.search-form .checkbox-row { grid-template-columns: 1fr; }
.search-form .checkbox-row label {
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-form .buttons {
  grid-template-columns: auto auto 1fr;
  margin-top: 14px;
}
.search-form .buttons button { width: auto; }

.status {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.pager.hidden { display: none; }

.results-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px;
}

.results-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f3f4f6;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.results-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  white-space: nowrap;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.results-table tbody tr:hover { background: #fafbfc; }
.results-table .muted, .muted { color: #c0c4cc; }

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