* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f4f5f7;
  color: #1f2933;
}

.hidden {
  display: none !important;
}

/* Auth */
.auth-container {
  max-width: 380px;
  margin: 4vh auto 10vh;
  background: #fff;
  padding: 32px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.auth-container h1 {
  font-size: 1.4rem;
  margin: 0 0 20px;
  text-align: center;
}

.tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #e0e3e8;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.95rem;
  color: #6b7280;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: #174d3a;
  border-bottom-color: #174d3a;
  font-weight: 600;
}

form label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: #4b5563;
}

form input, form select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 0.95rem;
}

button {
  cursor: pointer;
}

form button[type="submit"], .btn {
  width: 100%;
  padding: 10px;
  background: #174d3a;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
}

form button[type="submit"]:hover, .btn:hover {
  background: #1f6049;
}

.auth-back {
  display: inline-block;
  margin: 20px 0 0 24px;
  font-size: 0.875rem;
  color: #6b7280;
  text-decoration: none;
}

.auth-back:hover {
  color: #174d3a;
}

.error {
  color: #c0392b;
  font-size: 0.85rem;
  margin: -6px 0 12px;
}

.error.success {
  color: #174d3a;
  background: #e8f5ef;
  border: 1px solid #b7e4c7;
  padding: 8px 10px;
  border-radius: 6px;
}

.verify-hint {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.5;
  margin: 0 0 16px;
}

.verify-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.link-btn {
  width: auto;
  padding: 0;
  background: none;
  border: none;
  color: #174d3a;
  font-size: 0.85rem;
  font-weight: 500;
}

.link-btn:hover {
  background: none;
  text-decoration: underline;
}

/* App layout */
header.topbar {
  background: #fff;
  border-bottom: 1px solid #e0e3e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}

header.topbar .brand {
  font-weight: 700;
  color: #1f6feb;
}

header.topbar nav a {
  margin-left: 16px;
  color: #4b5563;
  text-decoration: none;
  font-size: 0.9rem;
}

header.topbar nav a.active {
  color: #1f6feb;
  font-weight: 600;
}

header.topbar .logout-btn {
  margin-left: 16px;
  background: none;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: #4b5563;
}

main.page {
  max-width: 880px;
  margin: 24px auto;
  padding: 0 16px;
}

.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 20px;
  margin-bottom: 20px;
}

.card h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.banner {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.banner.success {
  background: #e6f4ea;
  color: #1e7e34;
  border: 1px solid #b7e1c4;
}

.banner.error {
  background: #fdecea;
  color: #c0392b;
  border: 1px solid #f5c6cb;
}

.connect-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.connect-buttons .btn {
  width: auto;
  padding: 10px 18px;
}

.btn.secondary {
  background: #6b7280;
}

.btn.secondary:hover {
  background: #57606f;
}

.btn.danger {
  background: #c0392b;
}

.btn.danger:hover {
  background: #a93226;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #eef0f2;
}

th {
  color: #6b7280;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.empty {
  color: #6b7280;
  font-size: 0.9rem;
  padding: 12px 0;
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e6f4ea;
  color: #1e7e34;
}

.status-pill.inactive {
  background: #f1f2f4;
  color: #6b7280;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-actions .btn {
  padding: 6px 12px;
  font-size: 0.8rem;
}
