:root{
  --bg:#f4f6f8;
  --surface:#ffffff;
  --surface-2:#f8fafb;
  --ink:#23323f;
  --muted:#6f7f8c;
  --line:#dfe6eb;
  --line-strong:#cbd6dd;
  --primary:#1683b7;
  --primary-dark:#0d6e9f;
  --primary-soft:#eaf6fb;
  --top:#1586b9;
  --top-dark:#0c739f;
  --red:#d9534f;
  --red-soft:#fdf0ef;
  --orange:#e38b2c;
  --amber:#c99822;
  --green:#27a36a;
  --green-soft:#eaf7f1;
  --blue:#2f87c7;
  --shadow:0 1px 2px rgba(27,45,57,.08);
  --radius:4px;
}
*{box-sizing:border-box}
html{background:var(--bg)}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  font-size:13px;
  line-height:1.42;
}
a{color:#167dab;text-decoration:none}
a:hover{text-decoration:underline}
form{margin:0}

/* Top navigation — compact business-app style */
.ms-topbar{
  height:50px;
  background:linear-gradient(180deg,var(--top),var(--top-dark));
  color:#fff;
  display:flex;
  align-items:stretch;
  padding:0 16px;
  position:sticky;
  top:0;
  z-index:50;
  box-shadow:0 1px 3px rgba(0,0,0,.18);
}
.ms-logo{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:170px;
  padding-right:18px;
  color:white;
  font-size:16px;
  font-weight:700;
}
.ms-logo:hover{text-decoration:none}
.ms-logo-mark{
  display:grid;
  place-items:center;
  width:28px;height:28px;
  border-radius:4px;
  background:#fff;
  color:var(--top-dark);
  font-size:12px;
  font-weight:800;
}
.ms-primary-nav{display:flex;align-items:stretch;flex:1;overflow-x:auto}
.ms-primary-nav a{
  display:flex;
  align-items:center;
  color:#e8f7ff;
  padding:0 14px;
  border-left:1px solid rgba(255,255,255,.08);
  white-space:nowrap;
}
.ms-primary-nav a:hover,.ms-primary-nav a.active{
  background:rgba(0,0,0,.13);
  color:#fff;
  text-decoration:none;
}
.ms-primary-nav a.active{box-shadow:inset 0 -3px 0 #fff}
.ms-user{display:flex;align-items:center;gap:12px;padding-left:14px}
.ms-user-meta{display:flex;flex-direction:column;line-height:1.2;text-align:right}
.ms-user-meta strong{font-size:12px}
.ms-user-meta span{font-size:11px;color:#cfeaf7}
.ms-logout{
  padding:5px 9px;border:1px solid rgba(255,255,255,.35);
  background:transparent;color:white;border-radius:3px;cursor:pointer;
}
.ms-subbar{
  background:#fff;
  border-bottom:1px solid var(--line-strong);
  box-shadow:0 1px 1px rgba(0,0,0,.03);
}
.ms-subbar-inner{
  min-height:36px;
  max-width:1740px;
  margin:0 auto;
  padding:0 18px;
  display:flex;align-items:center;gap:20px;
}
.ms-subbar a{color:#536774;font-size:12px}
.ms-subbar a:hover{color:var(--primary);text-decoration:none}
.ms-context{font-weight:700;color:#2f4350;margin-right:8px}

.container{max-width:1740px;margin:0 auto;padding:16px 18px 36px}
.page-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.page-head h1{font-size:23px;font-weight:500;margin:0 0 2px;color:#283c49}
.page-head p{margin:0;color:var(--muted)}
.ms-page-head{border-bottom:1px solid var(--line);padding-bottom:12px}

/* Buttons and forms */
button,.button{
  display:inline-block;
  border:1px solid #1477a4;
  background:var(--primary);
  color:white;
  padding:7px 12px;
  border-radius:3px;
  font-weight:600;
  font-size:12px;
  cursor:pointer;
}
button:hover,.button:hover{background:var(--primary-dark);text-decoration:none}
.primary-action{min-width:130px}
.ghost{background:#fff;color:#425865;border-color:var(--line-strong)}
.ghost:hover{background:#f1f5f7}
.danger-btn{background:#fff;color:#b63d38;border-color:#dfa19e}
.danger-btn:hover{background:#fff1f0}
input,select,textarea{
  font:inherit;
  border:1px solid #bfcbd2;
  border-radius:3px;
  background:#fff;
  color:var(--ink);
}
.filters input,.filters select,.stack input,.stack select,.form-grid input,.form-grid select{
  padding:7px 8px;min-width:160px;
}
.filters{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:12px}
.stack{display:flex;flex-direction:column;gap:10px}
.stack label,.form-grid label{display:flex;flex-direction:column;gap:4px;color:#50636f}
.compact{max-width:420px}
.form-grid{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:10px;align-items:end}

/* Generic panels and tables */
section,.panel{
  background:var(--surface);
  border:1px solid var(--line-strong);
  border-radius:var(--radius);
  margin-bottom:14px;
  overflow:auto;
  box-shadow:var(--shadow);
}
section{padding:14px}
.panel{padding:0}
.panel>.section-head{padding:12px 14px 10px;border-bottom:1px solid var(--line)}
.panel>table{margin:0}
section h2,.panel h2{font-size:15px;font-weight:600;margin:0;color:#334b59}
.section-head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.section-subtitle{margin:2px 0 0;color:var(--muted);font-size:11px}
table{border-collapse:collapse;width:100%;min-width:680px;background:#fff}
th,td{padding:7px 9px;border-bottom:1px solid #e6ecef;text-align:left;vertical-align:middle}
th{
  font-size:11px;
  font-weight:600;
  color:#667985;
  background:#f4f7f8;
  border-top:1px solid #e3e9ec;
  white-space:nowrap;
}
tbody tr:hover{background:#f4f9fb}
.compact-table th,.compact-table td{padding:6px 9px}
.ok{color:var(--green);font-weight:600}
.badge,.tag,.status-chip{
  display:inline-block;padding:2px 6px;border:1px solid #d7e0e5;
  border-radius:3px;background:#f6f8f9;font-size:11px;color:#536873;
}
.tag.red,.danger-chip{background:#fff0ef;border-color:#f0c3c0;color:#b63c37}
.tag.yellow{background:#fff8e9;border-color:#edd9a7;color:#8b6a12}
.tag.green,.success-chip{background:#ecf8f2;border-color:#b8e1cf;color:#26734f}
.sev-overdue{background:#fff8f7}
.danger-text{color:#c44843;font-weight:700}
.warn-text{color:#9b7420;font-weight:700}
.muted{color:var(--muted);font-size:11px}
.alert{padding:10px;border-radius:3px;border:1px solid var(--line)}
.alert.danger{background:#fff0ef;color:#9f3430;border-color:#efc2bf}
.note{background:#edf7fc;border:1px solid #b9ddec;color:#305d72;padding:10px 12px;border-radius:3px;margin-bottom:12px}
.facts{display:grid;grid-template-columns:220px 1fr;gap:6px 14px}
.facts dt{color:var(--muted)}
.facts dd{margin:0;font-weight:600}
.ms-facts{padding:12px 14px}
.owner-big{font-size:22px;font-weight:700;margin:7px 0}

/* KPI strip */
.ms-kpi-strip{
  display:grid;
  grid-template-columns:repeat(5,minmax(150px,1fr));
  border:1px solid var(--line-strong);
  background:#fff;
  margin-bottom:14px;
  box-shadow:var(--shadow);
}
.ms-kpi{
  color:var(--ink);
  padding:12px 14px;
  border-right:1px solid var(--line);
  position:relative;
  min-height:88px;
}
.ms-kpi:last-child{border-right:0}
.ms-kpi:hover{background:#f8fbfc;text-decoration:none}
.ms-kpi:before{content:"";position:absolute;left:0;top:0;right:0;height:3px;background:#91a3ae}
.ms-kpi.danger:before{background:var(--red)}
.ms-kpi.warning:before{background:var(--orange)}
.ms-kpi.amber:before{background:var(--amber)}
.ms-kpi.success:before{background:var(--green)}
.ms-kpi-label{display:block;color:#667985;font-size:11px}
.ms-kpi strong{display:block;font-size:27px;font-weight:500;line-height:1.15;margin:3px 0;color:#253b48}
.ms-kpi-note{font-size:10px;color:#8a99a3}

/* Analytics */
.analytics-grid{display:grid;grid-template-columns:1fr 1.35fr;gap:14px;margin-bottom:14px}
.analytics-card{
  padding:0;
  min-height:270px;
  overflow:hidden;
}
.analytics-card>.section-head{padding:12px 14px;border-bottom:1px solid var(--line)}
.analytics-total{
  color:#667985;background:#f4f7f8;border:1px solid var(--line);
  padding:4px 7px;border-radius:3px;font-size:11px;
}
.donut-layout{display:flex;align-items:center;gap:38px;padding:22px 26px 20px}
.donut{
  width:164px;height:164px;border-radius:50%;
  background:conic-gradient(var(--green) 0 calc(var(--ontime-angle)), var(--red) calc(var(--ontime-angle)) 360deg);
  position:relative;flex:0 0 auto;
}
.donut:after{
  content:"";position:absolute;inset:25px;border-radius:50%;background:#fff;
}
.donut-center{
  position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;
  align-items:center;justify-content:center;
}
.donut-center strong{font-size:27px;font-weight:500;color:#2d4553}
.donut-center span{font-size:11px;color:var(--muted)}
.chart-legend{display:flex;flex-direction:column;gap:15px}
.legend-row{display:flex;align-items:flex-start;gap:9px}
.legend-row>div{display:flex;flex-direction:column}
.legend-row strong{font-size:13px}
.legend-row span{font-size:11px;color:var(--muted)}
.legend-dot{display:inline-block;width:9px;height:9px;border-radius:2px;flex:0 0 auto;margin-top:4px}
.legend-dot.good{background:var(--green)}
.legend-dot.bad{background:var(--red)}
.empty-analytics{margin:24px;background:#f7f9fa;border:1px dashed #ccd7dd;padding:24px;color:var(--muted);text-align:center}

.bar-chart{
  height:190px;
  display:flex;
  align-items:flex-end;
  gap:7px;
  padding:20px 16px 8px;
  border-bottom:1px solid var(--line);
}
.bar-col{
  flex:1;min-width:22px;height:100%;
  display:grid;
  grid-template-rows:1fr 16px 18px;
  align-items:end;text-align:center;position:relative;
}
.bar-stack{
  width:min(24px,76%);
  height:100%;
  display:flex;
  flex-direction:column-reverse;
  justify-content:flex-start;
  margin:auto;
}
.bar-part{width:100%;min-height:2px}
.bar-part.ontime{background:var(--green)}
.bar-part.overdue{background:var(--red)}
.bar-zero{height:1px;background:#dfe6ea;width:100%;margin-top:auto}
.bar-value{font-size:10px;color:#536873;line-height:16px}
.bar-label{font-size:9px;color:#8a99a3;white-space:nowrap}
.mini-legend{display:flex;gap:16px;justify-content:flex-end;padding:8px 14px 10px;color:#647783;font-size:10px}
.mini-legend .legend-dot{margin:0 4px 0 0}
.analytics-footnote{font-size:10px;color:#7d8d96;margin:4px 2px 0}

/* Dashboard layout */
.dashboard-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.dashboard-span-2{grid-column:1/-1}
.kpi-table td,.kpi-table th{white-space:nowrap}

/* Existing quick tabs kept for secondary pages */
.quick-tabs{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 12px}
.quick-tabs a{
  padding:6px 9px;background:#fff;border:1px solid var(--line-strong);
  border-radius:3px;color:#536774;font-weight:600;font-size:11px;
}
.quick-tabs a:hover,.quick-tabs a.active{background:var(--primary-soft);color:var(--primary-dark);text-decoration:none}

/* Legacy cards remain compatible */
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:9px;margin-bottom:14px}
.card{background:#fff;border:1px solid var(--line-strong);border-top:3px solid #91a3ae;padding:12px;box-shadow:var(--shadow)}
.card b{display:block;font-size:26px;font-weight:500}.card span{color:var(--muted)}
.card.red{border-top-color:var(--red)}.card.orange{border-top-color:var(--orange)}
.card.yellow{border-top-color:var(--amber)}.card.green{border-top-color:var(--green)}
.card.blue{border-top-color:var(--blue)}
.grid.two{display:grid;grid-template-columns:1fr 1fr;gap:14px}

/* Login */
.login-wrap{min-height:88vh;display:grid;place-items:center}
.login-card{
  width:min(410px,94vw);background:#fff;padding:28px;border:1px solid var(--line-strong);
  border-top:4px solid var(--primary);box-shadow:0 8px 28px rgba(32,55,69,.12);
}
.login-card h1{margin:0;font-size:22px}.login-card p{color:var(--muted);margin-top:5px}

/* Responsive */
@media(max-width:1100px){
  .ms-kpi-strip{grid-template-columns:repeat(2,1fr)}
  .analytics-grid,.dashboard-grid,.grid.two{grid-template-columns:1fr}
  .ms-primary-nav a{padding:0 10px}
  .donut-layout{justify-content:center}
}
@media(max-width:760px){
  .ms-topbar{height:auto;min-height:50px;flex-wrap:wrap;padding:7px 10px}
  .ms-logo{min-width:auto;padding-right:8px}
  .ms-primary-nav{order:3;width:100%;height:38px}
  .ms-primary-nav a{padding:0 9px}
  .ms-user{margin-left:auto}
  .ms-user-meta{display:none}
  .ms-subbar-inner{overflow-x:auto;white-space:nowrap;padding:0 10px}
  .container{padding:10px}
  .page-head{align-items:flex-start;gap:8px}
  .page-head h1{font-size:20px}
  .ms-kpi-strip{grid-template-columns:1fr 1fr}
  .ms-kpi{min-height:78px}
  .analytics-grid{display:block}
  .analytics-card{margin-bottom:10px}
  .donut-layout{gap:20px;padding:18px 12px;flex-direction:column}
  .donut{width:145px;height:145px}
  .bar-chart{gap:3px;padding-left:8px;padding-right:8px}
  .bar-label{font-size:8px;transform:rotate(-45deg);transform-origin:center}
  .form-grid{grid-template-columns:1fr}
}


/* V15.7 verified analytics */
.analytics-filterbar{
  display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;
  padding:10px 12px;background:#fff;border:1px solid var(--line-strong);
  margin-bottom:14px;box-shadow:var(--shadow)
}
.analytics-filterbar label{display:flex;flex-direction:column;gap:3px;color:#667985;font-size:11px}
.analytics-filterbar select{min-width:150px;padding:7px 8px}
.analytics-kpis{grid-template-columns:repeat(5,minmax(150px,1fr))}
.analytics-data-quality{padding:0}
.analytics-data-quality>.section-head{padding:12px 14px;border-bottom:1px solid var(--line)}
.coverage-grid{display:grid;grid-template-columns:repeat(4,1fr)}
.coverage-grid>div{padding:12px 14px;border-right:1px solid var(--line)}
.coverage-grid>div:last-child{border-right:0}
.coverage-grid span{display:block;color:var(--muted);font-size:10px}
.coverage-grid strong{display:block;font-size:18px;font-weight:500;margin-top:3px}
.rank-bars{padding:12px 14px}
.rank-row{display:grid;grid-template-columns:minmax(150px,1.4fr) 2fr 64px 72px;gap:8px;align-items:center;margin:8px 0}
.rank-label{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rank-track{height:9px;background:#edf1f3;border-radius:2px;overflow:hidden}
.rank-track i{display:block;height:100%;background:var(--red)}
.rank-track.confirmed i{background:var(--green)}
.rank-track.proposed i{background:var(--orange)}
.rank-row strong{font-size:11px;text-align:right}
.rank-row small{font-size:10px;color:var(--muted)}
.analytics-table{min-width:1100px}
.inline-review{display:inline-block;margin:1px}
.inline-review button{padding:4px 7px;font-size:10px}
@media(max-width:900px){
  .coverage-grid{grid-template-columns:1fr 1fr}
  .analytics-kpis{grid-template-columns:1fr 1fr}
  .rank-row{grid-template-columns:1fr 1.5fr 54px}
  .rank-row small{display:none}
}
.analytics-grid.three-col{grid-template-columns:repeat(3,1fr)}
.override-box{margin-top:4px;font-size:10px}
.override-box summary{cursor:pointer;color:var(--primary-dark);font-weight:600}
.override-form{display:grid;gap:5px;margin-top:6px;min-width:220px}
.override-form label{display:grid;gap:2px;color:var(--muted);font-size:10px}
.override-form input{padding:5px 6px;min-width:210px}
@media(max-width:1100px){.analytics-grid.three-col{grid-template-columns:1fr}}


/* V15.8.3 operational analytics */
.analytics-section-title{margin:20px 0 9px;font-size:15px;color:#2d4553;font-weight:600}
.analytics-kpis.six{grid-template-columns:repeat(6,minmax(135px,1fr))}
.analytics-coverage-six{grid-template-columns:repeat(6,minmax(150px,1fr))}
.analytics-coverage-six small{display:block;color:var(--muted);font-size:10px;margin-top:3px}
.analytics-live-table td,.analytics-live-table th{font-size:11px}
.priority-table{min-width:1120px}
.root-cause-table{min-width:1450px}
.action-text{color:#375b42}
.trend-bars{height:205px;display:flex;gap:7px;align-items:flex-end;padding:18px 16px 6px;overflow-x:auto}
.trend-day{display:flex;flex-direction:column;align-items:center;min-width:34px;height:180px;justify-content:flex-end;gap:5px}
.trend-columns{height:150px;width:26px;display:flex;align-items:flex-end;gap:3px;border-bottom:1px solid #d8e0e4}
.trend-columns i{display:block;width:11px;min-height:1px;border-radius:2px 2px 0 0}
.trend-columns i.opened,.trend-legend i.opened{background:var(--red)}
.trend-columns i.resolved,.trend-legend i.resolved{background:var(--green)}
.trend-day small{font-size:9px;color:var(--muted);transform:rotate(-45deg);transform-origin:center;white-space:nowrap}
.trend-legend{display:flex;gap:18px;padding:8px 16px 14px;font-size:10px;color:var(--muted)}
.trend-legend span{display:flex;align-items:center;gap:5px}.trend-legend i{width:9px;height:9px;display:inline-block;border-radius:2px}
@media(max-width:1280px){.analytics-kpis.six{grid-template-columns:repeat(3,1fr)}.analytics-coverage-six{grid-template-columns:repeat(3,1fr)}}
@media(max-width:700px){.analytics-kpis.six,.analytics-coverage-six{grid-template-columns:1fr 1fr}.trend-bars{height:180px}.trend-day{min-width:30px}}


/* V15.8.3.2 — readable analytics, action + prevention */
.analytics-page,
.analytics-page *{
  min-width:0;
}

.analytics-page h1,
.analytics-page h2,
.analytics-page h3,
.analytics-page p,
.analytics-page span,
.analytics-page strong,
.analytics-page small,
.analytics-page a,
.analytics-page td,
.analytics-page th,
.analytics-page label,
.analytics-page summary{
  overflow-wrap:anywhere;
  word-break:normal;
  hyphens:auto;
}

.analytics-page .section-head{
  flex-wrap:wrap;
  align-items:flex-start;
}

.analytics-page .analytics-card{
  overflow:visible;
}

.analytics-page .ms-kpi,
.analytics-page .coverage-grid>div{
  overflow:hidden;
}

.analytics-page table th,
.analytics-page table td{
  white-space:normal;
  vertical-align:top;
}

.analytics-page .analytics-live-table,
.analytics-page .priority-table{
  table-layout:fixed;
  min-width:920px;
}

.analytics-page .analytics-live-table th,
.analytics-page .analytics-live-table td,
.analytics-page .priority-table th,
.analytics-page .priority-table td{
  overflow-wrap:anywhere;
}

.analytics-page .rank-label{
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
}

.analytics-page .rank-row{
  grid-template-columns:minmax(135px,1.35fr) minmax(110px,2fr) minmax(62px,.55fr) minmax(68px,.65fr);
}

.analytics-page .analytics-filterbar label{
  min-width:140px;
}

.analytics-page .analytics-filterbar select,
.analytics-page .override-form input{
  width:100%;
  max-width:100%;
}

.decision-bars{
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.decision-bar-row{
  display:grid;
  gap:5px;
}

.decision-bar-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  font-size:11px;
}

.decision-bar-head strong{
  color:#334b59;
  flex:1;
}

.decision-bar-head span{
  color:var(--muted);
  white-space:nowrap;
}

.decision-track{
  height:12px;
  background:#edf1f3;
  border-radius:3px;
  overflow:hidden;
}

.decision-track i{
  display:block;
  height:100%;
  background:var(--red);
  min-width:2px;
}

.decision-track.action i{
  background:var(--orange);
}

.decision-track.prevention i{
  background:var(--green);
}

.prevention-playbook-panel{
  overflow:visible;
}

.playbook-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  padding:14px;
}

.playbook-card{
  border:1px solid var(--line);
  border-radius:4px;
  background:#fff;
  padding:12px;
  box-shadow:0 1px 2px rgba(27,45,57,.04);
  overflow:hidden;
}

.playbook-card-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  margin-bottom:8px;
}

.playbook-card-head strong{
  font-size:13px;
  color:#2f4552;
}

.playbook-metrics{
  display:flex;
  flex-wrap:wrap;
  gap:8px 14px;
  color:var(--muted);
  font-size:10px;
  padding-bottom:9px;
  border-bottom:1px solid var(--line);
}

.playbook-block{
  margin-top:10px;
  padding:9px 10px;
  border-radius:4px;
  background:#f7f9fa;
  border:1px solid #e4eaed;
}

.playbook-block.current{
  background:#fff8ef;
  border-color:#f0d6b4;
}

.playbook-block.prevention{
  background:#eef8f3;
  border-color:#c5e4d4;
}

.playbook-label,
.incident-label{
  display:block;
  margin-bottom:4px;
  color:#647783;
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.02em;
}

.playbook-block p,
.incident-block p{
  margin:0;
  line-height:1.48;
}

.incident-panel{
  overflow:visible;
}

.incident-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:12px;
}

.incident-card{
  border:1px solid var(--line-strong);
  border-left:4px solid var(--red);
  border-radius:4px;
  background:#fff;
  overflow:hidden;
}

.incident-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  padding:10px 12px;
  background:#f8fafb;
  border-bottom:1px solid var(--line);
}

.incident-order{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.incident-order strong{
  font-size:13px;
}

.incident-order span{
  color:var(--muted);
  font-size:10px;
}

.incident-tags{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:5px;
}

.incident-grid{
  display:grid;
  grid-template-columns:1fr 1.25fr 1.25fr 1.25fr;
  gap:0;
}

.incident-block{
  padding:12px;
  border-right:1px solid var(--line);
  overflow:hidden;
}

.incident-block:last-child{
  border-right:0;
}

.incident-block.solution{
  background:#fffaf3;
}

.incident-block.prevention{
  background:#f2faf6;
}

.incident-footer{
  display:grid;
  grid-template-columns:1fr 1fr 1.2fr;
  gap:12px;
  padding:10px 12px;
  border-top:1px solid var(--line);
  background:#fbfcfd;
  font-size:11px;
}

.incident-review{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  align-items:flex-start;
}

.analytics-page .inline-review{
  max-width:100%;
}

.analytics-page .inline-review button,
.analytics-page .override-box button{
  white-space:normal;
  line-height:1.25;
}

.analytics-page .override-box{
  width:100%;
}

.analytics-page .override-form{
  display:grid;
  gap:7px;
  margin-top:7px;
}

.analytics-page .override-form label{
  display:grid;
  gap:3px;
}

.analytics-page .override-form input{
  min-width:0;
  padding:7px 8px;
}

@media(max-width:1200px){
  .playbook-grid{
    grid-template-columns:1fr;
  }
  .incident-grid{
    grid-template-columns:1fr 1fr;
  }
  .incident-block:nth-child(2){
    border-right:0;
  }
  .incident-block:nth-child(-n+2){
    border-bottom:1px solid var(--line);
  }
  .incident-footer{
    grid-template-columns:1fr 1fr;
  }
  .incident-review{
    grid-column:1/-1;
  }
}

@media(max-width:760px){
  .analytics-page .analytics-filterbar label{
    width:100%;
  }
  .analytics-page .analytics-filterbar select{
    width:100%;
  }
  .decision-bar-head{
    flex-direction:column;
    gap:2px;
  }
  .decision-bar-head span{
    white-space:normal;
  }
  .incident-head{
    flex-direction:column;
  }
  .incident-tags{
    justify-content:flex-start;
  }
  .incident-grid{
    grid-template-columns:1fr;
  }
  .incident-block,
  .incident-block:nth-child(2){
    border-right:0;
    border-bottom:1px solid var(--line);
  }
  .incident-block:last-child{
    border-bottom:0;
  }
  .incident-footer{
    grid-template-columns:1fr;
  }
  .incident-review{
    grid-column:auto;
  }
  .analytics-page .rank-row{
    grid-template-columns:minmax(110px,1.2fr) minmax(80px,1fr) 54px;
  }
}


/* V15.8.3.3 — data-quality readability */
.analytics-page .data-quality-panel{
  overflow:visible;
}

.analytics-page .analytics-coverage-six{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(215px,1fr));
  align-items:stretch;
}

.analytics-page .analytics-coverage-six>div{
  position:relative;
  min-height:118px;
  padding:14px 16px 13px;
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  overflow:visible;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
}

.analytics-page .analytics-coverage-six>div:last-child{
  border-right:0;
}

.analytics-page .analytics-coverage-six span{
  display:block;
  min-height:0;
  font-size:10px;
  line-height:1.35;
  color:var(--muted);
  overflow-wrap:anywhere;
  word-break:normal;
}

.analytics-page .analytics-coverage-six strong{
  display:block;
  margin-top:7px;
  font-size:clamp(17px,1.25vw,23px);
  line-height:1.16;
  font-weight:600;
  color:#273d49;
  overflow-wrap:anywhere;
  word-break:normal;
}

.analytics-page .analytics-coverage-six .quality-date{
  font-size:clamp(15px,1vw,20px);
}

.analytics-page .analytics-coverage-six small{
  display:block;
  margin-top:auto;
  padding-top:7px;
  color:var(--muted);
  font-size:10px;
  line-height:1.35;
  overflow-wrap:anywhere;
  word-break:normal;
}

.quality-progress{
  width:100%;
  height:7px;
  margin-top:9px;
  background:#e9eef1;
  border-radius:999px;
  overflow:hidden;
}

.quality-progress i{
  display:block;
  min-width:2px;
  max-width:100%;
  height:100%;
  background:var(--primary);
  border-radius:inherit;
}

.quality-progress.details i{
  background:var(--green);
}

.analytics-page .quality-kpi.live{
  background:#f6fafc;
}

.analytics-page .quality-kpi.details{
  background:#f6fbf8;
}

.analytics-page .quality-kpi.excluded{
  background:#fafbfc;
}

.analytics-page .quality-note{
  margin:0;
  padding:11px 14px 12px;
  border-top:0;
  background:#f8fafb;
  color:#6f818c;
  font-size:10.5px;
  line-height:1.48;
  overflow-wrap:anywhere;
  word-break:normal;
}

.analytics-page .quality-note strong{
  color:#405865;
}

@media(min-width:1500px){
  .analytics-page .analytics-coverage-six{
    grid-template-columns:repeat(6,minmax(0,1fr));
  }
}

@media(max-width:1100px){
  .analytics-page .analytics-coverage-six{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:760px){
  .analytics-page .analytics-coverage-six{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .analytics-page .analytics-coverage-six>div{
    min-height:126px;
  }
}

@media(max-width:480px){
  .analytics-page .analytics-coverage-six{
    grid-template-columns:1fr;
  }
  .analytics-page .analytics-coverage-six>div{
    min-height:0;
    border-right:0;
  }
}


/* V15.8.3.4 — actionable tables + brand drilldown */
.status-action-panel,
.brand-drilldown-panel,
.trend-wide-card{
  margin-top:14px;
}

.table-scroll{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.status-action-table{
  min-width:1180px;
  table-layout:fixed;
}

.status-action-table th:nth-child(1){width:15%}
.status-action-table th:nth-child(2){width:7%}
.status-action-table th:nth-child(3){width:9%}
.status-action-table th:nth-child(4){width:7%}
.status-action-table th:nth-child(5){width:9%}
.status-action-table th:nth-child(6){width:10%}
.status-action-table th:nth-child(7){width:16%}
.status-action-table th:nth-child(8){width:27%}

.action-cell{
  line-height:1.45;
  color:#334b59;
}

.cell-note{
  margin-top:3px;
  font-size:10px;
  line-height:1.3;
  color:var(--muted);
}

.share-value{
  display:inline-flex;
  min-width:52px;
  justify-content:center;
  padding:3px 6px;
  border-radius:4px;
  background:#eef4f6;
  color:#405865;
  font-weight:700;
}

.share-value.warning{
  background:#fff5dc;
  color:#8a6110;
}

.share-value.danger{
  background:#ffebe8;
  color:#a33b31;
}

.table-help{
  padding:9px 12px 11px;
  border-top:1px solid var(--line);
  background:#f8fafb;
  color:var(--muted);
  font-size:10.5px;
  line-height:1.45;
}

.brand-drilldown-list{
  display:flex;
  flex-direction:column;
}

.brand-drilldown{
  border-top:1px solid var(--line);
  background:#fff;
}

.brand-drilldown:first-child{
  border-top:0;
}

.brand-drilldown>summary{
  list-style:none;
  cursor:pointer;
  display:grid;
  grid-template-columns:minmax(190px,1.5fr) repeat(4,minmax(90px,.7fr)) minmax(90px,.55fr);
  gap:12px;
  align-items:center;
  padding:12px 14px;
  transition:background .15s ease;
}

.brand-drilldown>summary::-webkit-details-marker{
  display:none;
}

.brand-drilldown>summary:hover{
  background:#f7fafb;
}

.brand-drilldown[open]>summary{
  background:#f4f8fa;
  border-bottom:1px solid var(--line);
}

.brand-name{
  font-weight:700;
  color:#2c4553;
  overflow-wrap:anywhere;
}

.brand-drilldown>summary>span:not(.brand-name):not(.brand-open-hint){
  display:flex;
  flex-direction:column;
  gap:2px;
}

.brand-drilldown>summary small{
  color:var(--muted);
  font-size:9px;
  line-height:1.2;
}

.brand-drilldown>summary strong{
  font-size:15px;
}

.brand-open-hint{
  justify-self:end;
  color:#557381;
  font-size:10px;
  font-weight:700;
  white-space:nowrap;
}

.brand-detail-body{
  padding:12px 14px 14px;
  background:#fbfcfd;
}

.brand-detail-note{
  margin-bottom:10px;
  padding:9px 10px;
  border:1px solid #dbe5ea;
  border-radius:4px;
  background:#fff;
  color:#5d727e;
  font-size:10.5px;
  line-height:1.45;
}

.brand-reason-table{
  min-width:1180px;
  table-layout:fixed;
  background:#fff;
}

.brand-reason-table th:nth-child(1){width:17%}
.brand-reason-table th:nth-child(2){width:8%}
.brand-reason-table th:nth-child(3){width:7%}
.brand-reason-table th:nth-child(4){width:23%}
.brand-reason-table th:nth-child(5){width:30%}
.brand-reason-table th:nth-child(6){width:15%}

.order-chip-list{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
}

.order-chip{
  display:inline-flex;
  padding:3px 5px;
  border:1px solid #d6e0e5;
  border-radius:4px;
  background:#f7fafb;
  font-size:9px;
  line-height:1.2;
  text-decoration:none;
  overflow-wrap:anywhere;
}

.trend-wide-card{
  width:100%;
}

@media(max-width:980px){
  .brand-drilldown>summary{
    grid-template-columns:minmax(160px,1.4fr) repeat(2,minmax(80px,.7fr));
  }
  .brand-open-hint{
    justify-self:start;
  }
}

@media(max-width:620px){
  .brand-drilldown>summary{
    grid-template-columns:1fr 1fr;
    gap:8px 12px;
  }
  .brand-name{
    grid-column:1/-1;
  }
  .brand-open-hint{
    grid-column:1/-1;
  }
}


/* V15.10 — final management analytics */
.analytics-page .final-kpis{
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
}
.analytics-page .quality-kpi.recheck{
  background:#fffaf0;
}
.final-action-center,.recheck-panel,.entity-drilldown-card{overflow:visible}
.final-action-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  gap:10px;
  padding:12px;
}
.final-action-card{
  border:1px solid var(--line);
  border-left:4px solid var(--red);
  border-radius:5px;
  background:#fff;
  padding:11px;
  overflow:hidden;
}
.final-action-card.owner{border-left-color:var(--orange)}
.final-action-card.recheck{border-left-color:#c8992d;background:#fffdf7}
.final-action-head{
  display:flex;justify-content:space-between;gap:10px;align-items:flex-start;
  padding-bottom:8px;border-bottom:1px solid var(--line);
}
.final-action-head strong{font-size:13px;color:#304955}
.final-action-head span{white-space:nowrap;font-size:10px;color:var(--muted);font-weight:700}
.final-action-block{margin-top:9px}
.final-action-block small{display:block;color:var(--muted);font-size:9px;text-transform:uppercase;font-weight:700;margin-bottom:3px}
.final-action-block p{margin:0;line-height:1.45;overflow-wrap:anywhere}
.final-action-block.solution{padding:8px 9px;border-radius:4px;background:#f2f8f5}
.recheck-table{min-width:1050px;table-layout:fixed}
.recheck-table th:nth-child(1){width:16%}.recheck-table th:nth-child(2){width:18%}.recheck-table th:nth-child(3){width:16%}.recheck-table th:nth-child(4){width:14%}.recheck-table th:nth-child(5){width:17%}.recheck-table th:nth-child(6){width:19%}
.entity-analytics-grid{align-items:start}
.entity-drilldown-list{display:flex;flex-direction:column}
.entity-drilldown{border-top:1px solid var(--line);background:#fff}
.entity-drilldown:first-child{border-top:0}
.entity-drilldown>summary{
  cursor:pointer;list-style:none;display:grid;
  grid-template-columns:minmax(150px,1.5fr) repeat(4,minmax(80px,.65fr));
  gap:9px;align-items:center;padding:10px 12px;overflow-wrap:anywhere
}
.entity-drilldown>summary::-webkit-details-marker{display:none}
.entity-drilldown>summary:hover,.entity-drilldown[open]>summary{background:#f6f9fa}
.entity-drilldown>summary>span{font-size:10px;color:var(--muted)}
.entity-drilldown>summary b{display:block;color:#324b58;font-size:13px}
.entity-drilldown-body{padding:10px 12px;background:#fbfcfd;border-top:1px solid var(--line)}
.entity-reason-row{
  display:grid;grid-template-columns:minmax(150px,.9fr) minmax(100px,.55fr) minmax(250px,1.6fr) minmax(160px,.9fr);
  gap:9px;padding:9px 0;border-bottom:1px solid var(--line);align-items:start
}
.entity-reason-row:last-child{border-bottom:0}
.entity-reason-row>span{color:var(--muted);font-size:10px}
.entity-reason-row p{margin:0;line-height:1.4}
.responsibility-list{display:flex;flex-direction:column;padding:8px 12px 12px}
.responsibility-row{
  display:grid;grid-template-columns:minmax(160px,1.3fr) minmax(90px,.5fr) minmax(110px,.65fr) minmax(180px,1fr);
  gap:10px;align-items:start;padding:9px 0;border-bottom:1px solid var(--line)
}
.responsibility-row:last-child{border-bottom:0}
.responsibility-row>div:first-child{display:flex;flex-direction:column;gap:2px}
.responsibility-row small{color:var(--muted);font-size:9px}
.responsibility-row>span{font-size:10px;color:var(--muted)}
.responsibility-row b{font-size:13px;color:#314a57}
.status-action-table{min-width:1240px}
.status-action-table th:nth-child(1){width:14%}
.status-action-table th:nth-child(2){width:6%}
.status-action-table th:nth-child(3){width:8%}
.status-action-table th:nth-child(4){width:6%}
.status-action-table th:nth-child(5){width:8%}
.status-action-table th:nth-child(6){width:8%}
.status-action-table th:nth-child(7){width:9%}
.status-action-table th:nth-child(8){width:15%}
.status-action-table th:nth-child(9){width:26%}
.brand-drilldown>summary{
  grid-template-columns:minmax(190px,1.5fr) repeat(5,minmax(80px,.65fr)) minmax(85px,.5fr);
}
.analytics-page table{max-width:100%}
.analytics-page td,.analytics-page th{overflow-wrap:anywhere;word-break:normal}
@media(max-width:900px){
  .entity-reason-row{grid-template-columns:1fr}
  .responsibility-row{grid-template-columns:1fr 1fr}
  .entity-drilldown>summary{grid-template-columns:1fr 1fr}
  .entity-drilldown>summary>strong{grid-column:1/-1}
}
@media(max-width:600px){
  .final-action-grid{grid-template-columns:1fr}
  .responsibility-row{grid-template-columns:1fr}
}


/* V15.11.0 — branch analytics */
.branch-drilldown-panel{overflow:visible}
.branch-rule-note{
  margin:0 12px 10px;
  padding:9px 10px;
  border:1px solid #dbe5ea;
  border-radius:4px;
  background:#f8fafb;
  color:#5d727e;
  font-size:10.5px;
  line-height:1.45;
}
.branch-drilldown-list{display:flex;flex-direction:column}
.branch-drilldown{border-top:1px solid var(--line);background:#fff}
.branch-drilldown:first-child{border-top:0}
.branch-drilldown>summary{
  list-style:none;
  cursor:pointer;
  display:grid;
  grid-template-columns:minmax(170px,1.25fr) repeat(6,minmax(72px,.5fr)) minmax(170px,1fr) minmax(66px,.38fr);
  gap:9px;
  align-items:center;
  padding:11px 12px;
  transition:background .15s ease;
}
.branch-drilldown>summary::-webkit-details-marker{display:none}
.branch-drilldown>summary:hover,
.branch-drilldown[open]>summary{background:#f5f9fb}
.branch-drilldown[open]>summary{border-bottom:1px solid var(--line)}
.branch-name{display:flex;flex-direction:column;gap:2px;min-width:0}
.branch-name>strong{font-size:14px;color:#294653}
.branch-name>small{font-size:9px;color:var(--muted);overflow-wrap:anywhere}
.branch-drilldown>summary>span:not(.branch-name):not(.branch-open-hint){
  display:flex;flex-direction:column;gap:2px;min-width:0
}
.branch-drilldown>summary small{font-size:9px;color:var(--muted)}
.branch-drilldown>summary strong{font-size:13px;overflow-wrap:anywhere}
.branch-stage-summary strong{font-size:11px!important}
.branch-open-hint{
  justify-self:end;
  color:#557381;
  font-size:10px;
  font-weight:700;
  white-space:nowrap;
}
.branch-detail-body{padding:12px;background:#fbfcfd}
.branch-summary-grid{
  display:grid;
  grid-template-columns:1fr 1.25fr 1fr;
  gap:10px;
  margin-bottom:12px;
}
.branch-summary-grid>div{
  padding:9px 10px;
  border:1px solid #dbe5ea;
  border-radius:4px;
  background:#fff;
  min-width:0;
}
.branch-summary-grid small{
  display:block;
  margin-bottom:4px;
  color:var(--muted);
  font-size:9px;
  font-weight:700;
  text-transform:uppercase;
}
.branch-summary-grid p{
  margin:4px 0 0;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.branch-action-box{background:#f2f8f5!important}
.branch-subtitle{
  margin:13px 0 7px;
  font-size:12px;
  color:#334f5d;
}
.branch-stage-table{min-width:1500px;table-layout:fixed;background:#fff}
.branch-stage-table th:nth-child(1){width:14%}
.branch-stage-table th:nth-child(2){width:7%}
.branch-stage-table th:nth-child(3){width:8%}
.branch-stage-table th:nth-child(4){width:8%}
.branch-stage-table th:nth-child(5){width:8%}
.branch-stage-table th:nth-child(6){width:8%}
.branch-stage-table th:nth-child(7){width:8%}
.branch-stage-table th:nth-child(8){width:13%}
.branch-stage-table th:nth-child(9){width:18%}
.branch-stage-table th:nth-child(10){width:8%}
.branch-bottleneck-row td{background:#fff8ea}
.branch-reason-table{min-width:1180px;table-layout:fixed;background:#fff}
.branch-reason-table th:nth-child(1){width:18%}
.branch-reason-table th:nth-child(2){width:8%}
.branch-reason-table th:nth-child(3){width:27%}
.branch-reason-table th:nth-child(4){width:32%}
.branch-reason-table th:nth-child(5){width:15%}

@media(max-width:1180px){
  .branch-drilldown>summary{
    grid-template-columns:minmax(160px,1.2fr) repeat(3,minmax(75px,.55fr)) minmax(150px,1fr);
  }
  .branch-open-hint{justify-self:start}
}
@media(max-width:760px){
  .branch-drilldown>summary{grid-template-columns:1fr 1fr}
  .branch-name,.branch-stage-summary,.branch-open-hint{grid-column:1/-1}
  .branch-summary-grid{grid-template-columns:1fr}
}


/* V15.11.2 — branch analytics UI */
.branch-kpi-strip{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:10px;
  padding:0 12px 12px;
}
.branch-kpi-card{
  border:1px solid var(--line);
  border-top:3px solid var(--primary);
  border-radius:4px;
  background:#fff;
  box-shadow:0 1px 2px rgba(27,45,57,.04);
  padding:12px;
}
.branch-kpi-card.danger{border-top-color:var(--red);background:#fffafa}
.branch-kpi-card.warning{border-top-color:var(--orange);background:#fffaf2}
.branch-kpi-card.amber{border-top-color:var(--amber);background:#fffdf6}
.branch-kpi-card small{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;font-weight:700;letter-spacing:.02em}
.branch-kpi-card strong{display:block;font-size:26px;line-height:1.1;margin:6px 0 4px;color:#2a4250}
.branch-kpi-card span{display:block;color:var(--muted);font-size:11px}

.branch-subsections{padding:0 12px 12px}
.branch-toolbar{
  border:1px solid var(--line);
  border-radius:6px;
  background:linear-gradient(180deg,#fbfdfe 0%,#f5f9fb 100%);
  padding:14px;
  margin-bottom:12px;
}
.branch-toolbar-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.branch-toolbar-head h3{margin:0 0 3px;font-size:15px;color:#304855}
.branch-toolbar-head p{margin:0;color:var(--muted);font-size:11px}
.small-btn{padding:6px 10px;font-size:11px}
.branch-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:10px;margin-bottom:12px}
.branch-filter-grid label{display:flex;flex-direction:column;gap:4px;color:#647784;font-size:11px}
.branch-filter-grid input,.branch-filter-grid select{width:100%;padding:8px 9px}
.branch-tabbar{display:flex;gap:8px;flex-wrap:wrap}
.branch-tab{
  background:#fff;border:1px solid var(--line-strong);color:#44606f;padding:7px 12px;border-radius:999px;font-size:11px;font-weight:700
}
.branch-tab:hover{background:#f1f6f8}
.branch-tab.active{background:var(--primary);border-color:#1477a4;color:#fff}
.branch-subsection{display:none}
.branch-subsection.active{display:block}
.branch-summary-table-wrap{border:1px solid var(--line);border-radius:6px;background:#fff}
.branch-summary-table{min-width:1500px;table-layout:fixed}
.branch-summary-table th:nth-child(1){width:18%}
.branch-summary-table th:nth-child(2){width:5%}
.branch-summary-table th:nth-child(3){width:6%}
.branch-summary-table th:nth-child(4){width:7%}
.branch-summary-table th:nth-child(5){width:5%}
.branch-summary-table th:nth-child(6){width:5%}
.branch-summary-table th:nth-child(7){width:6%}
.branch-summary-table th:nth-child(8){width:6%}
.branch-summary-table th:nth-child(9){width:11%}
.branch-summary-table th:nth-child(10){width:11%}
.branch-summary-table th:nth-child(11){width:20%}
.branch-summary-row.is-warning td{background:#fffdf8}
.branch-summary-row.is-critical td{background:#fff7f6}
.branch-cell-title{display:flex;flex-direction:column;gap:3px}
.branch-cell-title strong{font-size:13px;color:#2f4754}
.branch-cell-title small{font-size:10px;color:var(--muted)}
.branch-empty-state{margin-top:10px;padding:18px;border:1px dashed var(--line-strong);border-radius:6px;background:#fff;color:var(--muted);text-align:center}
.branch-guide-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.branch-guide-card{padding:12px;border:1px solid var(--line);border-radius:6px;background:#fff}
.branch-guide-card strong{display:block;margin-bottom:5px;font-size:13px;color:#304955}
.branch-guide-card p{margin:0;line-height:1.5;color:#526672}
.branch-drilldown-list{border:1px solid var(--line);border-radius:6px;overflow:hidden;background:#fff}

@media(max-width:1280px){
  .branch-filter-grid{grid-template-columns:repeat(2,minmax(180px,1fr))}
}
@media(max-width:760px){
  .branch-kpi-strip{grid-template-columns:1fr 1fr}
  .branch-filter-grid{grid-template-columns:1fr}
  .branch-guide-grid{grid-template-columns:1fr}
  .branch-toolbar-head{flex-direction:column}
}
@media(max-width:520px){
  .branch-kpi-strip{grid-template-columns:1fr}
}


/* V15.11.3 — analytics subsections + readable ASC/employees */
.analytics-subnav{
  position:sticky;top:50px;z-index:38;
  display:flex;gap:6px;flex-wrap:wrap;
  padding:8px 10px;margin:-1px 0 12px;
  background:rgba(244,246,248,.96);backdrop-filter:blur(8px);
  border:1px solid var(--line-strong);border-radius:5px;box-shadow:var(--shadow)
}
.analytics-subnav a{
  display:inline-flex;align-items:center;padding:7px 11px;border-radius:4px;
  background:#fff;border:1px solid var(--line);color:#455f6e;font-size:11px;font-weight:700
}
.analytics-subnav a:hover{background:var(--primary-soft);color:var(--primary-dark);text-decoration:none}
.analytics-anchor{scroll-margin-top:105px}
.entity-section-panel{overflow:visible}
.entity-section-head{align-items:flex-end!important}
.entity-filterbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.entity-filterbar input,.entity-filterbar select{padding:7px 9px;min-width:210px}
.entity-master-table-wrap{border-top:1px solid var(--line)}
.entity-master-table{min-width:1300px;table-layout:fixed}
.entity-master-table th:nth-child(1){width:16%}
.entity-master-table th:nth-child(2){width:7%}
.entity-master-table th:nth-child(3){width:8%}
.entity-master-table th:nth-child(4){width:7%}
.entity-master-table th:nth-child(5){width:7%}
.entity-master-table th:nth-child(6){width:9%}
.entity-master-table th:nth-child(7){width:14%}
.entity-master-table th:nth-child(8){width:25%}
.entity-master-table th:nth-child(9){width:7%}
.employee-master-table{min-width:1000px}
.employee-master-table th:nth-child(1){width:22%}
.employee-master-table th:nth-child(2){width:9%}
.employee-master-table th:nth-child(3){width:10%}
.employee-master-table th:nth-child(4){width:9%}
.employee-master-table th:nth-child(5){width:9%}
.employee-master-table th:nth-child(6){width:12%}
.employee-master-table th:nth-child(7){width:21%}
.employee-master-table th:nth-child(8){width:8%}
.entity-empty{margin:12px;padding:18px;border:1px dashed var(--line-strong);border-radius:5px;text-align:center;color:var(--muted)}
.entity-detail-stack{padding:12px;display:flex;flex-direction:column;gap:8px;background:#f8fafb;border-top:1px solid var(--line)}
.entity-full-detail{border:1px solid var(--line);border-radius:5px;background:#fff;overflow:hidden;scroll-margin-top:110px}
.entity-full-detail>summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:minmax(220px,1.8fr) repeat(4,minmax(95px,.6fr));gap:10px;align-items:center;padding:10px 12px}
.entity-full-detail>summary::-webkit-details-marker{display:none}
.entity-full-detail>summary:hover,.entity-full-detail[open]>summary{background:#f4f8fa}
.entity-full-detail[open]>summary{border-bottom:1px solid var(--line)}
.entity-full-detail>summary>span{display:flex;flex-direction:column;gap:2px}
.entity-full-detail>summary small{color:var(--muted);font-size:9px}
.entity-full-detail>summary b{font-size:14px;color:#314a57}
.entity-full-detail-body{padding:10px 12px;background:#fbfcfd}
.entity-reason-table-wide{min-width:1250px;table-layout:fixed;background:#fff}
.entity-reason-table-wide th:nth-child(1){width:16%}
.entity-reason-table-wide th:nth-child(2){width:7%}
.entity-reason-table-wide th:nth-child(3){width:7%}
.entity-reason-table-wide th:nth-child(4){width:27%}
.entity-reason-table-wide th:nth-child(5){width:31%}
.entity-reason-table-wide th:nth-child(6){width:12%}
.employee-reason-card{display:grid;grid-template-columns:minmax(180px,.8fr) minmax(260px,1.5fr) minmax(240px,1fr);gap:12px;padding:10px 0;border-bottom:1px solid var(--line);align-items:start}
.employee-reason-card:last-child{border-bottom:0}
.employee-reason-card>div:first-child{display:flex;flex-direction:column;gap:3px}
.employee-reason-card>div:first-child span{font-size:10px;color:var(--muted)}
.employee-reason-card p{margin:0;line-height:1.45}
@media(max-width:900px){
  .analytics-subnav{top:0;position:relative}
  .entity-section-head{align-items:flex-start!important}
  .entity-filterbar{width:100%}
  .entity-filterbar input,.entity-filterbar select{flex:1 1 220px}
  .entity-full-detail>summary{grid-template-columns:1fr 1fr}
  .entity-full-detail>summary>span:first-child{grid-column:1/-1}
  .employee-reason-card{grid-template-columns:1fr}
}


/* ==========================================================
   V15.11.4 — READABLE ANALYTICS TABLES
   Do not split Russian words letter-by-letter. Text columns get
   real horizontal width; tables scroll horizontally when needed.
   ========================================================== */

.analytics-page .table-scroll{
  overflow-x:auto;
  overflow-y:visible;
  -webkit-overflow-scrolling:touch;
  scrollbar-gutter:stable;
}

/* Generic analytics readability: wrap only at normal word boundaries. */
.analytics-page table.analytics-table th,
.analytics-page table.analytics-table td{
  overflow-wrap:normal !important;
  word-break:normal !important;
  hyphens:none !important;
  white-space:normal;
  line-height:1.42;
  vertical-align:top;
}

.analytics-page table.analytics-table th{
  vertical-align:middle;
  font-size:10.5px;
  line-height:1.25;
}

/* Never split counters / short KPI fields into vertical letters. */
.analytics-page table.analytics-table th.numeric,
.analytics-page table.analytics-table td.numeric,
.analytics-page .branch-stage-table th:nth-child(2),
.analytics-page .branch-stage-table td:nth-child(2),
.analytics-page .branch-stage-table th:nth-child(3),
.analytics-page .branch-stage-table td:nth-child(3),
.analytics-page .branch-stage-table th:nth-child(4),
.analytics-page .branch-stage-table td:nth-child(4),
.analytics-page .branch-stage-table th:nth-child(5),
.analytics-page .branch-stage-table td:nth-child(5),
.analytics-page .branch-stage-table th:nth-child(6),
.analytics-page .branch-stage-table td:nth-child(6),
.analytics-page .branch-stage-table th:nth-child(7),
.analytics-page .branch-stage-table td:nth-child(7),
.analytics-page .branch-reason-table th:nth-child(2),
.analytics-page .branch-reason-table td:nth-child(2),
.analytics-page .branch-summary-table th:nth-child(2),
.analytics-page .branch-summary-table td:nth-child(2),
.analytics-page .branch-summary-table th:nth-child(3),
.analytics-page .branch-summary-table td:nth-child(3),
.analytics-page .branch-summary-table th:nth-child(4),
.analytics-page .branch-summary-table td:nth-child(4),
.analytics-page .branch-summary-table th:nth-child(5),
.analytics-page .branch-summary-table td:nth-child(5),
.analytics-page .branch-summary-table th:nth-child(6),
.analytics-page .branch-summary-table td:nth-child(6),
.analytics-page .branch-summary-table th:nth-child(7),
.analytics-page .branch-summary-table td:nth-child(7),
.analytics-page .branch-summary-table th:nth-child(8),
.analytics-page .branch-summary-table td:nth-child(8){
  white-space:nowrap !important;
  overflow-wrap:normal !important;
  word-break:keep-all !important;
  text-align:center;
}

/* -------- Branch summary table -------- */
.analytics-page .branch-summary-table{
  table-layout:auto !important;
  width:100%;
  min-width:1850px !important;
}
.analytics-page .branch-summary-table th,
.analytics-page .branch-summary-table td{
  padding:10px 11px;
}
.analytics-page .branch-summary-table th:nth-child(1),
.analytics-page .branch-summary-table td:nth-child(1){min-width:260px;width:260px}
.analytics-page .branch-summary-table th:nth-child(2),
.analytics-page .branch-summary-table td:nth-child(2){min-width:75px;width:75px}
.analytics-page .branch-summary-table th:nth-child(3),
.analytics-page .branch-summary-table td:nth-child(3){min-width:90px;width:90px}
.analytics-page .branch-summary-table th:nth-child(4),
.analytics-page .branch-summary-table td:nth-child(4){min-width:115px;width:115px}
.analytics-page .branch-summary-table th:nth-child(5),
.analytics-page .branch-summary-table td:nth-child(5){min-width:85px;width:85px}
.analytics-page .branch-summary-table th:nth-child(6),
.analytics-page .branch-summary-table td:nth-child(6){min-width:85px;width:85px}
.analytics-page .branch-summary-table th:nth-child(7),
.analytics-page .branch-summary-table td:nth-child(7){min-width:120px;width:120px}
.analytics-page .branch-summary-table th:nth-child(8),
.analytics-page .branch-summary-table td:nth-child(8){min-width:145px;width:145px}
.analytics-page .branch-summary-table th:nth-child(9),
.analytics-page .branch-summary-table td:nth-child(9){min-width:190px;width:190px}
.analytics-page .branch-summary-table th:nth-child(10),
.analytics-page .branch-summary-table td:nth-child(10){min-width:220px;width:220px}
.analytics-page .branch-summary-table th:nth-child(11),
.analytics-page .branch-summary-table td:nth-child(11){min-width:390px;width:390px}

/* -------- Stage table inside a branch -------- */
.analytics-page .branch-stage-table{
  table-layout:auto !important;
  width:100%;
  min-width:1750px !important;
}
.analytics-page .branch-stage-table th,
.analytics-page .branch-stage-table td{
  padding:10px 11px;
}
.analytics-page .branch-stage-table th:nth-child(1),
.analytics-page .branch-stage-table td:nth-child(1){min-width:230px;width:230px}
.analytics-page .branch-stage-table th:nth-child(2),
.analytics-page .branch-stage-table td:nth-child(2){min-width:115px;width:115px}
.analytics-page .branch-stage-table th:nth-child(3),
.analytics-page .branch-stage-table td:nth-child(3){min-width:105px;width:105px}
.analytics-page .branch-stage-table th:nth-child(4),
.analytics-page .branch-stage-table td:nth-child(4){min-width:115px;width:115px}
.analytics-page .branch-stage-table th:nth-child(5),
.analytics-page .branch-stage-table td:nth-child(5){min-width:115px;width:115px}
.analytics-page .branch-stage-table th:nth-child(6),
.analytics-page .branch-stage-table td:nth-child(6){min-width:130px;width:130px}
.analytics-page .branch-stage-table th:nth-child(7),
.analytics-page .branch-stage-table td:nth-child(7){min-width:130px;width:130px}
.analytics-page .branch-stage-table th:nth-child(8),
.analytics-page .branch-stage-table td:nth-child(8){min-width:220px;width:220px}
.analytics-page .branch-stage-table th:nth-child(9),
.analytics-page .branch-stage-table td:nth-child(9){min-width:400px;width:400px}
.analytics-page .branch-stage-table th:nth-child(10),
.analytics-page .branch-stage-table td:nth-child(10){min-width:250px;width:250px}

/* -------- Confirmed reasons table -------- */
.analytics-page .branch-reason-table{
  table-layout:auto !important;
  width:100%;
  min-width:1500px !important;
}
.analytics-page .branch-reason-table th,
.analytics-page .branch-reason-table td{
  padding:11px 12px;
  font-size:11.5px;
  line-height:1.48;
}
.analytics-page .branch-reason-table th:nth-child(1),
.analytics-page .branch-reason-table td:nth-child(1){min-width:190px;width:190px}
.analytics-page .branch-reason-table th:nth-child(2),
.analytics-page .branch-reason-table td:nth-child(2){min-width:80px;width:80px}
.analytics-page .branch-reason-table th:nth-child(3),
.analytics-page .branch-reason-table td:nth-child(3){min-width:430px;width:430px}
.analytics-page .branch-reason-table th:nth-child(4),
.analytics-page .branch-reason-table td:nth-child(4){min-width:500px;width:500px}
.analytics-page .branch-reason-table th:nth-child(5),
.analytics-page .branch-reason-table td:nth-child(5){min-width:260px;width:260px}

/* Keep problem titles horizontal; normal wrapping happens only between words. */
.analytics-page .branch-reason-table td:first-child strong,
.analytics-page .branch-stage-table td:first-child strong,
.analytics-page .branch-summary-table .branch-cell-title strong{
  display:block;
  white-space:normal;
  word-break:normal !important;
  overflow-wrap:normal !important;
  hyphens:none !important;
}

/* Order IDs are atomic items: never wrap inside a number. */
.analytics-page .order-chip-list{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:5px 6px;
}
.analytics-page .order-chip{
  display:inline-flex;
  width:auto;
  max-width:none;
  white-space:nowrap !important;
  word-break:keep-all !important;
  overflow-wrap:normal !important;
  line-height:1.15;
  padding:4px 7px;
}

/* Clear visual separation in collapsed branch headers. */
.analytics-page .branch-drilldown>summary{
  grid-template-columns:minmax(275px,2fr) repeat(6,minmax(92px,.58fr)) minmax(205px,1.25fr) minmax(70px,.42fr) !important;
  gap:0 !important;
  padding:0 !important;
  align-items:stretch !important;
}
.analytics-page .branch-drilldown>summary>span{
  min-width:0;
  padding:10px 11px;
  border-right:1px solid var(--line);
  display:flex;
  justify-content:center;
  flex-direction:column;
}
.analytics-page .branch-drilldown>summary>span:last-child{border-right:0}
.analytics-page .branch-drilldown>summary .branch-name{justify-content:center}
.analytics-page .branch-drilldown>summary .branch-open-hint{
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}
.analytics-page .branch-drilldown>summary small{
  white-space:normal;
  word-break:normal;
  overflow-wrap:normal;
}
.analytics-page .branch-drilldown>summary strong{
  white-space:normal;
  word-break:normal !important;
  overflow-wrap:normal !important;
  hyphens:none !important;
}
.analytics-page .branch-stage-summary strong{
  font-size:12px !important;
  line-height:1.3;
}

/* The 3 explanatory cards also keep text horizontal and readable. */
.analytics-page .branch-summary-grid{
  grid-template-columns:minmax(0,1fr) minmax(0,1.25fr) minmax(0,.9fr) !important;
}
.analytics-page .branch-summary-grid p,
.analytics-page .branch-summary-grid strong,
.analytics-page .action-cell{
  word-break:normal !important;
  overflow-wrap:normal !important;
  hyphens:none !important;
  line-height:1.48;
}

/* Sticky header helps with wide tables. */
.analytics-page .branch-summary-table thead th,
.analytics-page .branch-stage-table thead th,
.analytics-page .branch-reason-table thead th{
  position:sticky;
  top:0;
  z-index:2;
  background:#f1f5f7;
}

@media(max-width:1180px){
  .analytics-page .branch-drilldown>summary{
    grid-template-columns:1fr 1fr 1fr !important;
  }
  .analytics-page .branch-drilldown>summary .branch-name,
  .analytics-page .branch-drilldown>summary .branch-stage-summary{
    grid-column:span 2;
  }
  .analytics-page .branch-summary-grid{
    grid-template-columns:1fr !important;
  }
}

@media(max-width:700px){
  .analytics-page .branch-drilldown>summary{
    grid-template-columns:1fr 1fr !important;
  }
  .analytics-page .branch-drilldown>summary .branch-name,
  .analytics-page .branch-drilldown>summary .branch-stage-summary,
  .analytics-page .branch-drilldown>summary .branch-open-hint{
    grid-column:1/-1;
  }
}


/* V15.12.0 — controls are not problems */
.ms-kpi.neutral-control{border-top-color:#7b8e99;background:#f8fafb}
.non-problem-controls-panel{overflow:visible}
.control-dropdown-list{display:flex;flex-direction:column;gap:10px;padding:0 12px 12px}
.control-dropdown{border:1px solid var(--line);border-radius:6px;background:#fff;overflow:hidden}
.control-dropdown>summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:minmax(320px,1fr) 80px 130px;align-items:center;gap:14px;padding:13px 14px;background:#f8fafb}
.control-dropdown>summary::-webkit-details-marker{display:none}
.control-dropdown[open]>summary{border-bottom:1px solid var(--line);background:#f3f8fa}
.control-summary-title{display:flex;flex-direction:column;gap:3px;min-width:0}
.control-summary-title strong{font-size:14px;color:#2e4957}
.control-summary-title small{font-size:10px;color:var(--muted);line-height:1.4}
.control-summary-count{justify-self:center;min-width:38px;padding:4px 9px;border-radius:999px;background:#e5f2f8;color:#1c6688;font-weight:800;text-align:center}
.control-summary-hint{justify-self:end;color:#59717e;font-size:10px;font-weight:700;white-space:nowrap}
.control-dropdown-body{padding:12px;background:#fff}
.control-info-box{padding:10px 12px;margin-bottom:10px;border:1px solid #c9e1ec;border-radius:5px;background:#f2f9fc;color:#526b79;line-height:1.5}
.control-info-box.movement{border-color:#d7dfe3;background:#f8fafb}
.separate-control-table{min-width:1320px;table-layout:fixed}
.separate-control-table th:nth-child(1){width:16%}.separate-control-table th:nth-child(2){width:16%}.separate-control-table th:nth-child(3){width:13%}.separate-control-table th:nth-child(4){width:12%}.separate-control-table th:nth-child(5){width:12%}.separate-control-table th:nth-child(6){width:16%}.separate-control-table th:nth-child(7){width:11%}.separate-control-table th:nth-child(8){width:22%}
.movement-table{min-width:1180px}.movement-table th:nth-child(1){width:18%}.movement-table th:nth-child(2){width:18%}.movement-table th:nth-child(3){width:15%}.movement-table th:nth-child(4){width:14%}.movement-table th:nth-child(5){width:13%}.movement-table th:nth-child(6){width:13%}.movement-table th:nth-child(7){width:25%}
.separate-control-table th,.separate-control-table td{word-break:normal!important;overflow-wrap:break-word!important;hyphens:none!important}
@media(max-width:760px){.control-dropdown>summary{grid-template-columns:1fr auto}.control-summary-hint{grid-column:1/-1;justify-self:start}}
