/* Morning Briefing Dashboard - Dark Theme */

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface-elevated: #1a1a24;
  --text: #e0e0e0;
  --text-secondary: #aaa;
  --text-muted: #666;
  --border: #2a2a3e;
  --blue: #7ab8ff;
  --green: #7aff7a;
  --purple: #d4a5ff;
  --orange: #ff9a7a;
  --gold: #ffd47a;
  --red: #ff7a7a;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 100px;
}

/* Header */
header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

header h1 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
}

.header-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.header-stats {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.header-stat {
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  padding: 16px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Sections */
.section {
  background: #0d0d14;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 16px;
}

.section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #fff;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* --- Digest (RDU-141) --- */

.digest-category {
  margin-bottom: 16px;
}

.digest-category:last-child {
  margin-bottom: 0;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.digest-entry {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--border);
}

.digest-entry:last-child {
  margin-bottom: 0;
}

.digest-sender {
  font-weight: 600;
  font-size: 0.85rem;
  color: #ccc;
}

.digest-subject {
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 6px;
}

.digest-insights {
  list-style: none;
  padding: 0;
}

.digest-insights li {
  font-size: 0.8rem;
  color: #aaa;
  padding: 1px 0;
  position: relative;
  padding-left: 16px;
}

.digest-insights li::before {
  content: "\2022";
  position: absolute;
  left: 4px;
  color: var(--text-secondary);
}

/* --- Auto-processed (RDU-142) --- */

.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.chip-count {
  font-weight: 600;
  color: #ccc;
}

.auto-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Triage items (RDU-143, RDU-144) --- */

.triage-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
}

.triage-item:last-child {
  margin-bottom: 0;
}

.triage-item.actioned {
  opacity: 0.4;
}

.triage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.triage-info {
  flex: 1;
  min-width: 0;
}

.triage-sender {
  font-weight: 600;
  font-size: 0.85rem;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.triage-subject {
  font-size: 0.8rem;
  color: #777;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

.tag-flight { background: #102010; color: var(--green); }
.tag-income { background: #2a1020; color: var(--red); }
.tag-job { background: #102030; color: var(--blue); }
.tag-financial { background: #201a10; color: var(--gold); }
.tag-property { background: #201520; color: var(--purple); }
.tag-calendar-yes { background: #102010; color: var(--green); }
.tag-calendar-no { background: #102030; color: var(--blue); }
.tag-queued { background: #222; color: var(--text-secondary); }

.triage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  border: 1px solid #2a2a3e;
  background: #1a1a2e;
  color: #aaa;
  cursor: pointer;
  transition: all 0.15s;
}

.btn:hover {
  background: #2a2a3e;
  color: #fff;
}

.btn-danger {
  background: #2a1020;
  color: var(--red);
  border-color: #3a1a2a;
}

.btn-danger:hover {
  background: #3a1a2a;
}

.btn-primary {
  background: #1a2a4e;
  color: var(--blue);
  border-color: #2a3a5e;
}

.btn-primary:hover {
  background: #2a3a5e;
}

/* Review / categorise expand panels */
.expand-panel {
  margin-top: 10px;
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius);
  border-top: 1px solid var(--border);
  display: none;
}

.expand-panel.open {
  display: block;
}

.body-preview {
  max-height: 150px;
  overflow-y: auto;
  font-size: 0.78rem;
  color: #999;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 8px;
  padding: 10px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.expand-panel textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #2a2a3e;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  margin-bottom: 8px;
  background: var(--bg);
  color: #ccc;
}

.expand-panel textarea::placeholder {
  color: #444;
}

.expand-panel textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.expand-panel select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #2a2a3e;
  border-radius: 6px;
  font-size: 0.8rem;
  margin-bottom: 8px;
  background: var(--bg);
  color: #ccc;
  font-family: inherit;
}

.expand-panel select option {
  background: #111;
}

/* --- Prompt bar (RDU-145) --- */

.prompt-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  z-index: 100;
}

.prompt-inner {
  display: flex;
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
}

.prompt-inner input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--surface);
  color: #ccc;
}

.prompt-inner input::placeholder {
  color: #444;
}

.prompt-inner input:focus {
  outline: none;
  border-color: var(--blue);
}

.prompt-inner button {
  padding: 10px 20px;
  background: #1a2a4e;
  color: var(--blue);
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.prompt-inner button:hover {
  background: #2a3a5e;
}

.prompt-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Responsive (RDU-145) --- */

/* Tablet */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }

  header {
    padding: 16px;
  }

  .section {
    padding: 12px;
  }

  .prompt-bar {
    padding: 8px 16px;
  }
}
