:root {
  --navy: #2A2A69;
  --navy-2: #35357d;
  --sky: #009147;
  --gold: #b8913a;
  --bg: #f4f5fa;
  --card: #fff;
  --line: #e3e7ef;
  --text: #1d2433;
  --muted: #6b7489;
  --green: #1fa463;
  --red: #d64545;
  --orange: #e58a1f;
  --mine: #e3f4ea;
  --theirs: #fff;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Plex Ar', 'Mont', Tahoma, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: var(--sky); }

/* ---------- layout ---------- */
.shell { display: flex; height: 100vh; }
.side { width: 210px; background: var(--navy); color: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.brand { padding: 18px 16px; font-weight: 700; font-size: 17px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand small { display: block; font-weight: 400; color: var(--gold); font-size: 12px; }
.nav { flex: 1; padding: 8px; }
.nav button { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: #c8d3ea; padding: 10px 12px; border-radius: 8px; cursor: pointer; text-align: right; margin-bottom: 2px; }
.nav button:hover { background: var(--navy-2); color: #fff; }
.nav button.active { background: var(--sky); color: #fff; }
.nav .badge { margin-inline-start: auto; background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; }
.side-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.side-foot button { background: none; border: 0; color: #9fb0d3; cursor: pointer; padding: 2px 0; display: block; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page { padding: 20px 24px; overflow: auto; flex: 1; }
.page h2 { margin: 0 0 16px; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.page h2 .spacer { flex: 1; }

/* ---------- controls ---------- */
.btn { background: var(--navy); color: #fff; border: 0; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn:hover { filter: brightness(1.15); }
.btn.sky { background: var(--sky); }
.btn.gold { background: var(--gold); }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn.danger { background: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.input, select.input, textarea.input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.input:focus { outline: 2px solid var(--sky); border-color: transparent; }
label.f { display: block; margin-bottom: 12px; }
label.f span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

/* ---------- login ---------- */
.login { height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.login .card { width: 340px; padding: 28px; }
.login h1 { margin: 0 0 4px; font-size: 22px; color: var(--navy); }
.login p { margin: 0 0 20px; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }

/* ---------- status ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 10px; border-radius: 20px; background: #eef1f6; color: var(--muted); font-weight: 600; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.connected { background: #e3f6ec; color: var(--green); }
.status.qr, .status.connecting { background: #fff3e2; color: var(--orange); }
.status.disconnected, .status.logged_out { background: #fde9e9; color: var(--red); }

/* ---------- accounts ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.acc-card h3 { margin: 0 0 6px; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.acc-card .meta { font-size: 13px; color: var(--muted); margin: 8px 0 12px; line-height: 1.8; }
.acc-card .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.qr-box { text-align: center; }
.qr-box img { width: 280px; height: 280px; border: 8px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,.1); border-radius: 8px; }
.qr-steps { text-align: right; font-size: 13px; line-height: 2; color: var(--muted); }

/* ---------- inbox ---------- */
.inbox { display: flex; height: 100%; min-height: 0; }
.chatlist { width: 340px; border-inline-end: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.chatlist .tools { padding: 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.tabs { display: flex; gap: 4px; }
.tabs button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 0; cursor: pointer; font-size: 12px; }
.tabs button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chats { overflow-y: auto; flex: 1; }
.chat-item { padding: 10px 12px; border-bottom: 1px solid #f0f2f6; cursor: pointer; display: flex; gap: 10px; }
.chat-item:hover { background: #f6f8fc; }
.chat-item.active { background: #e8f4fd; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--navy-2); color: #fff; display: grid; place-items: center; flex-shrink: 0; font-weight: 700; }
.avatar.g { background: var(--gold); }
.chat-item .body { flex: 1; min-width: 0; }
.chat-item .top { display: flex; justify-content: space-between; gap: 6px; }
.chat-item .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.chat-item .last { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .acc { font-size: 11px; color: var(--sky); }
.chat-item .waiting { color: var(--orange); font-weight: 600; }
.chatview { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #eef1f5; }
.chat-head { background: #fff; padding: 10px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-head .t { font-weight: 700; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 6%; display: flex; flex-direction: column; gap: 4px; }
.day-sep { align-self: center; background: #dfe5ee; color: var(--muted); font-size: 12px; padding: 2px 12px; border-radius: 10px; margin: 10px 0; }
.msg { max-width: 70%; padding: 6px 10px 4px; border-radius: 10px; box-shadow: 0 1px 1px rgba(0,0,0,.06); word-wrap: break-word; line-height: 1.6; }
.msg.in { align-self: flex-start; background: var(--theirs); border-start-start-radius: 2px; }
.msg.out { align-self: flex-end; background: var(--mine); border-start-end-radius: 2px; }
.msg .txt { white-space: pre-wrap; }
.msg .sender { font-size: 12px; color: var(--sky); font-weight: 600; }
.msg .info { font-size: 11px; color: var(--muted); display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; white-space: normal; }
.msg .tag { background: var(--gold); color: #fff; border-radius: 4px; padding: 0 5px; }
.msg .tag.phone { background: #8a96ad; }
.msg.deleted { border: 1px dashed var(--red); }
.msg .del { color: var(--red); font-size: 12px; font-weight: 600; }
.msg .orig { font-size: 12px; color: var(--muted); border-inline-start: 3px solid var(--gold); padding-inline-start: 6px; margin-bottom: 4px; }
.msg img.media, .msg video.media { max-width: 280px; max-height: 300px; border-radius: 6px; display: block; cursor: pointer; }
.msg audio { max-width: 260px; }
.msg .file { display: inline-flex; gap: 6px; align-items: center; background: rgba(0,0,0,.04); padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
.load-media { background: none; border: 1px dashed var(--muted); border-radius: 6px; padding: 6px 10px; cursor: pointer; color: var(--muted); }
.composer { background: #fff; padding: 10px; display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; max-height: 140px; }
.composer .attach { cursor: pointer; font-size: 20px; padding: 4px 8px; }
.composer .file-chip { font-size: 12px; background: #eef1f6; padding: 2px 8px; border-radius: 10px; }
.readonly-note { background: #fff8e8; color: #8a6514; text-align: center; padding: 8px; font-size: 13px; }
.empty { display: grid; place-items: center; height: 100%; color: var(--muted); text-align: center; }
.search-results .chat-item .last mark { background: #ffe58a; }

/* ---------- tables ---------- */
table.t { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
table.t th, table.t td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { background: #f6f8fc; font-size: 13px; color: var(--muted); font-weight: 600; }
table.t tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; background: #eef1f6; border-radius: 12px; padding: 1px 8px; font-size: 12px; margin: 1px; }
.pill.ro { background: #fff3e2; }

/* ---------- reports ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpi .v { font-size: 24px; font-weight: 700; color: var(--navy); }
.kpi .l { font-size: 13px; color: var(--muted); }
.good { color: var(--green); } .bad { color: var(--red); } .warn { color: var(--orange); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding: 10px 0; overflow-x: auto; }
.bar-day { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 34px; }
.bar-pair { display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.bar { width: 12px; border-radius: 3px 3px 0 0; }
.bar.r { background: var(--sky); } .bar.s { background: var(--gold); }
.bar-day small { font-size: 10px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 4px; }
.section { margin-bottom: 22px; }
.section h3 { font-size: 16px; margin: 0 0 10px; }

/* ---------- modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10,20,40,.45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 12px; padding: 22px; width: 480px; max-width: 100%; max-height: 90vh; overflow: auto; }
.modal h3 { margin: 0 0 16px; }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.acc-assign { border: 1px solid var(--line); border-radius: 8px; max-height: 220px; overflow: auto; }
.acc-assign label { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #f0f2f6; }
.acc-assign label .r { margin-inline-start: auto; font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; }
#toast div { background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 8px; margin-top: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
#toast div.e { background: var(--red); }

.mobile-back { display: none; }
@media (max-width: 860px) {
  .side { width: 60px; }
  .brand small, .nav button span, .side-foot { display: none; }
  .brand { font-size: 0; padding: 14px; } .brand::after { content: '💬'; font-size: 22px; }
  .chatlist { width: 100%; }
  .inbox.has-chat .chatlist { display: none; }
  .inbox:not(.has-chat) .chatview { display: none; }
  .mobile-back { display: inline-block; }
  .page { padding: 14px; }
  .msg { max-width: 88%; }
}

/* sidebar accounts quick switch */
.nav { overflow-y: auto; }
.side-accs { margin-top: 10px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 8px; }
.side-title { font-size: 11px; color: var(--gold); padding: 4px 12px 6px; letter-spacing: .3px; }
.side-acc { width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: 0; color: #c8d3ea; padding: 7px 12px; border-radius: 8px; cursor: pointer; text-align: right; font-size: 13px; }
.side-acc span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-acc:hover { background: var(--navy-2); color: #fff; }
.side-acc.active { background: rgba(58,160,224,.25); color: #fff; }
.side-empty { font-size: 12px; color: #7f8fb3; padding: 4px 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot.on { background: #2ecc71; box-shadow: 0 0 0 3px rgba(46,204,113,.2); }
.dot.wait { background: var(--orange); }
.dot.off { background: var(--red); }
.dot.all { background: var(--gold); }
.sec-ok { font-size: 11px; color: #6fdc9c; margin: 4px 0; }
.sec-warn { font-size: 11px; color: #ffb35c; margin: 4px 0; }
.input.otp { text-align: center; font-size: 22px; letter-spacing: 8px; direction: ltr; }
@media (max-width: 860px) { .side-accs .side-title, .side-acc span { display: none; } .side-acc { justify-content: center; } }

/* ================= CRM ================= */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 14px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--navy); color: #fff; }
.crm-filters { margin-bottom: 12px; }
.kpis.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpis.small .kpi { padding: 10px 12px; }
.kpis.small .kpi .v { font-size: 20px; }
.kpi .v2 { font-weight: 700; font-size: 13px; color: var(--navy); margin-top: 2px; }
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; min-height: 60vh; }
.col { min-width: 240px; width: 240px; background: #e9edf3; border-radius: 10px; flex-shrink: 0; display: flex; flex-direction: column; max-height: 74vh; }
.col.won, .col.lost { min-width: 200px; width: 200px; opacity: .92; }
.col.over { outline: 2px dashed var(--sky); background: #e1effa; }
.col-h { padding: 10px 12px; border-top: 4px solid; border-radius: 10px 10px 0 0; background: #f5f7fb; display: flex; justify-content: space-between; gap: 6px; font-size: 13px; }
.col-b { padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.empty-col { text-align: center; color: var(--muted); padding: 14px; }
.card-c { background: #fff; border-radius: 8px; padding: 9px 10px; box-shadow: 0 1px 2px rgba(0,0,0,.08); cursor: pointer; border: 1px solid transparent; }
.card-c:hover { border-color: var(--sky); }
.card-c.drag { opacity: .4; }
.card-c .cn { font-weight: 700; }
.card-c .cs { font-size: 12px; color: var(--muted); }
.card-c .cm { display: flex; gap: 8px; font-size: 12px; margin-top: 4px; flex-wrap: wrap; }
.card-c .co { font-size: 12px; color: var(--sky); margin-top: 3px; }
.flag { display: inline-block; font-size: 11px; border-radius: 4px; padding: 0 5px; margin: 3px 3px 0 0; font-weight: 600; }
.flag.red { background: #fde9e9; color: var(--red); } .flag.orange { background: #fff3e2; color: var(--orange); } .flag.gold { background: #fbf3df; color: #8a6514; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.modal.wide { width: 820px; }
.contact-page .c-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.status-pill { font-size: 12px; padding: 2px 10px; border-radius: 12px; vertical-align: middle; background: #e8f4fd; color: var(--sky); }
.status-pill.won { background: #e3f6ec; color: var(--green); } .status-pill.lost { background: #fde9e9; color: var(--red); }
.stages-line { display: flex; flex-wrap: wrap; gap: 4px; }
.stages-line .st { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 4px 11px; cursor: pointer; font-size: 12px; }
.stages-line .st:hover { border-color: var(--c); }
.stages-line .st.cur { background: var(--c); color: #fff; border-color: var(--c); font-weight: 700; }
.c-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.c-grid > div > .card { margin-bottom: 14px; }
.ch { margin: 0 0 10px; font-size: 15px; }
.act-tabs button { font-size: 12px; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #f0f2f6; }
.task:last-child { border-bottom: 0; }
.task input { margin-top: 4px; }
.task.done > div { text-decoration: line-through; opacity: .6; }
.task.late { color: var(--red); }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 3px 10px; cursor: pointer; font-size: 12px; }
.timeline-card { position: sticky; top: 10px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.timeline { overflow-y: auto; flex: 1; margin-top: 8px; }
.tl { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #e8ebf1; }
.tl-i { width: 30px; height: 30px; border-radius: 50%; background: #eef1f6; display: grid; place-items: center; flex-shrink: 0; }
.tl.msg.in .tl-i { background: #e3f6ec; } .tl.msg.out .tl-i { background: #e8f4fd; }
.tl-b { flex: 1; min-width: 0; }
.tl-h { font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tl-t { margin-inline-start: auto; font-size: 11px; color: var(--muted); direction: ltr; white-space: nowrap; }
.tl-x { white-space: pre-wrap; font-size: 13px; color: #3b4357; margin-top: 2px; word-wrap: break-word; }
.hbar { display: grid; grid-template-columns: 150px 1fr 40px; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }
.hbar div { background: #eef1f6; border-radius: 4px; height: 14px; overflow: hidden; }
.hbar i { display: block; height: 100%; border-radius: 4px; }
fieldset.fs { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 10px 0; }
fieldset.fs legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
.days { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; margin-bottom: 8px; }
.att-badge { font-size: 12px; color: #c8d3ea; margin: 6px 0; line-height: 1.6; }
.att-card .meta { font-size: 13px; color: var(--muted); line-height: 1.9; margin-top: 6px; }
.att-card.in { border-inline-start: 4px solid var(--green); } .att-card.late_in { border-inline-start: 4px solid var(--orange); }
.att-card.absent, .att-card.forgot, .att-card.missing { border-inline-start: 4px solid var(--red); }
.shift-alert { text-align: center; }
.shift-alert h3 { color: var(--red); } .shift-alert.soon h3 { color: var(--orange); }
.steps { line-height: 2; font-size: 13px; padding-inline-start: 20px; }
.steps code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; direction: ltr; display: inline-block; }
tr.waived td { opacity: .55; }
.crm-link { white-space: nowrap; }
@media (max-width: 1100px) { .c-grid { grid-template-columns: 1fr; } .timeline-card { position: static; max-height: 70vh; } }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
@media print { .side, .seg, .btn, #mm, .crm-filters { display: none !important; } .shell { display: block; } .page { overflow: visible; } }

/* ================= Accounting ================= */
.seg.wrap { flex-wrap: wrap; }
.dpill { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #eef1f6; white-space: nowrap; }
.dpill.good { background: #e3f6ec; color: var(--green); } .dpill.warn { background: #fff3e2; color: var(--orange); }
.dpill.bad { background: #fde9e9; color: var(--red); } .dpill.sky { background: #e8f4fd; color: var(--sky); } .dpill.muted { color: var(--muted); }
tr.click { cursor: pointer; } tr.click:hover td { background: #f6f9fd; }
.t tfoot td { font-weight: 700; background: #f5f7fb; }
.rowline { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #e8ebf1; font-size: 14px; }
.rowline.tot { border-bottom: 0; border-top: 2px solid var(--navy); font-size: 16px; margin-top: 4px; }
.rowline.click { cursor: pointer; } .rowline.click:hover { background: #f6f9fd; }
.tots { background: #f8fafd; border-radius: 8px; padding: 8px 14px; align-self: start; }
.t.items td { padding: 4px; } .t.items .input { padding: 6px 8px; }
.cpick select { margin-top: 4px; height: auto; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding: 6px 0; }
.bcol { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bpair { flex: 1; width: 100%; display: flex; align-items: flex-end; gap: 2px; justify-content: center; }
.bpair i { width: 42%; border-radius: 3px 3px 0 0; min-height: 1px; display: block; }
.bpair i.r, .lg.r { background: var(--green); } .bpair i.e, .lg.e { background: #f08a8a; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.bcol small { font-size: 10px; color: var(--muted); margin-top: 3px; }
.input.num { width: 95px; padding: 5px 6px; }
tr.grp td { font-weight: 700; background: #f5f7fb; }
.t.fin tr.sec td { background: #eef3fa; font-weight: 700; color: var(--navy); }
.t.fin tr.sub td { font-weight: 700; border-top: 1px solid #cfd6e3; }
.t.fin tr.grand td { font-weight: 800; font-size: 15px; border-top: 2px solid var(--navy); }
.t.fin td:not(:first-child), .t.fin th:not(:first-child) { text-align: left; direction: ltr; }
.rep-head { text-align: center; margin-bottom: 12px; } .rep-head h2, .rep-head h3 { margin: 2px 0; }
.pgroup { border-bottom: 1px dashed #e3e7ee; padding: 4px 0 6px; } .pgroup b { font-size: 13px; color: var(--navy); }
.doc-print { background: #fff; color: #111; padding: 18px 22px; border: 1px solid var(--line); border-radius: 8px; }
.dp-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--navy); padding-bottom: 10px; margin-bottom: 12px; }
.dp-head h2 { margin: 0 0 4px; color: var(--navy); } .dp-title { text-align: left; } .dp-title h1 { margin: 0; color: var(--sky); font-size: 26px; }
.dp-to { background: #f5f7fb; padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; }
.dp-items tr.sec td { background: #eef3fa; font-weight: 700; font-size: 13px; }
.dp-tot { max-width: 340px; margin-inline-start: auto; margin-top: 8px; }
.dp-notes { margin-top: 12px; font-size: 13px; line-height: 1.7; }
.dp-sign { display: flex; justify-content: space-between; margin-top: 40px; font-size: 13px; color: #555; }
.dp-sign div { border-top: 1px solid #999; padding-top: 6px; min-width: 180px; text-align: center; }
.vbox { max-width: 560px; margin: 10px auto; }
.slip { margin-bottom: 18px; page-break-after: always; }
#printArea { display: none; }
@media print {
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing #printArea { display: block !important; }
  #printArea .doc-print { border: 0; padding: 0; }
  @page { margin: 14mm; }
}

/* =====================================================================
   Sambridge identity layer — indigo #2A2A69 · green #009147
   IBM Plex Sans Arabic + Montserrat (self-hosted), soft surfaces, glass accents
   ===================================================================== */
@font-face { font-family: 'Plex Ar'; src: url(/fonts/plex-ar-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex Ar'; src: url(/fonts/plex-ar-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Plex Ar'; src: url(/fonts/plex-ar-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Plex Ar'; src: url(/fonts/plex-ar-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Mont'; src: url(/fonts/mont-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Mont'; src: url(/fonts/mont-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Mont'; src: url(/fonts/mont-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Mont'; src: url(/fonts/mont-800.woff2) format('woff2'); font-weight: 800; font-display: swap; }
:root {
  --ind: #2A2A69; --ind-d: #1b1b4b; --ind-dd: #13133a; --grn: #009147; --grn-d: #007a3c; --grn-l: #e6f5ec; --ind-l: #ececf7;
  --radius: 14px; --sh-1: 0 1px 2px rgba(25, 25, 70, .05), 0 1px 3px rgba(25, 25, 70, .06); --sh-2: 0 10px 30px -10px rgba(25, 25, 80, .22);
  --line: #e6e7f0; --text: #1e1e3a; --muted: #6e7090; --ease: cubic-bezier(.2, .8, .2, 1);
}
body { background: radial-gradient(1200px 600px at 100% -10%, #eceefb 0, transparent 60%), radial-gradient(900px 500px at -10% 110%, #e9f6ef 0, transparent 55%), var(--bg); background-attachment: fixed; }
.en, .num, input[type=number], .kpi .v, .t td b { font-variant-numeric: tabular-nums; }
.en { font-family: 'Mont', 'Plex Ar', sans-serif; }
::selection { background: rgba(0, 145, 71, .18); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #cdd0e2; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #aeb2cf; }

/* sidebar */
.side { width: 236px; background: linear-gradient(180deg, var(--ind) 0%, var(--ind-d) 55%, var(--ind-dd) 100%); position: relative; overflow: hidden; box-shadow: -1px 0 0 rgba(255,255,255,.04) inset; }
.side::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70' viewBox='0 0 70 70'%3E%3Cpath d='M35 2 68 35 35 68 2 35Z' fill='none' stroke='%23fff'/%3E%3C/svg%3E"); background-size: 70px 70px; }
.side::after { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(0, 145, 71, .35), transparent 65%); bottom: -120px; inset-inline-start: -110px; pointer-events: none; }
.side > * { position: relative; z-index: 1; }
.brand { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 6px; font-size: 0; }
.brand img.full { height: 34px; width: auto; display: block; align-self: flex-start; } .brand img.mk { display: none; height: 30px; }
.brand small { color: #9fe0bd; font-family: 'Mont'; font-size: 9.5px; letter-spacing: .12em; white-space: nowrap; text-transform: uppercase; font-weight: 600; }
.nav { padding: 10px; }
.nav button { color: #c9cbe8; padding: 10px 12px; border-radius: 10px; font-weight: 500; transition: background .2s var(--ease), color .2s, transform .2s var(--ease); position: relative; }
.nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav button.active { background: linear-gradient(90deg, rgba(0,145,71,.95), rgba(0,145,71,.75)); color: #fff; box-shadow: 0 8px 18px -8px rgba(0, 145, 71, .7); }
[dir=rtl] .nav button.active { background: linear-gradient(-90deg, rgba(0,145,71,.95), rgba(0,145,71,.75)); }
.side-title { color: #9fe0bd; }
.side-acc { color: #c9cbe8; border-radius: 10px; }
.side-acc:hover { background: rgba(255,255,255,.07); }
.side-acc.active { background: rgba(0, 145, 71, .28); }
.side-foot { border-top: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.12); }
.side-foot > div:first-child { font-weight: 700; color: #fff; }
.side-foot button { color: #a9abd0; font-size: 12.5px; transition: color .2s; } .side-foot button:hover { color: #fff; }
.dot.all { background: #9fe0bd; }

/* page */
.page { padding: 26px 30px; }
.page h2 { font-size: 22px; font-weight: 700; color: var(--ind); letter-spacing: -.2px; }
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.phead h2 { margin: 0 !important; }
.phead p { margin: 4px 0 0; font-size: 13px; }
.card { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--sh-1); }
.ch { color: var(--ind); font-weight: 700; }

/* controls */
.btn { background: var(--ind); border-radius: 10px; font-weight: 600; padding: 9px 16px; transition: transform .15s var(--ease), box-shadow .2s, filter .2s; box-shadow: 0 1px 2px rgba(20,20,60,.15); }
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.sky { background: linear-gradient(180deg, #05a253, var(--grn)); box-shadow: 0 6px 16px -8px rgba(0,145,71,.8); }
.btn.gold { background: linear-gradient(180deg, #34348a, var(--ind)); }
.btn.ghost { background: #fff; color: var(--ind); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: #c7c9e2; background: #fafaff; filter: none; }
.btn.danger { background: #d64545; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
a.btn { text-decoration: none; display: inline-block; }
.input, select.input, textarea.input { border-radius: 10px; border-color: #dfe0ec; padding: 9px 12px; transition: border-color .2s, box-shadow .2s; }
.input:hover { border-color: #c9cbe0; }
.input:focus { outline: none; border-color: var(--grn); box-shadow: 0 0 0 4px rgba(0, 145, 71, .14); }
label.f span { font-weight: 500; color: #5c5e80; }
.seg { border-radius: 12px; padding: 3px; gap: 2px; background: #fff; border-color: var(--line); box-shadow: var(--sh-1); }
.seg button { border-radius: 9px; padding: 7px 14px; transition: background .2s, color .2s; font-weight: 600; }
.seg button:hover { color: var(--ind); }
.seg button.on { background: var(--ind); color: #fff; box-shadow: 0 4px 12px -6px rgba(42,42,105,.8); }
.seg.sm button { padding: 5px 12px; font-size: 13px; }
.chip { border-radius: 20px; font-family: 'Mont', 'Plex Ar'; font-weight: 600; color: var(--ind); background: var(--ind-l); border-color: transparent; cursor: default; }

/* tables */
table.t { border-radius: var(--radius); box-shadow: var(--sh-1); border-color: var(--line); }
table.t th { background: #f7f7fc; color: #5c5e80; font-weight: 600; font-size: 12.5px; border-bottom-color: var(--line); }
table.t td { border-bottom-color: #eff0f6; }
tr.click:hover td { background: #f7faf8; }
.t tfoot td { background: #f7f7fc; }

/* KPIs */
.kpis { gap: 14px; }
.kpi { border-radius: var(--radius); box-shadow: var(--sh-1); border-color: var(--line); position: relative; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s; }
.kpi::after { content: ''; position: absolute; top: 0; inset-inline-start: 14px; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--grn); opacity: .8; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.kpi .v { color: var(--ind); font-family: 'Mont', 'Plex Ar'; font-weight: 700; font-size: 23px; letter-spacing: -.3px; }
.kpi .l { font-weight: 500; }
button.kpi { text-align: start; cursor: pointer; font: inherit; }
.kpi.kbtn.on { border-color: var(--grn); box-shadow: 0 0 0 3px rgba(0,145,71,.14); }
.good { color: var(--grn); } .kpi .v.good { color: var(--grn); }

/* pills */
.dpill { border-radius: 20px; padding: 3px 10px; font-weight: 600; font-size: 11.5px; }
.dpill.good { background: var(--grn-l); color: var(--grn-d); } .dpill.sky { background: var(--ind-l); color: var(--ind); }
.status.connected { background: var(--grn-l); color: var(--grn-d); }

/* modal */
.modal-bg { background: rgba(19, 19, 58, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .18s ease; }
.modal { border-radius: 18px; padding: 24px 26px; box-shadow: 0 30px 80px -20px rgba(19,19,58,.55); animation: pop .22s var(--ease); }
.modal h3 { color: var(--ind); font-size: 18px; }
.modal.wide.xl { width: 1080px; }
.mhead { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; } .mhead h3 { margin: 0; }
@keyframes fadeIn { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
#toast div { background: var(--ind); border-radius: 12px; box-shadow: 0 12px 30px -10px rgba(19,19,58,.6); animation: pop .25s var(--ease); }

/* doc form */
.fgrid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 14px; }
.fsec { background: #fafaff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 4px; }
.fsec h4 { margin: 0 0 8px; font-size: 13px; color: var(--grn); display: flex; align-items: center; gap: 6px; }
.fsec h4::before { content: ''; width: 6px; height: 6px; background: var(--grn); transform: rotate(45deg); }
.fsec .grid2 { gap: 0 10px; }
.sec-t { margin: 16px 0 8px; font-weight: 700; color: var(--ind); display: flex; align-items: center; gap: 8px; }
.sec-t::before { content: ''; width: 7px; height: 7px; background: var(--grn); transform: rotate(45deg); }
.itbl { overflow-x: auto; }
.t.items tr.govrow td { background: #f4fbf7; }
.tots { background: linear-gradient(180deg, #f7f7fd, #f2f3fb); border: 1px solid var(--line); border-radius: 14px; }
.rowline.tot { border-top-color: var(--ind); }
.rowline b { font-family: 'Mont', 'Plex Ar'; }
.dtool { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; position: sticky; top: -24px; background: #fff; padding: 6px 0 10px; z-index: 5; border-bottom: 1px solid var(--line); }
@media (max-width: 1000px) { .fgrid { grid-template-columns: 1fr; } }

/* client files */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.file { padding: 14px 16px; position: relative; transition: transform .2s var(--ease), box-shadow .2s; }
.file::before { content: ''; position: absolute; top: -1px; inset-inline-end: 18px; width: 46px; height: 3px; background: var(--ind); border-radius: 0 0 3px 3px; }
.file:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.file .fh { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.file .fh b { color: var(--ind); font-size: 14px; letter-spacing: .3px; }
.file .nm { font-weight: 700; font-size: 15px; margin-top: 2px; }
.file .fz { font-size: 12.5px; margin-top: 6px; }
.file .fd { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.dchip { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; transition: all .2s; font-family: inherit; }
.dchip:hover { border-color: var(--grn); color: var(--grn-d); background: var(--grn-l); }
.dchip.void { text-decoration: line-through; opacity: .55; }
.file .fm { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px; }
.file .fm small { display: block; color: var(--muted); font-size: 11px; }
.file .fm b { font-family: 'Mont', 'Plex Ar'; font-size: 13px; }
.file .bar { height: 5px; background: #eef0f6; border-radius: 5px; margin-top: 10px; overflow: hidden; width: auto; }
.file .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--grn), #3fc483); border-radius: 5px; }
.zone { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; background: #fcfcff; }
.zone summary { cursor: pointer; }
.zrow { display: grid; grid-template-columns: 1.4fr 1fr 90px 90px 34px; gap: 6px; margin-bottom: 6px; }
label.f.full { grid-column: 1 / -1; }

/* login */
.login { position: relative; overflow: hidden; background: radial-gradient(900px 600px at 85% 10%, rgba(0,145,71,.35), transparent 60%), linear-gradient(140deg, var(--ind-dd), var(--ind) 55%, #22225c); }
.login::before { content: ''; position: absolute; inset: 0; opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M60 4 116 60 60 116 4 60Z' fill='none' stroke='%23fff'/%3E%3Ccircle cx='60' cy='60' r='20' fill='none' stroke='%23fff'/%3E%3C/svg%3E"); background-size: 120px; }
.login::after { content: ''; position: absolute; width: 520px; height: 520px; inset-inline-start: -160px; bottom: -200px; background: url(/img/mark-white.png) no-repeat center / contain; opacity: .06; }
.login .card { width: 390px; padding: 34px 32px 28px; position: relative; z-index: 1; border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 22px; box-shadow: 0 40px 90px -30px rgba(0,0,0,.6); animation: pop .35s var(--ease); }
.login .lg-logo { height: 46px; display: block; margin: 0 auto 18px; }
.login h1 { text-align: center; font-size: 20px; color: var(--ind); }
.login p { text-align: center; }
.login .tagline { position: absolute; bottom: 24px; inset-inline: 0; text-align: center; color: rgba(255,255,255,.55); font-family: 'Mont'; letter-spacing: .3em; font-size: 11px; z-index: 1; }

/* chat / CRM refresh */
.avatar { background: linear-gradient(135deg, var(--ind), #4a4aa0); }
.avatar.g { background: linear-gradient(135deg, var(--grn), #2bb871); }
.chat-item.active { background: var(--grn-l); box-shadow: inset -3px 0 0 var(--grn); }
.chat-item:hover { background: #f7f7fc; }
.chatview { background: #f1f2f8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M30 4 56 30 30 56 4 30Z' fill='none' stroke='%232A2A69' stroke-opacity='.04'/%3E%3C/svg%3E"); }
.msg { border-radius: 12px; }
.tabs button.active { background: var(--ind); border-color: var(--ind); }
.col { background: #eceef6; border-radius: 14px; }
.col-h { background: #f8f8fd; border-radius: 14px 14px 0 0; font-weight: 600; }
.card-c { border-radius: 12px; box-shadow: var(--sh-1); transition: transform .15s var(--ease), box-shadow .2s, border-color .2s; }
.card-c:hover { border-color: var(--grn); transform: translateY(-1px); box-shadow: var(--sh-2); }
.card-c .co { color: var(--grn-d); }
.msg .sender, .chat-item .acc { color: var(--grn-d); }
.stages-line .st { border-radius: 20px; }

/* public share page */
.pub { min-height: 100vh; background: #e9e9f1; padding: 0 0 30px; }
.pub-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: rgba(42,42,105,.96); color: #fff; backdrop-filter: blur(8px); margin-bottom: 20px; }
.pub-bar img { height: 26px; }
.pub-bar span { flex: 1; font-size: 13px; opacity: .85; }
@media (max-width: 900px) { .pub .sbd { zoom: .46; } }

@media (max-width: 860px) {
  .side { width: 64px; }
  .brand img.full { display: none; } .brand img.mk { display: block; margin: 0 auto; } .brand::after { content: none; }
  .page { padding: 16px; }
  .modal { padding: 18px; }
}
@media print { body { background: #fff !important; } }

/* ================= v5: CRM journey, board grid, stepper, scores ================= */
.qchips { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 12px; }
.qchip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; color: #4a4c6a; transition: all .15s; }
.qchip:hover { border-color: var(--grn); }
.qchip.on { background: var(--ind); border-color: var(--ind); color: #fff; }
.journey { display: flex; gap: 4px; margin-bottom: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: var(--sh-1); }
.jstep { flex: 1 1 0; min-width: 0; position: relative; border: 0; background: #f6f7fb; border-radius: 9px; padding: 7px 6px 9px; cursor: pointer; font: inherit; text-align: center; overflow: hidden; transition: background .15s, transform .15s; }
.jstep:hover, .jstep.over { background: #eef0fb; transform: translateY(-1px); }
.jstep .jn { display: block; font-family: 'Mont', 'Plex Ar'; font-weight: 700; font-size: 15px; color: var(--c); line-height: 1.1; }
.jstep .jl { display: block; font-size: 11px; color: #4a4c6a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.jstep i { position: absolute; bottom: 0; inset-inline-start: 0; height: 3px; background: var(--c); border-radius: 3px; }
.jstep.won { background: var(--grn-l); } .jstep.lost { background: #fdf0f0; }
.board.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; overflow: visible; min-height: 0; padding: 0; }
.board.grid .col { min-width: 0; width: auto; max-height: 420px; }
.board.grid .col-h { border-top: 3px solid var(--c); padding: 8px 10px; }
.board.grid .col-h b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: 12.5px; }
.col.flash { box-shadow: 0 0 0 3px var(--grn); }
.card-c { padding: 8px 9px; }
.card-c .ctop { display: flex; align-items: center; gap: 6px; }
.card-c .av { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--ind), #4a4aa0); color: #fff; display: grid; place-items: center; font-size: 11px; flex-shrink: 0; }
.card-c .cn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.card-c .cs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score { display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 5px; border-radius: 10px; font: 700 11px 'Mont', sans-serif; vertical-align: middle; }
.score.hot { background: #e6f5ec; color: #007a3c; } .score.warm { background: #fff3e2; color: #b26a00; } .score.cold { background: #eef0f6; color: #6e7090; }
h2 .score { font-size: 12px; height: 22px; }
.stepper { display: flex; gap: 0; width: 100%; background: #f6f7fb; border-radius: 12px; padding: 4px; }
.stepper .sp { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; cursor: pointer; padding: 6px 2px; border-radius: 9px; font: inherit; position: relative; }
.stepper .sp::before { content: ''; position: absolute; top: 17px; inset-inline-start: -50%; width: 100%; height: 2px; background: #dfe1ec; z-index: 0; }
.stepper .sp:first-child::before { display: none; }
.stepper .sp.past::before, .stepper .sp.cur::before { background: var(--grn); }
.stepper .dot { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid #d4d6e4; display: grid; place-items: center; font: 700 11px 'Mont', sans-serif; color: #8a8ca6; z-index: 1; transition: all .15s; }
.stepper .sp.past .dot { background: var(--grn); border-color: var(--grn); color: #fff; }
.stepper .sp.cur .dot { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
.stepper .nm { font-size: 10.5px; color: #6e7090; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.stepper .sp.cur .nm { color: var(--ind); font-weight: 700; }
.stepper .sp:hover { background: #fff; }
.stepper .sp:hover .dot { border-color: var(--c); }
@media (max-width: 860px) { .stepper .nm { display: none; } .journey .jl { font-size: 9.5px; } }

/* ================= v5: connect accounts ================= */
.connect-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.ccard { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--sh-1); }
.ccard .ci { font-size: 28px; width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; background: var(--grn-l); }
.ccard.fb .ci { background: #eef1fc; font-size: 20px; }
.ccard h3 { margin: 0 0 4px; color: var(--ind); font-size: 16px; }
.ccard p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.ccard ol { margin: 0 0 12px; padding-inline-start: 18px; font-size: 12.5px; color: #4a4c6a; line-height: 1.9; }
.wiz-steps { display: flex; gap: 6px; margin-bottom: 14px; }
.wiz-steps span { flex: 1; text-align: center; font-size: 12px; padding: 7px; border-radius: 10px; background: #f3f4f9; color: var(--muted); }
.wiz-steps span.on { background: var(--ind); color: #fff; } .wiz-steps span.done { background: var(--grn-l); color: var(--grn-d); }
details.wiz { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; background: #fafaff; }
details.wiz summary { cursor: pointer; }
.copyrow { display: flex; gap: 6px; margin: 6px 0; } .copyrow .input { font-size: 12px; }
.wiz-go { text-align: center; padding: 14px; border: 1px dashed #c9cbe0; border-radius: 14px; margin-bottom: 12px; }
.btn.fbbtn { background: #1877f2; padding: 11px 26px; font-size: 15px; }
.pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.pick { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; flex-wrap: wrap; }
.pick .pp { width: 40px; height: 40px; border-radius: 10px; overflow: hidden; background: #eef1fc; display: grid; place-items: center; }
.pick .pp img { width: 100%; height: 100%; object-fit: cover; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; } .chk.dis { opacity: .5; }
@media (max-width: 900px) { .connect-cards { grid-template-columns: 1fr; } }

/* ================= v5: AI co-pilot panel ================= */
.chatview.with-ai { flex-direction: row; }
.chatview .chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ai-panel { width: 360px; flex-shrink: 0; background: #fff; border-inline-start: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ai-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; background: linear-gradient(135deg, #f5f5ff, #eefaf3); }
.ai-head b { color: var(--ind); flex: 1; }
.ai-body { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-actions button { font-size: 12px; }
.ai-sec h5 { margin: 0 0 6px; font-size: 12.5px; color: var(--grn-d); display: flex; align-items: center; gap: 6px; }
.ai-tags { display: flex; flex-wrap: wrap; gap: 5px; font-size: 12px; }
.ai-tags span { background: #f3f4f9; border-radius: 8px; padding: 2px 8px; }
.ai-tags .t-hot { background: #e6f5ec; color: #007a3c; } .ai-tags .t-warm { background: #fff3e2; color: #b26a00; } .ai-tags .t-cold { background: #eef0f6; }
.ai-tips { margin: 0; padding-inline-start: 18px; font-size: 12.5px; line-height: 1.8; color: #3d3f5c; }
.ai-reply { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fcfcff; }
.ai-reply .lb { font-size: 11.5px; font-weight: 700; color: var(--ind); }
.ai-reply .why { font-size: 11px; color: var(--muted); margin: 2px 0 6px; }
.ai-reply .tx { white-space: pre-wrap; font-size: 13px; line-height: 1.7; background: #fff; border-radius: 8px; padding: 8px; border: 1px dashed #e0e2ee; }
.ai-reply .row { margin-top: 6px; gap: 6px; }
.ai-next { background: var(--ind-l); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; }
.ai-load { text-align: center; color: var(--muted); padding: 20px; }
.ai-load i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--grn); margin: 0 2px; animation: aib 1s infinite ease-in-out; }
.ai-load i:nth-child(2) { animation-delay: .15s; } .ai-load i:nth-child(3) { animation-delay: .3s; }
@keyframes aib { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
.ai-note { font-size: 11px; color: var(--muted); text-align: center; padding: 8px; border-top: 1px solid var(--line); }
.btn.ai-btn { background: linear-gradient(135deg, var(--ind), #4a4aa0); }
@media (max-width: 1100px) { .ai-panel { position: absolute; inset-block: 0; inset-inline-end: 0; z-index: 20; box-shadow: -10px 0 30px rgba(0,0,0,.15); width: min(360px, 92vw); } .chatview { position: relative; } }

/* language switch */
.lang-sw { display: inline-flex; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; overflow: hidden; margin: 6px 0; }
.lang-sw button { padding: 3px 10px !important; font-size: 11.5px !important; } .lang-sw button.on { background: rgba(255,255,255,.18) !important; color: #fff !important; }
.login .lang-sw { position: absolute; top: 18px; inset-inline-end: 18px; z-index: 2; border-color: rgba(255,255,255,.35); }
.login .lang-sw button { background: none; border: 0; color: #fff; cursor: pointer; font-family: inherit; }
html[dir=ltr] .nav button, html[dir=ltr] .side-acc { text-align: left; }
html[dir=ltr] table.t th, html[dir=ltr] table.t td { text-align: left; }
.chatview .chat-main { min-height: 0; }
.login { position: relative; }
.board.grid .col-h span, .board.grid .col-h small { white-space: nowrap; flex-shrink: 0; }

/* ================= v6: services & prices ================= */
.ctry-tabs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.ctry-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 22px; padding: 7px 16px; font: inherit; font-size: 13.5px; cursor: pointer; color: #3d3f5c; }
.ctry-tabs button small { background: #eef0f6; border-radius: 10px; padding: 0 7px; margin-inline-start: 4px; font-size: 11px; }
.ctry-tabs button.on { background: var(--ind); color: #fff; border-color: var(--ind); } .ctry-tabs button.on small { background: rgba(255,255,255,.2); }
.svc-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 14px; align-items: start; }
.svc-wrap aside { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 12px; }
.svc-group { margin-bottom: 12px; padding: 14px 16px; } .svc-group .ch { margin-bottom: 8px; }
.svc-t td { vertical-align: top; } .svc-t tr.off { opacity: .45; }
.kind { display: inline-block; font-size: 11px; border-radius: 8px; padding: 2px 8px; white-space: nowrap; }
.kind.fee { background: var(--grn-l); color: var(--grn-d); } .kind.gov { background: #fff3e2; color: #9a5b00; }
.svc-pick { border: 1px solid #cfd2e6; border-radius: 12px; padding: 8px; margin: 6px 0 10px; background: #fafaff; box-shadow: var(--sh-1); }
.svc-list { max-height: 280px; overflow: auto; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.svc-item { display: grid; grid-template-columns: 1fr auto 150px; gap: 10px; align-items: center; text-align: start; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 10px; cursor: pointer; font: inherit; }
.svc-item:hover { border-color: var(--grn); background: #f6fcf8; } .svc-item.picked { border-color: var(--grn); background: var(--grn-l); }
.svc-item span:first-child { display: flex; flex-direction: column; gap: 1px; font-size: 13px; } .svc-item small { font-size: 11px; }
.svc-item .num { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; }
@media (max-width: 1000px) { .svc-wrap { grid-template-columns: 1fr; } .svc-wrap aside { position: static; } }

/* ================= v6: follow-up ================= */
.fu-bell { position: fixed; bottom: 18px; inset-inline-end: 18px; z-index: 60; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 4px 16px rgba(42,42,105,.18); font-size: 20px; cursor: pointer; }
.fu-bell .n { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--ind); color: #fff; font: 700 11px 'Mont', sans-serif; display: grid; place-items: center; padding: 0 5px; }
.fu-bell.hot .n { background: #e5484d; animation: fuPulse 1.6s infinite; }
@keyframes fuPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(229,72,77,.5); } 50% { box-shadow: 0 0 0 6px rgba(229,72,77,0); } }
.fu-panel { position: fixed; bottom: 72px; inset-inline-end: 18px; z-index: 61; width: min(420px, 94vw); max-height: 76vh; background: #fff; border-radius: 16px; box-shadow: 0 18px 50px rgba(20,20,60,.25); display: flex; flex-direction: column; overflow: hidden; }
.fu-ph { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #f5f5ff, #eefaf3); }
.fu-pl { overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.fu-it { border: 1px solid var(--line); border-inline-start: 4px solid #c9cbe0; border-radius: 12px; padding: 9px 11px; background: #fff; }
.fu-it.p0 { border-inline-start-color: #e5484d; } .fu-it.p1 { border-inline-start-color: #f5a524; } .fu-it.p2 { border-inline-start-color: #3aa0e0; } .fu-it.p3 { border-inline-start-color: #9aa0b8; }
.fu-t { font-size: 12.5px; color: #3d3f5c; } .fu-n { margin: 2px 0; } .fu-s { font-size: 12px; color: var(--grn-d); }
.fu-a { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; } .fu-a .btn { font-size: 11.5px; padding: 3px 9px; }
.fu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 10px; }
.fu-card .ch { display: flex; align-items: center; gap: 8px; }
.fu-meter { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.fu-meter span { width: 32px; height: 32px; border-radius: 50%; border: 2px dashed #cfd2e6; display: grid; place-items: center; font: 700 12px 'Mont', sans-serif; color: #9aa0b8; }
.fu-meter span.on { border: 2px solid #f5a524; background: #fff7e8; }
.fu-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.fu-facts div { background: #f6f7fb; border-radius: 10px; padding: 7px 9px; display: flex; flex-direction: column; gap: 2px; } .fu-facts small { color: var(--muted); font-size: 11px; }
.fu-sugg { background: var(--grn-l); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.status-pill.grey { background: #eceef3; color: #5d6075; }
.redis-card .btn.big { padding: 11px 22px; font-size: 15px; }
.redis-rules { background: #f5f7ff; border: 1px dashed #c9cbe0; border-radius: 12px; padding: 10px 12px; margin: 12px 0 6px; font-size: 13px; line-height: 1.9; }
.redis-per { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; } .redis-per span { background: #eef0fb; border-radius: 8px; padding: 3px 10px; font-size: 12.5px; }
html[dir=ltr] .svc-item .num { align-items: flex-end; }
.fu-bell .n[hidden] { display: none; }

.fx-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .fx-row span { white-space: nowrap; font-size: 12.5px; } .fx-row .input { flex: 1; min-width: 0; }

/* v7: ownership path */
.op-card { margin-bottom: 14px; }
.op-path { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.op-step { display: flex; gap: 10px; align-items: flex-start; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 200px; flex: 0 1 auto; }
.op-step.cur { border-color: var(--grn, #009147); box-shadow: 0 0 0 2px rgba(0,145,71,.12); }
.op-n { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.op-step.cur .op-n { background: var(--grn, #009147); }
.op-m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.op-arr { align-self: center; font-size: 20px; color: var(--muted); }
.op-det { margin-top: 10px; } .op-det summary { cursor: pointer; color: var(--muted); font-size: 13px; }

/* v7: attendance map */
.att-map { height: 340px; width: 100%; background: #e9ecf3; }
.att-pin-w { background: none; border: 0; }
.att-pin { transform: translate(-50%, -100%); border: 2px solid #fff; background: var(--grn, #009147); color: #fff; font-weight: 600; font-size: 12px; line-height: 1; padding: 6px 9px; border-radius: 14px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.25); position: relative; }
.att-pin.late_in { background: var(--orange); } .att-pin.out, .att-pin.forgot { background: #7b8094; }

/* v8: lock screen (cannot be dismissed) */
#lock-root .lock-bg { position: fixed; inset: 0; z-index: 9999; background: rgba(20, 20, 50, .72); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
#lock-root .lock-box { max-width: 460px; width: 100%; text-align: center; }
#lock-root .lock-box h3 { margin: 6px 0 8px; }

/* v10: WhatsApp files + in-app media viewer */
.msg .wa-file { display: flex; gap: 10px; align-items: center; background: rgba(0,0,0,.045); padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text); min-width: 220px; max-width: 320px; cursor: pointer; }
.msg .wa-file:hover { background: rgba(0,0,0,.08); }
.msg .wa-file .ic { font-size: 26px; }
.msg .wa-file .nm { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .wa-file .op { font-size: 12px; color: var(--grn, #009147); font-weight: 600; }
.msg img.media { cursor: zoom-in; }
.mv-modal { width: min(1100px, 96vw) !important; max-width: 96vw !important; padding: 0 !important; overflow: hidden; }
.mv-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.mv-h b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-a { display: flex; gap: 6px; flex: none; }
.mv-b { background: #1c1f2b; min-height: 300px; height: min(78vh, 900px); display: grid; place-items: center; overflow: auto; }
.mv-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mv-pdf { width: 100%; height: 100%; border: 0; background: #fff; }
.mv-load, .mv-err { color: #e8eaf2; text-align: center; padding: 30px; max-width: 520px; }
.mv-err p { line-height: 1.8; }
.mv-load .spin { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%; margin: 0 auto 12px; animation: mvspin .8s linear infinite; }
@keyframes mvspin { to { transform: rotate(360deg); } }

/* v11: Excel import + new clients */
.imp-drop { text-align: center; border: 2px dashed var(--line); cursor: pointer; padding: 26px; margin-bottom: 14px; transition: .2s; }
.imp-drop:hover, .imp-drop.on { border-color: var(--grn, #009147); background: rgba(0,145,71,.04); }
.imp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .imp-grid { grid-template-columns: 1fr; } }
.imp-map { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.imp-users { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 0; }
.imp-rep details { margin-top: 8px; } .imp-rep summary { cursor: pointer; color: var(--muted); }
.tab-n { background: var(--red, #e5484d); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; margin-inline-start: 4px; }
.new-item { border-inline-start: 4px solid var(--grn, #009147); }
