:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f2f5f9;
  --border: #e3e8ef;
  --text: #111827;
  --muted: #667085;
  --soft: #8a94a6;
  --blue: #155eef;
  --blue-soft: #eaf1ff;
  --green: #11845b;
  --green-soft: #e9f8f1;
  --amber: #b76e00;
  --amber-soft: #fff4dd;
  --red: #b42318;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button, input { font: inherit; }

.jc-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.jc-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--border);
  background: #f5f7fa;
  overflow-y: auto;
}

.jc-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 850;
}
.jc-brand img { width: 42px; height: 42px; object-fit: contain; }

.jc-nav {
  display: grid;
  gap: 4px;
  margin-top: 28px;
}
.jc-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 14px;
  border-radius: 12px;
  border-left: 3px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-weight: 760;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.jc-nav a:hover {
  background: #eff2f7;
  color: var(--text);
}
.jc-nav a.active {
  background: #fff;
  color: var(--blue);
  border-left-color: var(--blue);
  font-weight: 820;
  box-shadow: 0 2px 8px rgba(21, 94, 239, 0.08);
}
.jc-nav i {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: .75rem;
  font-style: normal;
}
.jc-nav b { color: var(--soft); font-size: .72rem; }

.jc-ai-card, .jc-card, .jc-profile-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.05);
}
.jc-ai-card {
  background: var(--blue-soft);
  border-color: #c9d8ff;
  border-top: 3px solid var(--blue);
}
.jc-ai-card h3, .jc-card h3, .jc-profile-card h3 { margin: 10px 0 4px; }
.jc-ai-card p, .jc-card p, .jc-profile-card p { margin: 0 0 12px; color: var(--muted); line-height: 1.5; }
.jc-ai-card button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--blue);
  color: #fff;
  font-weight: 820;
}

.jc-main { padding: 24px; min-width: 0; }
.jc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.jc-kicker {
  margin: 0;
  color: var(--blue);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.jc-topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  letter-spacing: 0;
}
.jc-top-actions { display: flex; align-items: center; gap: 10px; }
.jc-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(360px, 32vw);
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.jc-search span { color: var(--soft); font-size: .8rem; font-weight: 760; }
.jc-search input { width: 100%; border: 0; outline: 0; background: transparent; }

