/* Tradie Command — pack styles.
   Only what the engine primitives do not already cover. Everything here uses
   the engine's tokens so light, dark and the accent all follow along.
*/

.ph { display: flex; align-items: flex-end; gap: 12px; }
.ph__t { font-size: 15px; }
.ph__s { font-size: 12.5px; color: var(--ink-mute); margin-top: 2px; }
.ph__a { margin-left: auto; display: flex; gap: 6px; }

.input--slim { height: 32px; font-size: 13px; padding: 0 26px 0 9px; width: auto; min-width: 130px; }

.linkbtn {
  border: 0; background: none; padding: 0;
  font: inherit; font-weight: 600;
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  text-align: left;
}
.linkbtn:hover { text-decoration-thickness: 2px; }

.badge--stage { padding-left: 6px; }
.badge--stage::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--dot, var(--accent));
  margin-right: 1px;
}

.crewchip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); font-weight: 500; min-width: 0; }
.crewchip .avatar { font-weight: 700; }
.crewchip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crewchip--none { color: var(--ink-mute); font-style: normal; }

/* ------------------------------------------------------------- today --- */

.road { display: flex; flex-direction: column; }
.road__c { border-bottom: 1px solid var(--line-2); }
.road__c:last-child { border-bottom: 0; }
.road__h {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  background: var(--surface-2);
}
.road__v { margin-left: auto; font-size: 11.5px; color: var(--ink-mute); font-weight: 600; }
.road__l { display: flex; flex-direction: column; }
.road__i {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 9px 16px;
  border: 0; border-bottom: 1px solid var(--line-2);
  background: none; cursor: pointer; text-align: left;
  font: inherit;
}
.road__l li:last-child .road__i { border-bottom: 0; }
.road__i:hover { background: var(--accent-soft); }
.road__time { flex: 0 0 62px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.road__txt { flex: 1; min-width: 0; }
.road__t { display: block; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.road__s { display: block; font-size: 11.5px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.road__val { font-size: 12.5px; font-weight: 600; white-space: nowrap; }

.todo { display: flex; flex-direction: column; }
.todo__i {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 10px 16px;
  border: 0; border-bottom: 1px solid var(--line-2);
  background: none; cursor: pointer; text-align: left; font: inherit;
}
.todo li:last-child .todo__i { border-bottom: 0; }
.todo__i:hover { background: var(--surface-2); }
.todo__ic {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 27px; height: 27px; border-radius: 7px;
  background: var(--surface-2); color: var(--ink-mute);
}
.todo__ic--bad { background: var(--bad-soft); color: var(--bad); }
.todo__ic--accent { background: var(--accent-soft); color: var(--accent-ink); }
.todo__ic--info { background: var(--info-soft); color: var(--info); }
.todo__t { flex: 1; min-width: 0; }
.todo__tt { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.todo__ts { display: block; font-size: 11.5px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo__go { color: var(--ink-mute); flex: 0 0 auto; }

.mc { display: flex; flex-direction: column; }
.mc__i { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.mc__i:last-child { border-bottom: 0; }
.mc__h { display: flex; align-items: center; gap: 9px; }
.mc__ic {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bad-soft); color: var(--bad); flex: 0 0 auto;
}
.mc__ic.is-ok { background: var(--ok-soft); color: var(--ok); }
.mc__n { font-size: 13px; font-weight: 600; color: var(--ink); }
.mc__m { font-size: 10.5px; color: var(--ink-mute); }
.mc__sms {
  margin: 8px 0 0 35px;
  padding: 8px 10px;
  border-radius: 3px 10px 10px 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12.5px;
  line-height: 1.45;
}
.mc__reply {
  margin: 6px 0 0 35px;
  padding: 8px 10px;
  border-radius: 10px 3px 10px 10px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.45;
}
.mc__you {
  display: block;
  font: 700 9.5px var(--sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 2px;
}

/* -------------------------------------------------------------- jobs --- */

.jobsbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.jobsbar .tbl__search { max-width: 280px; background: var(--surface); }
.jobsbar__hint { font-size: 11.5px; color: var(--ink-mute); }

.kbc__cust { font-size: 11.5px; color: var(--ink-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbc__f { display: flex; align-items: center; gap: 6px; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.kbc__open {
  margin-left: auto; flex: 0 0 auto;
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-mute); cursor: pointer;
}
.kbc__open:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

/* ------------------------------------------------------------ details -- */

.detail { display: flex; flex-direction: column; gap: 18px; }
.detail__top { display: flex; align-items: flex-start; gap: 12px; }
.detail__v { font-size: 27px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.detail__vs { font-size: 12px; color: var(--ink-mute); margin-top: 3px; }
.detail__top .badge { margin-left: auto; }
.detail__bar { display: flex; flex-wrap: wrap; gap: 6px; }
.detail__sec { display: flex; flex-direction: column; }
.detail__sec .sec-head { margin-bottom: 8px; }
.detail__chips { gap: 6px; }

.stagebar { display: flex; gap: 2px; }
.stagebar__s {
  flex: 1 1 0; min-width: 0;
  padding: 6px 4px 7px;
  border: 0;
  border-top: 3px solid var(--line);
  background: none;
  font: 600 10px var(--sans);
  letter-spacing: 0.02em;
  color: var(--ink-mute);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stagebar__s:hover { color: var(--ink); border-top-color: var(--ink-mute); }
.stagebar__s.is-done { border-top-color: var(--st-c); color: var(--ink-2); }
.stagebar__s.is-on { color: var(--ink); font-weight: 700; }

.kvs { display: flex; flex-direction: column; }
.kvs .kv { border-bottom: 1px solid var(--line-2); }
.kvs .kv:last-child { border-bottom: 0; }

.lineswrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
.lines { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.lines th {
  text-align: left;
  padding: 8px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font: 700 10px var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
}
.lines th.ta-right { text-align: right; }
.lines td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: top; }
.lines tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.lines__k {
  display: inline-block;
  min-width: 62px;
  font: 700 9.5px var(--sans);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-right: 8px;
}
.lines tfoot td { padding: 6px 10px; border-bottom: 0; color: var(--ink-mute); font-size: 12px; }
.lines tfoot .lines__tot td { padding-top: 8px; padding-bottom: 10px; color: var(--ink); font-weight: 700; border-top: 1px solid var(--line); }

.notes { display: flex; flex-direction: column; gap: 8px; }
.notes__i { border-left: 2px solid var(--accent-soft-2); padding: 2px 0 2px 11px; }
.notes__t { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.notes__m { font-size: 10.5px; color: var(--ink-mute); margin-top: 3px; }

.notecard {
  padding: 11px 13px;
  background: var(--surface-2);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}
.gstnote { margin-top: 8px; font: 500 11px var(--mono); color: var(--ink-mute); }

.custhead { display: flex; align-items: center; gap: 14px; }
.custhead__n { font: 700 18px var(--display); letter-spacing: -0.015em; }
.custhead__s { font-size: 12.5px; color: var(--ink-mute); margin-top: 2px; }
.custhead__tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }

.minilist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.minilist__i, .minilist__plain {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px;
  border: 0; border-bottom: 1px solid var(--line-2);
  background: none; text-align: left; font: inherit; color: var(--ink-2);
}
.minilist__i { cursor: pointer; }
.minilist li:last-child .minilist__i, .minilist li:last-child .minilist__plain { border-bottom: 0; }
.minilist__i:hover { background: var(--surface-2); }
.minilist__t { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minilist__d { font-size: 11px; color: var(--ink-mute); white-space: nowrap; }
.minilist__v { font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; min-width: 62px; text-align: right; }

/* ---------------------------------------------------------- calendar --- */

.callegend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.callegend__i { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.callegend__i i { width: 9px; height: 9px; border-radius: 3px; display: block; }
.callegend__h { font-size: 11.5px; color: var(--ink-mute); margin-left: auto; }

.unsched { display: flex; flex-direction: column; }
.unsched__i {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 16px;
  border: 0; border-bottom: 1px solid var(--line-2);
  background: none; cursor: pointer; text-align: left; font: inherit;
  color: var(--ink-mute);
}
.unsched li:last-child .unsched__i { border-bottom: 0; }
.unsched__i:hover { background: var(--accent-soft); color: var(--accent-ink); }
.unsched__t { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unsched__c { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unsched__v { font-size: 12.5px; font-weight: 600; color: var(--ink); }

/* ------------------------------------------------------------ quotes --- */

.qwrap {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.qlist { display: flex; flex-direction: column; gap: 10px; min-width: 0; position: sticky; top: 0; }
.qlist .tabs { flex-wrap: wrap; }
.qlist__l {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}
.qlist__i {
  display: block; width: 100%;
  padding: 11px 13px;
  border: 0; border-bottom: 1px solid var(--line-2); border-left: 3px solid transparent;
  background: none; text-align: left; cursor: pointer; font: inherit;
}
.qlist__i:hover { background: var(--surface-2); }
.qlist__i.is-on { background: var(--accent-soft); border-left-color: var(--accent); }
.qlist__h { display: flex; align-items: baseline; gap: 8px; }
.qlist__n { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qlist__v { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.qlist__t { font-size: 12px; color: var(--ink-2); margin: 3px 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qlist__m { display: flex; align-items: center; gap: 7px; }
.qlist__a { font-size: 11px; color: var(--ink-mute); margin-left: auto; }

.qdetail {
  display: flex; flex-direction: column; gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 18px;
  min-width: 0;
}
.qdetail__head { display: flex; align-items: flex-start; gap: 12px; }
.qdetail__t { font-size: 17px; }
.qdetail__s { font-size: 12.5px; color: var(--ink-mute); margin-top: 3px; }

.qmsg {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.qmsg p { font-size: 14px; line-height: 1.55; color: var(--ink); }
.qmsg__f { font: 500 11px var(--mono); color: var(--ink-mute); margin-top: 7px; }

.qeditor { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
.qeditor.is-locked .qin { pointer-events: none; background: transparent; border-color: transparent; }
.qlines__t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.qlines__t th {
  text-align: left; padding: 8px 10px;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  font: 700 10px var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-mute); white-space: nowrap;
}
.qlines__t th.ta-right { text-align: right; }
.qlines__t td { padding: 5px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.qlines__t tbody tr:last-child td { border-bottom: 0; }
.qin {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: 400 12.5px var(--sans);
  padding: 5px 7px;
  width: 100%;
  min-width: 0;
}
.qin:hover { border-color: var(--line); }
.qin:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.qin--desc { font-weight: 500; }
.qin--num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; max-width: 92px; margin-left: auto; }
.qlines__amt { font-weight: 600; white-space: nowrap; }

.qtot { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; margin-left: auto; min-width: 260px; }
.qtot__r { display: flex; justify-content: space-between; gap: 20px; font-size: 12.5px; color: var(--ink-mute); }
.qtot__r--big {
  font-size: 15px; font-weight: 700; color: var(--ink);
  border-top: 1px solid var(--line); padding-top: 7px; margin-top: 3px;
}
.qnote {
  display: flex; align-items: flex-start; gap: 7px;
  margin-top: 14px;
  font-size: 12.5px; line-height: 1.5; color: var(--ink-mute);
}
.qnote .ic { flex: 0 0 auto; margin-top: 2px; }
.qactions { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 14px; flex-wrap: wrap; }
.qdone {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px;
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--ink-2);
}

/* ---------------------------------------------------------- invoices --- */

.ageing { display: flex; flex-direction: column; gap: 9px; }
.ageing__r { display: grid; grid-template-columns: 108px minmax(0, 1fr) 78px 52px; align-items: center; gap: 12px; }
.ageing__l { font-size: 12px; color: var(--ink-2); }
.ageing__v { font-size: 12.5px; font-weight: 600; text-align: right; }
.ageing__n { font-size: 11.5px; color: var(--ink-mute); text-align: right; }

/* ------------------------------------------------------- automations --- */

.autos { display: flex; flex-direction: column; gap: 10px; }
.auto {
  display: flex; gap: 13px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.auto.is-off { opacity: 0.62; }
.auto__ic {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.auto.is-off .auto__ic { background: var(--surface-2); color: var(--ink-mute); }
.auto__b { flex: 1; min-width: 0; }
.auto__h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.auto__t { font-size: 14px; text-decoration: none; }
.auto__n { font-size: 11px; color: var(--ink-mute); margin-left: auto; }
.auto__w { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.auto__w strong { color: var(--ink-mute); font-weight: 700; font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase; }
.auto__d { font-size: 12px; color: var(--ink-mute); line-height: 1.5; margin-top: 6px; }
.auto__sw { position: relative; width: 38px; height: 22px; flex: 0 0 auto; cursor: pointer; align-self: flex-start; }
.auto__sw .switch__i { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }

.why p { font-size: 13px; line-height: 1.6; color: var(--ink-2); margin-bottom: 10px; }

/* ----------------------------------------------------------- reports --- */

.crewrows { display: flex; flex-direction: column; }
.crewrows__i {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-2);
}
.crewrows__i:last-child { border-bottom: 0; }
.crewrows__i > .crewchip { flex: 0 0 128px; }
.crewrows__n { font-size: 11.5px; color: var(--ink-mute); white-space: nowrap; }
.crewrows__v { font-size: 12.5px; font-weight: 600; white-space: nowrap; min-width: 62px; text-align: right; }

/* -------------------------------------------------------- responsive --- */

@media (max-width: 1180px) {
  .qwrap { grid-template-columns: 268px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .qwrap { grid-template-columns: minmax(0, 1fr); }
  .qlist { position: static; }
  .qlist__l { max-height: 320px; }
  .qdetail { padding: 14px; }
  .callegend__h { margin-left: 0; flex-basis: 100%; }
  .jobsbar { gap: 8px; }
  .jobsbar .tbl__search { max-width: none; flex: 1 1 100%; }
  .jobsbar__hint { display: none; }
  .ageing__r { grid-template-columns: 84px minmax(0, 1fr) 66px; }
  .ageing__n { display: none; }
  .crewrows__i { flex-wrap: wrap; }
  .crewrows__i > .crewchip { flex: 0 0 auto; }
  .qtot { min-width: 0; width: 100%; }
  .detail__v { font-size: 23px; }
  .custhead__n { font-size: 16px; }
  .road__time { flex-basis: 54px; font-size: 11.5px; }
  .stagebar__s { font-size: 9px; padding: 5px 2px 6px; }
  .qin--num { max-width: 74px; }
}
