/* ==========================================================================
   Vista Assessments — Outreach Portal
   Same brand system as the site (see website/assets/css/styles.css):
   paper #F8F9FF · navy #16324F/#0D203F · blue #3E7EFF · coral #FF6B6B · cream #FFDB99
   ========================================================================== */

:root {
  --navy: #16324F;
  --navy-deep: #0D203F;
  --blue: #3E7EFF;
  --blue-ink: #2f66d6;
  --coral: #FF6B6B;
  --cream: #FFDB99;
  --paper: #F8F9FF;
  --white: #FFFFFF;
  --ink-70: rgba(22,50,79,.72);
  --ink-55: rgba(22,50,79,.55);
  --ink-35: rgba(22,50,79,.35);
  --line: rgba(22,50,79,.08);
  --line-strong: rgba(22,50,79,.14);
  --green: #2e9e6b;
  --green-soft: rgba(46,158,107,.12);
  --coral-soft: rgba(255,107,107,.12);
  --blue-soft: rgba(62,126,255,.10);
  --cream-soft: rgba(255,219,153,.28);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-xl: 28px; --r-lg: 20px; --r-md: 14px; --r-sm: 10px; --r-pill: 999px;
  --shadow-sm: 0 2px 10px -4px rgba(13,32,63,.14);
  --shadow: 0 10px 30px -18px rgba(13,32,63,.28);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--navy); background: var(--paper);
  line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
