/* Email Module slice 1 styles.
 *
 * Reuses tokens from /assets/_astoler-shared.css (--bg, --panel, --text,
 * --muted, --border, --accent, etc.) — no new design vocabulary. Layout
 * mirrors Leads + Admin (f-page-header + .app-nav sidebar + .app-shell-wrap
 * main column). Mobile-first per project rules: ≥44px tap targets,
 * single-column at <520px, no horizontal scroll.
 */

body.email-panel {
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);
  color: var(--text, #2A2722);
  background: var(--bg, #FBFAF4);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.email-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 22px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.email-section {
  background: var(--panel, #fff);
  border: 1px solid var(--border, #E6E2D6);
  border-radius: 12px;
  padding: 22px 22px;
  box-shadow: 0 1px 2px rgba(42,39,34,0.05);
}

.email-loading {
  color: var(--muted, #7A7460);
  font-size: 13px;
  text-align: center;
  padding: 24px 0;
}

/* ── First-run "Link Inbox" hero ─────────────────────────────────── */
.email-link-hero {
  text-align: left;
}
.email-link-hero h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text, #2A2722);
  letter-spacing: -0.01em;
}
.email-link-hero .lead {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--muted, #7A7460);
  line-height: 1.5;
}
.email-link-hero .note {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted, #7A7460);
  line-height: 1.55;
}

/* ── Connected-state settings card ───────────────────────────────── */
.email-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 0 18px;
}
@media (max-width: 520px) {
  .email-status-grid { grid-template-columns: 1fr; }
}
.email-status-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.email-status-field .label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted, #7A7460);
}
.email-status-field .value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #2A2722);
  word-break: break-word;
}
.email-status-field .value.is-muted { color: var(--muted, #7A7460); font-weight: 500; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.email-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  border: 1px solid var(--accent, #C96342);
  background: var(--accent, #C96342);
  color: #fff;
  text-decoration: none;
  transition: background 120ms, border-color 120ms, transform 120ms;
}
.email-btn:hover { background: var(--accent-2, #A84F31); border-color: var(--accent-2, #A84F31); }
.email-btn:active { transform: translateY(1px); }
.email-btn:disabled, .email-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.email-btn-ghost {
  background: transparent;
  color: var(--text, #2A2722);
  border-color: var(--border, #E6E2D6);
}
.email-btn-ghost:hover { background: var(--panel2, #F5F4ED); border-color: var(--muted2, #A8A28E); color: var(--text); }
.email-btn-danger {
  background: transparent;
  color: #b91c1c;
  border-color: rgba(185,28,28,.35);
}
.email-btn-danger:hover { background: rgba(185,28,28,.08); border-color: rgba(185,28,28,.55); }

.email-btn-full { width: 100%; }

.email-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

/* Connected-state expand-scopes affordance is stubbed disabled until
   slice 2 lands. Visible so future-you isn't surprised. */
.email-scope-future {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px dashed var(--border, #E6E2D6);
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted, #7A7460);
  line-height: 1.5;
}

/* ── Label-tree (read-only display of provisioned labels) ────────── */
.email-label-tree {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #E6E2D6);
}
.email-label-tree h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted, #7A7460);
}
.email-label-tree ul { list-style: none; padding: 0; margin: 0; }
.email-label-tree li {
  font-size: 12px;
  color: var(--text, #2A2722);
  padding: 3px 0;
  font-variant-numeric: tabular-nums;
}
.email-label-tree li .depth-1 { padding-left: 16px; color: var(--ink-2, #4D4738); }
.email-label-tree li .depth-2 { padding-left: 32px; color: var(--muted, #7A7460); }

/* ── Warning banner (e.g. partial-success after link) ────────────── */
.email-banner {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(184,134,45,.35);
  background: rgba(184,134,45,.10);
  color: #8a5a00;
  font-size: 13px;
  line-height: 1.5;
}
.email-banner strong { font-weight: 800; }

/* Error banner (e.g. consent denied, state expired). */
.email-banner.is-error {
  border-color: rgba(185,28,28,.35);
  background: rgba(185,28,28,.08);
  color: #b91c1c;
}

/* ── Coming-next stub ────────────────────────────────────────────── */
.coming-next {
  background: var(--panel3, #FBFAF4);
  border-style: dashed;
}
.coming-next-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.coming-next-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(201,99,66,.10);
  color: var(--accent, #C96342);
  border: 1px solid rgba(201,99,66,.30);
}
.coming-next-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text, #2A2722);
}
.coming-next-body {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ink-2, #4D4738);
  line-height: 1.55;
}

/* ── Sidebar disabled-item state (slice 2/5 placeholders) ────────── */
.app-nav-item.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.app-nav-item.is-disabled:hover { background: transparent; color: var(--muted, #7A7460); }

/* ── Mobile (<720px): sidebar collapses per _astoler-nav.css ─────── */
@media (max-width: 720px) {
  .email-page { padding: 16px 14px 80px; }
  .email-section { padding: 18px 16px; }
  .email-link-hero h2 { font-size: 17px; }
  .email-btn { width: 100%; }
  .email-actions .email-btn { flex: 1 1 100%; }
}
