/* Polls — minimal styles. Skeleton only, refines as views land. */

html, body {
  margin: 0; padding: 0;
  background: #f1f5f9;
  color: #1e293b;
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100%;
}

.pl-app {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.pl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.pl-header h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}
.pl-user {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #475569;
}
.pl-user-id {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: right;
}
.pl-user-name { font-weight: 600; color: #1e293b; }
.pl-user-email { font-size: 0.8rem; color: #64748b; }

.pl-cta {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  background: #2563eb;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
}
.pl-cta:hover { background: #1d4ed8; }

.pl-link { color: #2563eb; text-decoration: none; }
.pl-link:hover { text-decoration: underline; }

.pl-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
}

.pl-status {
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  margin: 0 0 0.75rem 0;
}
.pl-status--ok { background: #ecfdf5; color: #047857; }

.pl-hint {
  color: #64748b;
  font-size: 0.85rem;
}

/* Function menu — grid of cards linking to the polls surfaces. */
.pl-menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.75rem;
  margin: 0.25rem 0 1rem;
}
.pl-menu-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.pl-menu-item:hover {
  border-color: #2563eb;
  background: #fff;
}
.pl-menu-title {
  font-weight: 600;
  color: #2563eb;
}
.pl-menu-desc {
  font-size: 0.82rem;
  color: #64748b;
}

.pl-details {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}
.pl-details summary {
  cursor: pointer;
  color: #2563eb;
}
.pl-details ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  color: #334155;
}
.pl-details code {
  background: #f1f5f9;
  padding: 0 0.25rem;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
}

/* Header home link — keep the "Polls" title clickable but unstyled. */
.pl-home-link { color: inherit; text-decoration: none; }
.pl-home-link:hover { text-decoration: underline; }

/* ── Section nav ─────────────────────────────────────────────────────── */
.pl-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}
.pl-nav-link {
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  color: #475569;
  text-decoration: none;
  font-size: 0.88rem;
}
.pl-nav-link:hover { background: #e2e8f0; }
.pl-nav-link.is-active {
  background: #2563eb;
  color: #fff;
}

/* ── Banners ─────────────────────────────────────────────────────────── */
.pl-banner {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.pl-banner p { margin: 0 0 0.6rem; }
.pl-banner--error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.pl-banner--ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.pl-banner--warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Section internals ───────────────────────────────────────────────── */
.pl-section + .pl-section { margin-top: 1.25rem; }
.pl-h2 {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.pl-empty {
  color: #64748b;
  font-style: italic;
  margin: 0.25rem 0;
}
.pl-status--error { background: #fef2f2; color: #b91c1c; }

/* ── Dashboard item cards ────────────────────────────────────────────── */
.pl-item {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}
.pl-item:last-child { margin-bottom: 0; }
.pl-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.pl-item-title { margin: 0; font-size: 0.98rem; font-weight: 600; }
.pl-item-meta { font-size: 0.8rem; color: #64748b; }

.pl-polls { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.pl-poll {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-top: 1px solid #f1f5f9;
}
.pl-poll-title { font-weight: 500; }
.pl-poll-meta { font-size: 0.8rem; color: #64748b; }
.pl-poll-action { margin-left: auto; }

/* ── Status badges ───────────────────────────────────────────────────── */
.pl-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}
.pl-badge--started, .pl-badge--sharing { background: #dcfce7; color: #166534; }
.pl-badge--ended { background: #e0e7ff; color: #3730a3; }
.pl-badge--notstart { background: #f1f5f9; color: #475569; }
.pl-badge--deleted { background: #fee2e2; color: #b91c1c; }
.pl-badge--shared { background: #fef3c7; color: #92400e; }

.pl-h2-note { font-weight: 400; font-size: 0.82rem; color: #94a3b8; }

.pl-conn-summary { font-weight: 600; color: #475569; }
.pl-ref-type {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  background: #e2e8f0;
  color: #475569;
}
.pl-ref-type--webinar { background: #ede9fe; color: #6d28d9; }
.pl-ref-type--meeting { background: #dbeafe; color: #1d4ed8; }

/* ── Summary stats ───────────────────────────────────────────────────── */
.pl-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.pl-stat {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.85rem;
  text-align: center;
  background: #f8fafc;
}
.pl-stat-num { display: block; font-size: 1.6rem; font-weight: 700; color: #1e293b; }
.pl-stat-label { display: block; font-size: 0.78rem; color: #64748b; margin-top: 0.2rem; }

.pl-toplist { list-style: none; margin: 0; padding: 0; }
.pl-toplist li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-top: 1px solid #f1f5f9;
}
.pl-toplist li:first-child { border-top: 0; }
.pl-top-count {
  font-weight: 600;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 999px;
  padding: 0 0.55rem;
  text-decoration: none;
}
a.pl-top-count:hover {
  background: #2563eb;
  color: #fff;
}

/* ── Deduped poll lists (meetings / events pages) ────────────────────── */
.pl-polllist { list-style: none; margin: 0; padding: 0; }
.pl-pollcard {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}
.pl-pollcard:last-child { margin-bottom: 0; }
.pl-pollcard-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pl-pollcard-refs {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.83rem;
  color: #475569;
}
.pl-ref { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }

/* ── Forms ───────────────────────────────────────────────────────────── */
.pl-form { display: flex; flex-direction: column; gap: 0.9rem; max-width: 36rem; }
.pl-field { display: flex; flex-direction: column; gap: 0.3rem; }
.pl-field label { font-weight: 500; font-size: 0.9rem; }
.pl-field-hint { font-weight: 400; color: #94a3b8; font-size: 0.8rem; }
.pl-field input[type="text"],
.pl-field input[type="file"],
.pl-field select,
.pl-field textarea {
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #1e293b;
}
.pl-field input:focus,
.pl-field select:focus,
.pl-field textarea:focus {
  outline: 2px solid #bfdbfe;
  border-color: #2563eb;
}
.pl-field textarea { resize: vertical; font-family: inherit; }
.pl-field--check label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.pl-field--check input { width: auto; }

.pl-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.pl-cta { border: 0; cursor: pointer; }
button.pl-cta { font: inherit; }
.pl-btn-secondary {
  font: inherit;
  cursor: pointer;
  padding: 0.5rem 0.9rem;
  background: #fff;
  color: #2563eb;
  border: 1px solid #2563eb;
  border-radius: 4px;
}
.pl-btn-secondary:hover { background: #eff6ff; }

/* ── Export result ───────────────────────────────────────────────────── */
.pl-export-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.pl-export-head .pl-h2 { margin: 0; }
.pl-code {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  color: #1e293b;
}
