/* === DASHBOARD === */
.dashboard-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 120px 40px 80px;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 20px;
}

.dashboard-title {
  font-size: 32px;
  margin-bottom: 8px;
}

.dashboard-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

.header-actions { display: flex; gap: 12px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: 'DM Sans', sans-serif;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: #080B10; }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }

/* Briefing grid */
.briefing-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.briefing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
}

.briefing-card-accent { border-color: rgba(245,166,35,0.3); }

.briefing-num {
  font-family: 'Syne', sans-serif;
  font-size: 40px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.briefing-card-muted .briefing-num { color: var(--text-secondary); }

.briefing-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Drafts section */
.drafts-section { }

.drafts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.drafts-header h2 { font-size: 20px; }

.drafts-filter { display: flex; gap: 8px; }

.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(245,166,35,0.3);
}

/* Draft list */
.drafts-list { display: flex; flex-direction: column; gap: 16px; }

.draft-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.draft-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.draft-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-scheduling { background: rgba(45,212,168,0.15); color: #2DD4A8; }
.badge-follow_up { background: rgba(123,92,240,0.15); color: #7B5CF0; }
.badge-action_required { background: rgba(245,166,35,0.15); color: #F5A623; }
.badge-sent { background: rgba(255,255,255,0.06); color: var(--text-muted); }

.draft-from { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.draft-time { font-size: 12px; color: var(--text-muted); margin-left: auto; }

.draft-subject { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--text-primary); }

.draft-body-preview {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.draft-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.draft-actions .btn { padding: 8px 16px; font-size: 13px; }
.btn-send { background: var(--success); color: #080B10; }
.btn-discard { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-edit-draft {
  background: var(--bg-raised);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

/* Edit draft inline */
.edit-draft-form { margin-top: 16px; display: none; }
.edit-draft-form.active { display: block; }
.edit-draft-form input,
.edit-draft-form textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  margin-bottom: 10px;
}
.edit-draft-form textarea { resize: vertical; min-height: 120px; }
.edit-draft-form .btn { margin-right: 8px; }

/* Draft status */
.draft-status-line {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* Empty state */
.drafts-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon { font-size: 48px; margin-bottom: 16px; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(8,11,16,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(8px);
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  max-width: 480px;
  width: 90%;
  position: relative;
}

.modal-box h2 { font-size: 22px; margin-bottom: 12px; }
.modal-box p { color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin-bottom: 20px; }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.code-display {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.success-msg {
  color: var(--success);
  font-weight: 500;
  padding: 12px 16px;
  background: rgba(45,212,168,0.1);
  border-radius: 8px;
}

#poll-spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Sync result toast */
.sync-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-primary);
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s;
}
.sync-toast.visible { opacity: 1; }

/* Connection status dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.connected { background: var(--success); }
.status-dot.disconnected { background: var(--text-muted); }

/* Responsive */
@media (max-width: 768px) {
  .briefing-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-header { flex-direction: column; }
  .header-actions { width: 100%; }
  .header-actions .btn { flex: 1; justify-content: center; }
}