/* Fluxo — AI-native social posting suite. Design system by agent D1. */
:root {
  --bg: #14182B;
  --surface: #191F36;
  --card: #1F2642;
  --card-hover: #242C4E;
  --border: rgba(255,255,255,.09);
  --foreground: #EEF1FA;
  --muted: #9AA3C7;
  --accent: #7C3AED;
  --accent-soft: rgba(124,58,237,.16);
  --accent-2: #18E0C8;
  --accent-2-soft: rgba(24,224,200,.14);
  --pink: #FF3D8B;
  --accent-fg: #FFFFFF;
  --grad: linear-gradient(96deg, #7C3AED, #FF3D8B);
  --success: #2FD48C;
  --warn: #FFB454;
  --danger: #FF5470;
  --radius-xs: 8px; --radius-sm: 12px; --radius-md: 18px; --radius-lg: 24px; --radius-pill: 999px;
  --shadow-sm: 0 8px 24px rgba(0,0,0,.22);
  --shadow-md: 0 18px 48px rgba(0,0,0,.34);
  --shadow-glow: 0 0 0 1px rgba(124,58,237,.32), 0 0 36px rgba(124,58,237,.28);
  --shadow-accent: 0 0 32px rgba(24,224,200,.24);
  --font-sans: 'Geist', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --signal: #B6F500;
  --grad-brand: linear-gradient(135deg, #18E0C8 0%, #7C3AED 48%, #FF3D8B 100%);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans); background: var(--bg); color: var(--foreground);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
body::before { /* ambient glow */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 300px at 85% -5%, rgba(124,58,237,.18), transparent 60%),
    radial-gradient(500px 280px at -5% 105%, rgba(24,224,200,.10), transparent 60%);
}
#app { position: relative; z-index: 1; display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 232px; flex-shrink: 0; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; box-shadow: var(--shadow-glow); }
.logo-word { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.logo-word em { font-style: normal; color: var(--accent-2); }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--muted); cursor: pointer; font-weight: 500; border: 1px solid transparent; transition: .15s;
}
.nav-item:hover { color: var(--foreground); background: var(--surface); }
.nav-item.active { color: var(--foreground); background: var(--accent-soft); border-color: rgba(124,58,237,.35); }
.nav-item .ico { width: 18px; text-align: center; opacity: .9; }
.nav-item .badge { margin-left: auto; background: var(--grad); color: #fff; border-radius: var(--radius-pill); font-size: 10.5px; font-weight: 700; padding: 1px 7px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.trust-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; font-size: 12px; color: var(--muted); }
.trust-card b { color: var(--success); display: block; margin-bottom: 3px; font-size: 12.5px; }

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; padding: 26px 30px 60px; max-width: 1240px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.h1 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.actions { display: flex; gap: 9px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--card); color: var(--foreground);
  padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: .15s; font-family: inherit;
}
.btn:hover { background: var(--card-hover); transform: translateY(-1px); }
.btn.primary { background: var(--grad); border-color: transparent; color: var(--accent-fg); box-shadow: 0 6px 22px rgba(124,58,237,.35); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.teal { background: var(--accent-2-soft); border-color: rgba(24,224,200,.35); color: var(--accent-2); }
.btn.danger { background: rgba(255,84,112,.12); border-color: rgba(255,84,112,.35); color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 12px; }

/* ---------- cards & grids ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g2 { grid-template-columns: repeat(2, 1fr); }
.stat .k { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat .v { font-size: 26px; font-weight: 750; letter-spacing: -.5px; margin: 4px 0 2px; }
.stat .d { font-size: 12px; font-weight: 600; }
.up { color: var(--success); } .down { color: var(--danger); }
.section-title { font-size: 15px; font-weight: 700; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }

/* ---------- chips / status ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 650; }
.chip.posted { background: rgba(47,212,140,.13); color: var(--success); }
.chip.queued { background: var(--accent-soft); color: #B79BF5; }
.chip.failed { background: rgba(255,84,112,.13); color: var(--danger); }
.chip.draft { background: rgba(255,180,84,.13); color: var(--warn); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.plat-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.plat-dot { width: 7px; height: 7px; border-radius: 50%; }

/* ---------- post rows ---------- */
.post-row { display: flex; gap: 14px; align-items: flex-start; padding: 13px 4px; border-bottom: 1px solid var(--border); }
.post-row:last-child { border-bottom: 0; }
.post-thumb { width: 46px; height: 46px; border-radius: var(--radius-xs); flex-shrink: 0; display: grid; place-items: center; font-size: 17px; background: linear-gradient(135deg, var(--accent-soft), var(--accent-2-soft)); border: 1px solid var(--border); }
.post-body { flex: 1; min-width: 0; }
.post-caption { white-space: pre-wrap; word-break: break-word; }
.post-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.err-line { margin-top: 7px; background: rgba(255,84,112,.08); border: 1px solid rgba(255,84,112,.25); color: #ffb3c0; padding: 7px 10px; border-radius: var(--radius-xs); font-size: 12px; display: flex; align-items: center; gap: 10px; justify-content: space-between; }

/* ---------- composer ---------- */
.composer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
textarea.ta, input.inp {
  width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--foreground);
  border-radius: var(--radius-sm); padding: 11px 12px; font-family: inherit; font-size: 13.5px; resize: vertical;
}
textarea.ta:focus, input.inp:focus { outline: none; border-color: rgba(124,58,237,.55); box-shadow: var(--shadow-glow); }
label.lbl { display: block; font-size: 12px; font-weight: 650; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .4px; }
.ai-panel { background: linear-gradient(160deg, rgba(124,58,237,.14), rgba(24,224,200,.07)); border: 1px solid rgba(124,58,237,.3); border-radius: var(--radius-md); padding: 16px; }
.ai-badge { display: inline-flex; gap: 6px; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .8px; color: var(--accent-2); }
.variant { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px; margin-top: 10px; font-size: 12.5px; cursor: pointer; transition: .15s; position: relative; }
.variant:hover { border-color: rgba(124,58,237,.5); transform: translateY(-1px); }
.variant .vscore { position: absolute; top: 9px; right: 9px; font-size: 10.5px; font-weight: 800; color: var(--accent-2); background: var(--accent-2-soft); padding: 1px 7px; border-radius: var(--radius-pill); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 5px 11px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.seg button.on { background: var(--accent-soft); border-color: rgba(124,58,237,.5); color: var(--foreground); }
.preview-phone { background: #0d1020; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; margin-top: 10px; }
.preview-head { display: flex; gap: 9px; align-items: center; margin-bottom: 9px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; }
.preview-caption { font-size: 12.5px; color: #d6dbf0; white-space: pre-wrap; word-break: break-word; max-height: 150px; overflow: hidden; }
.charcount { font-family: var(--font-mono); font-size: 11px; }
.over { color: var(--danger); font-weight: 700; }

/* ---------- calendar ---------- */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-head div { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xs); min-height: 92px; padding: 6px; position: relative; transition: border-color .15s; }
.cal-cell.today { border-color: rgba(24,224,200,.5); box-shadow: inset 0 0 0 1px rgba(24,224,200,.25); }
.cal-cell.dragover { border-color: var(--accent); background: var(--accent-soft); }
.cal-num { font-size: 11px; color: var(--muted); font-weight: 600; }
.cal-post { margin-top: 4px; background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 6px; padding: 4px 7px; font-size: 11px; cursor: grab; overflow: hidden; }
.cal-post .t { font-weight: 600; font-size: 10.5px; color: var(--muted); }
.cal-post .cap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-post.failed { border-left-color: var(--danger); }
.cal-post.posted { border-left-color: var(--success); }
.best-band { position: absolute; bottom: 5px; left: 6px; right: 6px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, rgba(24,224,200,.65), rgba(124,58,237,.65)); opacity: .75; }

/* ---------- analytics ---------- */
.bars { display: flex; align-items: flex-end; gap: 7px; height: 120px; margin-top: 12px; }
.bar { flex: 1; background: var(--grad); border-radius: 6px 6px 2px 2px; min-height: 4px; opacity: .9; position: relative; }
.bar span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: 0; }
.spark { font-family: var(--font-mono); color: var(--accent-2); font-size: 12px; }

/* ---------- connections ---------- */
.acc-card { display: flex; gap: 13px; align-items: flex-start; }
.acc-avatar { width: 44px; height: 44px; border-radius: var(--radius-sm); display: grid; place-items: center; font-weight: 800; color: #10131f; font-size: 14px; flex-shrink: 0; }
.health { font-size: 11.5px; font-weight: 650; display: inline-flex; gap: 5px; align-items: center; margin-top: 3px; }

/* ---------- pricing ---------- */
.price-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.price-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; position: relative; }
.price-card.hot { border-color: rgba(24,224,200,.45); box-shadow: var(--shadow-accent); }
.price-card .plan { font-weight: 700; font-size: 15px; }
.price-card .price { font-size: 34px; font-weight: 800; letter-spacing: -1px; margin: 8px 0 2px; }
.price-card .price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.price-card ul { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.price-card li::before { content: '✓ '; color: var(--accent-2); font-weight: 800; }
.hot-tag { position: absolute; top: -11px; left: 22px; background: var(--accent-2); color: #06251f; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; padding: 3px 10px; border-radius: var(--radius-pill); }
.vs-note { margin-top: 16px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-md); padding: 14px 16px; color: var(--muted); font-size: 12.5px; }
.vs-note b { color: var(--foreground); }
code.kbd { font-family: var(--font-mono); font-size: 11.5px; background: var(--surface); border: 1px solid var(--border); padding: 2px 6px; border-radius: 6px; color: var(--accent-2); }

/* ---------- activity / toast ---------- */
.feed-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.feed-item:last-child { border-bottom: 0; }
.feed-item .ts { font-family: var(--font-mono); font-size: 10.5px; flex-shrink: 0; padding-top: 2px; }
.toast-wrap { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 99; }
.toast { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent-2); box-shadow: var(--shadow-md); border-radius: var(--radius-sm); padding: 11px 15px; font-size: 13px; animation: slidein .25s ease; max-width: 340px; }
.toast.err { border-left-color: var(--danger); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 13.5px; }
.empty .big { font-size: 30px; margin-bottom: 10px; }
.mt { margin-top: 14px; } .row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; } .right { margin-left: auto; }
a.lnk { color: var(--accent-2); text-decoration: none; }

@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr; }
  .composer-grid { grid-template-columns: 1fr; } .price-cards { grid-template-columns: 1fr; }
  .sidebar { width: 64px; } .sidebar .logo-word, .sidebar .nav-label, .trust-card { display: none; }
}
