/* ====== Ученики ====== */

/* показатели */
.crm-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:14px}
.crm-stat{padding:18px 20px;text-align:left;font:inherit;color:inherit;min-width:0}
button.crm-stat{cursor:pointer;transition:border-color .15s,box-shadow .15s}
button.crm-stat:hover{border-color:var(--line-2);box-shadow:var(--sh-2)}
.crm-stat .l{order:-1;margin-bottom:6px}
.crm-stat .d{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* возвращаемость */
.crm-ret{padding:0;margin-bottom:26px;overflow:hidden}
.crm-ret-head{display:flex;align-items:baseline;gap:12px;width:100%;padding:16px 20px;border:0;background:transparent;cursor:pointer;text-align:left;font:inherit;color:inherit}
.crm-ret-head svg{width:18px;height:18px;color:var(--muted);align-self:center;transition:transform .2s}
.crm-ret.closed .crm-ret-head svg{transform:rotate(-90deg)}
.crm-ret.closed .crm-ret-body{display:none}
.crm-ret-body{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:36px;padding:4px 20px 22px;align-items:start}
.crm-bars{display:flex;flex-direction:column;gap:9px}
.crm-bar{display:grid;grid-template-columns:96px minmax(0,1fr) 28px 40px;gap:12px;align-items:center;font-size:13px}
.crm-bar-l{color:var(--ink-2)}
.crm-bar-track{height:10px;border-radius:999px;background:var(--bg-2);overflow:hidden}
.crm-bar-track i{display:block;height:100%;min-width:3px;border-radius:999px;background:var(--accent)}
.crm-bar-track i.one{background:var(--faint)}
.crm-bar-n{text-align:right;font-weight:600}
.crm-bar-p{text-align:right;font-size:12px}
.crm-ret-side{display:flex;flex-direction:column;gap:10px}
.crm-flow{display:flex;align-items:center;gap:8px}
.crm-flow b{font-size:18px;margin-left:6px}
.crm-arrow{color:var(--faint)}

/* сегменты, фильтры, действия */
.crm-segs{margin-bottom:12px}
.crm-filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.crm-filters .select{width:auto;min-width:150px;max-width:230px;flex:0 1 auto}
.crm-search{flex:1 1 240px;max-width:340px}
.crm-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.crm-count{font-weight:600;display:flex;align-items:baseline;gap:12px}
.crm-link{border:0;background:none;padding:0;color:var(--accent);cursor:pointer;font-weight:400;font-size:13px;text-decoration:underline;text-underline-offset:3px}
.crm-center{justify-content:center}
.crm-grow{flex:1;min-width:200px}

/* таблица */
.crm-th{border:0;background:none;padding:0;font:inherit;color:inherit;cursor:pointer;display:inline-flex;gap:5px;align-items:center}
.crm-th:hover,.crm-th.on{color:var(--ink)}
.crm-dir{font-size:11px}
.crm-name{font-weight:500}
.crm-chips{display:flex;gap:5px;flex-wrap:wrap;align-items:center}
.crm-nowrap{white-space:nowrap}
.crm-table td{padding:11px 12px}
.crm-table th{padding-left:12px;padding-right:12px}
.crm-table td:first-child,.crm-table th:first-child{padding-left:18px}
.crm-table .crm-name{white-space:nowrap}
.crm-table .crm-chips{flex-wrap:nowrap}
.crm-cards{display:none;flex-direction:column;gap:10px}
.crm-pcard{display:flex;flex-direction:column;gap:9px;padding:15px 16px;text-align:left;font:inherit;color:inherit;cursor:pointer;width:100%}
.crm-pcard-top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}

/* окна раздела */
.modal.wide.crm-xl{width:min(100%,1020px)}
.crm-grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.crm-note{display:flex;gap:10px;align-items:flex-start;padding:11px 14px;border-radius:var(--r);background:var(--bg-2);color:var(--ink-2);font-size:13.5px}
.crm-note svg{width:17px;height:17px;flex:none;margin-top:2px;color:var(--muted)}
.crm-note.warn{background:var(--warn-soft)}
.crm-note.warn svg{color:var(--warn)}
.crm-notes{display:flex;flex-direction:column;gap:8px}

