* { box-sizing: border-box; }
body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  color: #222;
  background: #f7f8fa;
}
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  background: #1f2937;
  color: #fff;
  height: 56px;
}
.nav .brand { color: #fff; text-decoration: none; font-weight: 600; }
.nav .links { display: flex; gap: 16px; align-items: center; }
.nav .links a { color: #d1d5db; text-decoration: none; }
.nav .links a:hover { color: #fff; }
.nav .user { color: #9ca3af; font-size: 13px; margin-left: 8px; }

.main { max-width: 1100px; margin: 24px auto; padding: 0 24px; }
.main h1 { margin: 0 0 16px; font-size: 24px; }
.main h2 { margin: 32px 0 12px; font-size: 18px; }
.muted { color: #6b7280; }

/* Auth */
.auth-card {
  max-width: 360px;
  margin: 80px auto;
  padding: 32px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.auth-card h1 { margin: 0 0 20px; }
.auth-card label { display: block; margin-bottom: 14px; }
.auth-card input {
  display: block; width: 100%; padding: 10px 12px;
  border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
  margin-top: 4px;
}

/* Buttons */
.btn {
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.btn:hover { background: #f3f4f6; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.link-btn {
  background: none; border: none; color: #2563eb;
  cursor: pointer; font: inherit; padding: 0;
}
.link-btn.danger { color: #b91c1c; }

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.table th, .table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}
.table th { background: #f9fafb; font-weight: 600; color: #374151; }
.table tr:last-child td { border-bottom: none; }
.table .empty { color: #6b7280; text-align: center; padding: 24px; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.badge.ok   { background: #d1fae5; color: #065f46; }
.badge.err  { background: #fee2e2; color: #991b1b; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.new  { background: #dbeafe; color: #1e40af; }
.err-msg { color: #b91c1c; display: block; margin-top: 4px; }

/* Alerts */
.alert {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.info  { background: #dbeafe; color: #1e40af; }

/* Stats row */
.stats { display: flex; gap: 16px; margin-bottom: 24px; }
.stat {
  background: #fff;
  border-radius: 8px;
  padding: 16px 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  min-width: 120px;
}
.stat .num { display: block; font-size: 28px; font-weight: 600; color: #2563eb; }
.stat .lbl { color: #6b7280; font-size: 13px; }
.stat.fail .num { color: #b91c1c; }

/* Row form (phones page) */
.row-form { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.row-form input {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  flex: 1;
  min-width: 140px;
}

.error-pre {
  background: #fee2e2; padding: 12px; border-radius: 6px;
  white-space: pre-wrap; word-break: break-word;
}
