/* =========================================================
   S Task — Projects (list / grid / calendar) + Workspaces
   Measured from 01-workspaces / 02-projects-list / 03-projects-grid / 04-projects-calendar
   ========================================================= */

/* ---------------- toolbar ---------------- */
.pj-tb .count-badge{font:400 12px/16px var(--font-2);min-width:29px;height:18px}
.pj-tb .vtoggle{margin-left:20px}
.pj-tb .vtoggle button{font:600 12px/21px var(--font-2)}
.pj-tb .ptb-right{gap:10px}
.pj-search{width:250px;height:30px;font:400 12px var(--font)}
.pj-tb .tb-btn.sq{width:40px;height:32px}
.pj-tb .tb-btn.sq .ic{width:12px;height:12px;color:var(--muted)}
.pj-arch{width:89px;padding:0 9px 0 5px;gap:0;font:400 12px/21px var(--font);color:var(--muted)}
.pj-arch .pj-arch-ic{width:24px;height:24px;padding:3px;color:var(--muted-2)}
.pj-arch.on{border-color:var(--green);color:var(--green)}
.pj-arch.on .pj-arch-ic{color:var(--green)}
.pj-tb .pj-ie{width:131px;padding:0 8px;gap:0;margin-left:-3px;font:500 12px/14px var(--font-2);color:var(--muted)}
.pj-tb .pj-ie .ic{width:24px;height:24px;color:rgba(0,0,0,.54)}
.pj-tb .pj-add{width:40px;height:30px}
.pj-tb .pj-add .ic{width:18px;height:18px}
.pj-joined{display:flex}
.pj-joined .pj-ie{margin-left:0}
.pj-viewdd{width:177px;padding:0 9px 0 15px;gap:0;font:400 12px/21px var(--font);color:var(--muted);justify-content:space-between;white-space:pre}
.pj-viewdd .ic{width:24px;height:24px;color:var(--muted)}

