/* ===== VISITS — sales person ki client visits ===== */
.vs-acts { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.vs-acts #vsSearch { width: 220px; max-width: 220px; }
.vs-acts select { width: auto; max-width: 200px; padding: 6px 10px; font-size: .8rem; }
.vs-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.vs-stats .stat { box-shadow: none; }
.vs-stats .stat.red, .vs-stats .stat.overdue { border-top-color: var(--red); }
.vs-stats .stat.red .stat-n, .vs-stats .stat.overdue .stat-n { color: var(--red); }
.vs-stats .stat.today { border-top-color: var(--orange); }
.vs-stats .stat.upcoming { border-top-color: var(--navy2); }
.vs-stats .stat.done { border-top-color: var(--green2); }
.vs-fs { cursor: pointer; transition: box-shadow .15s; }
.vs-fs.on { box-shadow: 0 0 0 2px var(--navy2) inset; background: #f4f7fd; }
/* Tabs */
.vs-tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.vs-tabs button { border: 0; background: none; padding: 8px 14px; font: 600 .86rem 'DM Sans', sans-serif; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.vs-tabs button.on { color: var(--navy); border-bottom-color: var(--orange); }
.vs-tabs em { font-style: normal; font-size: .68rem; font-weight: 700; background: #e8edf6; color: var(--navy2); border-radius: 10px; padding: 1px 7px; margin-left: 4px; }
.vs-tabs em.red { background: var(--red); color: #fff; }
/* Filter line (header filter chips) */
.vs-fbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; min-height: 8px; }
.vs-fbar .cf-bar { margin: 0; }
.vs-fbar .vs-ph { display: none; }
.vs-cnt { margin-left: auto; font-size: .72rem; color: var(--muted); font-weight: 600; }
.vs-card { padding: 0; overflow: hidden; }
.vs-card .empty { padding: 30px 16px; }
.vs-tbl tbody tr { cursor: pointer; }
.vs-tbl tr.vs-od td { background: #fff1f1; }
.vs-tbl th .cf-ics { margin-left: 4px; }
.vs-tbl td { vertical-align: top; }
.vs-nw { white-space: nowrap; }
.vs-m { font-size: .7rem; color: var(--muted); }
.vs-notes { min-width: 260px; max-width: 460px; overflow-wrap: anywhere; line-height: 1.45; }
.vs-p { display: inline-block; font-size: .66rem; font-weight: 700; padding: 3px 9px; border-radius: 12px; white-space: nowrap; }
.vp1 { background: #e0ebfb; color: #1e3a8a; } .vp2 { background: #ede9fe; color: #4c1d95; } .vp3 { background: #fdf2d6; color: #854d0e; }
.vp4 { background: #dcf3e6; color: #14532d; } .vp5 { background: #fde9dc; color: #9a3412; } .vp6 { background: #eef1f6; color: #2d3f55; }
.vs-loc { font-size: .72rem; font-weight: 600; color: var(--green); white-space: nowrap; text-decoration: none; }
.vs-loc.no { color: var(--red); }
.vs-ph-ic { cursor: default; font-size: .8rem; }
.vs-no { font-family: 'JetBrains Mono', monospace; font-size: .74rem; font-weight: 600; color: var(--navy2); }
.vs-ph-ic.late { filter: drop-shadow(0 0 2px rgba(185, 28, 28, .7)); }
.vs-ctx { position: absolute; z-index: 9999; background: #fff; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, .15); min-width: 220px; padding: 6px 0; font-size: .85rem; }
.vs-ctx .ctx-item { padding: 8px 14px; cursor: pointer; }
.vs-ctx .ctx-item:hover { background: #f5f5f5; }
.vs-ctx .sep { height: 1px; background: #eee; margin: 4px 0; }
.vs-cards { display: none; }
.vs-fab { display: none; }

/* Popup */
.vs-modal { padding: 0; max-width: 520px; display: flex; flex-direction: column; }
.vs-modal.wide { max-width: 620px; }
.vs-modal .modal-title { padding: 16px 18px 0; margin-bottom: 12px; }
.vs-form { padding: 0 18px; display: flex; flex-direction: column; gap: 12px; }
.vs-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vs-mbg.sub { z-index: 900; }
.vs-cl { display: flex; gap: 8px; align-items: stretch; }
.vs-clbox { flex: 1; min-width: 0; border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 11px; background: var(--surface2); display: flex; flex-direction: column; justify-content: center; min-height: 40px; }
.vs-clbox b { font-size: .86rem; overflow-wrap: anywhere; }
.vs-clbox small { font-size: .72rem; color: var(--muted); }
.vs-clbox .ph { color: var(--muted2); font-size: .84rem; }
.vs-plist { margin: 10px 18px 0; border: 1px solid var(--border); border-radius: 10px; max-height: 392px; overflow-y: auto; }
.vs-plist > div { padding: 9px 12px; border-bottom: 1px solid #f0f2f7; cursor: pointer; }
.vs-plist > div:last-child { border-bottom: 0; }
.vs-plist > div:hover { background: var(--surface2); }
.vs-plist b { display: block; font-size: .84rem; }
.vs-plist small { font-size: .72rem; color: var(--muted); }
.vs-plist .none { cursor: default; text-align: center; color: var(--muted); font-size: .82rem; padding: 18px; }
.vs-form textarea { min-height: 80px; }
.vs-gps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-radius: 9px; padding: 9px 12px; font-size: .8rem; font-weight: 600; background: var(--surface2); color: var(--muted); }
.vs-gps.ok { background: #e9f7ef; color: #14532d; border: 1px solid #bfe6cf; }
.vs-gps.bad { background: #fff0f0; color: var(--red); border: 1px solid #f4c7c7; }
.vs-hint { font-size: .74rem; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 7px 10px; line-height: 1.4; }
.vs-hint:empty { display: none; }
.vs-futag { background: #eef3ff; border: 1px solid #c9d6ee; border-radius: 6px; padding: 8px 11px; margin-bottom: 12px; font-size: .78rem; color: var(--navy2); }
.vs-err { color: var(--red); font-size: .8rem; font-weight: 600; min-height: 1em; }
.vs-mact { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; margin-top: 12px; background: #fafbfd; border-top: 1px solid #edf0f6; }
.vs-ci { margin: 0 18px; background: var(--surface2); border-radius: 9px; padding: 9px 12px; font-size: .82rem; }
.vs-sec { margin: 14px 18px 6px; font-size: .68rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.vs-tl { margin: 0 18px; display: flex; flex-direction: column; gap: 9px; max-height: 230px; overflow-y: auto; }
.vs-tl div { position: relative; padding-left: 20px; font-size: .82rem; line-height: 1.45; overflow-wrap: anywhere; }
.vs-tl div::before { content: ""; position: absolute; left: 0; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }
.vs-tl div::after { content: ""; position: absolute; left: 4px; top: 17px; bottom: -9px; width: 2px; background: var(--border); }
.vs-tl div:last-child::after { display: none; }
.vs-qt { margin: 0 18px; border: 1px solid var(--border); border-radius: 10px; max-height: 220px; overflow-y: auto; }
.vs-qt > div { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #f0f2f7; font-size: .8rem; }
.vs-qt > div:last-child { border-bottom: 0; }
.vs-qn { flex: 1; min-width: 0; }
.vs-qn b { display: block; font-size: .78rem; }
.vs-qn small { font-size: .7rem; color: var(--muted); }
.vs-none { margin: 0 18px; font-size: .8rem; color: var(--muted); }
.vs-help { margin: 0 18px 10px; font-size: .8rem; color: var(--muted); }
.vs-map { margin: 0 18px; display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.vs-map > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .84rem; }
.vs-map select { width: 200px; padding: 6px 10px; font-size: .8rem; }
.vs-map > div.off b { color: var(--muted2); text-decoration: line-through; }
.vs-sr { display: flex; gap: 6px; align-items: center; }
.vs-add { margin: 0 18px 6px; display: flex; gap: 8px; }
.vs-add input { flex: 1; min-width: 0; }
.vs-add select { width: 180px; }
.vs-call { font-size: .74rem; font-weight: 700; color: var(--green); text-decoration: none; white-space: nowrap; border: 1px solid #bfe6cf; background: #e9f7ef; border-radius: 8px; padding: 4px 9px; }

/* Phone — cards, neeche "Add visit" */
@media (max-width: 768px) {
  .vs-dk { display: none; }
  .vs-acts { width: 100%; flex-wrap: wrap; }
  .vs-acts #vsSearch { max-width: none; flex: 1; min-width: 0; }
  .vs-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .vs-stats .stat { padding: 10px 12px; }
  .vs-stats .stat-n { font-size: 1.4rem; }
  .vs-fbar .vs-ph { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
  .vs-cnt { margin-left: 0; }
  .vs-tabs button { flex: 1; padding: 8px 6px; }
  .vs-c.od { border-color: #f4c7c7; background: #fff7f7; }
  .vs-add { flex-wrap: wrap; }
  .vs-add select { width: 100%; }
  .vs-sr { flex-direction: column; align-items: stretch; }
  .vs-qt > div { flex-wrap: wrap; row-gap: 4px; }
  .vs-qn { flex: 1 1 100%; }
  .vs-tbl { display: none; }
  .vs-cards { display: block; padding: 10px; }
  .vs-c { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fff; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .vs-c:last-child { margin-bottom: 0; }
  .vs-ct { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
  .vs-ct b { font-size: .88rem; overflow-wrap: anywhere; }
  .vs-c p { margin: 8px 0; font-size: .82rem; color: var(--text2); line-height: 1.45; overflow-wrap: anywhere; }
  .vs-cf { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
  .vs-fab { display: block; position: fixed; right: 16px; bottom: 18px; z-index: 700; background: var(--orange); color: #fff; border: 0; border-radius: 24px; padding: 12px 18px; font: 700 .86rem 'DM Sans', sans-serif; box-shadow: 0 8px 20px rgba(232, 80, 10, .4); }
  #pg-visits { padding-bottom: 70px; }
  .vs-mbg { align-items: flex-end; padding: 0; }
  .vs-modal, .vs-modal.wide { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .vs-map > div { flex-direction: column; align-items: stretch; }
  .vs-map select { width: 100%; }
  .cf-pop { max-width: calc(100vw - 16px); }
}

/* ===== Salesman ka follow-up popup ===== */
.vs-st { display: inline-block; flex: none; white-space: nowrap; font-size: .66rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; margin-left: 6px; vertical-align: middle; background: #fef3c7; color: #92400e; }
.vs-st.done { background: #dcfce7; color: #166534; }
.vs-st.closed { background: #fee2e2; color: #991b1b; }
.vs-cur { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 10px 12px; margin: 10px 18px; font-size: .86rem; overflow-wrap: anywhere; }
.vs-cur small { display: block; font-size: .66rem; font-weight: 700; letter-spacing: .5px; color: #c2410c; margin-bottom: 3px; }
.vs-chip { display: inline-block; margin-top: 6px; font-size: .7rem; font-weight: 700; background: #e0e7ff; color: #3730a3; border-radius: 10px; padding: 2px 8px; }
.vs-fubtn { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 18px 6px; }
.vs-sech { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vs-hist { margin: 0 18px; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.vs-hist > div { border: 1px solid var(--border, #dde3ec); border-left: 3px solid #cbd5e1; border-radius: 8px; padding: 7px 10px; font-size: .82rem; overflow-wrap: anywhere; }
.vs-hist > div.cur { border-left-color: #e8500a; background: #fffaf5; }
.vs-hh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.vs-red { color: #b91c1c; }
@media (max-width: 640px) { .vs-fubtn .btn { flex: 1 1 auto; } }
.vs-mt { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vs-mt .vs-st { margin-left: 0; }
.vs-cur small .vs-st { margin-left: 4px; }
.vs-cur.none { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface2); border-color: var(--border); color: var(--muted); font-size: .82rem; }