/* Dashboard agen. Layout: rel ikon gelap | daftar chat | percakapan | info pengunjung. Tema teal tenang. */
:root {
  --bg: #f3f6f6; --panel: #ffffff; --panel-2: #f7faf9; --line: #e1e8e7; --fg: #13201f; --muted: #5f716f;
  --accent: #0d8f80; --accent-strong: #0a7368; --accent-soft: #e2f4f1; --on-accent: #ffffff;
  --rail: #0f1c1b; --rail-fg: #9fb5b2; --rail-active: #1f3634;
  --bubble-in: #ffffff; --bubble-out: #0d8f80; --bubble-out-fg: #ffffff; --bubble-ai: #5b4bb7;
  --ok: #16a34a; --warn: #d97706; --bad: #dc2626; --ok-soft: #e3f6e8; --warn-soft: #fdf0dc; --bad-soft: #fde5e5; --info-soft: #e6eefc; --info: #3156b8;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --shadow: 0 8px 28px rgba(15, 28, 27, .12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1413; --panel: #121d1c; --panel-2: #172423; --line: #233432; --fg: #e3eeec; --muted: #8fa5a2;
    --accent: #2fb9a8; --accent-strong: #5fd0c1; --accent-soft: #163b37; --on-accent: #06201d;
    --rail: #070d0c; --rail-fg: #7f9794; --rail-active: #172a28;
    --bubble-in: #1a2928; --bubble-out: #1f7d72; --bubble-out-fg: #f2fbfa; --bubble-ai: #4a3d9a;
    --ok-soft: #12321d; --warn-soft: #3a2a10; --bad-soft: #3d1717; --info-soft: #18264a; --info: #8fb0ff; --shadow: 0 8px 28px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1413; --panel: #121d1c; --panel-2: #172423; --line: #233432; --fg: #e3eeec; --muted: #8fa5a2;
  --accent: #2fb9a8; --accent-strong: #5fd0c1; --accent-soft: #163b37; --on-accent: #06201d;
  --rail: #070d0c; --rail-fg: #7f9794; --rail-active: #172a28;
  --bubble-in: #1a2928; --bubble-out: #1f7d72; --bubble-out-fg: #f2fbfa; --bubble-ai: #4a3d9a;
  --ok-soft: #12321d; --warn-soft: #3a2a10; --bad-soft: #3d1717; --info-soft: #18264a; --info: #8fb0ff; --shadow: 0 8px 28px rgba(0,0,0,.45);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font-ui); overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
textarea { resize: vertical; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
code { background: var(--panel-2); border: 1px solid var(--line); padding: 0 5px; border-radius: 5px; font-size: 12px; }
kbd { font: 11px var(--font-ui); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--panel); color: var(--fg); }
.muted { color: var(--muted); } .small { font-size: 12px; }
.err { color: var(--bad); margin: 0; }

/* Tombol */
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 7px 12px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; justify-content: center; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ghost-bad { color: var(--bad); }
.btn.icon { padding: 7px; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Login */
.login { height: 100%; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.login-card { background: var(--panel); border: 1px solid var(--line); padding: 32px; border-radius: 18px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.login-card .logo { margin: 0 0 4px; }
.login-card h1 { margin: 0; font: 800 22px var(--font-display); }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }

/* Kerangka */
.app { height: 100%; display: grid; grid-template-columns: 72px 320px minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); }
.app.page-mode { grid-template-columns: 72px minmax(0, 1fr); }

/* Rel navigasi */
.rail { background: var(--rail); color: var(--rail-fg); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 4px; grid-row: 1; grid-column: 1; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 800 15px var(--font-display); margin-bottom: 12px; flex-shrink: 0; }
.rail button { position: relative; width: 56px; padding: 8px 0 6px; border: 0; border-radius: 12px; background: none; color: inherit; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; }
.rail button:hover { color: #e5f0ee; }
.rail button.active { background: var(--rail-active); color: #fff; }
.rail button.active::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent); }
.rail svg { width: 22px; height: 22px; }
.rail .count { position: absolute; top: 2px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.rail .count.gray { background: #47605d; }
.rail .spacer { flex: 1; }
.me { position: relative; }
.me-btn { width: 44px !important; height: 44px; padding: 0 !important; border-radius: 50% !important; background: #d9b38c center/cover no-repeat !important; color: #3b2611 !important; font: 700 15px var(--font-display) !important; }
.me-btn i { position: absolute; right: 0; bottom: 0; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--rail); background: var(--ok); }
.me-btn i.away { background: var(--warn); }
.menu { position: absolute; left: 60px; bottom: 0; z-index: 40; background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; width: 250px; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .who b { display: block; }
.menu button { width: 100%; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 9px 10px; font-size: 13px; color: var(--fg); border-radius: 8px; }
.menu button:hover { background: var(--panel-2); color: var(--fg); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: #9aa9a7; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); }

/* Daftar chat */
.list { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; grid-column: 2; grid-row: 1; }
.list-head { padding: 16px 16px 10px; display: flex; flex-direction: column; gap: 12px; }
.list-head h1 { margin: 0; font: 700 20px var(--font-display); display: flex; justify-content: space-between; align-items: baseline; }
.list-head h1 small { font: 500 12px var(--font-ui); color: var(--muted); }
.search { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; }
.search input { flex: 1; border: 0; background: none; padding: 9px 0; outline: none; min-width: 0; }
.search svg { width: 16px; height: 16px; color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; border-radius: 7px; padding: 6px 4px; font-size: 12px; font-weight: 600; color: var(--muted); display: flex; justify-content: center; gap: 5px; }
.seg button.on { background: var(--panel); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg em { font-style: normal; font-variant-numeric: tabular-nums; background: var(--line); color: var(--fg); border-radius: 8px; padding: 0 6px; font-size: 11px; }
.seg button.q em.has { background: var(--warn); color: #fff; }
.items { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.item { width: 100%; text-align: left; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 10px; border: 0; background: none; border-radius: 12px; position: relative; }
.item:hover { background: var(--panel-2); }
.item.sel { background: var(--accent-soft); }
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--font-display); position: relative; color: #1b2a29; flex-shrink: 0; background-size: cover; background-position: center; }
.av .on { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel); }
.item .row1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.item .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .tm { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.item .row2 { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 2px; }
.item .last { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .last.typing { color: var(--accent); font-style: italic; }
.item.unread .nm, .item.unread .last { color: var(--fg); font-weight: 600; }
.unread-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.wait { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 8px; flex-shrink: 0; white-space: nowrap; }
.wait.warn { background: var(--warn-soft); color: var(--warn); } .wait.bad { background: var(--bad-soft); color: var(--bad); } .wait.info { background: var(--info-soft); color: var(--info); }
.tags { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.tag { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.empty-list { padding: 30px 16px; text-align: center; color: var(--muted); }

/* Percakapan */
.conv { display: flex; flex-direction: column; min-height: 0; min-width: 0; grid-column: 3; grid-row: 1; position: relative; }
.conv-empty { margin: auto; text-align: center; color: var(--muted); padding: 24px; }
.conv-empty .big { width: 64px; height: 64px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 12px; }
.conv-empty h2 { margin: 0 0 4px; font: 700 18px var(--font-display); color: var(--fg); }
.conv-empty p { margin: 0 0 4px; }
.conv-box { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.conv-head { background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.conv-head .back { border: 0; background: none; padding: 4px; display: grid; place-items: center; color: var(--muted); border-radius: 8px; }
.conv-head .back:hover { background: var(--panel-2); color: var(--fg); }
.conv-head .t { flex: 1; min-width: 0; }
.conv-head h2 { margin: 0; font: 700 16px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-head .s { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.conv-head .s span.pg { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.off { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); } .pill.info { background: var(--info-soft); color: var(--info); }
.acts { display: flex; gap: 6px; align-items: center; position: relative; }
.acts .ip-btn { color: var(--accent-strong); }
.dropdown { position: absolute; right: 0; top: 42px; z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); width: 270px; padding: 6px; max-height: 60vh; overflow-y: auto; }
.dropdown h4 { margin: 6px 10px 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dropdown button { width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; display: flex; align-items: center; gap: 10px; }
.dropdown button:hover { background: var(--panel-2); }
.dropdown button span { flex: 1; }
.dropdown button small { color: var(--muted); font-variant-numeric: tabular-nums; }
.msgs { flex: 1; overflow-y: auto; padding: 18px clamp(12px, 3vw, 32px); display: flex; flex-direction: column; gap: 4px; }
.day { align-self: center; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--panel); border: 1px solid var(--line); padding: 2px 10px; border-radius: 10px; margin: 6px 0 10px; }
.grp { display: flex; gap: 8px; align-items: flex-end; max-width: min(78%, 620px); margin-top: 8px; }
.grp.out { align-self: flex-end; flex-direction: row-reverse; }
.grp .av { width: 28px; height: 28px; font-size: 11px; }
.grp .stack { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.grp.out .stack { align-items: flex-end; }
.b { padding: 8px 12px; border-radius: 16px; background: var(--bubble-in); border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; max-width: 100%; }
.b a { color: inherit; }
.grp.in .b { border-bottom-left-radius: 5px; }
.grp.out .b { background: var(--bubble-out); color: var(--bubble-out-fg); border-color: transparent; border-bottom-right-radius: 5px; }
.grp.ai .b { background: var(--bubble-ai); }
.b.img { padding: 4px; background: var(--panel); border: 1px solid var(--line); color: var(--fg); }
.grp.out .b.img { background: var(--panel); color: var(--fg); border-color: var(--line); }
.b .att { display: block; max-width: 260px; max-height: 300px; border-radius: 12px; cursor: zoom-in; }
.b .cap { padding: 6px 8px 4px; }
.meta { font-size: 11px; color: var(--muted); padding: 0 4px; font-variant-numeric: tabular-nums; }
.sysm { align-self: center; font-size: 12px; color: var(--muted); margin: 10px 0; text-align: center; }
.peek { margin: 0 clamp(12px, 3vw, 32px) 8px; font-size: 12.5px; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: 10px; padding: 6px 10px; display: flex; gap: 6px; }
.peek b { color: var(--accent); font-weight: 600; flex-shrink: 0; }
.peek span { white-space: pre-wrap; word-break: break-word; }
.composer { background: var(--panel); border-top: 1px solid var(--line); padding: 10px 16px 12px; position: relative; }
.composer-box { border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); padding: 8px 10px; }
.composer-box:focus-within { border-color: var(--accent); }
.composer textarea { width: 100%; border: 0; background: none; resize: none; outline: none; min-height: 44px; max-height: 160px; padding: 2px; }
.ctools { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctools .l { display: flex; gap: 2px; position: relative; }
.tbtn { border: 0; background: none; padding: 6px; border-radius: 8px; color: var(--muted); display: grid; place-items: center; }
.tbtn:hover { background: var(--line); color: var(--fg); }
.tbtn svg { width: 18px; height: 18px; }
.hint { font-size: 11.5px; color: var(--muted); }
.emoji-pop { position: absolute; bottom: 38px; left: 0; z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; grid-template-columns: repeat(8, 32px); gap: 2px; }
.emoji-pop button { border: 0; background: none; font-size: 18px; height: 32px; border-radius: 6px; }
.emoji-pop button:hover { background: var(--panel-2); }
.canned { position: absolute; left: 16px; right: 16px; bottom: calc(100% - 4px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; z-index: 15; }
.canned .ch { padding: 8px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.canned button { width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; display: block; }
.canned button.sel, .canned button:hover { background: var(--accent-soft); }
.canned b { color: var(--accent-strong); margin-right: 8px; }
.canned span { color: var(--muted); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploading { font-size: 12px; color: var(--muted); padding: 0 4px 6px; }
.ended { padding: 14px; text-align: center; color: var(--muted); background: var(--panel); border-top: 1px solid var(--line); }

/* Info pengunjung */
.info { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; min-height: 0; grid-column: 4; grid-row: 1; }
.info-top { padding: 20px 18px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.info-top .av { width: 64px; height: 64px; font-size: 22px; margin: 0 auto 10px; }
.info-top h3 { margin: 0; font: 700 17px var(--font-display); }
.info-top p { margin: 2px 0 0; color: var(--muted); font-size: 13px; word-break: break-word; }
.quick { display: flex; justify-content: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.sec { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sec h4 { margin: 0 0 10px; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.sec h4 button { border: 0; background: none; color: var(--accent-strong); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; padding: 0; }
.kv { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 7px 10px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.kv a { color: var(--accent-strong); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.past { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border: 0; border-bottom: 1px dashed var(--line); gap: 8px; width: 100%; background: none; text-align: left; }
.past:last-child { border-bottom: 0; }
.past:hover span:first-child { color: var(--accent-strong); }

/* Panel tracking IP */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow); z-index: 45; display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; flex: 1; font: 700 16px var(--font-display); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.ip-hero { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ip-hero .ip { font: 700 22px ui-monospace, "SF Mono", Menlo, Consolas, monospace; word-break: break-all; }
.ip-hero .loc { font-size: 14px; }
.ip-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.ip-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.ip-card .top b { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.ip-note { font-size: 12px; color: var(--muted); }
.backdrop { position: fixed; inset: 0; background: rgba(5, 12, 11, .35); z-index: 44; }

/* Lightbox foto */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 60; display: grid; place-items: center; cursor: zoom-out; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* Halaman lain */
.page { grid-column: 2 / -1; grid-row: 1; padding: 28px clamp(16px, 3vw, 36px); overflow-y: auto; min-width: 0; }
.page h1 { font: 700 22px var(--font-display); margin: 0 0 6px; }
.page > p.lead { color: var(--muted); max-width: 70ch; margin: 0 0 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 18px 0; max-width: 1000px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat small { color: var(--muted); font-size: 12px; } .stat b { display: block; font: 700 26px var(--font-display); font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin-top: 12px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; background: var(--panel-2); font-weight: 600; }
.table tr.click { cursor: pointer; } .table tr.click:hover td { background: var(--accent-soft); }
.table td.wrap { max-width: 380px; white-space: pre-wrap; word-break: break-word; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.filters input[name=q], .filters textarea { flex: 1; min-width: 200px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; margin-top: 20px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel h3 { margin: 6px 0 0; font: 700 15px var(--font-display); }
.panel h3:first-child { margin-top: 0; }
.panel label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.panel label.row { flex-direction: row; align-items: center; gap: 8px; color: var(--fg); }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.row2 input[type=color] { width: 100%; height: 38px; padding: 2px; }
.upl { display: flex; gap: 8px; align-items: center; }
.upl input { flex: 1; min-width: 0; }
.upl img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--panel-2); border: 1px solid var(--line); }
.upl img:not([src]), .upl img[src=""] { visibility: hidden; }
.code { background: var(--panel-2); border: 1px solid var(--line); padding: 12px; border-radius: 10px; white-space: pre-wrap; word-break: break-all; font-size: 12px; margin: 0; }
.canned-frame { width: 100%; height: calc(100vh - 56px); border: 0; border-radius: 14px; background: var(--panel); }
.edit-row td { background: var(--panel-2); }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.edit-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 9px 16px; border-radius: 10px; font-size: 13px; z-index: 70; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

/* Layar sedang: panel info jadi laci */
@media (max-width: 1180px) {
  .app { grid-template-columns: 72px 300px minmax(0, 1fr); }
  .info { display: none; position: fixed; right: 0; top: 0; bottom: 0; width: min(330px, 92vw); z-index: 35; box-shadow: var(--shadow); }
  .app.show-info .info { display: block; }
}
@media (min-width: 1181px) { #infoToggle { display: none; } }
/* HP */
@media (max-width: 720px) {
  .app, .app.page-mode { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .rail { grid-row: 2; grid-column: 1; flex-direction: row; justify-content: space-around; padding: 4px max(8px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); overflow-x: auto; }
  .rail .logo, .rail .spacer { display: none; }
  .rail button { width: 52px; }
  .rail button.active::before { display: none; }
  .menu { left: auto; right: 0; bottom: 56px; }
  .list, .conv, .page { grid-column: 1; grid-row: 1; }
  .app:not(.in-chat) .conv { display: none; }
  .app.in-chat .list { display: none; }
  .acts .btn .lbl, .hint { display: none; }
  .grp { max-width: 88%; }
  .page { padding: 18px 16px; }
}
@media (prefers-reduced-motion: no-preference) { .item, .btn, .seg button { transition: background .12s, border-color .12s; } }

/* Tambahan dashboard v1.4 */
.app.page-mode [data-pane="chats"] { display: none !important; }
.menu .who small { display: block; font-size: 12px; }
.me-btn span { pointer-events: none; }
.ip-hero .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ip-hero .flag { font-size: 22px; line-height: 1; }
.ip-hero dl { margin: 0; }
.ip-card .kv { grid-template-columns: 88px minmax(0, 1fr); font-size: 12.5px; }
.ip-card.now { border-color: var(--accent); }
.ip-warn { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; }
.team-actions { white-space: nowrap; display: flex; gap: 6px; }
.btn.danger { color: var(--bad); }
.histmark { align-self: center; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 8px; width: 100%; margin: 10px 0; }
.histmark::before, .histmark::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
.photo-preview { display: flex; align-items: center; gap: 12px; padding: 8px; margin-bottom: 8px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); }
.photo-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; cursor: zoom-in; background: var(--panel); flex-shrink: 0; }
.photo-preview .pv-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); }
.photo-preview .pv-txt > b { color: var(--fg); font-size: 13px; }
.photo-preview.busy { opacity: .6; pointer-events: none; }

.linked { display: flex; flex-direction: column; gap: 8px; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto auto auto; gap: 6px; align-items: center; }
.link-row input { min-width: 0; }
@media (max-width: 520px) { .link-row { grid-template-columns: minmax(0, 1fr) auto auto auto; } .link-row input[data-k=url] { grid-column: 1 / -1; grid-row: 2; } }

.field-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; background: var(--panel-2); }
.field-row label { font-size: 12px; }
.field-row .opts { grid-column: 1 / -1; }
.field-row .fr-foot { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.field-row .fr-foot .row { margin-right: auto; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } .field-row .lbl { grid-column: 1 / -1; } }

/* Halaman pengaturan: form utama lebar di kiri, panel kecil di kanan */
@media (min-width: 1000px) {
  #view-settings .grid2 { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); max-width: 1200px; }
  #view-settings #settingsForm { grid-column: 1; grid-row: 1 / span 2; }
  #view-settings #senderForm, #view-settings .grid2 > .panel:not(form) { grid-column: 2; }
}

/* Pengunjung online */
.vis-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0 14px; }
.vis-tools .search { flex: 1; min-width: 220px; max-width: 420px; background: var(--panel); }
.vis-tools .seg { min-width: 330px; background: var(--panel); }
.vis-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.vcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.vcard.chatting { border-color: var(--accent); }
.vcard .top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.vcard .top .t { flex: 1; min-width: 0; }
.vcard .top b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .top small { color: var(--muted); font-size: 12px; }
.vcard .pg { font-size: 13px; display: flex; gap: 6px; min-width: 0; }
.vcard .pg a { color: var(--accent-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .facts { display: flex; flex-wrap: wrap; gap: 6px; }
.vcard .facts span { font-size: 11.5px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 1px 7px; color: var(--muted); }
.vcard .acts2 { display: flex; gap: 6px; }
.vcard .acts2 .btn:first-child { flex: 1; }
/* Laporan */
.rep-filters select, .rep-filters input { background: var(--panel); }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; max-width: 1200px; }
.stats { max-width: 1200px; }
.stat em { font-style: normal; font-size: 12px; color: var(--muted); display: block; }
.bars { height: 170px; display: flex; align-items: flex-end; gap: 2px; padding: 0 0 22px; position: relative; border-bottom: 1px solid var(--line); }
.bars .bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; position: relative; cursor: default; }
.bars .bar i { display: block; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.bars .bar:hover i { background: var(--accent-strong); }
.bars .bar small { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.bars .bar .tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); font-size: 12px; padding: 5px 8px; border-radius: 7px; white-space: nowrap; z-index: 5; pointer-events: none; }
.bars .bar:hover .tip { display: block; }
.bars .bar .tip { bottom: auto; top: -8px; transform: translate(-50%, -100%); }
.bars .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }

.colorset { display: flex; flex-direction: column; gap: 8px; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; }
.colorset > span:first-child { font-size: 13px; font-weight: 600; color: var(--fg); }
.colorset .row2 input[type=color] { height: 34px; }
.colorset.off .row2 { opacity: .45; pointer-events: none; }
.link-row .lcol { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.link-row .lcol label { display: flex; align-items: center; gap: 6px; }
.link-row .lcol input[type=color] { width: 40px; height: 28px; padding: 2px; }
.link-row .lprev { padding: 4px 12px; border-radius: 8px; font-weight: 700; font-size: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: #fff; }
.link-row { padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.link-row .lcol label { flex-direction: row; color: var(--muted); }

/* v1.9.2: mute, banned */
.btn.bad-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.ban-pop { width: 300px; }
.ban-pop label.row { display: flex; gap: 8px; align-items: flex-start; }
.ban-pop .dropdown button, .ban-pop button.btn { width: auto; display: inline-flex; }
.ban-rows { display: flex; flex-direction: column; gap: 8px; }
.ban-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; }
.ban-row .who { min-width: 0; }
.ban-row .who b { display: block; }
.ban-row .who span { color: var(--muted); font-size: 12px; }
.item .muted-ico { font-size: 11px; margin-left: 4px; opacity: .7; }
#muteBtn.on { background: var(--panel-2); }
.ban-pop button.btn { border: 1px solid var(--line); background: var(--panel); padding: 6px 14px; justify-content: center; }
.ban-pop button.btn.bad-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.ban-pop button.btn.bad-fill:hover { filter: brightness(.95); }

/* v1.9.3: pemisah chat sebelumnya di room chat */
.chat-sep { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.chat-sep::before, .chat-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.chat-sep.now { color: var(--accent, #0f766e); }

/* v1.9.4: pengaturan notifikasi */
#notifPanel .nrow { display: flex; gap: 8px; align-items: flex-end; }
#notifPanel .nrow label { flex: 1; }
#notifPanel .nrow .btn { margin-bottom: 2px; }
#notifPanel input[type=range] { width: 100%; padding: 0; }
.danger-zone { display: grid; gap: 8px; justify-items: start; }

.meta .seen-by { color: inherit; }
.meta .seen-by.rd { color: var(--accent, #0f766e); font-weight: 600; }