/* карточка человека */
.crm-summary{color:var(--muted);margin-top:-12px}
.crm-person{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:30px;align-items:start}
.crm-pleft{display:flex;flex-direction:column;gap:14px;min-width:0}
.crm-pright{display:flex;flex-direction:column;gap:14px;min-width:0;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r-lg);padding:18px}
.crm-tags{display:flex;flex-wrap:wrap;gap:6px;align-items:center;min-height:42px;padding:7px 9px;border:1px solid var(--line-2);border-radius:11px;background:var(--surface)}
.crm-tags:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.crm-tag-input{flex:1;min-width:110px;border:0;outline:0;background:transparent;height:26px;padding:0 4px}
.crm-tag-input::placeholder{color:var(--faint)}
.crm-chip-x{border:0;background:none;padding:0;margin-right:-3px;display:inline-grid;place-items:center;width:16px;height:16px;border-radius:50%;cursor:pointer;color:inherit;opacity:.6}
.crm-chip-x:hover{opacity:1;background:var(--line-2)}
.crm-path{display:flex;flex-direction:column;position:relative;padding-left:24px}
.crm-path::before{content:"";position:absolute;left:6px;top:14px;bottom:14px;width:2px;background:var(--line-2);border-radius:2px}
.crm-step{position:relative;display:flex;gap:8px;align-items:flex-start;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:12px 8px 12px 14px}
.crm-step::before{content:"";position:absolute;left:-24px;top:16px;width:10px;height:10px;border-radius:50%;background:var(--muted);border:2px solid var(--surface-2);box-sizing:content-box}
.crm-step.club::before{background:var(--club)} .crm-step.course::before{background:var(--course)} .crm-step.violet::before{background:var(--violet)} .crm-step.common::before{background:var(--common)}
.crm-step.editing{padding:0;border:0;background:none}
.crm-step-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.crm-step-title{font-weight:600}
.crm-gap{font-size:12px;color:var(--muted);padding:7px 0 7px 2px}
.crm-path-empty{text-align:center;padding:26px 10px;color:var(--faint)}
.crm-path-empty svg{width:26px;height:26px;margin-bottom:6px}
.crm-pform{display:flex;flex-direction:column;gap:12px;background:var(--surface);border:1px solid var(--line-2);border-radius:var(--r);padding:16px;box-shadow:var(--sh-1)}
.crm-pform+.crm-path{margin-top:2px}
.crm-newprod{padding:12px;border-radius:var(--r-sm);background:var(--bg-2)}

/* список для рассылки */
.crm-copy-block{display:flex;flex-direction:column;gap:8px}
.crm-copy{min-height:0;font-size:13.5px;background:var(--surface-2);resize:vertical}

/* настройки */
.crm-set{display:flex;flex-direction:column;gap:16px;min-height:300px;padding-bottom:16px}
.crm-prods{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:var(--r-lg);overflow:hidden}
.crm-prod{display:grid;grid-template-columns:minmax(0,1fr) 150px auto;gap:16px;align-items:center;padding:13px 16px;border-bottom:1px solid var(--line)}
.crm-prod:last-child{border-bottom:0}
.crm-prod-main{display:flex;flex-direction:column;gap:5px;min-width:0}
.crm-prod-nums{text-align:right}
.crm-prod-act{display:flex;gap:4px;align-items:center}
.crm-setblock{display:flex;flex-direction:column;gap:10px;padding:18px;border:1px solid var(--line);border-radius:var(--r-lg)}
.crm-days{width:96px}
.crm-rows{display:flex;flex-direction:column;gap:8px}
.crm-row{display:grid;grid-template-columns:minmax(0,1.3fr) 140px minmax(0,1.2fr) 32px;gap:8px;align-items:center}
.crm-export{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:16px 18px;border:1px solid var(--line);border-radius:var(--r-lg)}

