/* dashboard.css — Meridian AI Brief Dashboard */

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

:root {
  --bg:        #0d0e1a;
  --surface:   #13152a;
  --surface2:  #1a1d35;
  --border:    rgba(255,255,255,0.07);
  --accent:    #7c6dff;
  --accent2:   #a78bfa;
  --green:     #34d399;
  --amber:     #fbbf24;
  --red:       #f87171;
  --text:      #e8e9f0;
  --muted:     #6b7280;
  --subtle:    rgba(255,255,255,0.05);
  --radius:    10px;
  --radius-lg: 16px;
}

html { font-size: 16px; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── NAV ───────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo {
  width: 30px; height: 30px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
}
.nav-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.nav-actions { display: flex; gap: 8px; align-items: center; }
.btn-ghost {
  padding: 7px 14px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center;
  transition: border-color 0.15s, background 0.15s;
}
.btn-ghost:hover { background: var(--subtle); border-color: rgba(255,255,255,0.15); }

/* ── MAIN ───────────────────────────────────── */
.main { max-width: 1100px; margin: 0 auto; padding: 40px 32px 80px; }

/* ── DATE HEADER ────────────────────────────── */
.date-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.date-label {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.date-badge {
  padding: 4px 10px;
  background: rgba(124,109,255,0.15);
  border: 1px solid rgba(124,109,255,0.3);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent2);
}

/* ── ALERTS ─────────────────────────────────── */
.alert-error {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  color: var(--red);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 14px;
}

/* ── EMPTY STATE ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 48px;
}
.empty-icon { font-size: 48px; margin-bottom: 20px; }
.empty-state h2 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}
.empty-state p {
  color: var(--muted);
  max-width: 400px;
  margin: 0 auto 28px;
  font-size: 15px;
}
.empty-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.demo-loading {
  display: flex; align-items: center; gap: 10px;
  justify-content: center;
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}

/* ── SUMMARY CARD ────────────────────────────── */
.summary-card {
  background: linear-gradient(135deg, rgba(124,109,255,0.1), rgba(167,139,250,0.05));
  border: 1px solid rgba(124,109,255,0.25);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
}
.summary-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent2);
  margin-bottom: 14px;
}
.pulse-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.summary-text {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  font-weight: 400;
}
.source-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.chip {
  padding: 3px 10px;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
  color: var(--muted);
}

/* ── THREE-COL GRID ───────────────────────────── */
.brief-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 768px) {
  .brief-grid { grid-template-columns: 1fr; }
}

.brief-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.actions-header { background: rgba(52,211,153,0.06); }
.blockers-header { background: rgba(251,191,36,0.06); }
.decisions-header { background: rgba(124,109,255,0.08); }
.col-icon { font-size: 14px; }
.col-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex: 1;
}
.col-count {
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.item-list { list-style: none; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.brief-item {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.priority-high { border-left: 3px solid var(--red); }
.priority-medium { border-left: 3px solid var(--amber); }
.priority-low { border-left: 3px solid var(--green); }
.blocker-item { border-left: 3px solid var(--amber); }
.decision-item { border-left: 3px solid var(--accent); }

.item-text { font-size: 14px; line-height: 1.5; color: var(--text); }
.item-meta { margin-top: 6px; }
.impact-text { font-size: 12px; color: var(--amber); }
.priority-flag { margin-top: 6px; font-size: 11px; color: var(--red); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.owner-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(124,109,255,0.12);
  border: 1px solid rgba(124,109,255,0.2);
  border-radius: 20px;
  font-size: 11px;
  color: var(--accent2);
  font-weight: 500;
}
.decision-badge {
  background: rgba(52,211,153,0.1);
  border-color: rgba(52,211,153,0.2);
  color: var(--green);
}
.empty-col {
  padding: 24px 18px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.empty-col.green { color: var(--green); }

/* ── BRIEF FOOTER ────────────────────────────── */
.brief-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.brief-timestamp { font-size: 12px; color: var(--muted); }
.btn-ghost-sm {
  background: none;
  border: none;
  color: var(--accent2);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
  text-decoration: none;
}
.btn-ghost-sm:hover { text-decoration: underline; }

/* ── SUBSCRIBE ───────────────────────────────── */
.subscribe-section { margin-top: 48px; }
.subscribe-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.subscribe-icon { font-size: 36px; flex-shrink: 0; }
.subscribe-copy { flex: 1; min-width: 200px; }
.subscribe-copy h3 {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.subscribe-copy p { font-size: 14px; color: var(--muted); }
.subscribe-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.input-field {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  width: 160px;
}
.input-field:focus { border-color: var(--accent); }
.input-field::placeholder { color: var(--muted); }
.subscribe-msg {
  margin-top: 8px;
  font-size: 13px;
  width: 100%;
}
.subscribe-msg.success { color: var(--green); }
.subscribe-msg.error { color: var(--red); }

/* ── BUTTONS ─────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary.btn-full { width: 100%; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--subtle); }

/* ── INPUT PANEL ─────────────────────────────── */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  z-index: 200;
}
.input-panel {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
  flex-shrink: 0;
}
.panel-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
}
.panel-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.panel-close:hover { background: var(--subtle); color: var(--text); }
.panel-lede {
  padding: 12px 28px 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.panel-form { padding: 20px 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.input-group { display: flex; flex-direction: column; gap: 8px; }
.input-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.tool-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.slack-dot    { background: #e01e5a; }
.notion-dot   { background: #fff; }
.linear-dot   { background: #5e6ad2; }
.other-dot    { background: var(--muted); }

textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  font-family: 'DM Sans', inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
textarea:focus { border-color: var(--accent); }
textarea::placeholder { color: var(--muted); }
.panel-actions { margin-top: 4px; }
.panel-error {
  font-size: 13px;
  color: var(--red);
  padding: 10px 14px;
  background: rgba(248,113,113,0.08);
  border-radius: var(--radius);
  border: 1px solid rgba(248,113,113,0.2);
}

/* ── SPINNER ─────────────────────────────────── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── UTILITIES ───────────────────────────────── */
.hidden { display: none !important; }
