/* Artboard-scoped resets so an artboard renders like a real page */
.jb-artboard {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.jb-artboard a { color: inherit; text-decoration: none; }

/* Landing layout */
.land {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}
.land .land-nav {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  background: var(--landing-topbar-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-soft);
}
.land .nav-left { display: flex; align-items: center; gap: 36px; }
.land .nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px; letter-spacing: -0.02em;
}
.land .nav-logo .logo-mark {
  width: 28px; height: 28px;
  background: url('../assets/js2mail-mark.svg') center/contain no-repeat;
  font-size: 0;
  color: transparent;
}
.land .nav-links { display: flex; gap: 28px; }
.land .nav-links a {
  font-size: 14px; color: var(--text-2);
  transition: color 180ms;
}
.land .nav-links a:hover { color: var(--text); }
.land .nav-right { display: flex; align-items: center; gap: 10px; }

/* Dashboard chrome */
.dash {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100%;
}
.dash-side {
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 14px 12px;
  gap: 4px;
}
.dash-side .side-logo {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 14px;
  font-weight: 600; font-size: 14px;
}
.dash-side .side-logo .logo-mark {
  width: 26px; height: 26px;
  background: url('../assets/js2mail-mark.svg') center/contain no-repeat;
  font-size: 0;
  color: transparent;
}
.dash-side .side-section {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 10px 6px;
  font-weight: 500;
}
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 160ms, color 160ms;
}
.side-item:hover { background: var(--hover-bg); color: var(--text); }
.side-item.is-active {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(110,123,255,0.18);
}
.side-item .ic { width: 16px; height: 16px; flex: none; opacity: 0.85; }
.side-item .badge {
  margin-left: auto;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--chip-bg);
  color: var(--text-2);
  font-family: var(--font-mono);
}

.dash-main {
  display: flex; flex-direction: column;
  min-width: 0;
  overflow-y: auto;
}
.dash-top {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
  position: sticky; top: 0; z-index: 4;
}
.dash-top .ws {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface-2);
}
.dash-top .ws .ws-icon {
  width: 18px; height: 18px; border-radius: 5px;
  background: linear-gradient(135deg,#3CC2A4,#1E8C75);
  display: grid; place-items: center;
  color: #051A14; font-size: 10px; font-weight: 700;
  font-family: var(--font-mono);
}
.dash-top .search {
  flex: 1; max-width: 360px;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 13px;
}
.dash-top .search kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.dash-content {
  padding: 28px 28px 60px;
}
.dash-h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.dash-sub {
  font-size: 14px; color: var(--text-2);
  margin: 0 0 22px;
}

/* ───── Stat cards ───── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  padding: 16px 16px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  position: relative;
}
.stat-label {
  font-size: 12px; color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
}
.stat-value {
  font-size: 24px; font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 8px;
  font-feature-settings: "tnum";
}
.stat-delta {
  font-size: 12px;
  margin-top: 6px;
  color: var(--success);
  font-family: var(--font-mono);
}
.stat-delta.is-warn { color: var(--warning); }
.stat-spark {
  position: absolute; right: 14px; top: 14px;
  opacity: 0.55;
}

/* Two-col layout for content rows */
.row-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

/* Provider card */
.prov-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color 200ms, transform 200ms;
}
.prov-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.prov-card .prov-head {
  display: flex; align-items: center; gap: 10px;
}
.prov-card .prov-name { font-size: 14px; font-weight: 500; }
.prov-card .prov-meta { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.prov-card .prov-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  border-top: 1px solid var(--border-soft);
  padding-top: 8px;
  margin-top: 4px;
}
.prov-card .prov-stats .k { color: var(--text-3); display: block; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.prov-card .prov-stats .v { color: var(--text); font-size: 12px; }

/* Logs */
.logs {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.logs-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
  font-weight: 500;
}
.logs-head .live {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--success);
}
.logs-table {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 11.5px;
  border-collapse: collapse;
}
.logs-table th {
  text-align: left;
  padding: 6px 12px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
  background: var(--row-stripe);
  border-bottom: 1px solid var(--border-soft);
}
.logs-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-2);
}
.logs-table td.email { color: var(--text); }
.logs-table tr:last-child td { border-bottom: none; }
.logs-table tr.is-new {
  animation: jStreamIn 360ms ease;
}
@keyframes jStreamIn {
  from { background: var(--accent-soft); }
  to   { background: transparent; }
}

/* API Keys */
.keys {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.key-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.key-row:last-child { border-bottom: none; }
.key-row .k-name { font-size: 13px; font-weight: 500; }
.key-row .k-token {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--row-stripe);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
}
.key-row .k-meta { font-size: 11.5px; color: var(--text-3); font-family: var(--font-mono); }
.icon-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all 160ms;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--hover-bg); }
