/* AWeber CSV Importer — shared design system.
 *
 * Every page (login, dashboard, import wizard) pulls this in. It is served
 * from the *public* /app.css route in routes/app.ts, deliberately outside the
 * session gate, because the login page needs it before there is a session.
 *
 * The palette below is "Graphite Teal", the default of the Claude Design
 * source this UI was implemented from. Two alternates from the same source
 * are kept commented out at the bottom — swapping the whole app's look is a
 * matter of replacing the six brand/outcome values in :root, nothing else
 * references a raw hex.
 */

:root {
  /* Brand + outcome colors */
  --brand: #1f2937;
  --positive: #0f766e;
  --positive-ink: #0b5a54;
  --soft: #eef1f1;
  --soft-line: #dfe4e4;
  --neutral: #bcbfbd;
  --warn: #a25b12;
  --danger: #a92b2b;
  --hero: #14181c;
  --hero-muted: #9aa6a5;

  /* Surfaces + ink */
  --bg: #f5f5f4;
  --surface: #fff;
  --surface-2: #fbfbfa;
  --line: #e4e6e1;
  --line-2: #f0f1ee;
  --line-strong: #d8dad4;
  --ink: #15181b;
  --ink-2: #4b5563;
  --muted: #6b7280;
  --faint: #9ca3af;

  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--positive-ink);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

[x-cloak] {
  display: none !important;
}

@keyframes pulseDot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

/* ---- App header -------------------------------------------------- */

.app-header {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 56px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  background: var(--brand);
  flex: none;
}
.brand-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.app-nav {
  display: flex;
  gap: 4px;
}
.app-nav a {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 7px;
  color: var(--ink-2);
}
.app-nav a:hover {
  text-decoration: none;
  background: var(--line-2);
}
.app-nav a.active {
  color: var(--positive-ink);
  background: var(--soft);
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.live-tick {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.live-tick i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--positive);
  animation: pulseDot 2s infinite;
}
.header-divider {
  width: 1px;
  height: 20px;
  background: var(--line);
}
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-user img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}
.header-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.header-user a {
  font-size: 12px;
  color: var(--muted);
}
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 600;
  flex: none;
}

/* ---- Buttons ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  padding: 10px 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  line-height: 1.2;
}
.btn:hover {
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.15);
}
.btn-ghost {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
  font-weight: 500;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 8px;
}
.btn-ghost:hover:not(:disabled) {
  border-color: #c6cabf;
}
.btn-danger {
  color: #b91c1c;
  border-color: #f0d7d7;
}
.btn-sm {
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 8px;
}

/* Small square icon button used in table rows and inline editors. `color`
 * is set explicitly on every state: a bare `currentColor` SVG inside a
 * <button> inherits the UA's button color, not the surrounding text. */
.icon-btn {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
}
.icon-btn:hover {
  border-color: #c6cabf;
  color: var(--ink);
}
.icon-btn.sm {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--muted);
}
.icon-btn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
.icon-btn.primary:hover {
  color: #fff;
  filter: brightness(1.15);
}
.icon-btn.danger:hover {
  border-color: #f0d7d7;
  color: #b91c1c;
}

/* ---- Narrow screens -----------------------------------------------
 *
 * The header is one non-wrapping flex row, so on a phone it was wider than
 * the viewport and dragged the whole document into horizontal scroll — every
 * page looked shifted and clipped, not just the header. Everything below
 * drops or shrinks a header element rather than letting it push the page.
 */

@media (max-width: 760px) {
  .app-header {
    gap: 12px;
    padding: 0 14px;
  }
  /* The "AW" mark alone still identifies the app. */
  .brand-name {
    display: none;
  }
  .app-nav {
    gap: 2px;
  }
  .app-nav a {
    font-size: 12.5px;
    padding: 6px 9px;
  }
  .header-right {
    gap: 10px;
    min-width: 0;
  }
  /* The user's name is the single widest thing in the header; the round
     avatar next to it already identifies who is signed in. */
  .header-name,
  .header-divider {
    display: none;
  }
  /* Keep the pulsing dot — it is the "polling is alive" signal — but drop
     its "live · 5s" label, which is detail nobody reads on a phone. */
  .live-tick {
    gap: 0;
    font-size: 0;
  }
  .live-tick i {
    width: 7px;
    height: 7px;
  }
  .header-user {
    gap: 8px;
  }
  .header-user a {
    font-size: 12px;
  }
}

/* ---- Alternate palettes from the design source --------------------
 *
 * Moss (the app's previous green):
 *   --brand:#166534; --positive:#166534; --positive-ink:#14532d;
 *   --soft:#e9f1ea; --soft-line:#dde6de; --neutral:#b9c0b5;
 *   --warn:#b45309; --danger:#b91c1c; --hero:#14231a; --hero-muted:#9db3a6;
 *   --bg:#f4f5f2;
 *
 * Indigo Ink:
 *   --brand:#3a3f8f; --positive:#2f7d63; --positive-ink:#1f5a47;
 *   --soft:#ecedf9; --soft-line:#dcdef3; --neutral:#b6b8c6;
 *   --warn:#b06a10; --danger:#b02a37; --hero:#1a1d3d; --hero-muted:#a3a7cc;
 *   --bg:#f5f5f9;
 */
