/* Business and People Management Newsletter — Dark Theme */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0a;
  color: #f1f5f9;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: #3b82f6; text-decoration: none; }
a:hover { color: #60a5fa; }

/* Header */
.site-header {
  background: #111827;
  border-bottom: 1px solid #1e293b;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #f1f5f9;
  font-weight: 700;
  font-size: 1.1rem;
}

.site-header .brand img {
  height: 32px;
}

.site-header nav a {
  color: #94a3b8;
  margin-left: 1.5rem;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.site-header nav a:hover,
.site-header nav a.active {
  color: #3b82f6;
}

.back-link {
  color: #94a3b8;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 2rem;
}

.back-link:hover { color: #f1f5f9; }

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.content-col {
  max-width: 720px;
  margin: 0 auto;
}

/* Newsletter listing */
.newsletter-hero {
  text-align: center;
  padding: 4rem 0 2rem;
}

.newsletter-title {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.02em;
  margin-bottom: 0;
}

.newsletter-divider {
  width: 100%;
  max-width: 500px;
  height: 2px;
  background: #3b82f6;
  margin: 0.75rem auto;
}

.newsletter-subtitle {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #3b82f6;
  letter-spacing: 0.25em;
  margin: 0;
}

.newsletter-hero p {
  color: #94a3b8;
  font-size: 1rem;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0 4rem;
}

.article-card {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.article-card .card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #1e293b;
}

.article-card .card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card .card-date {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.article-card .card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.article-card .card-excerpt {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.5;
  flex: 1;
}

/* Article reader */
.article-header {
  padding: 3rem 0 1.5rem;
  text-align: left;
}

.article-header h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.article-meta {
  color: #64748b;
  font-size: 0.85rem;
}

.article-meta .author { color: #94a3b8; }

.article-cover {
  width: 100%;
  border-radius: 12px;
  margin: 2rem 0;
}

/* Quill alignment classes */
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }

.article-body {
  padding-bottom: 4rem;
  font-size: 1.05rem;
  line-height: 1.42;
  color: #e2e8f0;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
  color: #f1f5f9;
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1rem 0 0.4rem;
  color: #f1f5f9;
}

.article-body p { margin: 0; padding: 0; }

.article-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1rem 0;
}

.article-body ul, .article-body ol {
  margin: 0 0 0 1.5em;
  padding: 0;
}

.article-body li { margin-bottom: 0; }

.article-body blockquote {
  border-left: 3px solid #3b82f6;
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: #94a3b8;
  font-style: italic;
}

.article-body strong { color: #f1f5f9; }

.article-body a { color: #3b82f6; text-decoration: underline; }

.share-bar {
  border-top: 1px solid #1e293b;
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.share-bar .btn {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.share-bar .btn:hover {
  background: #334155;
  color: #f1f5f9;
}

/* Editor */
.editor-login {
  max-width: 360px;
  margin: 8rem auto;
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 2rem;
}

.editor-login h2 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group select {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  color: #f1f5f9;
  font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3b82f6;
}

.btn-primary {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-primary:hover { background: #2563eb; }

.btn-secondary {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #334155;
  color: #f1f5f9;
}

.btn-danger {
  background: transparent;
  color: #ef4444;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-danger:hover { color: #f87171; }

.editor-layout {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
}

.editor-sidebar {
  width: 280px;
  flex-shrink: 0;
}

.editor-sidebar h3 {
  font-size: 0.85rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.sidebar-article {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.sidebar-article:hover { border-color: #334155; }
.sidebar-article.active { border-color: #3b82f6; }

.sidebar-article .sa-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-article .sa-meta {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.sidebar-article .sa-status {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.sa-status.published { background: #166534; color: #4ade80; }
.sa-status.scheduled { background: #1e3a5f; color: #60a5fa; }
.sa-status.draft { background: #334155; color: #94a3b8; }

.editor-main {
  flex: 1;
  min-width: 0;
}

.editor-title-input {
  width: 100%;
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-size: 2.5rem;
  font-weight: 800;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  outline: none;
}

.editor-title-input::placeholder { color: #334155; }

.editor-toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* Quill overrides for dark theme */
.ql-toolbar.ql-snow {
  border: 1px solid #1e293b !important;
  border-radius: 8px 8px 0 0;
  background: #111827;
}

.ql-container.ql-snow {
  border: 1px solid #1e293b !important;
  border-top: none !important;
  border-radius: 0 0 8px 8px;
  background: #0a0a0a;
  min-height: 400px;
  font-size: 1.05rem;
  color: #e2e8f0;
  line-height: 1.8;
}

.ql-editor { padding: 1.5rem; }
.ql-editor.ql-blank::before { color: #475569 !important; }

.ql-snow .ql-stroke { stroke: #94a3b8 !important; }
.ql-snow .ql-fill { fill: #94a3b8 !important; }
.ql-snow .ql-picker-label { color: #94a3b8 !important; }
.ql-snow .ql-picker-options { background: #1e293b !important; border-color: #334155 !important; }
.ql-snow .ql-picker-item { color: #94a3b8 !important; }
.ql-snow .ql-picker-item:hover { color: #f1f5f9 !important; }
.ql-snow .ql-active .ql-stroke { stroke: #3b82f6 !important; }
.ql-snow .ql-active .ql-fill { fill: #3b82f6 !important; }

.editor-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px solid #1e293b;
  margin-top: 1rem;
}

.error-msg {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.success-msg {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .articles-grid { grid-template-columns: 1fr; }
  .article-header h1 { font-size: 1.75rem; }
  .newsletter-hero h1 { font-size: 1.75rem; }
  .editor-layout { flex-direction: column; }
  .editor-sidebar { width: 100%; }
  .editor-title-input { font-size: 1.5rem; }
}

/* Paywall */
.paywall-wall {
  position: relative;
  margin-top: -1rem;
}

.paywall-blur {
  max-height: 200px;
  overflow: hidden;
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #e2e8f0;
}

.paywall-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, #0a0a0a 60%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 2rem;
}

.paywall-box {
  text-align: center;
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
}

.paywall-box h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.paywall-box p {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.paywall-input {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  color: #f1f5f9;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.paywall-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.paywall-btn {
  width: 100%;
  background: #3b82f6;
  color: white;
  border: none;
  padding: 0.625rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.paywall-btn:hover { background: #2563eb; }

/* ===== Subscriber Dashboard ===== */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.dashboard-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 1.25rem;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
}

.stat-card .stat-change {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.stat-change.up { color: #4ade80; }
.stat-change.down { color: #f87171; }
.stat-change.neutral { color: #94a3b8; }

/* Charts row */
.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chart-card {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 1.25rem;
  min-height: 0;
}

.chart-card h3 {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.chart-card canvas {
  max-height: 220px;
}

/* Activity feed */
.activity-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid #1e293b;
  font-size: 0.8rem;
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.activity-dot.green { background: #4ade80; }
.activity-dot.red { background: #f87171; }
.activity-dot.yellow { background: #fbbf24; }
.activity-time { color: #475569; font-size: 0.7rem; float: right; }

/* Subscriber table section */
.table-section {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.table-header h3 {
  font-size: 0.85rem;
  color: #94a3b8;
}

.table-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.table-controls input,
.table-controls select {
  background: #0a0a0a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  color: #f1f5f9;
  font-size: 0.75rem;
}

.table-controls input { width: 200px; }

.table-controls input:focus,
.table-controls select:focus {
  outline: none;
  border-color: #3b82f6;
}

.btn-export {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  color: #94a3b8;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-export:hover {
  background: #334155;
  color: #f1f5f9;
}

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.data-table th {
  text-align: left;
  color: #64748b;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #1e293b;
}

.data-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #0f172a;
}

.data-table tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

.status-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.paid { background: #166534; color: #4ade80; }
.status-badge.free { background: #1e3a5f; color: #60a5fa; }
.status-badge.cancelled { background: #7f1d1d; color: #fca5a5; }
.status-badge.past_due { background: #78350f; color: #fbbf24; }

.action-link {
  color: #64748b;
  font-size: 0.7rem;
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
}

.action-link:hover { color: #f1f5f9; }

/* Article performance */
.perf-row {
  display: flex;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #1e293b;
  font-size: 0.8rem;
  gap: 1rem;
}

.perf-row:last-child { border-bottom: none; }
.perf-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perf-stat { width: 70px; text-align: center; color: #94a3b8; flex-shrink: 0; }
.perf-stat strong { color: #f1f5f9; display: block; font-size: 1rem; }
.perf-bar { width: 120px; height: 6px; background: #1e293b; border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.perf-bar-fill { height: 100%; background: #3b82f6; border-radius: 3px; }

/* Section label */
.section-label {
  font-size: 0.7rem;
  color: #3b82f6;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin: 0.5rem 0 0.75rem;
}

/* Add subscriber row */
.add-sub-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.add-sub-row input {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  color: #f1f5f9;
  font-size: 0.8rem;
}

.add-sub-row input:focus {
  outline: none;
  border-color: #3b82f6;
}

/* Dashboard responsive */
@media (max-width: 768px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .table-controls { width: 100%; }
  .table-controls input { width: 100%; }
  .perf-bar { display: none; }
}