.pj-body{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}
.pj-empty{padding:40px 0;text-align:center;font:400 13px var(--font);color:#b8b8b8}

/* ---------------- list view ---------------- */
.pj-list{position:absolute;left:16px;right:46px;top:-2px;bottom:9px;background:#fff}
.pj-scroll{position:absolute;inset:0;overflow:auto}
.pj-head,.pj-row{display:flex;min-width:1613px}
.pj-head{position:sticky;top:0;z-index:3;height:31px;background:var(--head-bg)}
.pj-head .c{position:relative;height:31px;display:flex;align-items:center;padding-left:48px;font:500 13px/19px var(--font);color:var(--text-2);white-space:nowrap;background:var(--head-bg)}
.pj-head .c-title{padding-left:54px}
.pj-head .c:not(.c-fill):not(.c-menu)::after{content:"";position:absolute;right:0;top:8px;width:1px;height:15px;background:#e0e0e0}
.pj-head .c-menu{position:sticky;right:0}
.page-projects .c-title{width:228px;flex:none}
.page-projects .c-id{width:150px;flex:none}
.page-projects .c-pm{width:200px;flex:none}
.page-projects .c-prog{width:150px;flex:none}
.page-projects .c-res{width:200px;flex:none}
.page-projects .c-tasks{width:150px;flex:none}
.page-projects .c-fill{flex:1;min-width:0}
.page-projects .c-menu{width:40px;flex:none}

.pj-addrow{height:41px;display:flex;align-items:center;padding-left:5px;border-bottom:1px solid var(--border-2);cursor:pointer;min-width:1613px}
.pj-addrow .ic{width:20px;height:20px;color:var(--blue-link)}
.pj-addrow .t{margin-left:10px;font:500 14px/20px var(--font);color:var(--text)}
.pj-addrow:hover{background:#fafafa}
.pj-inline{margin-left:10px;width:360px;height:28px;border:1px solid var(--green);border-radius:4px;padding:0 10px;font:500 14px var(--font);color:var(--text);outline:0}

.pj-row{height:40px}
.pj-row .c{height:40px;display:flex;align-items:center;justify-content:center;border-bottom:1px solid var(--border-2);background:#fff;font:500 14px var(--font);color:var(--text)}
.pj-row .c-fill{border-bottom:0;background:transparent}
.pj-row .c-menu{position:sticky;right:0;z-index:1;justify-content:flex-start}
.pj-row:hover .c:not(.c-fill){background:#fafafa}
.pj-row .c-title{position:relative;justify-content:flex-start;padding-left:54px}
.pj-color{position:absolute;left:0;top:0;bottom:0;width:6px}
.pj-handle{width:26px;height:26px;border-radius:4px;display:flex;align-items:center;justify-content:center;margin-right:10px;flex:none}
.pj-handle svg{width:16px;height:16px;display:block}
.pj-handle:hover{background:rgba(0,0,0,.04)}
.pj-title{display:block;max-width:80px;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.pj-title:hover{color:var(--green)}
.pj-star{position:absolute;left:174px;top:8px;width:24px;height:24px;display:flex;align-items:center;justify-content:center;color:var(--muted-2);opacity:0}
.pj-star svg{width:24px;height:24px;fill:currentColor;display:block}
.pj-row:hover .pj-star,.pj-star.on{opacity:1}
.pj-star.on{color:#ffb400}
.pj-row .c-id{font:500 14px var(--font)}

.pj-addc{width:28px;height:28px;border-radius:50%;border:1px dashed var(--muted-2);background:#fff;display:inline-flex;align-items:center;justify-content:center;flex:none;color:rgba(0,0,0,.54)}
.pj-addc svg{width:18px;height:18px;fill:currentColor;display:block}
.pj-addc:hover{border-color:var(--green);color:var(--green)}
.pj-stack{margin-left:5px}
.pj-stack:empty{display:none}
.pj-stack .av{border:0;margin-left:-5px;font-size:17.1429px;font-weight:500}
.pj-stack .av:first-child{margin-left:0}
.pj-stack.s28 .av.online::after{width:8px;height:8px;border-width:2px;right:-2px;bottom:-3px;background:#2fd679}
.pj-stack.s32 .av{font-size:20px;margin-left:-5px}
.pj-stack.s32 .av:first-child{margin-left:0}
.pj-stack.s32 .av.online::after{width:12px;height:12px;border-width:2px;right:-6px;bottom:-4px;background:#2fd679;z-index:1}

.page-projects .c-prog{cursor:pointer}
.pj-ring{position:relative;width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center}
.pj-ring svg{position:absolute;inset:0;width:30px;height:30px}
.pj-ring circle{fill:none;stroke-width:10;stroke-linecap:round;transform:rotate(-90deg);transform-origin:50px 50px}
.pj-ring .tr{stroke:#dedede}
.pj-ring .pa{stroke:rgb(48,213,110);transition:stroke-dashoffset .3s}
.pj-ring h6{position:relative;margin:0;font:500 10px/16px var(--font-2);color:var(--text-2)}

.pj-row .c-tasks{cursor:pointer;gap:5px}
.pj-row .c-tasks .ic{width:17px;height:17px;color:#969696}
.pj-row .c-tasks p{margin:0;font:600 13px/19px var(--font);color:var(--text-2)}

.pj-more{width:37px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--muted)}
.pj-more svg{width:24px;height:24px;fill:currentColor;display:block}
.pj-more:hover{background:rgba(0,0,0,.04)}

/* filters tab + panel (list only) */
.page-projects .pj-filters-tab{top:-2px;bottom:9px;width:30px;background:#e8e8e8;border-left:0;padding-top:15px;z-index:4}
.page-projects .pj-filters-tab .ic{width:15px;height:15px;color:#000}
.page-projects .pj-filters-tab span{margin-top:5px;font:400 14px var(--font-2);color:#000}
.pj-fpanel{position:absolute;right:30px;top:-2px;bottom:9px;width:300px;background:#fff;box-shadow:-2px 0 8px rgba(0,0,0,.12);z-index:5;padding:10px 20px;overflow:auto}
.pj-fp-h{display:flex;align-items:center;height:47px;margin-bottom:10px}
.pj-fp-h h3{margin:0;font:600 20px/24px var(--font-2);color:#646464}
.pj-fp-x{margin-left:auto;width:22px;height:22px;color:var(--muted);cursor:pointer}
.pj-fp-chk{display:flex;align-items:center;gap:8px;font:400 13px var(--font);color:var(--text-2);cursor:pointer}
.pj-fp-f{margin-top:20px}

/* popovers / menus */
.pop .pj-pop-h{padding:6px 12px 4px;font:600 11px var(--font);color:var(--muted);text-transform:uppercase;letter-spacing:.3px}
.pop .pj-umi .av{width:22px;height:22px}
.pop .pj-chk{margin-left:auto;color:var(--green);font-weight:700}
.pop .pj-prog-pop{max-height:240px;overflow:auto}
.pop .mi.sel{color:var(--green);font-weight:700}
.pj-menu .mi .ic{width:16px;height:16px}
.pj-menu .pj-danger,.pj-menu .pj-danger .ic{color:var(--red)}
.pj-confirm{margin:0;font:400 14px/21px var(--font);color:var(--text-2)}
.pj-dates{display:flex;gap:16px}
.pj-dates .fld{flex:1}
.pj-create .req,.modal .req{color:var(--red);margin-left:2px;font-weight:400}
.pj-err{min-height:16px;font:400 12px var(--font);color:var(--red)}

/* ---------------- grid view ---------------- */
.pj-gridv{position:absolute;inset:0;overflow:auto;padding:6px 45px 20px 60px}
.pj-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));column-gap:16px;row-gap:16px}
.pj-card{height:185px;background:#fff;border-radius:5px;box-shadow:rgba(0,0,0,.2) 0 2px 6px 0;padding:11px 10px 20px 20px;display:flex;flex-direction:column;transition:box-shadow .15s}
.pj-card:hover{box-shadow:rgba(0,0,0,.26) 0 3px 10px 0}
.pjc-top{display:flex;align-items:flex-start;height:38px}
.pjc-tt{width:260px;min-width:0;flex:none;cursor:pointer}
.pjc-tt h6{margin:0;font:500 12px/19px var(--font-2);color:var(--text-2)}
.pjc-tt h5{margin:0;font:600 14px/19px var(--font-2);color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pjc-tt:hover h5{color:var(--green)}
.pjc-gantt{margin-left:auto;margin-top:6px;width:26px;height:26px;border-radius:4px;display:flex;align-items:center;justify-content:center}
.pjc-gantt svg{width:18px;height:18px;display:block}
.pjc-star{width:40px;height:40px;margin-top:-1px;margin-left:4px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--muted-2)}
.pjc-star svg{width:24px;height:24px;fill:currentColor;display:block}
.pjc-star.on{color:#ffb400}
.pjc-more{width:24px;height:40px;margin-top:-1px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--muted)}
.pjc-more svg{width:24px;height:24px;fill:currentColor;display:block}
.pjc-gantt:hover,.pjc-star:hover,.pjc-more:hover{background:rgba(0,0,0,.04)}
.pjc-av{height:32px;margin-top:11px;display:flex;padding-right:10px}
.pjc-av .pj-stack{margin-left:0}
.pjc-pr{display:flex;justify-content:space-between;margin-top:10px;padding-right:10px}
.pjc-pr p{margin:0;font:500 14px/21px var(--font-2);color:var(--muted-2)}
.pjc-bar{height:4px;margin:5px 10px 0 0;border-radius:20px;background:#9eebd4;overflow:hidden}
.pjc-bar i{display:block;height:100%;background:var(--green)}
.pjc-ft{display:flex;justify-content:space-between;margin-top:15px;padding-right:10px}
.pjc-ft button{height:18px;display:flex;align-items:center;gap:5px;border-radius:4px;color:var(--muted-2)}
.pjc-ft button svg{width:18px;height:18px;fill:currentColor;display:block}
.pjc-ft button svg path{fill:currentColor}
.pjc-ft p{margin:0;font:500 12px/17px var(--font-2);color:var(--muted)}
.pjc-ft button:hover,.pjc-ft button:hover p{color:var(--green)}

/* ---------------- calendar view ---------------- */
.pj-calv{position:absolute;inset:0;overflow:auto;padding:0 30px 20px 60px}
.pjc-tb{height:37px;margin-top:-2px;display:flex;align-items:center}
.pjc-today{width:66px;height:37px;border-radius:4px;background:var(--green);color:#fff;font:500 12px/21px var(--font-2)}
.pjc-today:hover{background:var(--green-dark)}
.pjc-arrow{width:28px;height:28px;border-radius:50%;margin-left:20px;color:var(--text-2);display:flex;align-items:center;justify-content:center}
.pjc-arrow+.pjc-title+.pjc-arrow{margin-left:0}
.pjc-arrow svg{width:28px;height:28px;fill:currentColor;display:block}
.pjc-arrow:hover{background:rgba(0,0,0,.04)}
.pjc-title{width:160px;text-align:center;font:500 18px/22px var(--font-2);color:#000}
.pjc-month{margin-top:20px;border:1px solid #eaeaea;background:#fff;min-width:900px}
.pjc-head{display:flex;height:34px;border-bottom:1px solid #eaeaea}
.pjc-hd{flex:1;display:flex;align-items:center;justify-content:center}
.pjc-hd+.pjc-hd{border-left:1px solid #eaeaea}
.pjc-hd span{font:500 10.8px/13px var(--font-2);color:var(--muted-2)}
.pjc-week{position:relative;height:101px;cursor:pointer}
.pjc-week+.pjc-week{border-top:1px solid #eaeaea}
.pjc-bgrow,.pjc-drow{position:absolute;inset:0;display:flex}
.pjc-dbg{flex:1;background:#fff}
.pjc-dbg+.pjc-dbg{border-left:1px solid #eaeaea}
.pjc-dbg.off{background:rgba(221,221,221,.3)}
.pjc-dbg.today{background:#fafafa}
.pjc-dcell{flex:1;padding:7px 0 0 7px}
.pjc-dcell button{font:400 12px/14px var(--font-2);color:#000;cursor:pointer}
.pjc-dcell.off button{color:#999}
.pjc-dcell.now button{color:var(--blue-link);font-weight:500}
.pjc-ev{position:absolute;height:20px;padding:2px 5px;border-radius:5px;color:#fff;font:500 12px/16px var(--font);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;z-index:1}
.pjc-ev.cp{border-top-left-radius:0;border-bottom-left-radius:0}
.pjc-ev.ca{border-top-right-radius:0;border-bottom-right-radius:0}
.pjc-ev:hover{filter:brightness(.92)}
.pjc-more-ev{position:absolute;font:600 11px/14px var(--font);color:var(--muted)}

/* =========================================================
   Workspaces dashboard (#/teams)
   ========================================================= */
#app:has(.page-teams) .hdr-search,#app:has(.page-teams) .btn-addnew,#app:has(.page-teams) .hdr-help{visibility:hidden}
.ws-page{position:absolute;inset:0;overflow:auto;padding:20px 51px 30px}
.ws-head{display:flex;align-items:center;height:40px}
.ws-head h4{margin:0;font:600 16px/20px var(--font-2);color:var(--text-2)}
.ws-head .ws-count{margin:0 0 0 5px;font:500 12px/17px var(--font-2);color:var(--muted)}
.ws-search{margin-left:auto;width:250px;height:40px;border:1px solid var(--border);border-radius:4px;padding:0 14px;font:400 12px var(--font);color:var(--text);outline:0;background:#fff}
.ws-search::placeholder{color:#b0b0b0}
.ws-search:focus{border-color:var(--green)}
.ws-grid{margin-top:10px;display:grid;grid-template-columns:repeat(auto-fill,385px);gap:16px}
.ws-create,.ws-card{height:238px;border-radius:4px;cursor:pointer}
.ws-create{background:#f6f6f6;border:2px dashed #eaeaea;display:flex;flex-direction:column;align-items:center;padding-top:87px}
.ws-plus{width:32px;height:32px;border-radius:50%;background:var(--green);color:#fff;display:flex;align-items:center;justify-content:center}
.ws-plus svg{width:24px;height:24px;fill:currentColor;display:block}
.ws-create h5{margin:12px 0 0;width:180px;text-align:center;font:600 15px/18px var(--font-2);color:var(--text-2)}
.ws-create:hover{border-color:#d6d6d6}
.ws-card{background:#fff;border:1px solid #eaeaea;display:flex;flex-direction:column;align-items:center;padding:20px 20px 0;transition:box-shadow .15s}
.ws-card:hover{box-shadow:0 2px 10px rgba(0,0,0,.08)}
.ws-av{width:48px;height:48px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;color:#fff;font:500 23px/1 var(--font)}
.ws-name{margin-top:11px;max-width:100%;font:500 15px/19px var(--font-2);color:#000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ws-stats{margin-top:33px;display:flex;gap:25px}
.ws-stat{display:flex;flex-direction:column;align-items:center}
.ws-stat span{font:500 12px/14px var(--font-2);color:var(--muted)}
.ws-stat b{margin-top:3px;font:600 18px/22px var(--font-2);color:#000}
.ws-mem{margin-top:14px;align-self:stretch;height:39px;border-top:1px solid #f1f1f1;display:flex;align-items:flex-start;justify-content:center;padding-top:10px}
.ws-mem p{margin:7px 5px 0 0;font:500 10px/14px var(--font-2);color:var(--muted)}
.ws-mem .pj-stack{margin-left:0}

/* =========================================================
   Phones (≤767px) — Projects list / grid / calendar + Workspaces
   List keeps its table form and scrolls sideways; the title column stays pinned (170px).
   ========================================================= */
@media (max-width: 767px){
  /* toolbar */
  .pj-tb .vtoggle{margin-left:auto}
  .pj-tb .vtoggle button{padding:0 10px}
  .pj-tb .tb-btn.sq,.pj-tb .pj-add{height:36px}

  /* list view: horizontal scroll, sticky title column */
  .pj-list{left:0;right:0;top:0;bottom:0}
  .pj-scroll{-webkit-overflow-scrolling:touch;padding-bottom:calc(76px + var(--safe-bottom))}
  .pj-head,.pj-row,.pj-addrow{min-width:700px}
  .page-projects .c-title{width:170px}
  .page-projects .c-id{width:90px}
  .page-projects .c-pm{width:120px}
  .page-projects .c-prog{width:80px}
  .page-projects .c-res{width:120px}
  .page-projects .c-tasks{width:80px}
  .pj-head .c{padding-left:0;justify-content:center}
  .pj-head .c-title{position:sticky;left:0;z-index:4;padding-left:12px;justify-content:flex-start;box-shadow:1px 0 0 #e6e6e6}
  .pj-row,.pj-row .c{height:46px}
  .pj-row .c-title{position:sticky;left:0;z-index:2;padding-left:10px;box-shadow:1px 0 0 #eee}
  .pj-handle{width:30px;height:30px;margin-right:4px}
  .pj-title{max-width:92px}
  .pj-star{left:auto;right:4px;top:5px;width:36px;height:36px;opacity:1}
  .pj-star:not(.on){color:#d0d0d0}
  .pj-addrow{height:46px;padding-left:10px}
  .pj-inline{width:calc(100vw - 60px);max-width:360px;height:36px}
  .pj-addc{width:32px;height:32px}
  .pj-more{width:40px;height:44px}

  /* filters: vertical tab becomes a round floating button; the panel covers the list */
  .page-projects .pj-filters-tab{display:flex;top:auto;right:14px;bottom:calc(74px + var(--safe-bottom));width:44px;height:44px;padding:0;border-radius:50%;justify-content:center;background:#fff;box-shadow:0 2px 8px rgba(0,0,0,.22);z-index:6}
  .page-projects .pj-filters-tab .ic{width:18px;height:18px}
  .page-projects .pj-filters-tab span{display:none}
  .pj-fpanel{left:0;right:0;top:0;bottom:0;width:auto;z-index:7;box-shadow:none;padding:6px 16px calc(16px + var(--safe-bottom))}
  .pj-fp-h h3{font-size:18px}
  .pj-fp-x{width:40px;height:40px;padding:9px;margin-right:-9px}
  .pj-fp-chk{min-height:40px}
  .pj-fp-f .btn{width:100%}

  /* grid view: one card per row */
  .pj-gridv{padding:10px 12px calc(80px + var(--safe-bottom))}
  .pj-cards{grid-template-columns:minmax(0,1fr);row-gap:12px}
  .pj-card{height:auto;min-height:175px}
  .pjc-tt{width:auto;flex:1}
  .pjc-gantt{width:36px;height:36px;margin-top:1px}
  .pjc-more{width:36px}
  .pjc-ft button{height:32px}

  /* calendar: 7 compact columns, 64px weeks, thin bars, "+N more" */
  .pj-calv{padding:8px 8px calc(80px + var(--safe-bottom))}
  .pjc-tb{height:40px;margin-top:0}
  .pjc-today{height:36px}
  .pjc-arrow{width:40px;height:40px;margin-left:8px}
  .pjc-title{width:auto;flex:1;font-size:16px}
  .pjc-month{min-width:0;margin-top:8px}
  .pjc-head{height:28px}
  .pjc-hd span{font-size:10px}
  .pjc-week{height:64px}
  .pjc-dcell{padding:3px 0 0 4px}
  .pjc-dcell button{font-size:10px;line-height:12px}
  .pjc-ev{height:13px;padding:0 3px;border-radius:3px;font:500 9px/13px var(--font)}
  .pjc-more-ev{font:600 9px/12px var(--font);white-space:nowrap}

  /* Workspaces dashboard */
  .ws-page{padding:12px 12px calc(24px + var(--safe-bottom))}
  .ws-head{flex-wrap:wrap;height:auto}
  .ws-search{order:3;width:100%;margin:10px 0 0;height:42px}
  .ws-grid{grid-template-columns:minmax(0,1fr);gap:12px}
  .ws-create{height:110px;padding-top:0;justify-content:center}
  .ws-card{height:auto;padding-top:16px}
  .ws-stats{margin-top:18px;gap:0;align-self:stretch;justify-content:space-around}
}
