/* iHost Chat – paneli v3
   Brez i gjelbër i thellë sipër (ballina), karta të bardha që ngrihen mbi të,
   avatarë me ngjyrë, flluska të gjelbra për mesazhet e agjentit. */
:root {
  --hero: #064e3b;
  --hero-2: #0b6b52;
  --canvas: #f1f5f4;
  --surface: #ffffff;
  --raised: #f5f8f7;
  --ink: #0f1f1b;
  --text: #1c2b27;
  --muted: #5d706b;
  --faint: #8fa29c;
  --line: #dfe8e5;
  --line-soft: #ebf1ef;
  --accent: #059669;
  --accent-2: #10b981;
  --accent-hover: #047857;
  --accent-soft: #d9f5ea;
  --accent-text: #046c4e;
  --alert: #f43f5e;
  --alert-soft: #ffe4e8;
  --alert-text: #be123c;
  --warn-soft: #fff1d6;
  --warn-text: #9a5b00;
  --info-soft: #e0ebff;
  --info-text: #2a55c4;
  --danger: #e11d48;
  --rail: #0b1916;
  --rail-text: #8fa9a1;
  --bubble-in: #ffffff;
  --chat-bg: #edf3f1;
  --dot: rgba(6, 78, 59, .07);
  --card-shadow: 0 1px 2px rgba(15, 31, 27, .04), 0 10px 30px -14px rgba(15, 31, 27, .16);
  --float-shadow: 0 22px 60px -14px rgba(6, 40, 30, .38);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --r: 18px;
  --r-ctl: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --hero: #063a2d;
    --hero-2: #0a5240;
    --canvas: #0b1412;
    --surface: #121e1b;
    --raised: #172622;
    --ink: #e9f2ef;
    --text: #dbe7e3;
    --muted: #93aaa3;
    --faint: #6a8079;
    --line: #22332f;
    --line-soft: #1b2a26;
    --accent: #10b981;
    --accent-2: #34d399;
    --accent-hover: #34d399;
    --accent-soft: #0f3a2e;
    --accent-text: #6ee7b7;
    --alert-soft: #3f1520;
    --alert-text: #fda4af;
    --warn-soft: #3a2a0c;
    --warn-text: #fcd38a;
    --info-soft: #172647;
    --info-text: #9fbcff;
    --danger: #fb7185;
    --rail: #070f0d;
    --bubble-in: #1a2a26;
    --chat-bg: #0e1816;
    --dot: rgba(110, 231, 183, .05);
    --card-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --float-shadow: 0 22px 60px -14px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.5 "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1;
  background: var(--canvas);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- kontrollet ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 10px 16px; border-radius: var(--r-ctl); cursor: pointer; font-weight: 600; font-size: 14px;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--raised); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 16px -6px rgba(5,150,105,.6); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0;
}
.icon-btn:hover { background: var(--raised); color: var(--text); }
.icon-btn svg, .nav svg { width: 21px; height: 21px; }

label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-ctl);
  padding: 11px 13px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=color] { width: 54px; height: 44px; border: 1.5px solid var(--line); border-radius: var(--r-ctl); padding: 4px; background: var(--surface); }
