:root {
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-500: #64748b;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --sky-600: #0284c7;
  --sky-700: #0369a1;
  --emerald-600: #059669;
  --amber-600: #d97706;
  --rose-600: #e11d48;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--slate-50);
  color: var(--slate-900);
}

.hidden {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--slate-900);
  color: white;
}

.topbar h1 {
  font-size: 16px;
  margin: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.api-base-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--slate-200);
}

.api-base-label input {
  width: 220px;
}

.session-email {
  font-size: 13px;
  color: var(--slate-200);
}

main {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card h2 {
  margin: 0;
  font-size: 18px;
}

.hint {
  color: var(--slate-500);
  font-size: 13px;
}

form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--slate-700);
  margin-bottom: 12px;
}

input,
select,
textarea {
  padding: 8px 10px;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

textarea {
  min-height: 70px;
  resize: vertical;
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}

.checkbox-label input {
  width: auto;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tab-btn {
  background: var(--slate-100);
  color: var(--slate-700);
  padding: 6px 12px;
  font-size: 12px;
}

.tab-btn.active {
  background: var(--sky-600);
  color: white;
}

button {
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  border: none;
  padding: 8px 14px;
}

.btn-primary {
  background: var(--sky-600);
  color: white;
}

.btn-primary:hover {
  background: var(--sky-700);
}

.btn-secondary {
  background: var(--slate-100);
  color: var(--slate-700);
}

.btn-link {
  background: none;
  color: var(--sky-600);
  padding: 4px 8px;
  font-size: 12px;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--slate-100);
}

.table th {
  color: var(--slate-500);
  font-weight: 600;
}

.selected-row {
  background: var(--slate-100);
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: white;
  border-radius: 10px;
  padding: 20px;
  width: 380px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h3 {
  margin-top: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.form-error {
  color: var(--rose-600);
  font-size: 13px;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--slate-900);
  color: white;
  font-size: 13px;
  z-index: 200;
}

.toast-error {
  background: var(--rose-600);
}

.toast-info {
  background: var(--emerald-600);
}
