:root {
  --navy-900: #061433;
  --navy-800: #0A1F44;
  --navy-700: #12306A;
  --navy-600: #1B3F87;
  --blue: #2563EB;
  --blue-soft: #E8EFFE;
  --bg: #F3F6FB;
  --card: #FFFFFF;
  --line: #E3E8F2;
  --text: #0E1B36;
  --muted: #64718C;
  --green: #10915B; --green-soft: #E3F6EC;
  --red: #D23B3B; --red-soft: #FDECEC;
  --amber: #C27A07; --amber-soft: #FFF4DE;
  --violet: #6D4AE0; --violet-soft: #EFEAFE;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(10,31,68,.04), 0 4px 16px rgba(10,31,68,.06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
.ltr { direction: ltr; unicode-bidi: plaintext; text-align: right; }

/* layout */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy-800); color: #C9D4EA; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 26px; color: #fff; }
.brand img { width: 36px; height: 36px; }
.brand b { font-size: 19px; letter-spacing: .5px; font-weight: 700; font-family: system-ui, sans-serif; }
.brand small { display: block; font-size: 11px; color: #8FA3CC; font-weight: 400; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #C9D4EA; margin-bottom: 2px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: #fff; color: var(--navy-800); }
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav .sep { font-size: 11px; color: #6F84B0; padding: 18px 12px 6px; }
.nav .badge { margin-inline-start: auto; background: #E5383B; color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; min-width: 20px; height: 20px; display: inline-grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px var(--navy-800); }
.nav a.active .badge { box-shadow: 0 0 0 2px #fff; }
.new-dot { display: inline-block; margin-inline-start: 6px; background: #E5383B; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 99px; vertical-align: middle; }
.t tbody tr.unseen { background: #FFF8F8; }
.t tbody tr.unseen .name { font-weight: 700; }
.conv.unread { background: #FFF8F8; }
.conv.unread b, .conv.unread p { color: var(--text); font-weight: 700; }
.c-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #E5383B; color: #fff; font-size: 10px; font-weight: 700; margin-inline-start: 4px; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding: 14px 6px 0; display: flex; align-items: center; gap: 10px; }
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who b { color: #fff; display: block; font-weight: 600; font-size: 13px; }
.side-foot .who span { font-size: 12px; color: #8FA3CC; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 30px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 20px; margin: 0; font-weight: 700; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.content { padding: 26px 30px 60px; }
.menu-btn { display: none; }

/* atoms */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: #C8D2E6; background: #FAFBFE; }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.btn.primary:hover { background: var(--navy-700); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px; outline: none; transition: .15s; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
textarea.input { resize: vertical; min-height: 80px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-h .actions { margin-inline-start: auto; display: flex; gap: 8px; }
.card-b { padding: 18px 20px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bg); color: var(--muted); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.nodot::before { display: none; }
.s-new { background: var(--blue-soft); color: var(--blue); }
.s-contacted { background: var(--violet-soft); color: var(--violet); }
.s-qualified { background: var(--green-soft); color: var(--green); }
.s-unqualified { background: var(--red-soft); color: var(--red); }
.s-proposal { background: var(--amber-soft); color: var(--amber); }
.s-won { background: var(--navy-800); color: #fff; }
.s-lost { background: #EEF0F4; color: #7A8296; }
.src { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.src i { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-style: normal; color: #fff; font-size: 11px; font-weight: 700; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-soft); color: var(--navy-700); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sidebar .avatar { background: var(--navy-600); color: #fff; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty svg { width: 44px; height: 44px; color: #B8C3DA; margin-bottom: 8px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #CDD5E5; border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::after { content: ''; position: absolute; width: 16px; height: 16px; top: 3px; right: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { right: 21px; }

/* kpis */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px 20px; }
.kpi .lbl { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.kpi .val { font-size: clamp(22px, 2.1vw, 30px); font-weight: 700; margin-top: 6px; letter-spacing: -.5px; white-space: nowrap; }
.kpi .val small { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi.hero { background: linear-gradient(135deg, var(--navy-800), var(--navy-600)); color: #fff; border: 0; }
.kpi.hero .lbl { color: #B7C6E6; }
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
.bars .row { display: grid; grid-template-columns: 90px 1fr 40px; align-items: center; gap: 10px; margin-bottom: 11px; font-size: 13px; }
.bars .track { height: 9px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bars .fill { height: 100%; border-radius: 99px; background: var(--navy-700); }
.chart svg { width: 100%; height: auto; max-height: 260px; display: block; }

/* tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 600; padding: 11px 16px; background: #F8FAFD; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tbody tr { transition: background .1s; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover { background: #F7F9FD; }
.t tr:last-child td { border-bottom: 0; }
.t .name { font-weight: 600; }
.t .sub { font-size: 12px; color: var(--muted); }
.rate { font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.filters .input { width: auto; min-width: 140px; padding: 7px 10px; }
.filters .search { flex: 1; min-width: 220px; position: relative; }
.filters .search .input { width: 100%; padding-inline-start: 36px; }
.filters .search .input[dir=auto] { text-align: right; padding-right: 36px; padding-left: 12px; } /* numbers keep LTR order, still aligned like the Arabic UI */
.filters .search svg { position: absolute; top: 50%; transform: translateY(-50%); right: 11px; width: 17px; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--navy-800); color: #fff; }
.bulkbar select { background: var(--navy-700); border-color: var(--navy-600); color: #fff; }

/* drawer & modal */
.overlay { position: fixed; inset: 0; background: rgba(6,20,51,.38); z-index: 40; animation: fade .15s; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(760px, 100vw); background: var(--bg); z-index: 41; display: flex; flex-direction: column; box-shadow: 0 0 40px rgba(6,20,51,.2); animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(-30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-h { background: var(--navy-800); color: #fff; padding: 20px 24px; }
.drawer-h .top { display: flex; align-items: flex-start; gap: 14px; }
.drawer-h h2 { margin: 0 0 4px; font-size: 20px; }
.drawer-h .meta { color: #A9BADC; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.drawer-h .icon-btn { color: #A9BADC; }
.drawer-h .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.qualify { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.qualify .btn { border: 0; }
.qualify .btn.q-yes { background: #fff; color: var(--green); }
.qualify .btn.q-no { background: rgba(255,255,255,.1); color: #fff; }
.qualify .btn.q-yes.on { background: var(--green); color: #fff; }
.qualify .btn.q-no.on { background: var(--red); color: #fff; }
.qualify select { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); color: #fff; width: auto; }
.qualify select option { color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--navy-800); border-color: var(--navy-800); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline li::before { content: ''; position: absolute; top: 30px; bottom: 0; right: 14px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; flex: none; color: var(--muted); }
.timeline .dot svg { width: 15px; height: 15px; }
.timeline .dot.capi { background: var(--blue-soft); border-color: transparent; color: var(--blue); }
.timeline .dot.status { background: var(--green-soft); border-color: transparent; color: var(--green); }
.timeline .tx { flex: 1; padding-top: 4px; }
.timeline .tx small { color: var(--muted); font-size: 12px; display: block; margin-top: 2px; }
.note-box { display: flex; gap: 8px; margin-bottom: 18px; align-items: flex-start; }
.note-box textarea { min-height: 44px; }
.chat { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 75%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.bubble.in { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-start-start-radius: 4px; }
.bubble.out { background: var(--navy-800); color: #fff; align-self: flex-end; border-start-end-radius: 4px; }
.bubble small { display: block; font-size: 11px; opacity: .6; margin-top: 3px; }
.composer { display: flex; gap: 8px; padding-top: 14px; }
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(6,20,51,.45); animation: fade .15s; }
.modal { background: #fff; border-radius: 16px; width: min(560px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(6,20,51,.3); }
.modal-h { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-h h3 { margin: 0; font-size: 17px; }
.modal-h .icon-btn { margin-inline-start: auto; }
.modal-b { padding: 20px 22px; overflow-y: auto; }
.modal-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-start; }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: #E9EEF7; border-radius: 14px; padding: 10px; min-height: 300px; }
.col.drop { outline: 2px dashed var(--blue); background: var(--blue-soft); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; }
.col-h .n { margin-inline-start: auto; color: var(--muted); font-size: 12px; font-weight: 600; }
.kcard { background: #fff; border-radius: 11px; padding: 11px 12px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(10,31,68,.08); cursor: grab; border: 1px solid transparent; }
.kcard:hover { border-color: #C8D4EE; }
.kcard b { display: block; margin-bottom: 4px; }
.kcard .row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); gap: 6px; }

/* inbox */
.inbox { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 140px); overflow: hidden; }
.conv-list { border-inline-end: 1px solid var(--line); overflow-y: auto; }
.conv { display: flex; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.conv:hover { background: #F7F9FD; }
.conv.on { background: var(--blue-soft); }
.conv .c-body { flex: 1; min-width: 0; }
.conv .c-top { display: flex; justify-content: space-between; gap: 6px; }
.conv .c-top small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.conv p { margin: 3px 0 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-panel { display: flex; flex-direction: column; min-height: 0; }
.conv-panel .head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.conv-panel .msgs { flex: 1; overflow-y: auto; padding: 20px; background: var(--bg); }
.conv-panel .composer { padding: 12px 16px; border-top: 1px solid var(--line); }

/* settings */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.set-grid .full { grid-column: 1 / -1; }
.copy { display: flex; gap: 8px; }
.copy .input { background: var(--bg); }
.status-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.status-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ok { color: var(--green); } .bad { color: var(--red); } .warn { color: var(--amber); }
.steps { margin: 0; padding-inline-start: 20px; line-height: 2; color: var(--muted); font-size: 13px; }
.steps b { color: var(--text); }
.stage-map { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; }
.soon { position: relative; }
.soon-tag { background: var(--amber-soft); color: var(--amber); font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.perm-grid label { display: flex; gap: 9px; align-items: center; font-size: 13.5px; padding: 6px 0; cursor: pointer; }
.perm-grid input { width: 17px; height: 17px; accent-color: var(--navy-800); }
.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.role-perms { display: flex; flex-wrap: wrap; gap: 6px; }
.role-perms .pill { font-weight: 500; }
pre.code { background: var(--navy-900); color: #C9D4EA; padding: 12px; border-radius: 10px; font-size: 12px; overflow: auto; direction: ltr; text-align: left; max-height: 260px; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .art { background: radial-gradient(circle at 80% 10%, #1B3F87 0, transparent 50%), linear-gradient(160deg, var(--navy-800), var(--navy-900)); color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login .art::after { content: ''; position: absolute; width: 520px; height: 520px; border: 60px solid rgba(255,255,255,.04); border-radius: 50%; left: -160px; bottom: -200px; }
.login .art h2 { font-size: 38px; line-height: 1.35; margin: 0 0 14px; max-width: 460px; }
.login .art p { color: #A9BADC; max-width: 420px; line-height: 1.8; }
.login .art .feats { display: flex; flex-direction: column; gap: 12px; color: #C9D4EA; position: relative; z-index: 1; }
.login .art .feats div { display: flex; gap: 10px; align-items: center; }
.login .art .feats svg { width: 20px; color: #6EA0FF; }
.login form { align-self: center; justify-self: center; width: min(380px, 90vw); }
.login form h1 { font-size: 26px; margin: 0 0 6px; }
.login form .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }

/* ads report */
.v-win { --v: #10915B; --vs: #E3F6EC; } .v-ok { --v: #C27A07; --vs: #FFF4DE; } .v-weak { --v: #D23B3B; --vs: #FDECEC; } .v-new { --v: #7A8296; --vs: #EEF0F4; }
.vbadge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--vs); color: var(--v); white-space: nowrap; }
.vbadge.big { font-size: 13px; padding: 5px 12px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.verdict-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.vs { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--vs); border: 1px solid color-mix(in srgb, var(--v) 18%, transparent); }
.vs-dot { font-size: 22px; }
.vs b { font-size: 24px; color: var(--v); margin-inline-end: 4px; }
.vs div { color: var(--v); font-weight: 600; }
.vs small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.recs { margin-bottom: 18px; border-inline-start: 4px solid var(--blue); }
.recs .card-h h3 { display: flex; align-items: center; gap: 8px; }
.recs .card-h svg { width: 18px; color: var(--blue); }
.recs ul { list-style: none; margin: 0; padding: 6px 20px 14px; }
.recs li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dashed var(--line); line-height: 1.7; }
.recs li:last-child { border-bottom: 0; }
.rec-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 700; }
.rec-up .rec-ic { background: var(--green-soft); color: var(--green); }
.rec-stop .rec-ic { background: var(--red-soft); color: var(--red); }
.rec-play .rec-ic { background: var(--blue-soft); color: var(--blue); }
.rec-warn .rec-ic { background: var(--amber-soft); color: var(--amber); }
.rec-info .rec-ic { background: var(--bg); color: var(--muted); }
.perf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 12px; flex-wrap: wrap; }
.perf-head h3 { margin: 0; font-size: 17px; }
.perf-list { overflow: hidden; }
.perf-row { display: flex; align-items: center; gap: 18px; padding: 16px 20px; border-bottom: 1px solid var(--line); border-inline-start: 4px solid var(--v); cursor: pointer; transition: background .12s; }
.perf-row:last-child { border-bottom: 0; }
.perf-row:hover { background: #F8FAFD; }
.pr-main { flex: 1; min-width: 0; }
.pr-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pr-title b { font-size: 15px; }
.pr-chips { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; font-size: 12px; align-items: center; }
.objchip { background: var(--violet-soft); color: var(--violet); padding: 2px 9px; border-radius: 99px; font-weight: 600; }
.stchip { padding: 2px 9px; border-radius: 99px; font-weight: 600; font-size: 11.5px; }
.st-on { background: var(--green-soft); color: var(--green); } .st-off { background: #EEF0F4; color: #7A8296; } .st-warn { background: var(--amber-soft); color: var(--amber); }
.pr-why { margin-top: 7px; font-size: 13px; color: var(--v); font-weight: 600; }
.pr-stats { display: grid; grid-template-columns: repeat(4, minmax(92px, auto)); gap: 18px; }
.pr-stats small, .ad-stats small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }
.pr-stats b, .ad-stats b { font-size: 15px; white-space: nowrap; }
.pr-stats em { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 500; }
.pr-go svg { width: 18px; color: #B8C3DA; }
.cbar { position: relative; height: 6px; background: var(--bg); border-radius: 99px; margin-top: 6px; overflow: visible; }
.cbar i { display: block; height: 100%; border-radius: 99px; background: var(--v); }
.cbar b { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--navy-800); border-radius: 2px; }
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.ad-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; border-top: 4px solid var(--v); }
.ad-img { position: relative; aspect-ratio: 1.2; background: linear-gradient(135deg, #E9EEF7, #F6F8FC); }
.ad-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-img .vbadge { position: absolute; top: 10px; right: 10px; }
.ad-img .stchip { position: absolute; top: 12px; left: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.ad-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.ad-name { font-size: 15px; }
.ad-body > .sub { font-size: 12px; color: var(--muted); }
.ad-copy { font-size: 13px; color: var(--text); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 4px; padding: 10px; background: #F8FAFD; border-radius: 10px; }
.ad-body .pr-why { margin-top: auto; padding-top: 8px; }
.crumb { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px; background: var(--blue-soft); border-radius: 12px; color: var(--navy-700); font-size: 14px; }
.crumb > svg { width: 18px; }
.crumb span { flex: 1; }
.details-table summary { cursor: pointer; list-style: none; }
.details-table summary::-webkit-details-marker { display: none; }
.details-table summary::after { content: '▾'; margin-inline-start: 8px; color: var(--muted); }
.details-table[open] summary::after { content: '▴'; }

/* team activity */
.presence { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.presence::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #C5CCDA; }
.presence.on { color: var(--green); font-weight: 700; }
.presence.on::before { background: #22C55E; box-shadow: 0 0 0 3px rgba(34,197,94,.2); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(34,197,94,0); } }
.avatar.av-on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #22C55E; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 30px; }
.spark i { width: 7px; border-radius: 2px; background: #C8D4EE; }
.spark i.cur { background: var(--navy-800); }
table.act td, table.act th { white-space: nowrap; }
.ulog li .tx a { font-weight: 600; }

/* leads kind tabs */
.kind-tabs { display: flex; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.kind-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px 12px; color: var(--muted); font-weight: 600; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.kind-tabs a svg { width: 17px; height: 17px; }
.kind-tabs a:hover { color: var(--text); }
.kind-tabs a.on { color: var(--navy-800); border-bottom-color: var(--navy-800); }
.kt-n { background: var(--bg); color: var(--muted); font-size: 12px; padding: 1px 8px; border-radius: 99px; }
.kind-tabs a.on .kt-n { background: var(--navy-800); color: #fff; }
.kt-new { background: #E5383B; color: #fff; font-size: 11px; font-weight: 700; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; display: inline-grid; place-items: center; }

/* whatsapp */
.btn.wa, .btn.q-wa { background: #25D366; border-color: #25D366; color: #fff; }
.btn.wa:hover, .btn.q-wa:hover { background: #1EBE5A; }
.icon-btn.wa-icon { color: #1EAE55; }
.icon-btn.wa-icon:hover { background: #E7F8EE; color: #128C3E; }
.icon-btn.wa-icon span { display: none; }

/* notifications */
.bell { position: relative; }
.bell-dot { position: absolute; top: 0; left: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.notif-overlay { background: rgba(6,20,51,.18); }
.notif-panel { position: fixed; top: 0; bottom: 0; left: 0; width: min(400px, 100vw); background: #fff; z-index: 45; display: flex; flex-direction: column; box-shadow: 0 0 40px rgba(6,20,51,.18); animation: slide .2s ease-out; }
.n-head { display: flex; align-items: center; gap: 8px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.n-head h3 { margin: 0; font-size: 17px; flex: 1; }
.n-enable { display: flex; align-items: center; gap: 10px; margin: 12px 14px 0; padding: 10px 12px; background: var(--blue-soft); border-radius: 10px; font-size: 13px; color: var(--navy-700); }
.n-enable svg { width: 18px; flex: none; }
.n-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.n-item { display: flex; gap: 12px; padding: 12px 18px; cursor: pointer; border-bottom: 1px solid #F0F3F9; position: relative; }
.n-item:hover { background: #F7F9FD; }
.n-item.unread { background: #F3F7FF; }
.n-item.unread::after { content: ''; position: absolute; left: 14px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.n-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--bg); color: var(--muted); }
.n-ic svg { width: 17px; }
.n-lead { background: var(--blue-soft); color: var(--blue); }
.n-message { background: #E7F8EE; color: #128C3E; }
.n-followup { background: var(--amber-soft); color: var(--amber); }
.n-assigned { background: var(--violet-soft); color: var(--violet); }
.n-tx { flex: 1; min-width: 0; padding-inline-end: 14px; }
.n-tx b { display: block; font-size: 14px; }
.n-tx p { margin: 3px 0 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.n-tx small { color: var(--muted); font-size: 11px; }

/* follow-ups */
.fu-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--amber); background: var(--amber-soft); padding: 2px 8px; border-radius: 99px; }
.fu-chip svg { width: 12px; height: 12px; }
.fu-chip.late { color: var(--red); background: var(--red-soft); }
.fu-card { border-inline-start: 4px solid var(--amber); }
.fu-card.late { border-inline-start-color: var(--red); background: #FFFBFB; }
.fu-top { display: flex; align-items: center; gap: 8px; }
.fu-top svg { width: 18px; color: var(--amber); }
.fu-form { margin-top: 12px; }
.fu-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.fu-row { display: flex; gap: 8px; flex-wrap: wrap; }
.fu-row input[type=datetime-local] { width: auto; flex: 0 0 210px; }
.fu-row input[name=note] { flex: 1; min-width: 160px; }
.fu-line { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.fu-line:last-child { border-bottom: 0; }
.fu-line:hover { background: #F7F9FD; }
.fu-main { flex: 1; min-width: 0; }
.fu-main .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.fu-main .sub svg { width: 13px; }
.fu-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fu-group.late .card-h { background: var(--red-soft); }
.fu-group.late .card-h h3 { color: var(--red); }
.fu-group.today .card-h { background: var(--amber-soft); }

/* segmented control + campaigns */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { padding: 5px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.seg a.on { background: #fff; color: var(--navy-800); box-shadow: 0 1px 3px rgba(10,31,68,.1); }
a.card.kpi { color: inherit; display: block; transition: .15s; }
a.card.kpi:hover { border-color: #C8D4EE; transform: translateY(-1px); }
.legend { gap: 14px !important; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
table.camp td, table.camp th { white-space: nowrap; }
table.camp td:first-child { white-space: normal; min-width: 220px; }

#toasts { position: fixed; bottom: 22px; left: 22px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy-800); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); animation: fade .2s; font-weight: 500; max-width: 380px; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
.spin { width: 18px; height: 18px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

@media (max-width: 1100px) { .dash-grid, .set-grid { grid-template-columns: 1fr; } }
/* push prompt card */
.push-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--blue-soft); color: var(--navy-700); font-size: 13px; position: relative; }
.push-card > svg { width: 22px; height: 22px; flex: none; }
.push-card div { flex: 1; min-width: 0; }
.push-card b { display: block; font-size: 14px; color: var(--navy-800); margin-bottom: 2px; }
.push-card span { color: var(--navy-700); line-height: 1.7; }
.push-card.on { background: var(--green-soft); } .push-card.on > svg, .push-card.on b { color: var(--green); }
.push-card.warn { background: var(--amber-soft); } .push-card.warn b { color: var(--amber); }
.push-banner { padding: 14px 30px 0; }
.push-banner .push-card { padding-inline-end: 40px; }
.pb-close { position: absolute; top: 6px; left: 6px; }

/* mobile-only pieces (hidden on desktop) */
.bottom-nav, .side-overlay, .lead-cards { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 0 0 auto; width: 270px; z-index: 70; transform: translateX(100%); transition: transform .22s ease; padding-top: calc(22px + env(safe-area-inset-top)); }
  .sidebar.open { transform: none; box-shadow: -10px 0 40px rgba(6,20,51,.35); }
  .side-overlay { display: block; position: fixed; inset: 0; background: rgba(6,20,51,.4); z-index: 65; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .side-overlay.on { opacity: 1; pointer-events: auto; }
  .menu-btn { display: none; }

  /* compact top bar */
  .topbar { padding: calc(12px + env(safe-area-inset-top)) 16px 12px; gap: 10px; }
  .topbar h1 { font-size: 18px; }
  .topbar .sub { display: none; }
  .topbar .actions { gap: 6px; }
  .topbar .actions .btn { padding: 7px 10px; font-size: 13px; }
  .topbar .actions .btn span, #exportBtn { display: none; }
  .content { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  .push-banner { padding: 12px 12px 0; }

  /* bottom navigation like a native app */
  .bottom-nav { display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 20px rgba(10,31,68,.06); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 2px; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; border-radius: 10px; }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--navy-800); }
  .bottom-nav a.active svg { stroke-width: 2.4; }
  .bn-badge { position: absolute; top: 0; left: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #E5383B; color: #fff;
    font-size: 10px; font-weight: 700; font-style: normal; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }

  /* forms: 16px stops iOS from zooming into inputs */
  .input, select.input, textarea.input { font-size: 16px; }
  .filters { padding: 10px; gap: 8px; }
  .filters .search { min-width: 100%; }
  .filters .input { flex: 1 1 calc(50% - 8px); min-width: 0; }

  /* leads: cards instead of the wide table */
  .card:has(.lead-cards) .table-wrap { display: none; }
  .lead-cards { display: block; }
  .lead-card { padding: 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
  .lead-card:active { background: #F3F6FB; }
  .lead-card.unseen { background: #FFF8F8; }
  .lc-top { display: flex; align-items: center; gap: 10px; }
  .lc-main { flex: 1; min-width: 0; }
  .lc-main b { font-size: 15px; }
  .lc-main .sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
  .lc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 10px 0 0; font-size: 12.5px; }
  .lc-camp { color: var(--text); font-weight: 500; }
  .lc-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
  .lc-actions .btn { padding: 7px 12px; }
  .lc-owner { margin-inline-start: auto; font-size: 12px; color: var(--muted); }
  .lead-card .fu-chip { margin-top: 8px; }
  .kind-tabs { padding: 6px 6px 0; }
  .kind-tabs a { padding: 9px 10px 11px; font-size: 13px; gap: 6px; }
  .kind-tabs a svg { display: none; }
  .bulkbar { flex-wrap: wrap; }
  .pager { flex-direction: column; gap: 8px; }

  /* dashboard */
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
  .kpi { padding: 14px; }
  .kpi .lbl { font-size: 12px; }
  .kpi .val { font-size: 22px; }
  .dash-grid { gap: 12px; margin-bottom: 12px; }
  .card-h { padding: 14px 16px; }
  .card-b { padding: 14px 16px; }
  .t th, .t td { padding: 10px 12px; }

  /* lead drawer: full screen sheet */
  .drawer { width: 100vw; }
  .drawer-h { padding: calc(16px + env(safe-area-inset-top)) 16px 16px; }
  .drawer-h h2 { font-size: 18px; }
  .qualify { gap: 8px; }
  .qualify .btn { flex: 1 1 auto; justify-content: center; padding: 9px 10px; }
  .qualify select { flex: 1 1 100%; }
  .drawer-body { padding: 14px 12px calc(20px + env(safe-area-inset-bottom)); }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs button { white-space: nowrap; padding: 10px 12px; }
  .note-box { flex-wrap: wrap; }
  .note-box textarea { flex: 1 1 100%; order: -1; }
  .notif-panel { width: 100vw; padding-top: env(safe-area-inset-top); }
  .modal-wrap { align-items: end; padding: 0; }
  .modal { width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }

  .login { grid-template-columns: 1fr; } .login .art { display: none; }
  .inbox { grid-template-columns: 1fr; height: calc(100dvh - 150px - env(safe-area-inset-bottom)); }
  .conv-panel { display: none; } .inbox.has-sel .conv-list { display: none; } .inbox.has-sel .conv-panel { display: flex; }
  .conv-panel .head { padding: 10px 12px; flex-wrap: wrap; }
  .bubble { max-width: 88%; }
  .grid2, .perm-grid, .set-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .fu-line { flex-wrap: wrap; padding: 12px 14px; }
  .fu-actions { width: 100%; justify-content: flex-start; }
  .fu-row input[type=datetime-local] { flex: 1 1 100%; }
  .kanban { grid-auto-columns: 82vw; scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .verdict-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .vs { padding: 10px 12px; } .vs b { font-size: 20px; }
  .perf-row { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; }
  .pr-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pr-go { display: none; }
  .recs ul { padding: 4px 14px 10px; }
  #toasts { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
}
