*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  background: #f5f5f5;
  color: #111;
  min-height: 100vh;
}

/* ── Layout ── */
.app  { display: flex; min-height: 100vh; }
.main { flex: 1; display: flex; flex-direction: column; }

/* ── Sidebar ── */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #1a1a2e;
  color: #ccc;
  padding: 0;
}
.sidebar-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid #2a2a4a;
}
.brand-name { font-size: 14px; font-weight: 700; color: #fff; }
.brand-sub  { font-size: 11px; color: #666; margin-top: 2px; }

.nav-link {
  display: block;
  padding: 10px 16px;
  color: #999;
  text-decoration: none;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: background .1s, color .1s;
}
.nav-link:hover { background: #2a2a4a; color: #fff; }
.nav-active { color: #fff; background: #2a2a4a; border-left-color: #6366f1; }

/* ── Topbar ── */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-back {
  color: #666;
  text-decoration: none;
  font-size: 13px;
  margin-right: 8px;
}
.topbar-back:hover { color: #111; }

/* ── Content ── */
.content { padding: 24px; flex: 1; }

/* ── Stats ── */
.stats-row { display: flex; gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 16px 20px;
  flex: 1;
}
.stat-value { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 12px; color: #666; margin-top: 2px; }

/* ── Card ── */
.card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}
.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-weight: 600; font-size: 13px; }
.card-body  { padding: 16px; }

/* ── Table ── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 8px 16px;
  border-bottom: 1px solid #e5e5e5;
  background: #fafafa;
}
.table td {
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fafafa; }
.table-scroll { max-height: 300px; overflow-y: auto; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 5px;
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #333;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .1s;
}
.btn:hover:not(:disabled) { background: #f5f5f5; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: #6366f1; color: #fff; border-color: #6366f1; }
.btn-primary:hover:not(:disabled) { background: #4f52d9; border-color: #4f52d9; }
.btn-sm { padding: 4px 9px; font-size: 11px; }
.btn-group { display: flex; gap: 4px; }

/* ── Badge / Tag ── */
.badge {
  display: inline-block;
  background: #f0f0f0;
  color: #555;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
}
.tag {
  display: inline-block;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: monospace;
  color: #444;
}

/* ── Forms ── */
.input {
  border: 1px solid #d0d0d0;
  border-radius: 5px;
  padding: 7px 10px;
  font-size: 13px;
  outline: none;
  width: 100%;
  background: #fff;
  transition: border-color .15s;
}
.input:focus { border-color: #6366f1; }
.input::placeholder { color: #aaa; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 11px; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: .04em; }
.search-form { display: flex; gap: 6px; align-items: center; }

/* ── Detail ── */
.detail-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-list { display: flex; flex-direction: column; }
.info-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid #f0f0f0; }
.info-row:last-child { border-bottom: none; }
.info-key { width: 80px; font-size: 11px; font-weight: 600; color: #888; text-transform: uppercase; flex-shrink: 0; }

/* ── Modal ── */
[x-cloak] { display: none !important; }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal {
  background: #fff;
  border-radius: 8px;
  width: min(460px, 95vw);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.modal-lg { width: min(540px, 95vw); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e5e5;
}
.modal-title { font-size: 14px; font-weight: 600; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: #999; line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: #333; }
.modal-body  { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid #e5e5e5;
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ── Migrations ── */
.mig-list { display: flex; flex-direction: column; }
.mig-select-all {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 4px 10px;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 4px;
  cursor: pointer;
  font-size: 11px; font-weight: 600; color: #666; text-transform: uppercase;
}
.mig-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
}
.mig-item:last-child { border-bottom: none; }
.mig-item span { font-family: monospace; font-size: 12px; }
.mig-item input, .mig-select-all input { cursor: pointer; }

/* ── Misc ── */
.text-muted { color: #888; }
.text-sm    { font-size: 11px; }
.hidden     { display: none !important; }
.empty      { text-align: center; padding: 32px; color: #aaa; font-size: 13px; }
.error-msg  { color: #dc2626; font-size: 12px; }
.spinner-wrap { display: flex; justify-content: center; padding: 16px; }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid #e5e5e5;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
code { background: #f5f5f5; border: 1px solid #e0e0e0; border-radius: 3px; padding: 1px 5px; font-size: 11px; }

/* ── Alert ── */
.alert { padding: 9px 12px; border-radius: 5px; font-size: 12px; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.toast-success { border-color: #86efac; color: #15803d; }
.toast-error   { border-color: #fca5a5; color: #dc2626; }
.toast-enter   { transition: opacity .2s, transform .2s; }
.toast-hidden  { opacity: 0; transform: translateY(6px); }
.toast-visible { opacity: 1; transform: translateY(0); }

/* ── Pagination ── */
.pagination {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #e5e5e5;
}
.page-info { flex: 1; text-align: center; font-size: 12px; color: #888; }

/* ── Size badge ── */
.size-badge {
  display: inline-block;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  color: #15803d;
}

@keyframes spin { to { transform: rotate(360deg); } }


/* ── SQL Editor ── */
.sql-editor { display: flex; flex-direction: column; gap: 12px; }
.sql-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sql-meta { font-size: 12px; color: #666; margin-left: 8px; }
.sql-textarea {
  width: 100%; font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 13px; line-height: 1.5;
  background: #fff; border: 1px solid #d0d0d0;
  border-radius: 6px; padding: 12px 14px;
  resize: vertical; outline: none;
  transition: border-color .15s;
}
.sql-textarea:focus { border-color: #6366f1; }
.sql-result { border: 1px solid #e5e5e5; border-radius: 6px; overflow: hidden; margin-top: 4px; }
.sql-result-scroll { max-height: 400px; overflow: auto; }
.sql-result-empty {
  padding: 16px; font-size: 13px; color: #666;
  background: #fafafa; border: 1px solid #e5e5e5; border-radius: 6px;
  margin-top: 4px;
}


/* ── Table Explorer (mini-supabase) ── */
.te-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.te-meta { display: flex; gap: 6px; }
.te-actions { display: flex; gap: 6px; }
.te-loading { display: flex; align-items: center; gap: 8px; padding: 20px; color: #888; font-size: 13px; }

.te-insert {
  background: #fafafa; border: 1px solid #e5e5e5; border-radius: 8px;
  padding: 16px; margin-bottom: 12px;
}
.te-insert-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.te-insert-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.te-insert-actions { display: flex; gap: 8px; margin-top: 12px; }

.te-table-wrap { border: 1px solid #e5e5e5; border-radius: 6px; overflow: hidden; }
.te-table-scroll { overflow-x: auto; overflow-y: auto; max-height: 500px; }
.te-table { min-width: max-content; }
.te-table th { position: sticky; top: 0; background: #fafafa; z-index: 1; white-space: nowrap; }
.te-th-actions { width: 70px; }
.te-td-actions { display: flex; gap: 4px; }
.te-sort-btn {
  background: none; border: none; cursor: pointer; font-weight: 600;
  font-size: 11px; color: #333; text-transform: uppercase; letter-spacing: .04em;
  display: inline-flex; align-items: center; gap: 3px;
}
.te-sort-btn:hover { color: #6366f1; }
.te-col-type { display: block; font-size: 9px; color: #999; font-weight: 400; text-transform: none; letter-spacing: 0; }
.te-pk { font-size: 9px; background: #6366f1; color: #fff; padding: 0 4px; border-radius: 3px; margin-left: 4px; }
.te-cell {
  display: block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer; padding: 2px 4px; border-radius: 3px;
  transition: background .1s;
}
.te-cell:hover { background: #f0f0f0; }
.te-edit-input { width: 100%; font-size: 12px; padding: 4px 6px; }
.te-pagination { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid #e5e5e5; }
.te-page-info { flex: 1; text-align: center; font-size: 12px; color: #888; }
Content-Length: 0

