/* ==== Soprix team platform: phone design ====
   loaded only on screens up to 700px wide, after styles.css. One calm column, 14px side margins, 44px touch targets,
   cards instead of tables, horizontal swipe only where the content is a board. Each block below owns one screen. */

/* ---- shell ---- */
html,body{overflow-x:hidden;max-width:100vw}
main{padding:64px 14px calc(36px + env(safe-area-inset-bottom))!important}
main>*,.card,.sec{min-width:0}
h1{font-size:1.45rem!important;line-height:1.25!important}
.page-h{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;margin-bottom:16px!important}
.page-h .actions{display:flex!important;flex-wrap:wrap;gap:8px!important;width:100%;justify-content:flex-start!important}
.period{width:100%!important}.period .month{flex:1 1 auto}
.card,.sec,.surface{border-radius:16px!important}
.btn,button.btn,.linkbtn{min-height:44px}
select,textarea,input:not([type=checkbox]):not([type=radio]):not([type=file]){font-size:16px!important;min-height:44px}
dialog{width:calc(100vw - 20px)!important;max-width:none!important;max-height:88vh;margin:auto}
.toast{bottom:calc(16px + env(safe-area-inset-bottom))!important}
.card:has(>table),.card:has(>.rp-table){overflow-x:auto}

/* ---- CRM: board = one stage at a time, swipe sideways; cards never wider than their column ---- */
.crm-bar{display:grid!important;grid-template-columns:1fr 1fr;gap:8px!important;align-items:stretch!important}
.crm-bar>.crm-co,.crm-bar>#fq,.crm-bar>span{grid-column:1/-1}
.crm-bar>span{display:none}
.crm-bar .seg{grid-column:1/-1;justify-self:start}
:root:has(.crm-bar) .board.lboard{display:flex!important;grid-template-columns:none!important;overflow-x:auto!important;overflow-y:hidden;scroll-snap-type:x mandatory;gap:12px!important;margin-inline:-14px;padding:0 14px 14px;-webkit-overflow-scrolling:touch;align-items:flex-start}
:root:has(.crm-bar) .board.lboard>.lcol{flex:0 0 86%!important;width:86%!important;min-width:0!important;scroll-snap-align:center;padding:12px!important}
.lcard{width:100%!important;min-width:0!important;box-sizing:border-box;padding:14px!important}
.lcard *{min-width:0;overflow-wrap:anywhere}
.lcard .lc-n,.lcard h3,.lcard .nm{line-height:1.3}

/* ---- team performance: one flat card per person, top to bottom: person + rank, progress, numbers, hours (the hour chips wrap, nothing is cut) ---- */
:root .pt{padding:0!important;background:none!important;border:0!important;box-shadow:none!important}
:root .pt .ptr{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-template-areas:"who rk" "bar pct" "n n" "side side"!important;gap:12px 12px!important;padding:16px!important;border-radius:16px!important;margin:0 0 12px!important;align-items:center!important}
:root .pt .ptr .rk{display:flex!important;flex-direction:row;gap:6px;justify-self:end;align-self:start;grid-template-columns:none}
:root .pt .ptr .pt-n{justify-self:start!important;text-align:start!important}
:root .pt .ptr .pt-side{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;border-top:1px solid var(--line)!important;padding-top:12px!important}
:root .pt .ptr .pt-side>[data-k]{display:flex!important;flex-wrap:wrap!important;align-items:center;gap:8px!important;width:100%!important;max-width:none!important;white-space:normal!important;grid-template-columns:none!important;flex:none!important}
:root .pt .ptr .pt-side>[data-k]::before{flex:0 0 100%!important;margin:0 0 2px!important;padding:0!important}
:root .pt .ptr .pt-side .hrs,:root .pt .ptr .pt-side .pt-offchip{white-space:nowrap}
:root .pt .ptr .pt-more{justify-self:start}
/* the hour rows: this selector is deliberately heavier than the desktop ones so the rows can wrap on a phone */
.pt.pt.pt .ptr.ptr .pt-side>[data-k][data-label],.pt.pt.pt .ptr.ptr .pt-side>[data-k=time],.pt.pt.pt .ptr.ptr .pt-side>[data-k=waste]{display:flex!important;flex-wrap:wrap!important;grid-template-columns:none!important;white-space:normal!important;gap:8px!important;width:100%!important;max-width:none!important;flex-direction:row!important}
.pt.pt.pt .ptr.ptr .pt-side>[data-k][data-label]::before,.pt.pt.pt .ptr.ptr .pt-side>[data-k=time]::before{flex:0 0 100%!important;margin:0 0 2px!important;padding-inline-start:26px!important}
.pt.pt.pt .ptr.ptr .pt-side>[data-k=pres],.pt.pt.pt .ptr.ptr .pt-side>[data-k=roles],.pt.pt.pt .ptr.ptr .pt-side>[data-k=ads]{white-space:normal!important}