.check { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

/* ---------- hyrja ---------- */
.login {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 500px at 85% -10%, #12a37a 0%, transparent 60%), radial-gradient(700px 500px at -10% 110%, #0e7a5d 0%, transparent 55%), var(--hero);
}
.login form { width: 100%; max-width: 390px; background: var(--surface); border-radius: 24px; padding: 34px 28px 28px; box-shadow: var(--float-shadow); }
.login h1 { margin: 0 0 6px; font-size: 25px; font-weight: 700; display: flex; align-items: center; gap: 12px; color: var(--ink); letter-spacing: -.02em; }
.login h1 img { width: 44px; height: 44px; border-radius: 13px; }
.login p { margin: 0 0 24px; color: var(--muted); }
.login .err { color: var(--danger); font-size: 14px; min-height: 20px; margin-bottom: 8px; }
.login .btn { width: 100%; padding: 13px; font-size: 15px; }

/* ---------- struktura ---------- */
.shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.nav {
  width: 88px; background: var(--rail); color: var(--rail-text); display: flex; flex-direction: column; align-items: stretch;
  padding: calc(16px + var(--safe-t)) 10px 16px; flex-shrink: 0; gap: 4px;
}
.brand { display: flex; justify-content: center; padding: 0 0 18px; }
.brand img { width: 42px; height: 42px; border-radius: 13px; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.brand span { display: none; }
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 4px 9px; border-radius: 16px;
  text-decoration: none; font-weight: 600; font-size: 11.5px; position: relative; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #d6e7e1; }
.nav a.active { background: linear-gradient(160deg, #10b981, #047857); color: #fff; box-shadow: 0 10px 22px -10px rgba(16,185,129,.8); }
.nav .count {
  position: absolute; top: 3px; right: 8px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: #22322e; color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--rail);
}
.nav .count.alert { background: var(--alert); }
.nav a.active .count { border-color: #0a7a59; }
.nav .count:empty { display: none; }
.nav .spacer { flex: 1; }
.avail {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.08); cursor: pointer; color: #e6f5ef; font-size: 13px; font-weight: 700; border: 1px solid rgba(255,255,255,.12);
}
.nav .avail { flex-direction: column; gap: 6px; border-radius: 16px; padding: 11px 4px; font-size: 11.5px; }
.avail .dot { width: 10px; height: 10px; border-radius: 50%; background: #7c8f89; }
.avail.on .dot { background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.25); animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 7px rgba(52,211,153,.08); } }
.conn { font-size: 11px; text-align: center; padding: 8px 2px 0; }
.conn.off { color: #fda4af; }

.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--canvas); }
/* ballina me ngjyrë */
.top {
  position: relative; display: flex; align-items: center; gap: 12px; padding: calc(22px + var(--safe-t)) 32px 18px;
  background: radial-gradient(600px 220px at 100% 0%, rgba(52,211,153,.35), transparent 70%), var(--hero); color: #fff; min-height: 76px;
}
.top h2 { margin: 0; font-size: 26px; font-weight: 700; flex: 1; min-width: 0; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .avail { display: none; }
#view {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: linear-gradient(var(--hero), var(--hero)) top / 100% 64px no-repeat local, var(--canvas);
}
.pad { padding: 0 32px 48px; max-width: 1100px; }

/* ---------- avatarët ---------- */
.av {
  --h: 160; position: relative; width: 46px; height: 46px; border-radius: 15px; flex-shrink: 0;
  background: linear-gradient(140deg, hsl(var(--h) 85% 64%), hsl(calc(var(--h) + 35) 75% 48%));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.av .fl { position: absolute; right: -5px; bottom: -4px; font-size: 15px; line-height: 1; text-shadow: none; filter: drop-shadow(0 0 1.5px rgba(255,255,255,.9)); }
.av .live { position: absolute; left: -3px; top: -3px; width: 13px; height: 13px; border-radius: 50%; background: #22c55e; border: 2.5px solid var(--surface); }
.av.typing::after { content: ""; position: absolute; inset: -5px; border-radius: 19px; border: 2px solid var(--accent-2); animation: ring 1.3s ease-in-out infinite; }
@keyframes ring { 50% { inset: -8px; opacity: .3; } }
.av.lg { width: 60px; height: 60px; font-size: 21px; border-radius: 19px; }

/* ---------- statistikat (ngrihen mbi ballinë) ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin: 0 0 22px; }
.stat {
  background: var(--surface); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--card-shadow); position: relative; overflow: hidden;
  border: 1px solid var(--line-soft); text-decoration: none; display: block;
}
.stat::after { content: ""; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; border-radius: 50%; background: var(--accent-soft); opacity: .9; }
.stat:nth-child(2)::after { background: var(--info-soft); }
.stat:nth-child(3)::after { background: var(--warn-soft); }
.stat:nth-child(4)::after { background: #f3e8ff; }
.stat.alert::after { background: var(--alert-soft); }
.stat b { position: relative; z-index: 1; display: block; font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1.1; letter-spacing: -.03em; }
.stat span { position: relative; z-index: 1; font-size: 13px; color: var(--muted); font-weight: 500; }
.stat.alert b { color: var(--alert); }
@media (prefers-color-scheme: dark) { .stat:nth-child(4)::after { background: #2a1d3d; } }

/* ---------- listat ---------- */
.list { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; box-shadow: var(--card-shadow); }
.row {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; text-decoration: none; position: relative;
  border-bottom: 1px solid var(--line-soft); min-height: 74px; transition: background .12s;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--raised); }
.row.active { background: var(--accent-soft); }
.row.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent-2); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 650; font-size: 15.5px; display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--ink); overflow: hidden; }
.row .t .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.row .s { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row .s.typing { color: var(--accent); font-weight: 500; }
.row .s.loc { font-size: 12.5px; color: var(--faint); }
.row.unread-row .t { color: var(--ink); }
.row.unread-row .s:not(.loc) { color: var(--text); font-weight: 600; }
.row .r { text-align: right; font-size: 12px; color: var(--faint); flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-weight: 500; }
.chip { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--raised); color: var(--muted); white-space: nowrap; flex-shrink: 0; border: 1px solid var(--line-soft); }
.chip .sw { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.unread { background: var(--alert); color: #fff; border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 1px 7px; min-width: 21px; text-align: center; box-shadow: 0 4px 10px -4px rgba(244,63,94,.7); }
.chatting { color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 60px 24px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.empty a { color: var(--accent); font-weight: 600; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .tabs { margin-bottom: 0; }
.toolbar select { width: auto; padding: 9px 12px; font-size: 14px; border-radius: 12px; background: var(--surface); }
.tabs {
  display: flex; gap: 4px; margin-bottom: 16px; background: var(--surface); border-radius: 14px; padding: 5px;
  width: fit-content; max-width: 100%; box-shadow: var(--card-shadow); border: 1px solid var(--line-soft); overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 15px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--accent); color: #fff; box-shadow: 0 6px 14px -6px rgba(5,150,105,.7); }
.tabs a.active .unread { background: #fff; color: var(--alert); box-shadow: none; }
.search { margin-bottom: 16px; }
.search input { border-radius: 14px; background: var(--surface); }

.tag { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--raised); color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.tag.red { background: var(--alert-soft); color: var(--alert-text); }
.tag.blue { background: var(--info-soft); color: var(--info-text); }
.tag.gray { background: var(--raised); color: var(--muted); }
.tag.green { background: var(--accent-soft); color: var(--accent-text); }
.dept {
  font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; flex-shrink: 0;
  background: color-mix(in srgb, var(--dc, #3b82f6) 15%, var(--surface)); color: color-mix(in srgb, var(--dc, #3b82f6) 80%, var(--ink));
}

/* ---------- pamja e ndarë (kompjuter) ---------- */
.split { display: flex; height: 100%; }
.side { width: 340px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; display: none; }
.side .side-h { position: sticky; top: 0; z-index: 1; padding: 16px 14px 12px; display: flex; gap: 4px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.side .side-h a { flex: 1; text-align: center; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 600; text-decoration: none; color: var(--muted); background: var(--raised); }
.side .side-h a.active { background: var(--accent); color: #fff; }
.side .row { padding: 12px 14px; min-height: 68px; border-bottom-color: transparent; margin: 2px 8px; border-radius: 14px; }
.side .row.active::before { display: none; }
.side .av { width: 40px; height: 40px; font-size: 14px; border-radius: 13px; }
.pane { flex: 1; min-width: 0; display: flex; }
@media (min-width: 1180px) { .side { display: block; } }

/* ---------- biseda ---------- */
.chat { display: flex; height: 100%; width: 100%; }
.chat-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative;
  background: radial-gradient(var(--dot) 1.2px, transparent 1.4px) 0 0 / 22px 22px, var(--chat-bg);
}
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 18px 10px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); min-height: 70px; z-index: 2;
}
.chat-head .who { flex: 1; min-width: 0; }
.who-in { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-in > div { min-width: 0; }
.who-in .av { width: 42px; height: 42px; border-radius: 14px; }
.chat-head .who b { display: flex; align-items: center; gap: 7px; font-size: 16px; color: var(--ink); min-width: 0; }
.chat-head .who b .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .who span.sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; margin-top: 2px; }
.chat-head .who span.sub > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.head-actions { display: flex; gap: 6px; align-items: center; }
.msgs { flex: 1; overflow-y: auto; padding: 24px 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.msg { max-width: min(72%, 560px); display: flex; flex-direction: column; animation: in .18s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
.msg .b { padding: 10px 15px; border-radius: 20px; white-space: pre-wrap; word-break: break-word; line-height: 1.45; font-size: 15px; }
.msg .i { font-size: 11px; color: var(--faint); margin: 4px 10px 10px; font-weight: 500; }
.msg.visitor { align-self: flex-start; }
.msg.visitor .b { background: var(--bubble-in); border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(15,31,27,.06), 0 4px 14px -8px rgba(15,31,27,.15); }
.msg.agent { align-self: flex-end; align-items: flex-end; }
.msg.agent .b { background: linear-gradient(140deg, #10b981, #047857); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 8px 18px -10px rgba(4,120,87,.8); }
.msg.agent .b a { color: #fff; }
.msg.system { align-self: center; font-size: 12px; color: var(--muted); padding: 5px 14px; margin: 10px 0; text-align: center; max-width: 90%; background: color-mix(in srgb, var(--surface) 75%, transparent); border-radius: 999px; font-weight: 500; }
.divider { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 12px; color: var(--muted); margin: 12px 0; font-weight: 500; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.peek { padding: 2px 26px 8px; font-size: 13px; color: var(--accent); white-space: pre-wrap; word-break: break-word; display: none; font-weight: 500; }
.peek.on { display: block; }
.composer {
  display: flex; align-items: flex-end; gap: 6px; margin: 0 18px calc(16px + var(--safe-b)); padding: 7px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 24px; box-shadow: 0 12px 30px -16px rgba(15,31,27,.35);
}
.composer:focus-within { border-color: var(--accent-2); }
.composer textarea { resize: none; border: 0; box-shadow: none !important; padding: 10px 6px; max-height: 160px; min-height: 42px; line-height: 1.45; background: transparent; }
.composer textarea:focus-visible { outline: none; }
.composer .icon-btn { width: 42px; height: 42px; border-radius: 50%; }
.composer .send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: linear-gradient(140deg, #10b981, #047857); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; box-shadow: 0 8px 16px -8px rgba(4,120,87,.9); transition: transform .1s; }
.composer .send:active { transform: scale(.92); }
.composer .send svg { width: 18px; height: 18px; margin-left: 2px; }
.canned-pop {
  display: none; position: absolute; left: 18px; right: 18px; bottom: 84px; max-height: 300px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--float-shadow); z-index: 5; padding: 6px;
}
.canned-pop.on { display: block; }
.canned-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 12px; cursor: pointer; }
.canned-pop button.sel, .canned-pop button:hover { background: var(--accent-soft); }
.canned-pop b { display: block; font-size: 13px; color: var(--accent); }
.canned-pop span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-empty { padding: 10px; font-size: 13px; color: var(--muted); }
.msg .att { display: block; margin-top: 3px; }
.msg .att img { max-width: 280px; max-height: 280px; border-radius: 18px; display: block; box-shadow: 0 6px 18px -10px rgba(0,0,0,.4); }
.msg .file { display: flex; align-items: center; gap: 9px; background: var(--surface); border-radius: 16px; padding: 11px 14px; text-decoration: none; font-size: 13.5px; max-width: 300px; margin-top: 3px; box-shadow: var(--card-shadow); }
.msg .file svg { color: var(--accent); flex-shrink: 0; }
.msg .file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-info { width: 330px; border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; padding: 24px 22px 32px; flex-shrink: 0; }
.chat-info .id-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.chat-info .id-head b { display: block; font-size: 17px; color: var(--ink); }
.chat-info .id-head span { font-size: 13px; color: var(--muted); }
.chat-info h3 { font-size: 14px; font-weight: 700; color: var(--ink); margin: 24px 0 10px; display: flex; align-items: center; gap: 8px; }
.chat-info h3:first-child { margin-top: 0; }
.kv { display: grid; grid-template-columns: 108px 1fr; gap: 8px 12px; font-size: 13.5px; margin: 0; background: var(--raised); border-radius: 14px; padding: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.pages { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.pages li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.pages li:last-child { border-bottom: 0; }
.pages a { text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 500; }
.pages small { color: var(--faint); }
.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--faint); }
.status-pill.on { color: var(--accent); }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chat-info .actions { margin: 14px 0 0; }

/* ---------- seksionet (faqet, cilësimet, raportet) ---------- */
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--card-shadow); }
.card h3 { margin: 0 0 4px; font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.card > h3 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.card-head h3 { margin: 0; flex: 1; }
.code { display: flex; gap: 8px; align-items: stretch; margin-top: 12px; }
.code code { flex: 1; min-width: 0; background: var(--raised); border-radius: 10px; padding: 11px 13px; font-size: 12.5px; overflow-x: auto; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.meta { font-size: 13.5px; color: var(--muted); margin: 0; }
.agent-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.agent-row:last-child { border-bottom: 0; }
.agent-row .grow { flex: 1; min-width: 180px; }
.agent-row .deps { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.agent-row .deps label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 5px 12px 5px 9px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; }
.agent-row .deps label:has(input:checked) { border-color: var(--accent-2); background: var(--accent-soft); color: var(--accent-text); }
.agent-row .deps input { accent-color: var(--accent); }
.notice { background: var(--accent-soft); color: var(--accent-text); padding: 13px 15px; border-radius: 14px; font-size: 14px; margin-bottom: 12px; font-weight: 500; }
.notice.warn { background: var(--warn-soft); color: var(--warn-text); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
#sec-val { user-select: all; }

dialog { border: 0; border-radius: 24px; padding: 0; width: min(540px, calc(100vw - 24px)); background: var(--surface); color: var(--text); box-shadow: var(--float-shadow); }
dialog::backdrop { background: rgba(4, 20, 16, .55); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
dialog form { padding: 26px; max-height: 85vh; overflow-y: auto; }
dialog h3 { margin: 0 0 18px; font-size: 19px; color: var(--ink); letter-spacing: -.01em; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pick label { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick label:has(input:checked) { border-color: var(--accent-2); background: var(--accent-soft); color: var(--accent-text); }
.pick .on-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.pick .on-dot.on { background: #22c55e; }

#toast {
  position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: 16px; font-size: 14px; font-weight: 600; opacity: 0;
  pointer-events: none; transition: .2s; z-index: 100; max-width: calc(100vw - 32px); box-shadow: var(--float-shadow);
}
#toast.on { opacity: 1; transform: translateX(-50%); pointer-events: auto; cursor: pointer; }

/* ---------- raportet ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 2px; }
.bar i { display: block; width: 100%; background: linear-gradient(180deg, #34d399, #059669); border-radius: 5px 5px 2px 2px; min-height: 2px; }
.bar i.alt { background: linear-gradient(180deg, #818cf8, #4f46e5); }
.bar:hover i { filter: brightness(1.1); }
.bars-x { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); margin-top: 8px; }
.hbar { margin-bottom: 12px; }
.hbar .hl { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 5px; }
.hbar .hl a, .hbar .hl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.hbar i { display: block; height: 7px; border-radius: 4px; background: linear-gradient(90deg, #10b981, #34d399); }

.hide-desktop { display: none !important; }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .chat-info { position: fixed; inset: 0; width: auto; z-index: 30; display: none; padding-top: calc(18px + var(--safe-t)); padding-bottom: calc(30px + var(--safe-b)); }
  .chat-info.open { display: block; animation: in .2s ease-out; }
  .hide-desktop { display: inline-flex !important; }
}

/* ---------- celular ---------- */
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .main { order: 1; }
  .nav {
    order: 2; position: fixed; z-index: 20; left: 10px; right: 10px; bottom: calc(8px + var(--safe-b));
    width: auto; flex-direction: row; justify-content: space-around; gap: 2px; padding: 6px;
    background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
    border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 14px 40px -12px rgba(6,40,30,.35); color: var(--muted);
  }
  .brand, .nav .spacer, .nav .avail, .conn { display: none; }
  .nav a { flex: 1; padding: 8px 2px 6px; font-size: 10.5px; color: var(--faint); border-radius: 16px; gap: 3px; }
  .nav a:hover { background: none; color: var(--muted); }
  .nav a.active { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
  .nav .count { top: 2px; right: calc(50% - 24px); border-color: var(--surface); background: var(--muted); }
  .nav .count.alert { background: var(--alert); }
  .top { padding: calc(16px + var(--safe-t)) 18px 14px; min-height: 64px; }
  .top h2 { font-size: 23px; }
  .top .avail { display: flex; padding: 7px 12px; }
  #view { background-size: 100% 48px; padding-bottom: calc(88px + var(--safe-b)); }
  .pad { padding: 0 14px 20px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
  .stat { padding: 13px 14px; border-radius: 16px; }
  .stat b { font-size: 25px; }
  .stat span { font-size: 12.5px; }
  .list { border-radius: 18px; }
  .row { padding: 13px 14px; gap: 12px; min-height: 72px; }
  .row .t { font-size: 15px; }
  .row .t .chip { display: none; }
  .row .r { gap: 5px; }
  .av { width: 44px; height: 44px; border-radius: 14px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar select { width: 100%; }
  .tabs { width: 100%; }
  .tabs a { flex: 1 0 auto; justify-content: center; padding: 8px 10px; font-size: 13.5px; }
  .card { padding: 18px 16px; border-radius: 18px; }
  .grid2 { grid-template-columns: 1fr; }

  .shell.in-chat .nav, .shell.in-chat .top { display: none; }
  .shell.in-chat #view { padding-bottom: 0; background: var(--chat-bg); }
  .chat-head { padding: calc(8px + var(--safe-t)) 8px 8px 4px; min-height: 62px; gap: 4px; }
  .who-in { gap: 10px; }
  .who-in .av { width: 38px; height: 38px; border-radius: 12px; font-size: 13.5px; }
  .chat-head .who b { font-size: 15.5px; }
  .chat-head .who b .tag, .chat-head .who b .dept { display: none; }
  .head-actions { gap: 2px; }
  .head-actions .btn { width: 40px; height: 40px; padding: 0; border-radius: 12px; border-color: transparent; background: transparent; }
  .head-actions .btn span { display: none; }
  .msgs { padding: 16px 12px 10px; }
  .msg { max-width: 84%; }
  .msg .att img { max-width: 220px; }
  .composer { margin: 0 8px calc(8px + var(--safe-b)); border-radius: 26px; }
  .canned-pop { left: 8px; right: 8px; bottom: 72px; }
  .kv { grid-template-columns: 100px 1fr; }
}
@media (max-width: 360px) {
  .stats { gap: 8px; }
  .stat b { font-size: 22px; }
  .nav a { font-size: 9.5px; }
}

/* ---------- rregullime pas rishikimit ---------- */
.shell.in-chat .top { display: none; }
.shell.in-chat #view { background: var(--chat-bg); }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
/* emri ka përparësi; etiketat që nuk nxënë në një rresht fshihen */
.row .t { flex-wrap: wrap; max-height: 25px; row-gap: 8px; }
.row .t .nm { flex-shrink: 0; max-width: 100%; }
@media (max-width: 760px) {
  .stats {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 -14px 16px; padding: 0 14px 4px; gap: 10px; scroll-padding-inline: 14px;
  }
  .stats::-webkit-scrollbar { display: none; }
  .stat { flex: 0 0 132px; scroll-snap-align: start; padding: 12px 14px; }
  .stat b { font-size: 24px; }
  .stat::after { width: 56px; height: 56px; right: -16px; top: -16px; }
}
