:root {
  --bg: #0b0f14;
  --panel: #111821;
  --panel-2: #16202b;
  --line: #223041;
  --text: #e6edf3;
  --muted: #8b9bb0;
  --brand: #14b8a6;
  --brand-ink: #04211e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --ok: #22c55e;
  --radius: 14px;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f7fa; --panel: #ffffff; --panel-2: #eef2f6; --line: #dde3ea;
  --text: #0f1720; --muted: #5b6b7e; --brand: #0d9488; --brand-ink: #ffffff;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select {
  font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
textarea { min-height: 160px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: var(--panel-2); padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13px;
}
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger { color: var(--danger); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.chip.brand { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.chip.ok { color: var(--ok); }
.chip.warn { color: var(--warn); }

/* Avatar */
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; color: #fff; position: relative; font-size: 15px; }
.av.sm { width: 30px; height: 30px; font-size: 12px; }
.av.lg { width: 64px; height: 64px; font-size: 24px; }
.av .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--panel); background: var(--muted); }
.av .dot.online { background: var(--ok); }
.av .dot.working { background: var(--warn); }

/* ===== Landing ===== */
.land { max-width: 1120px; margin: 0 auto; padding: 0 16px 64px; }
.land-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), #0ea5e9); display: grid; place-items: center; color: #fff; font-size: 15px; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 48px 0 32px; }
.hero h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.08; margin: 12px 0 16px; letter-spacing: -0.02em; }
.hero p.lead { font-size: 17px; color: var(--muted); max-width: 520px; }
.hero .bullets { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 18px; color: var(--muted); font-size: 13px; }
.mock { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 14px; box-shadow: 0 30px 80px -30px rgba(20,184,166,.35); }
.mock .msg { margin: 10px 0; }
.mock .handoff { font-size: 12px; color: var(--muted); text-align: center; margin: 8px 0; }
.feat { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 40px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { margin: 6px 0 6px; font-size: 16px; }
.section-title { font-size: 28px; margin: 56px 0 8px; letter-spacing: -0.01em; }
.compare { width: 100%; border-collapse: collapse; margin-top: 16px; }
.compare th, .compare td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.compare td:last-child { color: var(--brand); }
.divs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
.cta { text-align: center; padding: 48px 16px; margin-top: 56px; border-radius: 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 22%, var(--panel)), var(--panel)); border: 1px solid var(--line); }