/* ---- dashboard ---- */
.dash-cols{grid-template-columns:minmax(0,1fr)!important;gap:14px!important}
.dash-card{padding:16px!important}
.dash-card li{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:10px!important;align-items:start!important}
.dash-card li>a{min-width:0}
.dash-card .dc-q,.dash-card .qa-bar{display:flex!important;flex-wrap:wrap;gap:8px!important;width:100%;justify-content:flex-start!important}
.dash-card .qa-bar .btn{flex:1 1 auto;justify-content:center}

/* ---- client list / client page ---- */
.crow{padding:16px!important}
.crow .trackers,.crow .crow-b{min-width:0}
.client-h{grid-template-columns:minmax(0,1fr)!important;gap:14px!important}
.client-h .title-row{gap:12px!important}
.client-h .title-line h1{font-size:1.6rem!important}
.client-h .actions{width:100%}
#tabpane,.tabs{min-width:0}
.tabs,[role=tablist]{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;gap:6px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.tabs::-webkit-scrollbar,[role=tablist]::-webkit-scrollbar{display:none}
.tabs>*,[role=tablist]>*{flex:0 0 auto;min-height:44px}

/* client page header: the admin buttons become one swipeable strip, the logo sits beside the name, the rest stacks */
.client-h .cfg{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;gap:8px!important;margin:0 -14px;padding:0 14px 4px;scrollbar-width:none;width:auto!important}
.client-h .cfg::-webkit-scrollbar{display:none}
.client-h .cfg>*{flex:0 0 auto;min-height:40px;white-space:nowrap}
.client-h .title-row{display:grid!important;grid-template-columns:64px minmax(0,1fr)!important;align-items:center!important;gap:6px 14px!important}
.client-h .title-row>.avatar{width:64px!important;height:64px!important;grid-row:1}
.client-h .title-col{grid-column:1/-1;gap:8px!important}
.client-h .title-line{gap:8px!important;flex-wrap:wrap}
.client-h .title-line h1{font-size:1.4rem!important}
.client-h .actions{display:flex!important;flex-wrap:wrap;gap:8px!important}

/* client page header, second pass: the logo sits beside the status chips and the name; the team fold goes under both */
.client-h .title-col{display:contents!important}
.client-h .title-row>.avatar{grid-column:1;grid-row:1/span 2;align-self:center}
.client-h .meta-top{grid-column:2;grid-row:1;display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.client-h .title-line{grid-column:2;grid-row:2}
.client-h .team-fold{grid-column:1/-1;grid-row:3}
/* tabs: all of them stay visible, in two tidy rows, instead of hiding behind a sideways scroll */
main [role=tablist]{display:flex!important;flex-wrap:wrap!important;gap:6px!important;overflow:visible!important}
main [role=tablist]>[role=tab]{flex:1 1 calc(25% - 6px)!important;min-width:0!important;min-height:44px;justify-content:center;padding-inline:8px!important;font-size:.84rem!important}
