/* Same brand palette as the public gate/email pages (src/lib/html.ts,
   email-templates.ts) — sampled from whoz.com's own site/logo. */
:root {
  --border: #e2e0ec;
  --text: #0c0625;
  --muted: #6b6b7d;
  --accent: #9f7cff;
  --danger: #c0392b;
  --bg-subtle: #f3f1fb;
  --bg-page: #f8f7fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg-page);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.container-narrow {
  max-width: 420px;
  margin: 64px auto;
  padding: 0 20px;
}

header.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

header.app-header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

header.app-header .brand img {
  width: 22px;
  height: 22px;
  display: block;
}

header.app-header nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

header.app-header a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

header.app-header a:hover {
  color: var(--accent);
}

h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

h2 {
  font-size: 17px;
  margin: 32px 0 12px;
}

p.muted, .muted {
  color: var(--muted);
  font-size: 14px;
}

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

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Explanatory tooltip on table headers — CSS-driven so it shows
   immediately on hover/focus, unlike the native `title` attribute which
   only appears after a multi-second delay. */
.hint {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--muted);
}

.hint::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 0;
  background: var(--text);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.hint:hover::after,
.hint:focus::after {
  opacity: 1;
  visibility: visible;
}

.truncate {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  padding: 4px 6px;
  border-color: transparent;
  background: transparent;
}

.icon-button:hover {
  border-color: var(--border);
}

input[type="text"], input[type="email"], input[type="url"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="url"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(159, 124, 255, 0.25);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.field {
  margin-bottom: 14px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.checkbox-field label {
  margin: 0;
  font-weight: normal;
}

button, .button {
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

/* Ink, not --accent — the light brand purple doesn't have enough
   contrast against white button text (same reasoning as the gate page's
   CTA button in html.ts); --accent stays reserved for links, focus
   rings, and badges. */
button.primary {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

button.primary:hover {
  opacity: 0.9;
}

button.danger {
  color: var(--danger);
  border-color: var(--danger);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  background: var(--bg-subtle);
  margin-bottom: 20px;
}

.error {
  color: var(--danger);
  font-size: 13px;
  margin: 8px 0;
}

.slug-link {
  font-family: ui-monospace, Menlo, monospace;
}

/* Only the list-view cell (slugLinkCell) gets the flex layout — the detail
   pages reuse .slug-link for a plain (non-truncated, no icon) URL display,
   where a flex row risks the long URL text not wrapping. */
.slug-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Let the link fill the column's actual width (rather than stopping at the
   .truncate default cap) so the copy icon sits at the cell's right edge. */
.slug-cell .truncate {
  flex: 1;
  min-width: 0;
  max-width: none;
}

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

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  white-space: nowrap;
}