/* ===== Console ===== */
.app { display: grid; grid-template-columns: 220px 1fr; height: 100vh; }
.side { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; padding: 14px 10px; gap: 4px; }
.side .proj { padding: 8px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.nav-a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.nav-a:hover { background: var(--panel-2); color: var(--text); }
.nav-a.on { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.nav-a svg { width: 18px; height: 18px; flex: none; }
.side .foot { margin-top: auto; padding: 10px; font-size: 12px; color: var(--muted); }
.main { min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.page { overflow-y: auto; padding: 24px; flex: 1; }
.page-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { margin: 0; font-size: 24px; }

/* Chat layout */
.chat { display: grid; grid-template-columns: 320px 1fr; height: 100%; min-height: 0; }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; padding: 12px; }
.chat-item { display: flex; gap: 10px; padding: 10px; border-radius: 12px; align-items: center; }
.chat-item:hover { background: var(--panel-2); }
.chat-item.on { background: var(--panel-2); outline: 1px solid var(--line); }
.chat-item .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .prev { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: var(--panel-2); border: 1px solid var(--line); flex: none; }
.thread { display: flex; flex-direction: column; min-height: 0; }
.thread-h { padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.m { display: flex; gap: 10px; max-width: 760px; }
.m.me { align-self: flex-end; flex-direction: row-reverse; }
.m .bub { background: var(--panel); border: 1px solid var(--line); padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.m.me .bub { background: color-mix(in srgb, var(--brand) 18%, var(--panel)); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.m .who { font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.m .who span { color: var(--muted); font-weight: 500; margin-left: 6px; }
.m .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.sys { align-self: center; font-size: 12px; color: var(--muted); background: var(--panel-2); border: 1px dashed var(--line); padding: 4px 12px; border-radius: 999px; }
.typing { font-size: 12px; color: var(--muted); padding: 0 18px 6px; min-height: 18px; }
.composer { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; gap: 10px; }
.composer textarea { min-height: 44px; max-height: 160px; height: 44px; }
.hint { font-size: 11px; color: var(--muted); padding: 0 18px 10px; }
.mention-pop { position: absolute; bottom: 64px; left: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 240px; z-index: 5; }
.mention-pop button { display: flex; width: 100%; gap: 8px; align-items: center; background: none; border: 0; padding: 6px 8px; border-radius: 8px; text-align: left; }
.mention-pop button:hover, .mention-pop button.sel { background: var(--panel-2); }

/* Agents */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.agent-card { display: flex; flex-direction: column; gap: 10px; }
.agent-card .top { display: flex; gap: 12px; align-items: center; }
.agent-card .meta { font-size: 12px; color: var(--muted); }
.agent-card p { margin: 0; color: var(--muted); font-size: 13px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.filters button { border: 1px solid var(--line); background: var(--panel); padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); }
.filters button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* Agent detail */
.detail { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
.tabs { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; align-self: start; }
.tabs a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.tabs a.on { background: var(--panel-2); color: var(--text); }
.tabs a.danger { color: var(--danger); }
.form { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.list-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.radio { display: flex; flex-direction: column; gap: 8px; }
.radio label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-weight: 500; cursor: pointer; }
.radio input { width: auto; }
.switch { width: 40px; height: 22px; border-radius: 999px; background: var(--line); position: relative; border: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--brand); }
.switch.on::after { left: 21px; }

/* Team map */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.lane { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-height: 160px; }
.lane.drop { outline: 2px dashed var(--brand); }
.lane-h { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.mini { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; background: var(--panel-2); margin-bottom: 6px; cursor: grab; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 50; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; width: min(520px, 100%); max-height: 90vh; overflow-y: auto; }

/* Mobile */
.bottom-nav { display: none; }
.back { display: none; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 24px; }
  .feat { grid-template-columns: 1fr 1fr; }
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .side { display: none; }
  .bottom-nav { display: flex; justify-content: space-around; border-top: 1px solid var(--line); background: var(--panel); padding: 6px 0; }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--muted); padding: 4px 8px; gap: 2px; }
  .bottom-nav a.on { color: var(--brand); }
  .bottom-nav svg { width: 20px; height: 20px; }
  .page { padding: 16px; }
  .chat { grid-template-columns: 1fr; }
  .chat.has-thread .chat-list { display: none; }
  .chat:not(.has-thread) .thread { display: none; }
  .back { display: inline-flex; }
  .detail { grid-template-columns: 1fr; }
  .tabs { flex-direction: row; overflow-x: auto; position: static; }
  .tabs a { white-space: nowrap; }
  .compare { font-size: 12px; }
}
@media (max-width: 520px) { .feat { grid-template-columns: 1fr; } }

/* Mock jendela konsol di landing */
.mock-win { display: grid; grid-template-columns: 190px 1fr; gap: 10px; padding: 10px; }
.mock-side { border-right: 1px solid var(--line); padding-right: 8px; min-width: 0; }
.mock-lbl { font-weight: 700; margin: 8px 6px 4px; }
.team-av.sm { width: 30px; height: 30px; font-size: 11px; border-radius: 9px; }
@media (max-width: 860px) { .mock-win { grid-template-columns: 1fr; } .mock-side { display: none; } }
.bub code { background: var(--panel-2); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.tbl { overflow-x: auto; margin: 6px 0; }
.tbl table { border-collapse: collapse; font-size: 13px; white-space: normal; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.tbl th { background: var(--panel-2); }

/* Mind map */
.mindmap { padding: 4px 0; }
.mm-root { display: inline-block; background: var(--brand); color: var(--brand-ink); font-weight: 800; padding: 6px 12px; border-radius: 10px; margin-bottom: 8px; }
.mindmap ul { list-style: none; margin: 0; padding-left: 18px; border-left: 2px solid var(--line); }
.mindmap li { position: relative; padding: 3px 0 3px 10px; }
.mindmap li::before { content: ""; position: absolute; left: -2px; top: 13px; width: 10px; border-top: 2px solid var(--line); }
.mindmap li > span { display: inline-block; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; }
.mindmap > ul > li > span { border-color: color-mix(in srgb, var(--brand) 50%, transparent); font-weight: 700; }

/* Kartu persetujuan media */
.approval { border: 1px dashed color-mix(in srgb, var(--brand) 55%, transparent); border-radius: 12px; padding: 10px 12px; background: color-mix(in srgb, var(--brand) 6%, var(--panel)); }

/* Galeri media di chat */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.media-grid img, .media-grid video { width: 100%; border-radius: 10px; display: block; background: var(--panel-2); }
.lnk { color: var(--brand); text-decoration: underline; }

/* Header chat di layar sempit */
.thread-h { flex-wrap: nowrap; overflow-x: auto; }
.thread-h .grow { min-width: 120px; }
.thread-h .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-h .grow .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-h .btn { white-space: nowrap; flex: none; }
@media (max-width: 860px) { .thread-h { gap: 6px; padding: 10px 12px; } .thread-h .btn { padding: 6px 10px; font-size: 12px; } }
.att-list { padding: 0 18px; display: flex; gap: 6px; flex-wrap: wrap; }
.att-x { background: none; border: 0; color: var(--muted); padding: 0 2px; }
.att-img { max-width: 220px; border-radius: 10px; display: block; margin-bottom: 4px; }

/* Halaman masuk / daftar */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 50%), var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; background: var(--panel-2); padding: 4px; border-radius: 999px; }
.auth-tabs a { flex: 1; text-align: center; padding: 8px; border-radius: 999px; font-weight: 700; color: var(--muted); }
.auth-tabs a.on { background: var(--brand); color: var(--brand-ink); }
.userbox { margin-top: auto; padding: 10px; border-top: 1px solid var(--line); }
.userbox + .foot { margin-top: 0; }
.plan h3 { margin: 6px 0; font-size: 22px; }
.plan .btn { margin-top: 6px; }
.google-btn { width: 100%; justify-content: center; background: #fff; color: #1f1f1f; border-color: #dadce0; gap: 10px; padding: 10px 14px; }
.google-btn:hover { border-color: #4285f4; }
.auth-or { display: flex; align-items: center; gap: 8px; margin: 14px 0; color: var(--muted); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
