/* === Вкладка «Оборачиваемость» === */

/* Верхние карточки */
.to-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px;margin-bottom:14px}
.to-card{background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:14px 16px;display:flex;flex-direction:column;gap:4px;cursor:pointer;transition:box-shadow .15s,border-color .15s}
.to-card:hover{border-color:#93c5fd;box-shadow:0 2px 8px rgba(37,99,235,.1)}
.to-card.active{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.15)}
.to-card-label{font-size:11px;color:#6b7280;font-weight:500;line-height:1.3}
.to-card-value{font-size:22px;font-weight:700;color:#111827;line-height:1.2}
.to-card-value.red{color:#dc2626}
.to-card-value.orange{color:#ea580c}
.to-card-value.green{color:#16a34a}
.to-card-value.blue{color:#2563eb}
.to-card-sub{font-size:10px;color:#9ca3af;line-height:1.2}

/* Фильтры */
.to-filters{display:flex;align-items:flex-end;gap:10px;margin-bottom:0;flex-wrap:wrap;background:#fff;padding:12px 16px;border:1px solid #e5e7eb;border-radius:12px 12px 0 0;box-shadow:0 2px 8px rgba(0,0,0,.06)}
.to-filter-group{display:flex;flex-direction:column;gap:2px}
.to-filter-label{font-size:11px;color:#6b7280}
.to-filter-input{font-size:13px;padding:6px 10px;border:1px solid #d1d5db;border-radius:6px;background:#fff;outline:none}
.to-filter-input:focus{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.1)}

/* Статус загрузки */
.to-loading{text-align:center;padding:40px;color:#6b7280}
.to-loading .spin{display:inline-block;width:24px;height:24px;border:3px solid #e5e7eb;border-top-color:#2563eb;border-radius:50%;animation:spin .8s linear infinite;margin-bottom:8px}
@keyframes spin{to{transform:rotate(360deg)}}
.to-loading-status{font-size:13px;margin-top:6px;color:#6b7280}

/* Таблица */
.to-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12px}
.to-table thead{background:#f9fafb;z-index:11}
.to-table th{background:#f9fafb;border:1px solid #e5e7eb;padding:8px 6px;font-size:11px;font-weight:600;color:#374151;text-align:left;white-space:nowrap;vertical-align:bottom;cursor:pointer;user-select:none;position:sticky;top:0;z-index:12;box-shadow:0 1px 0 #e5e7eb}
.to-table th:hover{background:#f3f4f6}
.to-table th .sort-arrow{font-size:9px;margin-left:2px;color:#9ca3af}
.to-table th .sort-arrow.active{color:#2563eb}
.to-table th .to-help{display:inline-block;width:14px;height:14px;line-height:14px;text-align:center;font-size:10px;background:#e5e7eb;color:#6b7280;border-radius:50%;cursor:help;margin-left:3px;vertical-align:middle;position:relative}
.to-table td{border:1px solid #f3f4f6;padding:6px;vertical-align:middle}
.to-table tr:hover td{background:#f0f9ff}
.to-table .num{text-align:right;font-variant-numeric:tabular-nums}
.to-table .money::after{content:' ₽'}

/* Строки по статусу */
.to-row-danger td{background:#fef2f2}
.to-row-warning td{background:#fffbeb}
.to-row-dead td{background:#f9fafb;color:#9ca3af}

/* Фото товара */
.to-photo{width:40px;height:40px;border-radius:6px;object-fit:cover;cursor:pointer;transition:transform .15s}
.to-photo-wrap{position:relative;display:inline-block;width:40px;height:40px}
.to-photo-big{display:none;position:absolute;top:-10px;left:50px;width:160px;height:160px;border-radius:10px;object-fit:cover;box-shadow:0 4px 20px rgba(0,0,0,.25);z-index:100;pointer-events:none;border:2px solid #fff}
.to-photo-wrap:hover .to-photo-big{display:block}

/* Бейджи решений */
.to-badge{display:inline-block;padding:2px 8px;border-radius:10px;font-size:10px;font-weight:600;white-space:nowrap;line-height:1.5}
.to-badge-red{background:#fef2f2;color:#dc2626;border:1px solid #fecaca}
.to-badge-orange{background:#fff7ed;color:#ea580c;border:1px solid #fed7aa}
.to-badge-yellow{background:#fffbeb;color:#a16207;border:1px solid #fde68a}
.to-badge-green{background:#f0fdf4;color:#16a34a;border:1px solid #bbf7d0}
.to-badge-gray{background:#f9fafb;color:#6b7280;border:1px solid #e5e7eb}
.to-badge-blue{background:#eff6ff;color:#2563eb;border:1px solid #bfdbfe}

/* Бейджи факторов риска */
.to-risk-badges{display:flex;flex-wrap:wrap;gap:3px;max-width:260px}

/* Решение */
.to-decision{font-weight:600;font-size:11px;white-space:nowrap}

/* Причина */
.to-reason{font-size:11px;color:#4b5563;line-height:1.4;max-width:260px}

/* Подсказки (tooltip) */
.to-tooltip{position:absolute;background:#1f2937;color:#fff;font-size:11px;padding:8px 12px;border-radius:8px;max-width:320px;line-height:1.5;z-index:200;pointer-events:none;box-shadow:0 4px 12px rgba(0,0,0,.2);white-space:normal}

/* Кнопка обновить */
.to-refresh-btn{font-size:12px;padding:6px 14px;background:#2563eb;color:#fff;border:none;border-radius:6px;cursor:pointer;font-weight:600;transition:background .15s}
.to-refresh-btn:hover{background:#1d4ed8}
.to-refresh-btn:disabled{background:#93c5fd;cursor:not-allowed}

/* Адаптив */
@media(max-width:1200px){
  .to-cards{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:768px){
  .to-cards{grid-template-columns:repeat(2,1fr)}
  .to-filters{flex-direction:column;align-items:stretch}
}
