/* LaunchPad Autopilot — light premium UI (soft shadows, hairline borders, no gradients). */
:root {
  --lp-bg:        #f7f8fb;   /* cool neutral canvas */
  --lp-surface:   #ffffff;   /* cards, panels */
  --lp-surface-2: #f2f3f8;   /* raised / hover */
  --lp-line:      #e8eaf1;   /* hairlines, borders */
  --lp-text:      #14161f;   /* near-black ink */
  --lp-text-dim:  #6a7184;   /* secondary text */

  --lp-accent:    #5b5bd6;   /* indigo-violet — modern AI accent */
  --lp-accent-2:  #4b3fc4;   /* deeper ink for highlights */
  --lp-accent-soft:#eef0fe;  /* accent tint */
  --lp-good:      #1f9d57;
  --lp-bad:       #e5484d;

  --lp-shadow:    0 1px 2px rgba(20,22,40,.05), 0 8px 24px rgba(20,22,40,.07);
  --lp-shadow-sm: 0 1px 2px rgba(20,22,40,.05);
  --lp-border:    1px solid var(--lp-line);
  --lp-radius:    13px;

  --lp-font-head: "Sora", system-ui, sans-serif;
  --lp-font-body: "Inter", system-ui, sans-serif;
  --lp-font-mono: "JetBrains Mono", ui-monospace, monospace;

  --rail-w: 220px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--lp-bg); color: var(--lp-text);
  font-family: var(--lp-font-body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .head { font-family: var(--lp-font-head); letter-spacing: -0.01em; }
.mono { font-family: var(--lp-font-mono); }
a { color: var(--lp-accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

input, select, textarea {
  font-family: var(--lp-font-body); font-size: 14px; color: var(--lp-text);
  background: var(--lp-surface); border: var(--lp-border); border-radius: 9px;
  padding: 10px 12px; width: 100%; transition: border-color .12s, box-shadow .12s;
}
textarea { font-family: var(--lp-font-mono); font-size: 13px; resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lp-accent); box-shadow: 0 0 0 3px var(--lp-accent-soft); }
label { font-size: 12px; color: var(--lp-text-dim); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
select option { background: var(--lp-surface); }

/* ---------- Buttons ---------- */
.btn {
  background: var(--lp-surface); color: var(--lp-text);
  border: var(--lp-border); border-radius: 9px; padding: 9px 15px;
  font-weight: 600; box-shadow: var(--lp-shadow-sm); transition: background .12s, border-color .12s, transform .04s;
}
.btn:hover { background: var(--lp-surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--lp-accent); color: #fff; border-color: var(--lp-accent); box-shadow: 0 1px 2px rgba(91,91,214,.28); }
.btn.primary:hover { background: #4f4fce; }
.btn.gold { background: var(--lp-accent-soft); color: var(--lp-accent-2); border-color: #dcdefb; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn.ghost:hover { background: var(--lp-surface-2); }
.btn.danger { background: var(--lp-surface); color: var(--lp-bad); }
.btn.danger:hover { background: #fdecec; }
.btn.sm { padding: 6px 11px; font-size: 13px; }

/* ---------- Login ---------- */
.login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card { background: var(--lp-surface); border: var(--lp-border); border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow); padding: 34px; width: 100%; max-width: 380px; }
.login-card h1 { margin: 0 0 6px; font-size: 23px; }
.login-card p { margin: 0 0 20px; color: var(--lp-text-dim); }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail-w) 1fr; grid-template-rows: 60px 1fr; min-height: 100vh; }
.topbar { grid-column: 1 / 3; display: flex; align-items: center; gap: 14px;
  padding: 0 22px; background: var(--lp-surface); border-bottom: var(--lp-border); }
.topbar .brand { font-family: var(--lp-font-head); font-weight: 800; letter-spacing: -0.01em; font-size: 15px; }
.topbar .brand .rocket { color: var(--lp-accent); }
.topbar .grow { flex: 1; }
.topbar .search { max-width: 300px; background: var(--lp-bg); cursor: pointer; color: var(--lp-text-dim); }
.rail { background: var(--lp-surface); border-right: var(--lp-border); padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; }
.rail a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: var(--lp-text-dim); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .12s, color .12s; }
.rail a:hover { background: var(--lp-surface-2); color: var(--lp-text); }
.rail a.active { background: var(--lp-accent-soft); color: var(--lp-accent); }
.rail .ico { font-size: 16px; width: 20px; text-align: center; }
.rail .spacer { flex: 1; }
.content { padding: 26px 30px; overflow-y: auto; }
.page-head { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; }
.page-head h2 { margin: 0; font-size: 22px; font-weight: 700; }
.page-head .grow { flex: 1; }
.muted { color: var(--lp-text-dim); }
.muted-sm { color: var(--lp-text-dim); font-size: 13px; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--lp-surface); border: var(--lp-border); border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow-sm); padding: 16px 18px; }
.stat .v { font-family: var(--lp-font-mono); font-size: 25px; font-weight: 700; }
.stat .l { color: var(--lp-text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-top: 5px; font-weight: 600; }
.stat .v.accent { color: var(--lp-accent); }
.stat .v.good { color: var(--lp-good); }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); }
.card { background: var(--lp-surface); border: var(--lp-border); border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow-sm); overflow: hidden; cursor: pointer; transition: box-shadow .14s, transform .08s; }
.card:hover { box-shadow: var(--lp-shadow); transform: translateY(-2px); }
.card .thumb { width: 100%; height: 132px; object-fit: cover; display: block; border-bottom: var(--lp-border); background: var(--lp-surface-2); }
.card .body { padding: 15px; }
.card .title { font-family: var(--lp-font-head); font-weight: 700; font-size: 15px; margin: 0 0 8px; }
.card .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Pills / chips ---------- */
.pill { font-family: var(--lp-font-mono); font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 3px 9px; border-radius: 30px; border: 1px solid transparent; }
.pill.draft { background: var(--lp-surface-2); color: var(--lp-text-dim); border-color: var(--lp-line); }
.pill.scheduled { background: #fff4e0; color: #9a6700; }
.pill.live { background: var(--lp-accent-soft); color: var(--lp-accent); }
.pill.done { background: #e7f6ed; color: var(--lp-good); }
.pill.complete { background: #e7f6ed; color: var(--lp-good); border-color: #bfe6cf; }
.chip { font-family: var(--lp-font-mono); font-size: 11px; padding: 3px 9px; border-radius: 7px;
  background: var(--lp-surface-2); color: var(--lp-text-dim); border: 1px solid var(--lp-line); }
.chip.accent { color: var(--lp-accent); background: var(--lp-accent-soft); border-color: #f3d9bf; }
.badge-ok { color: var(--lp-good); font-weight: 600; }

/* ---------- Sparkline ---------- */
.spark { display: flex; align-items: flex-end; gap: 2px; height: 26px; margin-top: 10px; }
.spark i { flex: 1; background: var(--lp-accent); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .8; }

/* ---------- Modal / slide-over ---------- */
.overlay { position: fixed; inset: 0; background: rgba(22,27,34,.38); display: grid; z-index: 40; backdrop-filter: blur(2px); }
.overlay.center { place-items: center; padding: 18px; }
.overlay.right { grid-template-columns: 1fr minmax(360px, 560px); }
.overlay.right .panel { grid-column: 2; }
.panel { background: var(--lp-surface); border-left: var(--lp-border); height: 100vh; overflow-y: auto; box-shadow: -12px 0 40px rgba(16,24,40,.12); }
.modal { background: var(--lp-surface); border: var(--lp-border); border-radius: var(--lp-radius);
  box-shadow: 0 12px 48px rgba(16,24,40,.18); width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; }
.modal-head, .panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px;
  border-bottom: var(--lp-border); position: sticky; top: 0; background: var(--lp-surface); z-index: 2; }
.modal-head h2, .panel-head h2 { margin: 0; font-size: 18px; flex: 1; font-weight: 700; }
.modal-body, .panel-body { padding: 20px; }
.x { background: none; border: none; font-size: 24px; line-height: 1; color: var(--lp-text-dim); cursor: pointer; }
.x:hover { color: var(--lp-text); }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.section { border-top: var(--lp-border); margin-top: 22px; padding-top: 18px; }
.section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--lp-text-dim); margin: 0 0 12px; font-weight: 700; }

/* ---------- Pipeline tracker ---------- */
.pipe { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.pipe .step { font-family: var(--lp-font-mono); font-size: 12px; padding: 7px 11px; border-radius: 8px;
  border: var(--lp-border); background: var(--lp-surface); color: var(--lp-text-dim); cursor: pointer; }
.pipe .step.active { background: var(--lp-accent); color: #fff; border-color: var(--lp-accent); }
.pipe .step.done { background: #e7f6ed; color: var(--lp-good); border-color: #cdebd8; }

/* ---------- Tracking link box ---------- */
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--lp-surface-2); border: var(--lp-border);
  border-radius: 9px; padding: 10px 12px; font-family: var(--lp-font-mono); font-size: 13px; }
.linkbox .u { flex: 1; overflow-x: auto; white-space: nowrap; }

/* ---------- Email cards ---------- */
.email { border: var(--lp-border); border-radius: 12px; padding: 16px; margin-bottom: 14px; background: var(--lp-surface); box-shadow: var(--lp-shadow-sm); }
.email .meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 8px 0; }
.email textarea.body { min-height: 240px; line-height: 1.6; overflow: hidden; }
textarea { overflow: hidden; }

/* ---------- Collapsible email card ---------- */
.ecard { padding: 0; overflow: hidden; }
.ecard > .ehead { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; padding: 13px 16px; user-select: none; }
.ecard > .ehead::-webkit-details-marker { display: none; }
.ecard .etitle { font-weight: 700; font-size: 15px; }
.ecard .echev { color: var(--lp-text-dim); transition: transform .2s; font-size: 18px; }
.ecard[open] > .ehead { border-bottom: var(--lp-border); }
.ecard[open] .echev { transform: rotate(180deg); }
.ecard .ebody { padding: 14px 16px 16px; }
.ecard .erow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 720px) { .ecard .erow { grid-template-columns: 1fr; } }
.ecard .ebox label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--lp-text-dim); margin-bottom: 4px; }
.ecard .ebox-in { display: flex; gap: 6px; align-items: center; background: var(--lp-bg);
  border: var(--lp-border); border-radius: 10px; padding: 5px 8px; }
