:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f5f5f7;
}

.app-nav {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.app-nav-brand {
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}

.app-nav-email {
  color: #666;
  font-size: 0.85rem;
  flex: 1;
}

.app-nav a {
  color: #2563eb;
  text-decoration: none;
  font-size: 0.85rem;
}

.auth-page, .page {
  width: 100%;
  max-width: 480px;
  padding: 2rem 1.5rem;
  box-sizing: border-box;
}

.auth-form, .create-workspace-form, .invite-section form, .create-change-form {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.create-workspace-form, .invite-section form, .create-change-form {
  margin-top: 1rem;
}

.auth-form label, .create-workspace-form label, .invite-section form label, .create-change-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.auth-form input, .create-workspace-form input, .invite-section input, .invite-section select, .create-change-form textarea {
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  margin-top: 0.5rem;
  padding: 0.6rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

.btn-oidc {
  padding: 0.6rem;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #111;
  cursor: pointer;
}

.btn-small {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.form-error {
  color: #b91c1c;
  font-size: 0.9rem;
}

.form-success {
  color: #15803d;
  font-size: 0.9rem;
}

.auth-divider {
  text-align: center;
  color: #999;
  font-size: 0.8rem;
}

.auth-switch, .lang-switch {
  text-align: center;
  font-size: 0.85rem;
}

.workspace-list, .member-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.workspace-item, .member-item {
  background: #fff;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.role-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
}

.role-badge.role-owner {
  background: #fde68a;
  color: #92400e;
}

.active-badge {
  font-size: 0.75rem;
  color: #15803d;
}

.empty-state {
  color: #666;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.audit-table th, .audit-table td {
  text-align: start;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #eee;
  font-size: 0.85rem;
}

.page-wide {
  max-width: 900px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.admin-table th, .admin-table td {
  text-align: start;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #eee;
  font-size: 0.85rem;
}

.app-footer {
  color: #888;
  font-size: 0.75rem;
  padding: 1rem;
}

.banner {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.banner-warning {
  background: #fef3c7;
  color: #92400e;
}

.usage-grid {
  background: #fff;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.usage-grid dt {
  color: #666;
  font-size: 0.8rem;
  margin-top: 0.6rem;
}

.usage-grid dd {
  margin-inline-start: 0;
  font-size: 1.1rem;
}

.create-change-form {
  margin-bottom: 1.5rem;
}

.state-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
}

.state-badge.state-landed {
  background: #bbf7d0;
  color: #166534;
}

.state-badge.state-failed {
  background: #fecaca;
  color: #991b1b;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.chat-message {
  max-width: 80%;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  background: #fff;
}

.chat-message-user {
  align-self: flex-end;
  background: #dbeafe;
}

.chat-message-agent {
  align-self: flex-start;
  background: #f3f4f6;
}

.chat-message-sender {
  display: block;
  font-size: 0.7rem;
  color: #6b7280;
  margin-bottom: 0.15rem;
}

.chat-message-body {
  margin: 0;
  white-space: pre-wrap;
}

.chat-send-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
