/* LookExpress — Team page (js/views/team.js)
   Page ki saari styling .team-page ke andar hai (app.css ke purane .tm-* rules ko ye override karti hai).
   Sabse neeche wala "Add / Edit contact dialog" section .modal.tm-dlg se scoped hai, kyunki dialog <body> mein khulta hai.
   Colors / fonts app.css ke :root variables se aate hain (--cyan, --yellow, --line-2 ...). */

/* ------------------------------------------------------------ page layout */
.page.team-page { max-width: 1360px; }
.team-page .two {
  display: grid;
  grid-template-columns: minmax(0, 1.43fr) minmax(0, 1fr);   /* left : right = Reviewers/Members : Contacts */
  gap: 24px;
  align-items: start;
}
.team-page .two > div,
.team-page .two > aside { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* every section is a white card */
.team-page .section {
  margin: 0;
  padding: 20px 22px 22px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* ------------------------------------------------------------ section heading */
.team-page .tm-sh { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.team-page .tm-hi {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.team-page .tm-hi svg { width: 18px; height: 18px; }
.team-page .tm-hi.t-cyan { background: var(--cyan-bg); color: var(--cyan-strong); }
.team-page .tm-hi.t-yellow { background: var(--yellow-bg); color: var(--yellow-ink); }
.team-page .tm-hi.t-magenta { background: var(--magenta-bg); color: var(--magenta); }
.team-page .tm-hi.t-key { background: var(--sunk); color: var(--ink); }
.team-page .tm-st { min-width: 0; }
.team-page .tm-st h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; line-height: 36px; }
.team-page .tm-st .hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-3); }
.team-page .tm-st .hint b { color: var(--ink-2); font-weight: 600; }
.team-page .tm-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 99px;
  background: var(--cyan-bg);
  color: var(--cyan-strong);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
}
.team-page .tm-count.n { background: var(--sunk); color: var(--ink-2); }

/* ------------------------------------------------------------ list panel + rows */
.team-page .tm-list,
.team-page .people.panel {
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: none;
  overflow: hidden;
}
.team-page .tm-body { min-width: 0; }
.team-page .tm-p {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-2);
  transition: background .12s;
}
.team-page .tm-p:hover { background: #fafbfa; }
.team-page .tm-p .avatar { width: 44px; height: 44px; font-size: 14px; }
.team-page .tm-p b { font-size: 15.5px; overflow-wrap: anywhere; }
.team-page .tm-p .num {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--cyan-strong);
}

/* reviewer row: light cyan tint */
.team-page .tm-p:not(.c) { grid-template-columns: 52px minmax(0, 1fr) auto; background: #f3f9fb; }
.team-page .tm-p:not(.c):hover { background: #eaf4f7; }
.team-page .tm-p:not(.c) .avatar { width: 52px; height: 52px; font-size: 16px; }
.team-page .tm-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; }
.team-page .tm-mail { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.team-page .tm-mail svg { width: 15px; height: 15px; flex: none; color: var(--ink-3); }
.team-page .tm-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 99px;
  background: var(--sunk);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.team-page .tm-tag.warn { background: var(--yellow-bg); color: var(--yellow-ink); }
.team-page .tm-tag.ok { background: var(--green-bg); color: var(--green); }
.team-page .tm-sign { margin-top: 5px; }
.team-page .tm-sign:empty { display: none; }
.team-page .tm-invited { color: var(--yellow-ink); font-weight: 600; }
.team-page .tm-bad { color: var(--magenta); }

/* ------------------------------------------------------------ row buttons */
.team-page .tm-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.team-page .tm-acts .btn.ghost,
.team-page .tm-m > .btn.ghost.icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: var(--sunk);
  color: var(--ink);
}
.team-page .tm-acts .btn.ghost:hover,
.team-page .tm-m > .btn.ghost.icon:hover { background: var(--line); }
.team-page .tm-acts .tm-del:hover { background: var(--magenta-bg); color: var(--magenta); }
.team-page .tm-invite {
  height: 30px;
  padding: 0 13px;
  font-size: 12.5px;
  font-weight: 650;
  border-radius: 99px;
  color: var(--cyan-strong);
  background: var(--surface);
  border: 1.5px solid var(--cyan);
}
.team-page .tm-invite:hover { background: var(--cyan); color: #fff; }
.team-page .tm-invite svg { width: 14px; height: 14px; }

/* ------------------------------------------------------------ add reviewer strip */
.team-page .tm-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  background: var(--cyan-bg);
  border: 0;
  border-radius: 0;
}
.team-page .tm-field { position: relative; display: block; min-width: 0; }
.team-page .tm-field svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--cyan-strong);
  pointer-events: none;
}
.team-page .tm-field .in { width: 100%; height: 42px; padding-left: 40px; border-radius: 10px; background: var(--surface); }
.team-page .tm-add .btn.primary { height: 42px; padding: 0 20px; border-radius: 10px; font-weight: 650; }
.team-page .tm-list .empty { border: 0; border-radius: 0; }

