:root{
  --bg:#f4f7f9;--card:#fff;--text:#263238;--muted:#72808c;--line:#dfe5e9;
  --blue:#2f80ed;--green:#19a463;--red:#e5484d;--orange:#f59e0b;--gray:#a7b0b8;--dayw:18px;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);font:14px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;color:var(--text)}
body.loading{cursor:progress} body.loading .app-shell{opacity:.62;pointer-events:none}.app-shell{padding:18px}
.topbar{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:14px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:.11em;color:#7a8791}.topbar h1{font-size:24px;margin:4px 0}.meta{color:var(--muted)}.actions{display:flex;gap:8px;flex-wrap:wrap}
.btn{border:1px solid transparent;border-radius:8px;padding:10px 14px;font-weight:700;cursor:pointer}.btn.primary{background:#31c1ef;color:white}.btn.ghost{background:#fff;border-color:var(--line);color:#41505b}.btn.small{padding:8px 11px}
.message{padding:11px 14px;border-radius:9px;margin-bottom:12px;background:#fff3cf;color:#775600;border:1px solid #f3d67a}.message.error{background:#ffe8e8;color:#a52b31;border-color:#ffcaca}.message.success{background:#e8f8ee;color:#167245;border-color:#bfe8ce}
.filters{display:flex;gap:10px;flex-wrap:wrap;background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px;margin-bottom:12px;align-items:end}.filters label{display:flex;flex-direction:column;gap:5px;font-size:11px;font-weight:700;color:#6d7a85}.filters select,.filters input{min-width:160px;border:1px solid #cfd7dd;border-radius:7px;padding:8px;background:#fff}
.stats{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:10px;margin-bottom:12px}.stat{background:#fff;border:1px solid var(--line);border-radius:10px;padding:12px}.stat span{display:block;color:var(--muted);font-size:12px}.stat strong{font-size:22px}.stat.danger strong{color:var(--red)}
.gantt-card{background:#fff;border:1px solid var(--line);border-radius:11px;overflow:auto;max-height:calc(100vh - 240px)}
.single-head,.task-row{display:grid;grid-template-columns:330px 180px 120px 120px auto;min-width:max-content}.portfolio-head,.project-row,.portfolio-task{display:grid;grid-template-columns:350px 190px 180px auto;min-width:max-content}
.single-head,.portfolio-head{position:sticky;top:0;z-index:15;background:#f7f9fb;border-bottom:1px solid var(--line);font-size:12px;font-weight:800;color:#52616c;min-height:62px}.single-head>div,.portfolio-head>div{padding:9px;border-right:1px solid var(--line)}
.task-row,.project-row{min-height:56px;border-bottom:1px solid #e7ecef;background:#fff}.task-row>div:not(.timeline-cell),.project-row>div:not(.timeline-cell){padding:8px 10px;border-right:1px solid var(--line);display:flex;align-items:center}.project-row{min-height:64px;background:#fbfcfd}.project-row.project-overdue{background:#fff8f8}
.project-title,.stage{font-weight:700}.project-title small,.stage small{display:block;color:var(--muted);font-weight:400;margin-top:2px}.project-title{position:relative;padding-left:36px!important;display:block!important}.chevron{position:absolute;left:8px;top:18px;border:0;background:transparent;font-size:18px;cursor:pointer}.clickable{cursor:pointer}.clickable:hover{text-decoration:underline}.indent{padding-left:34px!important}.resp,.period{color:#52616c;font-size:12px}.period{display:block!important}.period b{font-weight:700;color:#34444f}.period small{display:block;margin-top:3px}.danger-text{color:var(--red)}
.print-mini{border:1px solid #cbd6dc;background:#fff;border-radius:6px;padding:3px 7px;margin-left:7px;font-size:10px;color:#52616c;font-weight:700;cursor:pointer}.print-mini:hover{border-color:#69b9e5;color:#1886c7}
.timeline-head,.timeline-cell{position:relative;overflow:hidden}.timeline-header-wrap{position:absolute;inset:0;height:100%;background:#f7f9fb}.month-grid{display:flex;height:27px;border-bottom:1px solid #dce4e9;white-space:nowrap}.month-segment{flex:0 0 auto;text-align:center;padding:5px 3px 3px;font-size:11px;font-weight:800;color:#41515d;background:#eef5f8;border-right:1px solid #cfd9df;overflow:hidden;text-overflow:ellipsis}.timeline-header-wrap>.timeline-grid{height:35px}.timeline-grid{display:flex;height:100%;pointer-events:none}.day{flex:0 0 var(--dayw);width:var(--dayw);border-right:1px solid #edf1f3;text-align:center;padding-top:4px;font-size:10px;color:#6f7d87;overflow:hidden}.day b{font-size:9px}.day small{display:block;font-size:8px;font-weight:400}.day.weekend{background:#fafafa;color:#b2bac0}.day.today-col{background:#fff5f5;border-left:1px solid #ff9c9c}.timeline-cell{min-height:56px}.timeline-cell>.timeline-grid{position:absolute;inset:0}
.bar,.project-bar{position:absolute;top:14px;height:27px;border-radius:6px;background:var(--blue);color:#fff;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:800;cursor:grab;z-index:3;box-shadow:0 1px 4px #0002;overflow:hidden;white-space:nowrap}.bar.done{background:var(--green)}.bar.done-late{background:#c88419}.bar.overdue{background:var(--red)}.bar.today{background:var(--orange)}.project-bar{top:18px;height:25px}.project-progress{background:#e5ece8;color:#244237;opacity:1;cursor:default;border:1px solid #d0ddd6}.project-progress-fill{position:absolute;left:0;top:0;bottom:0;background:#28a36a;transition:width .25s ease}.project-progress-label{position:relative;z-index:2;font-weight:900;color:#fff;text-shadow:0 1px 2px #0005}.project-progress:has(.project-progress-fill[style*="width:0%"]) .project-progress-label{color:#52616c;text-shadow:none}.project-row.project-overdue .project-progress{box-shadow:0 0 0 1px #e5484d55,0 1px 4px #0002}.resize-handle{position:absolute;right:0;top:0;width:9px;height:100%;cursor:ew-resize;background:#ffffff22}
.date-edit{width:100%;border:1px solid transparent;background:transparent;border-radius:6px;padding:5px}.date-edit:hover,.date-edit:focus{border-color:#cbd4da;background:#fff;outline:none}.date-edit.compact{display:block;width:145px;margin:1px 0;padding:3px 4px}
.pill{display:inline-block;font-size:10px;padding:2px 6px;border-radius:999px;margin-left:6px;font-weight:800}.pill.red{background:#ffe1e1;color:#b82e34}.pill.amber{background:#fff0cf;color:#9a6400}.pill.gray{background:#edf1f4;color:#67747e}
.project-empty-note{padding:12px 20px 12px 46px;color:#7b8790;border-bottom:1px solid var(--line);background:#fcfcfc}.empty{background:#fff;border:1px dashed #cbd4da;border-radius:11px;padding:36px;text-align:center;color:#66737d}.dragging{user-select:none}
.modal-backdrop{position:fixed;inset:0;background:#0006;z-index:50;display:flex;align-items:center;justify-content:center}.modal-backdrop[hidden]{display:none}.modal{width:min(560px,92vw);background:#fff;border-radius:13px;box-shadow:0 20px 70px #0004}.modal-head{display:flex;justify-content:space-between;align-items:center;padding:16px 18px;border-bottom:1px solid var(--line)}.modal-head h2{margin:0;font-size:18px}.icon-btn{border:0;background:transparent;font-size:25px;cursor:pointer}.modal-body{padding:18px;max-height:70vh;overflow:auto}.field{display:flex;flex-direction:column;gap:6px;margin-bottom:13px;font-weight:700}.field select,.field input{padding:9px;border:1px solid #cdd6dc;border-radius:7px}.hint{font-size:12px;color:var(--muted)}.modal-foot{padding:14px 18px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:8px}
@media(max-width:900px){.stats{grid-template-columns:repeat(2,1fr)}.topbar{flex-direction:column}.gantt-card{max-height:none}}

/* v1.3 — compact production view */
.project-days-info{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 10px}.project-days-info:empty{display:none}.timing-chip{display:inline-flex;align-items:center;min-height:28px;padding:5px 10px;border-radius:999px;background:#eef3f6;color:#52616c;font-size:12px;font-weight:800;border:1px solid #d8e0e5}.timing-chip.good{background:#e9f8f0;color:#18794e;border-color:#bfe8d1}.timing-chip.warn{background:#fff6df;color:#9a6400;border-color:#f0d693}.timing-chip.bad{background:#fff0f0;color:#c43238;border-color:#f0b8bb}.timing-chip.extra{background:#f3efff;color:#6941c6;border-color:#d7c8ff}
/* More compact left-side rows while preserving readable bars */
.single-head,.task-row{grid-template-columns:300px 160px 112px 112px auto}.portfolio-head,.project-row,.portfolio-task{grid-template-columns:350px 180px 180px auto}.task-row{min-height:46px}.project-row{min-height:58px}.task-row>div:not(.timeline-cell),.project-row>div:not(.timeline-cell){padding:6px 9px}.timeline-cell{min-height:46px}.bar{top:9px;height:28px;min-width:36px}.project-bar{top:15px;height:27px}.stage{line-height:1.25}.stage small,.project-title small{font-size:11px;line-height:1.25}.indent{padding-left:28px!important}.chevron{top:14px}.date-edit.compact{width:138px;padding:2px 3px;font-size:11px}.period{line-height:1.3}
.pill.violet{background:#eee8ff;color:#6941c6}.extend-mini{border:1px solid #d7c8ff;background:#f7f4ff;border-radius:6px;padding:3px 7px;margin-left:5px;font-size:10px;color:#6941c6;font-weight:800;cursor:pointer}.extend-mini:hover{background:#eee8ff}
.field textarea{padding:9px;border:1px solid #cdd6dc;border-radius:7px;resize:vertical;font:inherit}.extension-modal{width:min(640px,94vw)}.extension-history-title{font-weight:800;margin:18px 0 8px}.extension-history{display:flex;flex-direction:column;gap:7px;max-height:210px;overflow:auto}.extension-item{display:grid;grid-template-columns:74px 1fr;gap:3px 9px;padding:9px;border:1px solid #e0e6ea;background:#fafcfd;border-radius:8px}.extension-item>b{grid-row:1/3;color:#6941c6}.extension-item>span{font-size:12px}.extension-item>small{color:#7b8790;font-size:10px}
@media(max-width:1200px){.portfolio-head,.project-row,.portfolio-task{grid-template-columns:320px 155px 165px auto}.single-head,.task-row{grid-template-columns:280px 145px 108px 108px auto}.project-title{padding-left:31px!important}.project-title small{white-space:normal}}
.project-row.project-risk{background:#fffaf0}.project-row.project-risk .project-progress{box-shadow:0 0 0 1px #e9b94966,0 1px 4px #0002}


/* v1.4 — management dashboard */
.stat-click{cursor:pointer;transition:.15s}.stat-click:hover{transform:translateY(-1px);box-shadow:0 3px 12px #0000000d}.stat.warning strong{color:#c47b00}
.range-switch{display:flex;gap:4px}.range-btn.active{background:#e9f4fb;border-color:#7ec5ec;color:#1677aa}
.health-badge{display:inline-flex;align-items:center;gap:5px;margin-left:7px;padding:2px 7px;border-radius:999px;font-size:10px;font-weight:800;vertical-align:middle}.health-badge i{width:7px;height:7px;border-radius:50%;background:currentColor}.health-badge.ok{background:#e9f8f0;color:#16824b}.health-badge.risk{background:#fff2d8;color:#a76800}.health-badge.overdue{background:#ffe7e7;color:#c62828}.health-badge.waiting{background:#e8f2ff;color:#276fb8}.health-badge.empty{background:#eef1f3;color:#71808a}
.project-row.project-waiting{background:#f7fbff}.project-row.project-risk{background:#fffaf0}.project-row.project-overdue{background:#fff7f7}
.project-actions{display:inline-flex;gap:3px;margin-left:5px}.mini-progress{height:5px;background:#e5ece8;border-radius:999px;margin-top:5px;overflow:hidden;width:150px}.mini-progress>div{height:100%;background:#28a36a;border-radius:inherit}
.project-days-left{display:block!important;margin-top:5px!important;font-size:14px!important;font-weight:650}.project-days-left strong{font-size:20px!important;font-weight:850!important;color:#34444f}.project-overdue .project-days-left strong{color:var(--red)}.forecast-text{color:#b36b00!important;font-weight:700}
.baseline-marker{position:absolute;top:5px;bottom:5px;width:2px;background:#596773;z-index:5;opacity:.8}.baseline-marker:after{content:'План';position:absolute;top:-2px;left:4px;font-size:8px;color:#596773;font-weight:800}
.extension-segment{position:absolute;top:17px;height:29px;background:repeating-linear-gradient(135deg,#9b7be8,#9b7be8 5px,#bba7ef 5px,#bba7ef 10px);color:white;z-index:4;border-radius:0 6px 6px 0;font-size:9px;font-weight:900;display:flex;align-items:center;justify-content:center;overflow:hidden}
.forecast-marker{position:absolute;top:4px;bottom:4px;width:2px;background:#e5484d;z-index:6}.forecast-marker span{position:absolute;top:0;left:4px;background:#e5484d;color:white;border-radius:4px;padding:2px 4px;font-size:8px;font-weight:900;white-space:nowrap}
.extension-item em{display:block;font-style:normal;font-size:9px;text-transform:uppercase;color:#7b61c8;font-weight:800;margin-bottom:2px}
/* Sticky identity columns while timeline scrolls */
.portfolio-head>div:nth-child(1),.project-row>div:nth-child(1),.portfolio-task>div:nth-child(1){position:sticky;left:0;z-index:10;background:inherit}
.portfolio-head>div:nth-child(2),.project-row>div:nth-child(2),.portfolio-task>div:nth-child(2){position:sticky;left:350px;z-index:10;background:inherit}
.portfolio-head>div:nth-child(3),.project-row>div:nth-child(3),.portfolio-task>div:nth-child(3){position:sticky;left:530px;z-index:10;background:inherit;box-shadow:5px 0 8px -7px #0008}
.portfolio-head>div:nth-child(-n+3){z-index:25;background:#f7f9fb}
@media(max-width:1200px){.portfolio-head>div:nth-child(2),.project-row>div:nth-child(2),.portfolio-task>div:nth-child(2){left:320px}.portfolio-head>div:nth-child(3),.project-row>div:nth-child(3),.portfolio-task>div:nth-child(3){left:475px}}


/* v1.5 — plan/fact, dashboard, workload, analytics, journal */
.view-tabs{display:flex;gap:6px;margin:10px 0 8px;border-bottom:1px solid #d9e1e6;padding-bottom:7px;overflow:auto}.view-tab{border:1px solid #d5dee4;background:white;color:#40525f;padding:7px 12px;border-radius:8px;font-weight:750;cursor:pointer;white-space:nowrap}.view-tab.active{background:#eaf6fd;border-color:#72bde9;color:#0879b7}.insight-card{border:1px solid #dce4e9;border-radius:10px;background:#fff;overflow:auto;min-height:180px;padding:14px}
.project-progress{background:#e5ece8!important;overflow:visible}.project-progress-fill{position:absolute;left:0;top:0;bottom:0;background:#23a36a;border-radius:6px 0 0 6px;overflow:hidden;min-width:0}.project-progress-label{position:absolute;top:50%;transform:translateY(-50%);font-size:10px;font-weight:900;z-index:3}.done-label{right:7px;color:#fff;text-shadow:0 1px 2px #0008}.rest-label{color:#52636e;margin-left:5px}.project-progress-fill[style*="width:100%"]{border-radius:6px}
.planfact-mini{display:block!important;color:#72818b!important;margin-top:2px}.planfact-mini b{color:#d24a43}.dash-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.dash-kpi{border:1px solid #e0e6ea;border-radius:10px;padding:13px;background:#fafcfd}.dash-kpi span,.dash-kpi small{display:block;color:#72818b}.dash-kpi b{display:block;font-size:25px;margin:5px 0}.dash-columns,.analytics-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}.dash-columns section,.analytics-grid section{border:1px solid #e0e6ea;border-radius:10px;padding:12px}.dash-columns h3,.analytics-grid h3,.journal-head h3{margin:0 0 10px}.attention-row,.delay-row{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:8px;padding:8px 0;border-bottom:1px solid #eef2f4}.attention-row:last-child,.delay-row:last-child{border-bottom:0}.attention-row>span:last-child{color:#72818b}.empty-mini{padding:18px;color:#7b8790;text-align:center}.analytics-total{font-size:12px;color:#6b7c88;margin-bottom:10px}.reason-row{display:grid;grid-template-columns:230px 1fr;align-items:center;gap:10px;margin:9px 0}.reason-row span{display:block;font-size:10px;color:#788892}.reason-track{height:9px;background:#edf1f3;border-radius:999px;overflow:hidden}.reason-track i{display:block;height:100%;background:#7b61c8;border-radius:999px}.delay-row{grid-template-columns:1fr auto}.delay-row small{display:block;color:#788892}.delay-row strong{color:#d24a43;font-size:15px}
.workload-note{padding:8px 10px;background:#fff7e6;border:1px solid #f0d693;border-radius:7px;margin-bottom:10px;color:#8a6100}.workload-head,.workload-person,.workload-task{display:grid;grid-template-columns:300px 180px auto;min-width:max-content}.workload-head{position:sticky;top:0;z-index:20;background:#f5f8fa;font-weight:800;border:1px solid #dce4e9}.workload-head>div,.workload-person>div,.workload-task>div{padding:7px 10px;border-right:1px solid #e1e7eb;border-bottom:1px solid #e1e7eb}.workload-person{background:#f8fafb;min-height:50px}.workload-person small,.workload-task small{display:block;color:#75858f;margin-top:3px}.workload-task{min-height:44px}.workload-task>div:first-child{padding-left:30px}.conflict-day{position:absolute;top:0;bottom:0;background:#e5484d33;border-left:1px solid #e5484d;border-right:1px solid #e5484d;z-index:2}.workload-task .bar{height:25px;top:9px}
.journal-head{display:flex;justify-content:space-between;align-items:center}.journal-head span{color:#74838e}.journal-list{display:flex;flex-direction:column}.journal-row{display:grid;grid-template-columns:135px 1fr 110px;gap:12px;padding:9px 5px;border-bottom:1px solid #edf1f3;align-items:start}.journal-row time{font-size:11px;color:#6f7f89}.journal-row b,.journal-row span,.journal-row small{display:block}.journal-row span{margin-top:2px}.journal-row small{color:#85929a;margin-top:3px}.journal-type{font-size:9px!important;text-transform:uppercase;color:#6b7780!important;background:#eef2f4;padding:3px 5px;border-radius:4px;text-align:center}.danger-text{color:#d6383f!important}
@media(max-width:1100px){.dash-grid{grid-template-columns:repeat(2,1fr)}.dash-columns,.analytics-grid{grid-template-columns:1fr}.reason-row{grid-template-columns:180px 1fr}}

/* v1.5.2 Smart Process 169 */
.project-title small{word-break:break-word}


/* v1.5.3 — Team roles / grouped workload */
.team-modal{width:min(780px,94vw);max-height:90vh}
.team-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
.team-field{display:flex;flex-direction:column;gap:6px;padding:11px 12px;border:1px solid #dfe7ec;border-radius:9px;background:#fff}
.team-field span{font-size:12px;font-weight:750;color:#34444f}
.team-field span b{color:#e5484d}
.team-field select{height:38px;border:1px solid #cbd7df;border-radius:7px;padding:0 9px;background:#fff;min-width:0}
.team-field small{font-size:9px;color:#8b99a3}
.team-field.missing{border-color:#f2b8b8;background:#fff8f8}
.team-field.missing select{border-color:#e98c8c}
.team-alert{padding:10px 12px;border-radius:8px;background:#eef8ff;border:1px solid #b9ddf5;color:#31566d;font-size:12px;line-height:1.45}
.team-alert b{color:#d64545}
.workload-user-title{display:flex;align-items:center;gap:8px}
.workload-user-title .chevron{flex:0 0 auto}
.workload-group{cursor:default}
.workload-person>div:first-child small,.workload-task>div:nth-child(2) small{display:block;color:#81909b;font-size:10px;margin-top:3px}
@media(max-width:850px){.team-fields{grid-template-columns:1fr}}


/* =========================================================
   v1.5.4 — Funnels + full project team
   ========================================================= */

/* Основной список: команда стала шире, период остается компактным */
.portfolio-head,
.project-row,
.portfolio-task {
  grid-template-columns: 350px 290px 180px max-content !important;
}

/* sticky positions под новую ширину */
.portfolio-head>div:nth-child(2),
.project-row>div:nth-child(2),
.portfolio-task>div:nth-child(2) {
  left:350px !important;
}

.portfolio-head>div:nth-child(3),
.project-row>div:nth-child(3),
.portfolio-task>div:nth-child(3) {
  left:640px !important;
}

/* Команда проекта */
.project-team-cell{
  padding:8px 9px !important;
  align-self:stretch;
}
.project-team-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:5px;
  align-content:start;
}
.project-team-member{
  display:flex;
  align-items:center;
  min-width:0;
  gap:6px;
  padding:5px 6px;
  border:1px solid #dfe8ed;
  background:#fff;
  border-radius:8px;
  box-shadow:0 1px 1px #00000005;
}
.project-team-member.missing{
  border-color:#f1c4c4;
  background:#fff7f7;
}
.project-team-avatar{
  width:24px;
  height:24px;
  min-width:24px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#e8f4fb;
  color:#2277a8;
  font-size:9px;
  font-weight:850;
  letter-spacing:.2px;
}
.project-team-member.missing .project-team-avatar{
  background:#ffe4e4;
  color:#c64545;
}
.project-team-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  line-height:1.12;
}
.project-team-copy b{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:10px;
  color:#273945;
  font-weight:750;
}
.project-team-copy small{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  margin-top:2px;
  font-size:8px !important;
  color:#84939d !important;
}
.project-team-empty{
  color:#9aa6ae;
  font-size:10px;
  padding:7px;
  border:1px dashed #ced8de;
  border-radius:7px;
}

/* Бейдж воронки */
.funnel-badge{
  display:inline-flex;
  align-items:center;
  margin-left:6px;
  padding:2px 7px;
  border-radius:999px;
  font-size:9px;
  line-height:16px;
  font-weight:850;
  vertical-align:middle;
  border:1px solid transparent;
}
.funnel-badge.design{
  background:#e9f5ff;
  color:#1677b8;
  border-color:#bee0f6;
}
.funnel-badge.architecture{
  background:#efeaff;
  color:#6750b8;
  border-color:#d6caf9;
}

/* Ряд проекта автоматически увеличивается по содержимому команды */
.project-row{
  min-height:68px;
  height:auto !important;
}
.project-row>div{
  min-height:68px;
}

/* На небольшом экране команда остается читаемой */
@media(max-width:1200px){
  .portfolio-head,
  .project-row,
  .portfolio-task{
    grid-template-columns:320px 260px 175px max-content !important;
  }
  .portfolio-head>div:nth-child(2),
  .project-row>div:nth-child(2),
  .portfolio-task>div:nth-child(2){
    left:320px !important;
  }
  .portfolio-head>div:nth-child(3),
  .project-row>div:nth-child(3),
  .portfolio-task>div:nth-child(3){
    left:580px !important;
  }
  .project-team-list{
    grid-template-columns:1fr;
  }
}


/* =========================================================
   v1.5.5.4 — Height only, no iframe resize
   ========================================================= */

/* Keep normal Bitrix24 width */
html,
body {
  width: 100% !important;
  max-width: none !important;
  min-height: 100%;
}

body {
  min-height: 100vh;
}

/* Application uses available vertical area */
.app-shell {
  width: 100% !important;
  max-width: none !important;
  min-height: calc(100vh - 8px);
  box-sizing: border-box;
}

/* Main work areas */
#ganttCard,
#insightCard {
  width: 100%;
  min-height: calc(100vh - 250px);
  box-sizing: border-box;
}

/* Do not create a narrow parent column */
.app-shell > *,
.page,
.main,
.content {
  max-width: none;
}

/* Internal scroll is vertical/horizontal only where needed */
.gantt-scroll,
.portfolio-wrap,
.timeline-wrap {
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 285px);
  overflow: auto;
}

/* Keep filters and tabs in normal horizontal layout */
.filters,
.toolbar,
.view-tabs,
.stats {
  width: 100%;
}

/* On shorter screens, don't force a huge panel */
@media (max-height: 760px) {
  #ganttCard,
  #insightCard {
    min-height: 420px;
  }

  .gantt-scroll,
  .portfolio-wrap,
  .timeline-wrap {
    max-height: 520px;
  }
}


/* =========================================================
   v1.5.5.5 — compact collapsed project controls
   ========================================================= */
.collapsed-project-controls{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:4px 2px;
  min-height:50px;
  justify-content:center;
}
.collapsed-project-status-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:5px;
}
.collapsed-project-status-row .funnel-badge{
  margin-left:0;
}
.collapsed-project-status-row .health-badge{
  margin-left:0;
}
.collapsed-project-actions{
  display:flex;
  gap:6px;
  align-items:center;
}
.collapsed-project-actions button{
  min-height:26px;
}

/* Свёрнутый проект не раздувается из-за командных карточек */
.project-row:not(:has(+ .portfolio-task)) .project-team-cell{
  align-content:center;
}

/* В раскрытом виде команда остается как раньше */
.project-team-list{
  align-content:start;
}


/* =========================================================
   v1.5.6 — responsible-only project row + management dashboard
   ========================================================= */
.project-responsible{
  display:flex;
  align-items:center;
  gap:8px;
  padding:7px 8px;
  border:1px solid #dfe8ed;
  background:#fff;
  border-radius:9px;
  width:fit-content;
  max-width:100%;
}
.project-responsible.missing{
  background:#fff7f7;
  border-color:#efc5c5;
}
.project-summary-controls{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:5px;
  margin:5px 0 2px 27px;
}
.project-summary-controls .funnel-badge,
.project-summary-controls .health-badge{
  margin-left:0;
}

/* More useful dashboard */
.dash-grid-real{
  grid-template-columns:repeat(6,minmax(125px,1fr)) !important;
}
.dash-kpi.danger b{color:#d83b42;}
.dash-kpi.warning b{color:#c77b00;}
.dash-kpi.info b{color:#287bb5;}
.dashboard-section{
  margin-top:14px;
  border:1px solid #dfe7ec;
  border-radius:10px;
  background:#fff;
  overflow:hidden;
}
.dashboard-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:11px 13px;
  border-bottom:1px solid #e6ecef;
}
.dashboard-section-head h3{
  margin:0;
  font-size:13px;
}
.dashboard-section-head span{
  font-size:10px;
  color:#81909b;
}
.problem-project-table{
  width:100%;
}
.problem-table-head,
.problem-table-row{
  display:grid;
  grid-template-columns:minmax(240px,2fr) 145px 110px 100px 120px;
  gap:8px;
  align-items:center;
  padding:8px 12px;
}
.problem-table-head{
  background:#f7f9fb;
  font-size:9px;
  text-transform:uppercase;
  color:#7f8e98;
  font-weight:800;
}
.problem-table-row{
  border-top:1px solid #edf1f3;
  font-size:11px;
}
.problem-table-row>span{
  min-width:0;
}
.problem-table-row small{
  display:block;
  color:#87949d;
  font-size:9px;
  margin-top:2px;
}
.dashboard-real-columns{
  margin-top:14px;
}
.dashboard-task-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  padding:9px 10px;
  border-top:1px solid #edf1f3;
  font-size:11px;
}
.dashboard-task-row:first-of-type{
  border-top:0;
}
.dashboard-task-row>div{
  min-width:0;
}
.dashboard-task-row small{
  display:block;
  margin-top:3px;
  color:#83919a;
  font-size:9px;
}
.dashboard-task-row>div:last-child{
  text-align:right;
}
.dashboard-footnote{
  margin-top:12px;
  padding:10px 12px;
  border-radius:8px;
  background:#f7f9fb;
  font-size:11px;
  color:#61717d;
}

/* Workload expansion */
.workload-group{
  cursor:pointer;
}
.workload-group:hover{
  background:#f7fbfe;
}
.workload-group.expanded{
  background:#f3f9fd;
}
.workload-chevron{
  pointer-events:none;
}
.workload-task-expanded{
  background:#fff;
}
.workload-task-expanded>div:first-child{
  padding-left:32px;
}
.workload-task-expanded .clickable{
  font-weight:700;
}
.workload-task-expanded .clickable:hover{
  text-decoration:underline;
}

@media(max-width:1400px){
  .dash-grid-real{
    grid-template-columns:repeat(3,minmax(140px,1fr)) !important;
  }
}
@media(max-width:900px){
  .dash-grid-real{
    grid-template-columns:repeat(2,minmax(130px,1fr)) !important;
  }
  .problem-table-head{
    display:none;
  }
  .problem-table-row{
    grid-template-columns:1fr 1fr;
  }
}


/* =========================================================
   v1.5.7 — project pagination
   ========================================================= */
.project-pager{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  background:#fff;
  border-bottom:1px solid #dfe7ec;
}
.project-pager:last-child{
  border-top:1px solid #dfe7ec;
  border-bottom:0;
}
.project-pager.compact{
  justify-content:flex-end;
  color:#75848e;
  font-size:10px;
}
.pager-summary{
  color:#667782;
  font-size:11px;
  white-space:nowrap;
}
.pager-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:4px;
}
.pager-btn{
  height:30px;
  min-width:30px;
  padding:0 9px;
  border:1px solid #d5e0e6;
  border-radius:7px;
  background:#fff;
  color:#344955;
  font-size:11px;
  font-weight:650;
  cursor:pointer;
}
.pager-btn:hover:not(:disabled){
  background:#f0f8fd;
  border-color:#a8d8f0;
}
.pager-btn.active{
  background:#e6f5ff;
  border-color:#66bdeb;
  color:#147bb3;
}
.pager-btn:disabled{
  opacity:.45;
  cursor:default;
}
.pager-nav{
  min-width:auto;
}
.pager-ellipsis{
  display:inline-flex;
  width:24px;
  justify-content:center;
  color:#86949d;
}

@media(max-width:900px){
  .project-pager{
    align-items:flex-start;
    flex-direction:column;
  }
}


/* =========================================================
   v1.5.8 — compact columns, one-line task titles, quick finish
   ========================================================= */

/* DETAIL: more room for the task title + Gantt.
   Fixed columns total is slightly smaller than before. */
.single-head,
.task-row{
  grid-template-columns: 410px 130px 96px 96px auto !important;
}

/* PORTFOLIO: responsible and period narrower;
   first column wider, but total fixed width is reduced. */
.portfolio-head,
.project-row,
.portfolio-task{
  grid-template-columns: 410px 135px 145px max-content !important;
}

/* Sticky left offsets for portfolio after width change */
.portfolio-head>div:nth-child(2),
.project-row>div:nth-child(2),
.portfolio-task>div:nth-child(2){
  left:410px !important;
}
.portfolio-head>div:nth-child(3),
.project-row>div:nth-child(3),
.portfolio-task>div:nth-child(3){
  left:545px !important;
}

/* Task title never wraps */
.task-title-line{
  display:flex;
  align-items:center;
  gap:6px;
  width:100%;
  min-width:0;
}
.task-title-main{
  flex:1 1 auto;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-weight:800;
}
.task-title-main:hover{
  text-decoration:underline;
}

/* Plan/fact stays as the only secondary technical line */
.stage .planfact-mini{
  margin-top:4px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Quick task completion */
.task-complete-btn{
  flex:0 0 auto;
  border:1px solid #9fd7b8;
  background:#eefaf3;
  color:#16854b;
  border-radius:6px;
  height:24px;
  padding:0 7px;
  font-size:9px;
  line-height:22px;
  font-weight:800;
  cursor:pointer;
}
.task-complete-btn:hover{
  background:#dcf5e7;
  border-color:#6fc695;
}
.task-complete-state{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  height:22px;
  padding:0 7px;
  border-radius:999px;
  background:#e8f7ee;
  color:#16854b;
  font-size:9px;
  font-weight:800;
}

/* Compact date columns in detail view */
.single-head>div:nth-child(3),
.single-head>div:nth-child(4),
.task-row>div:nth-child(3),
.task-row>div:nth-child(4){
  padding-left:5px !important;
  padding-right:5px !important;
}
.task-row .date-edit:not(.compact){
  width:88px;
  min-width:88px;
  padding:2px 1px;
  font-size:10px;
}

/* Compact portfolio period */
.portfolio-task .period{
  gap:2px;
  padding-left:5px !important;
  padding-right:5px !important;
}
.portfolio-task .date-edit.compact{
  width:128px;
  max-width:128px;
  padding:2px 2px;
  font-size:10px;
}

/* Smaller screens: still preserve Gantt space */
@media(max-width:1200px){
  .single-head,
  .task-row{
    grid-template-columns: 360px 115px 92px 92px auto !important;
  }

  .portfolio-head,
  .project-row,
  .portfolio-task{
    grid-template-columns: 365px 120px 135px max-content !important;
  }

  .portfolio-head>div:nth-child(2),
  .project-row>div:nth-child(2),
  .portfolio-task>div:nth-child(2){
    left:365px !important;
  }
  .portfolio-head>div:nth-child(3),
  .project-row>div:nth-child(3),
  .portfolio-task>div:nth-child(3){
    left:485px !important;
  }
}


/* =========================================================
   v1.5.8.1 — responsible width + compact task rows
   ========================================================= */

.portfolio-head,
.project-row,
.portfolio-task{
  grid-template-columns:395px 175px 125px max-content !important;
}

.portfolio-head>div:nth-child(2),
.project-row>div:nth-child(2),
.portfolio-task>div:nth-child(2){
  left:395px !important;
}

.portfolio-head>div:nth-child(3),
.project-row>div:nth-child(3),
.portfolio-task>div:nth-child(3){
  left:570px !important;
}

/* Full project responsible name */
.project-responsible{
  width:100%;
  max-width:100%;
}
.project-responsible .project-team-copy{
  flex:1 1 auto;
  min-width:0;
}
.project-responsible .project-team-copy b{
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  line-height:1.15;
  font-size:10px;
}

/* Task responsible can wrap instead of being cut */
.portfolio-task .resp,
.task-row .resp{
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  line-height:1.2;
}

/* Keep remaining workdays on one line, slightly smaller */
.project-row .period{
  font-size:11px;
  line-height:1.2;
}
.project-row .period b,
.project-row .period strong{
  font-size:16px !important;
  line-height:1.05 !important;
  white-space:nowrap !important;
}

/* Compact task row after removing Plan/Fact */
.portfolio-task .stage,
.task-row .stage{
  padding-top:8px;
  padding-bottom:8px;
}
.task-title-line{
  margin:0;
}
.planfact-mini{
  display:none !important;
}

@media(max-width:1200px){
  .portfolio-head,
  .project-row,
  .portfolio-task{
    grid-template-columns:360px 160px 120px max-content !important;
  }

  .portfolio-head>div:nth-child(2),
  .project-row>div:nth-child(2),
  .portfolio-task>div:nth-child(2){
    left:360px !important;
  }

  .portfolio-head>div:nth-child(3),
  .project-row>div:nth-child(3),
  .portfolio-task>div:nth-child(3){
    left:520px !important;
  }

  .project-row .period b,
  .project-row .period strong{
    font-size:15px !important;
  }
}


/* =========================================================
   v1.5.8.2 — fix portfolio "Период" column overflow
   ========================================================= */

/*
  Было:
  Проект 395 | Ответственный 175 | Период 125

  Стало:
  Проект 385 | Ответственный 170 | Период 165

  Общая фиксированная часть увеличилась всего на 25px,
  но колонка Период получила +40px и больше не залезает в Гант.
*/
.portfolio-head,
.project-row,
.portfolio-task{
  grid-template-columns:385px 170px 165px max-content !important;
}

/* Sticky offsets */
.portfolio-head>div:nth-child(2),
.project-row>div:nth-child(2),
.portfolio-task>div:nth-child(2){
  left:385px !important;
}

.portfolio-head>div:nth-child(3),
.project-row>div:nth-child(3),
.portfolio-task>div:nth-child(3){
  left:555px !important;
}

/* Period is fully contained inside its cell */
.project-row .period,
.portfolio-task .period{
  min-width:0;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  overflow:hidden;
}

/* Project summary dates */
.project-row .period{
  padding-left:9px !important;
  padding-right:9px !important;
}

.project-row .period > div:first-child,
.project-row .period > b:first-child,
.project-row .period > strong:first-child{
  white-space:nowrap;
}

/* Task date inputs stay inside Period */
.portfolio-task .period{
  padding-left:7px !important;
  padding-right:7px !important;
  align-items:flex-start;
}

.portfolio-task .date-edit.compact{
  width:148px !important;
  max-width:148px !important;
  box-sizing:border-box;
}

/* Tablet / narrower Bitrix window */
@media(max-width:1200px){
  .portfolio-head,
  .project-row,
  .portfolio-task{
    grid-template-columns:345px 150px 155px max-content !important;
  }

  .portfolio-head>div:nth-child(2),
  .project-row>div:nth-child(2),
  .portfolio-task>div:nth-child(2){
    left:345px !important;
  }

  .portfolio-head>div:nth-child(3),
  .project-row>div:nth-child(3),
  .portfolio-task>div:nth-child(3){
    left:495px !important;
  }

  .portfolio-task .date-edit.compact{
    width:138px !important;
    max-width:138px !important;
  }
}


/* =========================================================
   v1.5.8.3 — окончательное исправление колонки "Период"
   ========================================================= */

/*
   Было: текст периода обрезался у границы временной шкалы.
   Решение:
   - увеличиваем Период;
   - запрещаем overflow:hidden;
   - период проекта показываем полностью;
   - начало Ганта смещаем вправо строго по новой сетке.
*/

.portfolio-head,
.project-row,
.portfolio-task {
  grid-template-columns:
    375px       /* Проект / этап */
    165px       /* Ответственный */
    190px       /* Период */
    max-content /* Гант */
    !important;
}

/* sticky offsets */
.portfolio-head > div:nth-child(2),
.project-row > div:nth-child(2),
.portfolio-task > div:nth-child(2) {
  left: 375px !important;
}

.portfolio-head > div:nth-child(3),
.project-row > div:nth-child(3),
.portfolio-task > div:nth-child(3) {
  left: 540px !important;
}

/* Период никогда не залезает под Гант */
.portfolio-head > div:nth-child(3),
.project-row > div:nth-child(3),
.portfolio-task > div:nth-child(3) {
  width: 190px !important;
  min-width: 190px !important;
  max-width: 190px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  z-index: 5;
  background: inherit;
}

/* строка периода проекта */
.project-row .period {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: visible !important;
  padding: 8px 10px !important;
  box-sizing: border-box;
}

/* диапазон дат проекта: строго одна строка */
.project-row .period > :first-child {
  display: block;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  font-weight: 700;
}

/* Осталось XX р.д. — компактно и в одну строку */
.project-row .period b,
.project-row .period strong {
  display: block;
  margin-top: 5px;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  font-size: 15px !important;
  line-height: 1.1 !important;
}

/* Период задач — даты и иконки остаются внутри ячейки */
.portfolio-task .period {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: hidden !important;
  padding: 6px 8px !important;
  box-sizing: border-box;
  gap: 3px;
}

.portfolio-task .date-edit.compact {
  width: 168px !important;
  min-width: 168px !important;
  max-width: 168px !important;
  box-sizing: border-box !important;
  font-size: 10px !important;
}

/* Чёткая граница перед Гантом */
.portfolio-head > div:nth-child(3),
.project-row > div:nth-child(3),
.portfolio-task > div:nth-child(3) {
  border-right: 1px solid #d7e0e5 !important;
  box-shadow: 5px 0 8px rgba(40, 60, 75, 0.05);
}

/* На средних экранах не уменьшаем Период ниже безопасной ширины */
@media (max-width: 1200px) {
  .portfolio-head,
  .project-row,
  .portfolio-task {
    grid-template-columns:
      340px
      150px
      185px
      max-content
      !important;
  }

  .portfolio-head > div:nth-child(2),
  .project-row > div:nth-child(2),
  .portfolio-task > div:nth-child(2) {
    left: 340px !important;
  }

  .portfolio-head > div:nth-child(3),
  .project-row > div:nth-child(3),
  .portfolio-task > div:nth-child(3) {
    left: 490px !important;
    width: 185px !important;
    min-width: 185px !important;
    max-width: 185px !important;
  }

  .portfolio-task .date-edit.compact {
    width: 163px !important;
    min-width: 163px !important;
    max-width: 163px !important;
  }
}


/* =========================================================
   v1.5.10 — Выполнение проектов
   ========================================================= */

.progress-projects-summary{
  display:grid;
  grid-template-columns:repeat(5,minmax(120px,1fr));
  gap:10px;
  margin-bottom:12px;
}
.progress-projects-summary>div{
  border:1px solid #dfe7ec;
  border-radius:10px;
  background:#fff;
  padding:11px 13px;
}
.progress-projects-summary span{
  display:block;
  color:#7d8c97;
  font-size:10px;
  margin-bottom:5px;
}
.progress-projects-summary b{
  font-size:20px;
  line-height:1;
}

.project-progress-board{
  border:1px solid #dfe7ec;
  border-radius:10px;
  background:#fff;
  overflow:hidden;
}

.project-progress-head,
.project-progress-row{
  display:grid;
  grid-template-columns:minmax(260px,2fr) 115px minmax(150px,1fr) 85px minmax(220px,1.35fr) 110px 125px;
  gap:8px;
  align-items:center;
}

.project-progress-head{
  padding:10px 12px;
  background:#f5f8fa;
  border-bottom:1px solid #dfe7ec;
  color:#657681;
  font-size:9px;
  text-transform:uppercase;
  font-weight:800;
}

.project-progress-row{
  min-height:64px;
  padding:9px 12px;
  border-bottom:1px solid #edf1f3;
  cursor:pointer;
}
.project-progress-row:last-child{border-bottom:0;}
.project-progress-row:hover{background:#f8fbfd;}

.pp-project{min-width:0;}
.pp-project b{
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:12px;
  line-height:1.25;
}
.pp-project small{
  display:block;
  margin-top:4px;
  color:#8a98a1;
  font-size:9px;
}
.pp-responsible{font-size:11px;line-height:1.25;}
.pp-stages{font-size:11px;white-space:nowrap;}
.pp-stages b{font-size:15px;}

.pp-progress{min-width:0;}
.pp-progress-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  margin-bottom:5px;
}
.pp-progress-top b{font-size:13px;}
.pp-progress-top span{font-size:9px;color:#89969e;}
.pp-track{
  height:7px;
  overflow:hidden;
  border-radius:999px;
  background:#e2e9ed;
}
.pp-track>span{
  display:block;
  height:100%;
  border-radius:inherit;
  background:#1da463;
}
.pp-remaining{font-size:11px;font-weight:700;white-space:nowrap;}
.warning-text{color:#c47a00!important;}

@media(max-width:1250px){
  .project-progress-head,
  .project-progress-row{
    grid-template-columns:minmax(220px,1.7fr) 105px 140px 75px minmax(180px,1.2fr) 95px 110px;
  }
}

@media(max-width:900px){
  .progress-projects-summary{
    grid-template-columns:repeat(2,minmax(130px,1fr));
  }
  .project-progress-head{display:none;}
  .project-progress-row{
    grid-template-columns:1fr 1fr;
    gap:7px 12px;
  }
  .pp-progress{grid-column:1/-1;}
}


/* =========================================================
   v1.5.11 — График проектов по статусам
   ========================================================= */
.project-status-chart-card{
  background:#fff;
  border:1px solid #dfe7ec;
  border-radius:12px;
  padding:18px 20px 16px;
  min-height:430px;
}

.project-status-chart-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  margin-bottom:18px;
}

.project-status-chart-head h3{
  margin:0;
  font-size:17px;
  line-height:1.2;
  color:#203541;
}

.project-status-chart-head p{
  margin:6px 0 0;
  font-size:11px;
  color:#7a8a94;
}

.overdue-focus{
  min-width:150px;
  border-radius:10px;
  padding:10px 13px;
  border:1px solid #dce5ea;
  background:#f7fafb;
  text-align:right;
}

.overdue-focus span,
.overdue-focus small{
  display:block;
  font-size:9px;
  color:#7e8d97;
}

.overdue-focus b{
  display:block;
  margin:3px 0;
  font-size:26px;
  line-height:1;
}

.overdue-focus.has-overdue{
  background:#fff1f1;
  border-color:#f0b0b0;
}
.overdue-focus.has-overdue b{color:#d9363e;}
.overdue-focus.clean b{color:#1b9a5d;}

.project-status-chart{
  height:300px;
  display:grid;
  grid-template-columns:repeat(5,minmax(110px,1fr));
  gap:20px;
  align-items:end;
  padding:12px 10px 0;
  border-bottom:1px solid #dfe7ec;
  background:
    linear-gradient(to top, transparent 24%, rgba(223,231,236,.6) 25%, transparent 26%),
    linear-gradient(to top, transparent 49%, rgba(223,231,236,.6) 50%, transparent 51%),
    linear-gradient(to top, transparent 74%, rgba(223,231,236,.6) 75%, transparent 76%);
}

.status-chart-column{
  height:100%;
  display:grid;
  grid-template-rows:28px 1fr auto 32px;
  align-items:end;
  text-align:center;
  min-width:0;
}

.status-chart-count{
  font-size:20px;
  font-weight:800;
  line-height:1;
  margin-bottom:5px;
}
.status-chart-count.overdue{color:#d9363e;}
.status-chart-count.risk{color:#d98900;}
.status-chart-count.waiting{color:#337fc4;}
.status-chart-count.ok{color:#1a9b5e;}
.status-chart-count.done{color:#607d8b;}

.status-chart-bar-wrap{
  height:190px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  width:100%;
}

.status-chart-bar{
  width:min(78px,72%);
  min-height:6px;
  border-radius:8px 8px 2px 2px;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding-top:6px;
  box-sizing:border-box;
  box-shadow:0 2px 6px rgba(34,54,66,.08);
}
.status-chart-bar span{
  font-size:10px;
  font-weight:800;
}
.status-chart-bar.overdue{background:#f05c63;color:#fff;}
.status-chart-bar.risk{background:#f2a321;color:#fff;}
.status-chart-bar.waiting{background:#5aa5df;color:#fff;}
.status-chart-bar.ok{background:#38b879;color:#fff;}
.status-chart-bar.done{background:#8aa4b2;color:#fff;}

.status-chart-label{
  margin-top:8px;
  font-size:11px;
  font-weight:800;
  color:#2b414d;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.status-chart-desc{
  margin-top:4px;
  font-size:8px;
  line-height:1.25;
  color:#8a98a1;
  min-height:26px;
}

.project-status-chart-foot{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.status-legend{
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:9px;
  color:#63757f;
}
.status-legend:before{
  content:'';
  width:8px;
  height:8px;
  border-radius:2px;
  display:inline-block;
}
.status-legend.overdue:before{background:#f05c63;}
.status-legend.risk:before{background:#f2a321;}
.status-legend.waiting:before{background:#5aa5df;}
.status-legend.ok:before{background:#38b879;}
.status-legend.done:before{background:#8aa4b2;}

@media(max-width:1000px){
  .project-status-chart{gap:10px;}
  .status-chart-bar{width:min(58px,76%);}
}
@media(max-width:760px){
  .project-status-chart-card{overflow-x:auto;}
  .project-status-chart{min-width:720px;}
}


/* =========================================================
   v1.5.11.1 — clickable problem projects
   ========================================================= */
.clickable-problem-project{
  cursor:pointer;
  transition:background .12s ease, box-shadow .12s ease;
}

.clickable-problem-project:hover{
  background:#f2f8fc;
  box-shadow:inset 3px 0 0 #2f9bd3;
}

.clickable-problem-project:hover > span:first-child b{
  color:#147eb5;
  text-decoration:underline;
}

/* v1.5.11.2 — График проектов без колонки «Завершено» */
.project-status-chart{
  grid-template-columns:repeat(4,minmax(130px,1fr));
}


/* =========================================================
   v1.5.12 — ручное включение проекта + отставание от нормы
   ========================================================= */
.include-project-btn{
  border-color:#8fc7e7 !important;
  color:#147fb8 !important;
  background:#f3faff !important;
}
.include-project-btn:hover:not(:disabled){
  background:#e6f5ff !important;
}
.include-project-btn:disabled{
  opacity:.8;
  cursor:default;
}

.norm-delay{
  display:block;
  margin-top:4px;
  color:#d64545 !important;
  font-size:10px !important;
  line-height:1.15;
  white-space:nowrap;
}
.norm-delay strong{
  display:inline !important;
  margin:0 !important;
  color:#d64545 !important;
  font-size:10px !important;
  font-weight:800;
}


/* =========================================================
   v1.5.12.1 — проверенные правки
   ========================================================= */

/* Незавершённая задача — СИНЯЯ кнопка */
.task-complete-btn{
  border:1px solid #62afe4 !important;
  background:#e8f5ff !important;
  color:#117bb8 !important;
  font-weight:800;
}
.task-complete-btn:hover{
  border-color:#3199da !important;
  background:#d6edfc !important;
  color:#086ca5 !important;
}

/* Завершённая задача — ЗЕЛЁНЫЙ статус */
.task-complete-state{
  border:1px solid #91d0ad !important;
  background:#e5f7ed !important;
  color:#148049 !important;
  font-weight:800;
}

/* Активное ручное добавление в общий Гант */
.include-project-btn:not(:disabled){
  border-color:#63afe2 !important;
  background:#eaf6ff !important;
  color:#117bb7 !important;
  font-weight:800;
}
.include-project-btn:not(:disabled):hover{
  background:#d9effd !important;
  border-color:#359bd9 !important;
}

/* Отставание должно хорошо читаться в Периоде */
.norm-delay{
  display:block !important;
  margin-top:4px !important;
  color:#d33f49 !important;
  font-size:11px !important;
  line-height:1.15 !important;
  font-weight:700 !important;
  white-space:nowrap !important;
}
.norm-delay strong{
  display:inline !important;
  margin:0 !important;
  color:#d33f49 !important;
  font-size:11px !important;
  font-weight:800 !important;
}


/* =========================================================
   v2.0 Performance
   ========================================================= */
.health-badge.loading{
  background:#eef3f6;
  color:#6c7f8a;
  border-color:#dce5ea;
}
.health-badge.loading i{
  background:#90a4ae;
}
.project-empty-note{
  min-height:42px;
}

/* v2.0.1 auth-safe */
.message.error{white-space:normal;}


/* v2.0.2 — опережение графика */
.norm-ahead{
  display:block !important;
  margin-top:4px !important;
  color:#14834c !important;
  font-size:11px !important;
  line-height:1.15 !important;
  font-weight:700 !important;
  white-space:nowrap !important;
}
.norm-ahead strong{
  display:inline !important;
  margin:0 !important;
  color:#14834c !important;
  font-size:11px !important;
  font-weight:800 !important;
}