.ecard .ebox-in input { border: 0; background: transparent; flex: 1; min-width: 0; font-size: 14px; padding: 3px 0; color: var(--lp-text); }
.ecard .ebox-in input:focus { outline: none; }
.ecard .ebox-in .btn { flex: none; padding: 4px 8px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--lp-text);
  color: #fff; padding: 12px 20px; border-radius: 10px; box-shadow: var(--lp-shadow); z-index: 60; font-weight: 600; max-width: 80vw; }

/* ---------- Feed / lists ---------- */
.feed { display: grid; gap: 8px; }
.feed .item { display: flex; align-items: center; gap: 10px; background: var(--lp-surface); border: var(--lp-border);
  border-radius: 10px; padding: 11px 14px; box-shadow: var(--lp-shadow-sm); }
.feed .item .t { flex: 1; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } .shell { grid-template-columns: 66px 1fr; } .rail a span.lbl { display: none; } }

/* ---------- Home: two-column (dashboard | live sidebar) + fancy motion ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 366px; gap: 26px; align-items: start; }
.home-side { position: sticky; top: 18px; }
.home-side .head { margin-top: 0; }
@media (max-width: 1040px) { .home-grid { grid-template-columns: 1fr; } .home-side { position: static; margin-top: 22px; } }

/* Pulsing LIVE indicator */
.live-head { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lp-good); flex: none;
  box-shadow: 0 0 0 0 rgba(31,157,87,.55); animation: livePulse 1.8s ease-out infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(31,157,87,.55); } 70% { box-shadow: 0 0 0 10px rgba(31,157,87,0); } 100% { box-shadow: 0 0 0 0 rgba(31,157,87,0); } }