/* ------------------------------------------------------------ members */
.team-page .person.tm-m {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
}
.team-page .tm-m:hover { background: #fafbfa; }
.team-page .tm-mname { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.team-page .tm-mname b { font-size: 14.5px; }
.team-page .tm-msub { margin-top: 1px; font-size: 13px; color: var(--ink-2); }
.team-page .tm-role {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 99px;
  background: var(--sunk);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.team-page .tm-role.r-owner { background: var(--yellow-bg); color: var(--yellow-ink); }
.team-page .tm-role.r-coordinator { background: var(--cyan-bg); color: var(--cyan-strong); }
.team-page .tm-role.r-reviewer { background: var(--green-bg); color: var(--green); }
.team-page .tm-wait {
  padding: 10px 16px 6px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: #fafbfa;
  border-bottom: 1px solid var(--line-2);
}
.team-page .tm-mfoot { padding: 12px 16px; background: #fafbfa; }

/* ------------------------------------------------------------ companies (customers / graphics / printers) */
.team-page .tm-p.c { grid-template-columns: 44px minmax(0, 1fr) auto; align-items: start; padding: 16px; }
.team-page .tm-p.c .avatar { margin-top: 1px; }
.team-page .tm-p.c .tm-acts { align-self: start; }
.team-page .tm-p.c.k-customer { --tc: var(--yellow); }
.team-page .tm-p.c.k-graphics { --tc: var(--magenta); }
.team-page .tm-p.c.k-printer { --tc: var(--key); }
.team-page .tm-p.c.k-graphics .avatar { background: var(--magenta); }
.team-page .tm-ctitle { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-height: 26px; }
.team-page .tm-p.c .tm-ctitle b { font-size: 15.5px; line-height: 1.3; }

/* contact persons of one company: bulleted, joined by a thin line */
.team-page .tm-ppl { position: relative; list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.team-page .tm-ppl::before {
  content: "";
  position: absolute;
  left: 3.25px;
  top: 9px;
  bottom: 9px;
  width: 1.5px;
  background: var(--line);
}
.team-page .tm-ppl > li { position: relative; padding-left: 20px; min-width: 0; }
.team-page .tm-ppl > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tc, var(--ink-3));
  box-shadow: 0 0 0 3px var(--surface);
}
.team-page .tm-ppl > li:only-child { padding-left: 0; }
.team-page .tm-ppl > li:only-child::before,
.team-page .tm-ppl:has(> li:only-child)::before { display: none; }
.team-page .tm-pn { display: block; font-size: 13.5px; font-weight: 650; color: var(--ink); line-height: 1.35; }
.team-page .tm-pd { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 1px; }
.team-page .tm-pm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.team-page .tm-pm svg { width: 13px; height: 13px; flex: none; color: var(--ink-3); }

.team-page .tm-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--cyan-bg);
  color: var(--cyan-strong);
  font-size: 13.5px;
  line-height: 1.45;
}
.team-page .tm-info p { margin: 0; }
.team-page .tm-i {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cyan);
  color: #fff;
  font: italic 700 13px Georgia, serif;
}
.team-page .tm-foot { padding: 12px 14px; background: #fafbfa; }
.team-page .tm-addbtn { height: 36px; padding: 0 16px; border-radius: 10px; font-weight: 650; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .team-page .two { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .team-page .section { padding: 16px; }
  .team-page .tm-p,
  .team-page .tm-p:not(.c) { grid-template-columns: 40px minmax(0, 1fr); }
  .team-page .tm-p.c { grid-template-columns: 40px minmax(0, 1fr); }
  .team-page .tm-p .tm-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .team-page .tm-add { grid-template-columns: 1fr; }
}

/* ============================================================
   Add / Edit contact dialog  (Customer / Printer / Graphics artist)
   NOTE: ye dialog <body> mein khulta hai (.team-page ke bahar), isliye
   yahan .team-page nahi, .modal.tm-dlg se scope kiya hai. Logic: team.js -> contactDialog()
   ============================================================ */
.modal.tm-dlg {
  --d-blue: #0b4c9a;
  --d-blue-dk: #083b7a;
  --d-tint: #f6f9fd;
  --d-line: #d8e2ef;
  --d-ink: #0f1f3a;
  --d-mute: #6b7a92;
  --d-red: #e0212d;
  width: min(920px, 100%);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 60px rgba(15, 31, 58, .20);
}

/* header: icon tile + title + subtitle (close "X" nahi hai) */
.modal.tm-dlg .mh {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 16px;
  align-items: center;
  padding: 24px 28px;
  background: var(--d-tint);
}
.modal.tm-dlg .mh h2 { grid-column: 2; font-size: 22px; font-weight: 700; color: var(--d-ink); }
.modal.tm-dlg .mh p { grid-column: 2; margin-top: 3px; font-size: 13.5px; color: var(--d-mute); }
.tm-dlg-ic {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e3edfb;
  color: var(--d-blue);
}
.tm-dlg-ic svg { width: 22px; height: 22px; }

/* body */
.modal.tm-dlg .mb { padding: 26px 28px; gap: 20px; }
.tm-dhr { border: 0; border-top: 1px solid #e6ecf4; margin: 0; }
.tm-dh {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -6px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--d-ink);
}
.tm-dh svg { width: 18px; height: 18px; }
.tm-dgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tm-df { display: block; min-width: 0; }
.tm-dl {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 650;
  color: var(--d-ink);
}
.tm-dl svg { width: 17px; height: 17px; flex: none; }
.tm-dl i { margin-left: -3px; font-style: normal; color: var(--d-red); }   /* red * */
.modal.tm-dlg .tm-df .in {
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--d-line);
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
}
.modal.tm-dlg .tm-df .in::placeholder { color: #8d9bb0; }
.modal.tm-dlg .tm-df .in:focus { border-color: var(--d-blue); box-shadow: 0 0 0 3px rgba(11, 76, 154, .12); }
.tm-df.err .in { border-color: var(--d-red) !important; box-shadow: 0 0 0 3px rgba(224, 33, 45, .10) !important; }
.tm-er { display: none; margin-top: 6px; font-size: 12.5px; color: #c81e2a; }
.tm-df.err .tm-er { display: block; }

/* footer: sirf 2 buttons — Cancel (left) aur Add (right) */
.modal.tm-dlg .mf {
  justify-content: space-between;
  flex-wrap: nowrap;
  padding: 20px 28px;
  background: var(--d-tint);
  border-top: 0;
}
.modal.tm-dlg .mf .btn {
  height: 44px;
  padding: 0 26px;
  border: 1px solid var(--d-line);
  border-radius: 10px;
  font-weight: 650;
}
.modal.tm-dlg .mf .btn:hover { border-color: #a9b9d0; }
.modal.tm-dlg .mf .btn svg { width: 17px; height: 17px; }

@media (max-width: 760px) {
  .tm-dgrid { grid-template-columns: 1fr; }
  .modal.tm-dlg .mh { padding: 18px; }
  .modal.tm-dlg .mb { padding: 20px 18px; }
  .modal.tm-dlg .mf { padding: 16px 18px; }
}

/* ---- multiple contacts: "Contact Details +" ---- */
.tm-plus {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: 4px;
  padding: 0;
  border: 1.5px solid var(--d-blue, #0b4c9a);
  border-radius: 50%;
  background: #fff;
  color: var(--d-blue, #0b4c9a);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.tm-plus:hover { background: var(--d-blue, #0b4c9a); color: #fff; }
.tm-plus svg { width: 15px; height: 15px; }

.tm-clist { display: flex; flex-direction: column; gap: 22px; }
.tm-chead { display: none; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tm-clist.multi .tm-chead { display: flex; }
.tm-cn { font-size: 14px; font-weight: 700; color: var(--d-blue, #0b4c9a); }
.tm-clist.multi .tm-cblock + .tm-cblock { padding-top: 22px; border-top: 1px dashed var(--d-line, #d8e2ef); }
.tm-crem {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eef2f8;
  color: var(--d-mute, #6b7a92);
  cursor: pointer;
}
.tm-crem:hover { background: #fde8ea; color: #c81e2a; }
.tm-crem svg { width: 14px; height: 14px; }

/* ---- dialog: "1/3" counter aur + band hone par ---- */
.tm-pcount { margin-left: 2px; font-size: 12.5px; font-weight: 600; color: var(--d-mute, #6b7a92); }
.tm-plus:disabled { opacity: .35; cursor: not-allowed; background: #fff; color: var(--d-blue, #0b4c9a); }