/* style.css — tema Yapp: gelap + emas #e0a83e, Plus Jakarta Sans.
   Semua warna/ukuran lewat token :root, tanpa hex tersebar. */
:root {
  --bg: #14110e;
  --surface: #1d1a16;
  --surface-2: #241f19;
  --surface-3: #2e2822;
  --border: #3a332b;
  --border-2: #4a4238;
  --text: #f2ede3;
  --muted: #b7ad9c;
  --faint: #8a8378;
  --accent: #e0a83e;
  --on-accent: #171310;
  --green: #3fb950;
  --red: #ff9d9d;
  --danger: #d64545;
  --radius: 12px;
  --radius-lg: 16px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--accent); }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 8px; }
h3 { font-size: 15px; margin: 0 0 6px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.container { max-width: 1080px; margin: 0 auto; padding: 14px 16px 32px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 13px;
  margin-bottom: 12px;
}
input, textarea, select {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 14px;
  font-family: var(--font);
  width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 3px; }
.field { margin-bottom: 10px; }
button {
  font-family: var(--font);
  cursor: pointer;
  border-radius: 10px;
  border: 0;
  padding: 8px 13px;
  font-size: 14px;
  font-weight: 700;
}
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ghost { background: transparent; border: 1px solid var(--border-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 9px; font-size: 13px; }
button:focus-visible, a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  color: var(--muted);
}
.badge.baru { color: #ffd479; border-color: #6b5a2e; }
.badge.menunggu { color: #9ecbff; border-color: #2e4a6b; }
.badge.dijawab { color: #7ee2a0; border-color: #2e6b41; }
.badge.selesai { color: var(--faint); }
.badge.bot { color: #17130c; background: var(--accent); border-color: var(--accent); }

/* Menu titik tiga (⋮) untuk aksi percakapan. */
.menu-wrap { position: relative; flex-shrink: 0; }
.menu-btn { background: transparent; border: 1px solid var(--border-2); color: var(--text); padding: 3px 10px; font-size: 18px; line-height: 1.2; letter-spacing: 1px; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface-3); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 6px; z-index: 20; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.menu-item { display: block; width: 100%; text-align: left; background: transparent; color: var(--text); font-weight: 600; padding: 8px 11px; border-radius: 8px; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--red); }
.menu-item.danger:hover { background: rgba(214,69,69,.15); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); vertical-align: middle; }
.dot.off { background: var(--faint); }
.err { color: var(--red); font-size: 13px; margin: 8px 0; }
.ok { color: #7ee2a0; font-size: 13px; margin: 8px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.list-item {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  cursor: pointer;
  background: var(--surface);
}
.list-item:hover { border-color: var(--border-2); }
.list-item.active { border-color: var(--accent); }
.list-item.untaken { border-left: 3px solid var(--accent); }
.badge.untaken { color: #ffd479; border-color: var(--accent); }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { background: transparent; border: 1px solid var(--border-2); color: var(--text); }
.tabs button.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }

/* Navigasi vertikal panel agen: sidebar kiri, ikon + label. */
.app-shell { display: flex; gap: 12px; align-items: flex-start; }
.side-tabs { flex-direction: column; flex-wrap: nowrap; width: 52px; flex-shrink: 0; margin-bottom: 0; position: sticky; top: 12px; }
.side-tabs button { display: inline-flex; align-items: center; justify-content: center; width: 100%; white-space: nowrap; padding: 9px 0; }
.side-tabs button svg { width: 18px; height: 18px; flex-shrink: 0; }
.side-tabs button span { display: none; }
.app-main { flex: 1; min-width: 0; }
@media (max-width: 760px) {
  .app-shell { gap: 8px; }
  .side-tabs { top: 8px; }
}
.msg { max-width: 80%; padding: 7px 10px; border-radius: 12px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; margin-bottom: 5px; }
.msg.in { background: var(--surface-3); border-bottom-left-radius: 4px; }
.msg.out { background: var(--accent); color: var(--on-accent); margin-left: auto; border-bottom-right-radius: 4px; }
.msg.sys { background: transparent; border: 1px dashed var(--border-2); color: var(--muted); font-size: 12px; margin: 6px auto; text-align: center; }
@media (max-width: 640px) {
  h1 { font-size: 21px; }
  .container { padding: 10px 10px 28px; }
}

/* Brand lockup Yapp — mark + wordmark */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { width: 32px; height: 32px; flex: none; }
.brand h1 { margin: 0; }

/* Wordmark Yapp — "Yapp." titik emas + garis emas. */
.app-header { margin-bottom: 18px; }
.brand-wordmark { display: flex; flex-direction: column; }
.wordmark { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; color: var(--text); margin: 0; }
.wordmark .dot-gold { color: var(--accent); }
.wordmark-bar { width: 28px; height: 3px; background: var(--accent); border-radius: 2px; margin-top: 4px; }
@media (max-width: 640px) { .wordmark { font-size: 23px; } }

/* Aksesibilitas: fokus keyboard jelas + hormati reduced motion */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