/* Feed items: slide-in, colored accents, hover, new-item flash */
.feed .item { animation: slideIn .5s cubic-bezier(.16,.84,.34,1) both; transition: transform .14s, box-shadow .14s; }
.feed .item:hover { transform: translateX(3px); box-shadow: var(--lp-shadow); }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.feed .item.click { border-left: 3px solid var(--lp-accent); }
.feed .item.sale  { border-left: 3px solid var(--lp-good); background: #eafaf1; }
.feed .item.flash { animation: slideIn .5s cubic-bezier(.16,.84,.34,1) both, flashGlow 1.6s ease-out; }
@keyframes flashGlow { 0% { box-shadow: 0 0 0 2px var(--lp-accent-soft), 0 0 20px rgba(91,91,214,.4); } 100% { box-shadow: var(--lp-shadow-sm); } }

/* Stat cards: staggered rise + hover lift */
.stat { animation: riseIn .5s cubic-bezier(.16,.84,.34,1) both; transition: transform .12s, box-shadow .14s; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--lp-shadow); }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.stats .stat:nth-child(2) { animation-delay: .06s; }
.stats .stat:nth-child(3) { animation-delay: .12s; }
.stats .stat:nth-child(4) { animation-delay: .18s; }

/* Chart bars grow up from the baseline */
.spark i { transform-origin: bottom; animation: growUp .55s cubic-bezier(.16,.84,.34,1) both; }
@keyframes growUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Monthly-goal bar sweeps to fill */
.goalfill { transform-origin: left; animation: fillGrow .9s cubic-bezier(.16,.84,.34,1) both; }
@keyframes fillGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Floating "Ask Hermes" chat widget ---------- */
.hw { position: fixed; right: 22px; bottom: 22px; z-index: 75; }
.hw-fab { width: 56px; height: 56px; border-radius: 50%; border: none; background: var(--lp-accent); color: #fff;
  font-size: 23px; box-shadow: 0 10px 26px rgba(91,91,214,.42); cursor: pointer;
  transition: transform .14s, box-shadow .14s; animation: hwFabIn .4s cubic-bezier(.16,.84,.34,1) both; }