/* импорт */
.crm-imp{display:flex;flex-direction:column;gap:16px}
.crm-imp-foot{display:flex;align-items:center;gap:10px;width:100%}
.crm-steps{display:flex;gap:8px;align-items:center}
.crm-stepdot{display:flex;align-items:center;gap:8px;color:var(--muted);font-weight:500;font-size:13.5px}
.crm-stepdot+.crm-stepdot::before{content:"";width:28px;height:1px;background:var(--line-2);margin-right:2px}
.crm-stepdot i{font-style:normal;width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:var(--bg-2);font-size:12px;font-weight:600}
.crm-stepdot.on{color:var(--ink)} .crm-stepdot.on i{background:var(--ink);color:#fff}
.crm-stepdot.done i{background:var(--ok-soft);color:var(--ok)}
.crm-drop{display:flex;flex-direction:column;align-items:center;gap:6px;padding:34px 20px;border:1.5px dashed var(--line-2);border-radius:var(--r-lg);background:var(--surface-2);cursor:pointer;font:inherit;color:inherit;text-align:center;transition:border-color .15s,background .15s}
.crm-drop:hover,.crm-drop.over{border-color:var(--accent);background:var(--accent-softer)}
.crm-drop svg{color:var(--accent);margin-bottom:4px}
.crm-or{display:flex;align-items:center;gap:12px;color:var(--faint);font-size:13px}
.crm-or::before,.crm-or::after{content:"";flex:1;height:1px;background:var(--line)}
.crm-imp-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.crm-peek{box-shadow:none;border-radius:var(--r);max-width:100%}
.crm-peek .table th,.crm-peek .table td{padding:8px 12px;font-size:12.5px;white-space:nowrap;max-width:220px;overflow:hidden;text-overflow:ellipsis}
.crm-peek .table tbody tr{cursor:default}
.crm-maps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 28px}
.crm-map{display:grid;grid-template-columns:118px minmax(0,1fr);gap:2px 10px;align-items:center}
.crm-map-l{font-size:13.5px;font-weight:500}
.crm-map .select{height:38px}
.crm-sample{grid-column:2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:18px;font-size:12px}
.crm-tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.crm-tile{padding:16px;border:1px solid var(--line);border-radius:var(--r-lg);display:flex;flex-direction:column;gap:3px}
.crm-tile .v{font-size:28px;font-weight:600;letter-spacing:-.03em;line-height:1.1}
.crm-tile .l{font-size:13.5px;font-weight:500}
.crm-tile.good{background:var(--ok-soft);border-color:transparent}
.crm-tile.good .v{color:var(--ok)}

@media (max-width:1100px){
  .crm-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:860px){
  .crm-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .crm-stat{padding:14px 15px}
  .crm-stat .v{font-size:25px}
  .crm-ret-head{flex-wrap:wrap;gap:4px 10px;padding:14px 16px}
  .crm-ret-head .small{display:none}
  .crm-ret-body{grid-template-columns:1fr;gap:18px;padding:2px 16px 18px}
  .crm-bar{grid-template-columns:84px minmax(0,1fr) 24px 36px;gap:8px}
  .crm-segs{flex-wrap:nowrap;overflow-x:auto;margin:0 -14px 12px;padding:0 14px 2px;scrollbar-width:none}
  .crm-segs::-webkit-scrollbar{display:none}
  .crm-segs .pill{flex:none;height:38px}
  .crm-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .crm-search{grid-column:1/-1;max-width:none}
  .crm-filters .select{width:100%;max-width:none;min-width:0}
  .crm-actions .spacer{flex-basis:100%;height:0}
  .crm-actions .btn{flex:1;height:38px}
  .crm-table{display:none}
  .crm-cards{display:flex}
  .crm-person{grid-template-columns:1fr;gap:20px}
  .crm-pright{padding:14px}
  .crm-prod{grid-template-columns:minmax(0,1fr) auto;gap:8px 12px}
  .crm-prod-act{grid-column:1/-1}
  .crm-prod-act .btn:first-child{flex:1}
  .crm-row{grid-template-columns:minmax(0,1fr) 120px 32px}
  .crm-row>:nth-child(3){grid-column:1/-1;grid-row:2}
  .crm-row>span:nth-child(3){display:none}
  .crm-maps{grid-template-columns:1fr}
  .crm-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
  .crm-stepdot+.crm-stepdot::before{width:12px}
  .crm-set .seg{align-self:stretch;overflow-x:auto}
  .crm-set .seg button{flex:1;padding:0 10px;font-size:13.5px;white-space:nowrap}
}