.jc-btn, .jc-icon-btn {
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 42px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 820;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.jc-btn:hover, .jc-icon-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(16, 24, 40, .08); }
.jc-btn.primary { background: var(--text); color: #fff; border-color: var(--text); }
.jc-btn.ghost { background: #fff; }
.jc-icon-btn { width: 42px; padding: 0; }

.jc-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.jc-metrics article {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  border-top-width: 3px;
  position: relative;
  overflow: hidden;
}
/* Revenue → green */
.jc-metrics article:nth-child(1) { border-top-color: var(--green); background: linear-gradient(160deg, #f0fdf8 0%, #fff 60%); }
.jc-metrics article:nth-child(1) strong { color: var(--green); }
/* Conversion → blue */
.jc-metrics article:nth-child(2) { border-top-color: var(--blue); background: linear-gradient(160deg, #eef4ff 0%, #fff 60%); }
.jc-metrics article:nth-child(2) strong { color: var(--blue); }
/* Response time → amber */
.jc-metrics article:nth-child(3) { border-top-color: #d97706; background: linear-gradient(160deg, #fffbeb 0%, #fff 60%); }
.jc-metrics article:nth-child(3) strong { color: #b76e00; }
/* Trust score → indigo */
.jc-metrics article:nth-child(4) { border-top-color: #7c3aed; background: linear-gradient(160deg, #f5f3ff 0%, #fff 60%); }
.jc-metrics article:nth-child(4) strong { color: #6d28d9; }

.jc-metrics span { display: block; color: var(--muted); font-weight: 760; font-size: .83rem; text-transform: uppercase; letter-spacing: .04em; }
.jc-metrics strong { display: block; margin-top: 8px; font-size: 1.9rem; font-weight: 850; }
.jc-metrics em { font-style: normal; font-weight: 780; font-size: .82rem; }

.jc-workspace {
  display: grid;
  grid-template-columns: minmax(270px, .75fr) minmax(520px, 1.55fr) minmax(260px, .7fr);
  gap: 16px;
  align-items: start;
}
.jc-list-panel, .jc-job-panel, .jc-side-panel {
  min-width: 0;
}
.jc-list-panel, .jc-job-panel {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
/* Thread list: blue accent header */
.jc-list-panel { border-top: 3px solid var(--blue); }
/* Job panel: depends on status — green accent via .jc-panel-success class added by JS */
.jc-job-panel { border-top: 3px solid #e3e8ef; }
.jc-job-panel.status-active  { border-top-color: var(--green); }
.jc-job-panel.status-pending { border-top-color: #d97706; }
.jc-job-panel.status-open    { border-top-color: var(--blue); }

.jc-panel-head, .jc-job-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}
.jc-panel-head {
  background: #f9fbff;
}
.jc-panel-head h2, .jc-job-hero h2 { margin: 3px 0 0; }
.jc-job-hero p { margin: 6px 0 0; color: var(--muted); }
.jc-job-actions { display: flex; gap: 8px; }
.jc-filter-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.jc-filter-row button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 8px 10px;
  color: var(--muted);
  font-weight: 760;
}
.jc-filter-row .active { background: var(--blue-soft); color: var(--blue); border-color: #c9d8ff; }

.jc-thread {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 8px;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.jc-thread:hover { background: #f8fbff; }
.jc-thread.active {
  background: var(--blue-soft);
  border-left-color: var(--blue);
}
.jc-thread img { width: 42px; height: 42px; border-radius: 999px; object-fit: cover; }
.jc-thread-initials {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.jc-thread strong, .jc-thread p, .jc-thread span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jc-thread p { margin: 3px 0; color: var(--muted); }
.jc-thread span { color: var(--soft); font-size: .82rem; font-weight: 720; }
.jc-thread i { width: 8px; height: 8px; margin-top: 8px; border-radius: 999px; background: var(--blue); }

.jc-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 16px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.jc-tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  padding: 11px 12px;
  color: var(--muted);
  font-weight: 820;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: color .15s ease, background .15s ease;
}
.jc-tabs button:hover { background: var(--blue-soft); color: var(--blue); }
.jc-tabs .active { color: var(--blue); border-bottom-color: var(--blue); background: transparent; font-weight: 850; }
.jc-tab-panel { display: none; padding: 18px; min-height: 520px; }
.jc-tab-panel.active { display: grid; align-content: start; gap: 14px; }

.jc-system-event {
  justify-self: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
  font-size: .86rem;
}
.jc-message-row { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
.jc-message-row.mine { grid-template-columns: minmax(0, 1fr); justify-items: end; }
.jc-message-row img { width: 38px; height: 38px; border-radius: 999px; object-fit: cover; }
.jc-bubble {
  max-width: 78%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}
.mine .jc-bubble { background: #111827; color: #fff; border-color: #111827; }
.jc-bubble header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.jc-bubble header span { color: var(--soft); font-size: .8rem; }
.mine .jc-bubble header span { color: rgba(255,255,255,.65); }
.jc-bubble p { margin: 0; line-height: 1.55; }
.jc-attachment {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.12);
}
.jc-reactions { display: flex; gap: 8px; margin-top: 10px; }
.jc-reactions button, .jc-smart-replies button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 7px 10px;
  color: var(--muted);
  font-weight: 760;
}
.jc-smart-replies { display: flex; flex-wrap: wrap; gap: 8px; }
.jc-composer {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}
.jc-composer input, .jc-composer button {
  border: 0;
  outline: 0;
  background: transparent;
}
.jc-composer .jc-send {
  border-radius: 12px;
  padding: 0 14px;
  background: var(--blue);
  color: #fff;
  font-weight: 850;
}

.jc-milestone {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 16px;
  background: #fff;
}
.jc-milestone.active {
  border-color: #b9ceff;
  border-left-color: var(--blue);
  background: var(--blue-soft);
}
.jc-milestone p { margin: 6px 0 0; color: var(--muted); }
.jc-milestone span { color: var(--blue); font-weight: 850; white-space: nowrap; }
.jc-empty-state {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 32px 20px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: #fbfcfe;
}
.jc-empty-state svg { margin-bottom: 2px; }
.jc-empty-state strong { color: var(--text); font-size: 1rem; }
.jc-empty-state p { margin: 0; color: var(--muted); max-width: 280px; line-height: 1.55; }
.jc-payment-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}
.jc-payment-card span { display: block; margin: 8px 0 12px; color: var(--muted); }
.jc-payment-card div { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.jc-payment-card b { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.jc-timeline { display: grid; gap: 10px; margin: 0; padding-left: 20px; color: var(--muted); font-weight: 760; }

.jc-profile-card {
  text-align: center;
  margin-top: 0;
  border-top: 3px solid var(--green);
  background: linear-gradient(160deg, #f0fdf8 0%, #fff 50%);
}
.jc-profile-card > img { width: 76px; height: 76px; border-radius: 999px; object-fit: cover; }
.jc-trust-grid { display: grid; gap: 6px; margin-top: 12px; }
.jc-trust-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 820;
  font-size: .76rem;
  border: 1px solid #bbf7d0;
}
.jc-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 820;
  font-size: .78rem;
  border: 1px solid #bbf7d0;
}
.jc-pill.soft { background: var(--blue-soft); color: var(--blue); border-color: #c9d8ff; }
.jc-pill.success { background: var(--green-soft); color: var(--green); border-color: #bbf7d0; }
.jc-card label { display: block; color: var(--muted); margin-top: 9px; font-weight: 740; }

.jc-mobile-nav { display: none; }

@media (max-width: 1180px) {
  .jc-shell { grid-template-columns: 1fr; }
  .jc-sidebar { display: none; }
  .jc-workspace { grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); }
  .jc-side-panel { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

@media (max-width: 820px) {
  .jc-main { padding: 14px 14px 76px; }
  .jc-topbar { align-items: flex-start; flex-direction: column; }
  .jc-top-actions { width: 100%; }
  .jc-search { width: 100%; }
  .jc-top-actions .jc-btn { display: none; }
  .jc-metrics { grid-template-columns: repeat(2, 1fr); }
  .jc-workspace { grid-template-columns: 1fr; }
  .jc-list-panel { max-height: 360px; overflow: auto; }
  .jc-side-panel { grid-template-columns: 1fr; }
  .jc-bubble { max-width: 92%; }
  .jc-job-hero { flex-direction: column; }
  .jc-job-actions { width: 100%; }
  .jc-job-actions .jc-btn { flex: 1; }
  .jc-mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255,255,255,.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
  }
  .jc-mobile-nav a {
    min-height: 40px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--muted);
    font-weight: 820;
  }
  .jc-mobile-nav .active { background: var(--text); color: #fff; }
}

@media (max-width: 540px) {
  .jc-metrics { grid-template-columns: 1fr; }
  .jc-composer { grid-template-columns: 34px minmax(0, 1fr) 34px; }
  .jc-composer .jc-send { grid-column: 1 / -1; min-height: 40px; }
}