.hw-fab:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 14px 32px rgba(91,91,214,.52); }
@keyframes hwFabIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.hw-panel { position: absolute; right: 0; bottom: 70px; width: 366px; max-width: 90vw; height: 526px; max-height: 74vh;
  background: var(--lp-surface); border: var(--lp-border); border-radius: 16px; box-shadow: var(--lp-shadow);
  display: flex; flex-direction: column; overflow: hidden; animation: hwPop .22s cubic-bezier(.16,.84,.34,1) both; }
.hw-panel[hidden] { display: none; } /* author display:flex would otherwise override the hidden attr */
@keyframes hwPop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.hw-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: var(--lp-border); }
.hw-head b { font-family: var(--lp-font-head); }
.hw-head select { font-size: 12px; padding: 2px 6px; }
.hw-head button { background: none; border: none; font-size: 15px; cursor: pointer; color: var(--lp-text-dim); padding: 2px 4px; border-radius: 6px; }
.hw-head button:hover { background: var(--lp-surface-2); }
.hw-avatar { width: 26px; height: 26px; border-radius: 8px; background: var(--lp-accent-soft); display: grid; place-items: center; font-size: 15px; }
.hw-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.hw-empty { color: var(--lp-text-dim); font-size: 13px; text-align: center; margin: auto; max-width: 260px; line-height: 1.5; }
.hw-msg { max-width: 84%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere; animation: slideIn .32s cubic-bezier(.16,.84,.34,1) both; }
.hw-msg.user { align-self: flex-end; background: var(--lp-accent); color: #fff; border-bottom-right-radius: 4px; }
.hw-msg.bot { align-self: flex-start; background: var(--lp-surface-2); color: var(--lp-text); border-bottom-left-radius: 4px; }
.hw-msg.pending { color: var(--lp-text-dim); font-style: italic; }
.hw-dots { animation: hwDots 1.2s steps(4, end) infinite; }
@keyframes hwDots { 0% { clip-path: inset(0 100% 0 0); } 100% { clip-path: inset(0 0 0 0); } }
.hw-form { display: flex; gap: 8px; padding: 10px 12px; border-top: var(--lp-border); align-items: flex-end; }
.hw-input { flex: 1; resize: none; max-height: 120px; min-height: 38px; border-radius: 10px; }
.hw-send { flex: none; padding: 8px 14px; }
@media (max-width: 560px) { .hw-panel { width: 92vw; } }

.empty { text-align: center; color: var(--lp-text-dim); padding: 46px; border: 1px dashed var(--lp-line); border-radius: var(--lp-radius); background: var(--lp-surface); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: s .7s linear infinite; vertical-align: -2px; }
@keyframes s { to { transform: rotate(360deg); } }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Command palette ---------- */
.cmdk { width: 100%; max-width: 560px; background: var(--lp-surface); border: var(--lp-border);
  border-radius: var(--lp-radius); box-shadow: 0 16px 50px rgba(16,24,40,.2); overflow: hidden; align-self: start; margin-top: 12vh; }
.cmdk input { border: none; border-bottom: var(--lp-border); border-radius: 0; font-size: 16px; padding: 16px; }
.cmdk input:focus { box-shadow: none; }
.cmdk .results { max-height: 50vh; overflow-y: auto; }
.cmdk .res { padding: 12px 16px; display: flex; gap: 10px; align-items: center; cursor: pointer; border-bottom: 1px solid var(--lp-line); }
.cmdk .res:hover, .cmdk .res.sel { background: var(--lp-surface-2); }
.cmdk .res .k { margin-left: auto; font-family: var(--lp-font-mono); font-size: 11px; color: var(--lp-text-dim); }

/* ---------- Tables ---------- */
table.rep { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--lp-surface); border: var(--lp-border); border-radius: var(--lp-radius); overflow: hidden; }
table.rep th, table.rep td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--lp-line); }
table.rep th { color: var(--lp-text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; background: var(--lp-surface-2); }
table.rep tr:last-child td { border-bottom: none; }
table.rep tr:hover td { background: var(--lp-surface-2); }
table.rep td.num, table.rep th.num { text-align: right; font-family: var(--lp-font-mono); }

/* ---------- Integrations ---------- */
.intg { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.intg .card .body { display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.on { background: var(--lp-good); } .dot.off { background: var(--lp-text-dim); opacity: .5; }