img { display: block; max-width: 100%; }
a { color: var(--blue-ink); text-decoration: none; }
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---- Auth screen ------------------------------------------------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow); padding: clamp(28px, 5vw, 44px); width: min(430px, 100%);
  text-align: center;
}
.auth-card .emblem { width: 54px; margin: 0 auto 18px; }
.auth-card h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
.auth-card p { color: var(--ink-70); margin: 0 0 22px; font-size: .95rem; }
.auth-card form { display: grid; gap: 10px; }
.auth-card input {
  font: inherit; padding: .85rem 1.1rem; border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--navy); text-align: center;
}
.auth-card input:focus { outline: 2px solid var(--blue); border-color: transparent; }
.auth-note { font-size: .85rem; color: var(--ink-55); margin-top: 16px !important; }
.auth-note.ok { color: var(--green); font-weight: 600; }
.auth-note.err { color: var(--coral); font-weight: 600; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5ch;
  font-weight: 700; font-size: .95rem; padding: .8rem 1.5rem; border-radius: var(--r-pill);
  background: var(--blue); color: #fff; border: 2px solid transparent;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s, opacity .18s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -12px rgba(62,126,255,.6); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--navy); box-shadow: none; }
.btn.small { padding: .5rem 1.05rem; font-size: .85rem; }
.btn.approve { background: var(--green); }
.btn.approve:hover { box-shadow: 0 12px 22px -12px rgba(46,158,107,.55); }
.btn.exclude { background: transparent; color: var(--coral); border-color: rgba(255,107,107,.4); }
.btn.exclude:hover { border-color: var(--coral); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

/* ---- App shell --------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--white); border-right: 1px solid var(--line);
  padding: 26px 18px; display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .logo img { width: 138px; }
.sidebar nav { display: grid; gap: 4px; }
.nav-link {
  display: flex; align-items: center; justify-content: space-between; gap: .6ch;
  padding: .68rem .95rem; border-radius: var(--r-md); font-weight: 600; font-size: .93rem;
  color: var(--ink-70); background: transparent; border: none; text-align: left; width: 100%;
}
.nav-link:hover { background: var(--blue-soft); color: var(--navy); }
.nav-link.active { background: var(--navy); color: #fff; }
.nav-badge {
  background: var(--coral); color: #fff; font-size: .72rem; font-weight: 800;
  border-radius: var(--r-pill); padding: .1rem .55rem; min-width: 1.5em; text-align: center;
}
.nav-link.active .nav-badge { background: var(--cream); color: var(--navy); }
.sidebar .foot { margin-top: auto; display: grid; gap: 8px; font-size: .82rem; color: var(--ink-55); }
.sidebar .foot .who { font-weight: 600; color: var(--ink-70); overflow-wrap: anywhere; }
.signout { background: none; border: none; color: var(--ink-55); font-size: .82rem; text-align: left; padding: 0; text-decoration: underline; }
.signout:hover { color: var(--coral); }

.main { padding: clamp(22px, 3.5vw, 42px); max-width: 1060px; width: 100%; }
.view-head { margin: 0 0 22px; }
.view-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -0.025em; margin: 0 0 4px; }
.view-head p { color: var(--ink-70); margin: 0; max-width: 62ch; }

/* ---- Cards + tiles ----------------------------------------------------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); padding: 22px;
}
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.tile .num { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.tile .lbl { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-55); margin-top: 2px; }
.tile.accent { background: var(--navy); border-color: var(--navy); }
.tile.accent .num { color: var(--cream); }
.tile.accent .lbl { color: rgba(255,255,255,.65); }

.section-label { font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-ink); margin: 26px 0 12px; display: flex; align-items: center; gap: .7ch; }
.section-label::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--coral); }

/* ---- Tables / lists ---------------------------------------------------- */
.list { display: grid; gap: 10px; }
.row-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.row-card .grow { flex: 1 1 220px; min-width: 0; }
.row-card .name { font-weight: 700; }
.row-card .meta { font-size: .84rem; color: var(--ink-55); }
.score-chip {
  flex: none; width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue-ink); font-weight: 800; font-size: 1.05rem;
}
.status-tag {
  font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: .28rem .7rem; border-radius: var(--r-pill); background: var(--paper); color: var(--ink-55); border: 1px solid var(--line);
}
.status-tag.contacted { background: var(--blue-soft); color: var(--blue-ink); border-color: transparent; }
.status-tag.replied, .status-tag.meeting, .status-tag.won { background: var(--green-soft); color: var(--green); border-color: transparent; }
.status-tag.queued { background: var(--cream-soft); color: #8a6414; border-color: transparent; }
.status-tag.excluded, .status-tag.dnc { background: var(--coral-soft); color: var(--coral); border-color: transparent; }

/* ---- Approval queue ---------------------------------------------------- */
.batch-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.batch-head .title { font-weight: 800; font-size: 1.1rem; }
.progress { flex: 1 1 180px; height: 8px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; min-width: 140px; }
.progress span { display: block; height: 100%; width: 100%; background: var(--blue); border-radius: var(--r-pill); transform-origin: left; transition: transform .3s var(--ease); }

.approval-card { border-radius: var(--r-lg); border: 1.5px solid var(--line); background: var(--white); box-shadow: var(--shadow-sm); margin-bottom: 16px; overflow: hidden; transition: border-color .2s; }
.approval-card.approved { border-color: rgba(46,158,107,.45); }
.approval-card.excluded { border-color: rgba(255,107,107,.45); opacity: .75; }
.approval-top { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px 0; flex-wrap: wrap; }
.approval-top .grow { flex: 1; min-width: 240px; }
.approval-top h3 { margin: 0 0 2px; font-size: 1.12rem; font-weight: 800; letter-spacing: -0.015em; }
.approval-top .meta { font-size: .86rem; color: var(--ink-55); }
.decision-mark { font-size: .78rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: .3rem .8rem; border-radius: var(--r-pill); }
.decision-mark.ok { background: var(--green-soft); color: var(--green); }
.decision-mark.no { background: var(--coral-soft); color: var(--coral); }

.why { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 22px 0; }
.why-chip { font-size: .78rem; font-weight: 600; color: var(--navy); background: var(--cream-soft); border-radius: var(--r-pill); padding: .3rem .75rem; }
.why-chip b { font-weight: 800; color: var(--blue-ink); }

.email-preview { margin: 14px 22px 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); }
.email-preview summary { padding: .7rem 1rem; font-weight: 700; font-size: .88rem; color: var(--blue-ink); cursor: pointer; list-style: none; }
.email-preview summary::before { content: "▸ "; }
.email-preview[open] summary::before { content: "▾ "; }
.email-preview .subject { padding: 0 1rem .4rem; font-weight: 700; font-size: .92rem; }
.email-preview .body { padding: 0 1rem 1rem; white-space: pre-wrap; font-size: .9rem; color: var(--ink-70); }

.approval-actions { display: flex; align-items: center; gap: 10px; padding: 16px 22px 20px; flex-wrap: wrap; }
.forever { display: inline-flex; align-items: center; gap: .5ch; font-size: .84rem; color: var(--ink-55); margin-left: auto; }
.forever input { accent-color: var(--coral); }

.submit-bar {
  position: sticky; bottom: 16px; margin-top: 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--navy); color: #fff; border-radius: var(--r-lg); padding: 14px 20px; box-shadow: var(--shadow);
}
.submit-bar .txt { flex: 1 1 200px; font-size: .92rem; }
.submit-bar .btn { background: var(--cream); color: var(--navy); }

/* ---- Activity ---------------------------------------------------------- */
.timeline { display: grid; gap: 10px; }
.t-item { display: flex; gap: 14px; align-items: flex-start; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 18px; }
.t-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; background: var(--blue); }
.t-item.reply .t-dot { background: var(--green); }
.t-item.reply-negative .t-dot, .t-item.bounce .t-dot { background: var(--coral); }
.t-item .when { font-size: .8rem; color: var(--ink-55); }

.empty { text-align: center; color: var(--ink-55); padding: 42px 20px; background: var(--white); border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty b { color: var(--navy); }

/* ---- Reports ----------------------------------------------------------- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

/* ---- Mobile ------------------------------------------------------------ */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: column; padding: 18px; gap: 14px; }
  .sidebar nav { display: flex; overflow-x: auto; gap: 6px; }
  .nav-link { white-space: nowrap; }
  .sidebar .foot { margin: 0; flex-direction: row; align-items: center; gap: 14px; }
}
