/* «Потребность» (static/demand.js). Каркас — как у «Динамики финансов» (findyn.css: fd-shell,
   fd-head, fd-bar, fd-side); здесь только три таблицы страницы PBI и их цвета. */
.dm-main{flex:1;min-width:0;min-height:0;display:grid;grid-template-columns:minmax(0,45fr) minmax(0,55fr);gap:8px;padding:8px;background:#eef3fa}
.dm-right{display:grid;grid-template-rows:minmax(0,62fr) minmax(0,38fr);gap:8px;min-height:0}
.dm-card{display:flex;flex-direction:column;min-height:0;background:#fff;border:1px solid #cfdcee;border-radius:8px;overflow:hidden}
.dm-card h3{margin:0;padding:4px 8px;font-size:13px;font-weight:700;text-align:center;background:#bcd6f5;color:#1f2a3a}
.dm-scroll{flex:1;min-height:0;overflow:auto}
.dm-empty{padding:16px}

.dm-t{border-collapse:separate;border-spacing:0;font-size:11px;width:max-content;min-width:100%}
.dm-t th,.dm-t td{padding:2px 6px;white-space:nowrap;text-align:right;border-bottom:1px solid #eef0f3}
.dm-t thead th{position:sticky;top:0;z-index:2;background:#fff;font-weight:700;text-align:center;white-space:normal;max-width:110px;vertical-align:bottom;border-bottom:1px solid #b9c6d8}
.dm-t thead tr.dm-h2 th{top:22px}
.dm-t th.dm-grp-h{border-bottom:1px solid #dfe6f0}
.dm-t .dm-l{text-align:left}
.dm-t td.dm-l{font-weight:600;color:#1f2a3a;max-width:220px;overflow:hidden;text-overflow:ellipsis}
.dm-t td.dm-txt{text-align:left;max-width:260px;overflow:hidden;text-overflow:ellipsis}
/* левая таблица: текстовые колонки узкие, с переносом — цифры должны помещаться без прокрутки */
.dm-need .dm-t .dm-l{white-space:normal;word-break:break-word}
/* #modal-demand в селекторах: общие правила таблиц сайта (style.css) иначе перебивают отступы и шрифт */
#modal-demand .dm-t th,#modal-demand .dm-t td{padding:2px 6px;font-size:11px;line-height:1.35}
#modal-demand .dm-need .dm-t th,#modal-demand .dm-need .dm-t td{padding:2px 4px;font-size:10.5px}
#modal-demand .dm-need .dm-t tr > .dm-l:nth-child(1){width:68px;max-width:68px}
#modal-demand .dm-need .dm-t tr > .dm-l:nth-child(2){width:96px;max-width:96px}
/* баркод не переносится и не обрезается: колонка растёт по содержимому, а не наезжает на соседнюю */
#modal-demand .dm-need .dm-t tr > .dm-l:nth-child(3){width:auto;min-width:92px;max-width:none;white-space:nowrap;word-break:normal;overflow:visible}
#modal-demand .dm-t thead th{white-space:normal;vertical-align:bottom}
#modal-demand .dm-need .dm-t thead th{max-width:72px;font-size:10px;overflow-wrap:break-word}
.dm-t tr.dm-first td{border-top:1px solid #dfe6f0}
.dm-t tr.dm-grp td{background:#f7f9fc}
.dm-t tr.dm-total td{font-weight:700;border-top:1px solid #b9c6d8;background:#f2f5fa;position:sticky;bottom:0}
.dm-t td.dm-b{font-weight:600}
.dm-tog{width:16px;height:16px;line-height:12px;font-size:11px;margin-right:4px}
.dm-t a{color:inherit;text-decoration:underline dotted}

/* правила условного форматирования PBI */
.dm-t td.dm-pink{background:#efb5b9}
.dm-t td.dm-green{background:#a9d18e}
.dm-t td.dm-grey{background:#bdbdbd}
.dm-t td.dm-today{background:#a0a7d8}

@media (max-width:1100px){
  .dm-main{grid-template-columns:minmax(0,1fr);overflow:auto}
  .dm-right{grid-template-rows:auto auto}
  .dm-card{min-height:360px}
}


/* Skeleton Shimmer for Demand tables */
@keyframes dmShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.dm-sk-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.dm-sk-table th { padding: 4px 6px; background: #bcd6f5; height: 24px; border-bottom: 1px solid #cfdcee; }
.dm-sk-table td { padding: 4px 6px; border-bottom: 1px solid #eef2f6; }
.dm-sk-bar {
  display: block;
  height: 13px;
  border-radius: 3px;
  background: linear-gradient(90deg, #f0f4f8 25%, #dce4ee 50%, #f0f4f8 75%);
  background-size: 200% 100%;
  animation: dmShimmer 1.4s infinite;
}
