/* Демо «Школа · School Pulse». Только классы .sh-*, цвета — из темы (var(--…)). */

/* экран: колонка не шире окна, широкие таблицы прокручиваются внутри */
.sh-scr, .sh-scr .list, .sh-scr .card { grid-template-columns: minmax(0, 1fr); }
.sh-scr .card { min-width: 0; }
.sh-g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.sh-k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 760px) { .sh-k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* роль и «кто я» */
.sh-role { display: flex; align-items: center; gap: 10px; }
.sh-me {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px; border-radius: var(--radius-sm);
  border: var(--bw) solid var(--line); background: var(--surface);
  text-align: left; cursor: pointer; transition: border-color .2s;
}
.sh-me:hover { border-color: var(--accent); }
.sh-me > span:not(.av) { flex: 1; min-width: 0; display: grid; }
.sh-me b { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-me small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-me .ic { width: 14px; height: 14px; color: var(--muted); }
.sh-push { margin-left: auto; }
.sh-badge-inv { background: var(--accent-ink); color: var(--accent); }

/* Сегодня */
.sh-todo .li-r .btn { white-space: nowrap; }
.sh-todo .li-t { white-space: normal; }
.sh-todo.t-bad .li-i { background: var(--bad-soft); color: var(--bad); }
.sh-todo.t-warn .li-i { background: var(--warn-soft); color: var(--warn); }
.sh-todo.t-ok .li-i { background: var(--ok-soft); color: var(--ok); }
.sh-bag { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; border-radius: var(--radius-sm); }
.sh-bag-i {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: var(--radius-sm); border: var(--bw) solid var(--line);
  background: var(--surface); text-align: left; cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.sh-bag-i:hover { border-color: var(--accent); }
.sh-bag-i > span:last-child { display: grid; min-width: 0; }
.sh-bag-i b { font-size: 13px; font-weight: 600; line-height: 1.25; }
.sh-bag-i small { font-size: 11.5px; color: var(--muted); }
.sh-box {
  flex: none; width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid var(--line-2); display: grid; place-items: center; color: transparent;
  transition: background-color .2s, border-color .2s, color .2s;
}
.sh-box .ic { width: 13px; height: 13px; stroke-width: 3; }
.sh-bag-i.on { background: var(--ok-soft); border-color: transparent; }
.sh-bag-i.on .sh-box { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.sh-bag-i.on b { text-decoration: line-through; color: var(--text-2); }

.sh-les-list { display: grid; gap: 2px; }
.sh-les {
  display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; align-items: center;
  padding: 8px 10px; border-radius: var(--radius-sm); position: relative;
}
.sh-les-t { font-size: 12.5px; color: var(--muted); white-space: nowrap; min-width: 40px; }
.sh-les-n { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.sh-les .sh-take { grid-column: 2; }
.sh-les.done { opacity: .5; }
.sh-les.now { background: var(--accent-soft); }
.sh-les.now::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--accent); }
.sh-take { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--warn); font-weight: 600; }
.sh-take .ic { width: 13px; height: 13px; }
.sh-meal { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 6px 0; font-size: 13.5px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.sh-meal:last-child { border-bottom: 0; }
.sh-date {
  flex: none; width: 42px; height: 44px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; align-content: center; line-height: 1;
}
.sh-date b { font-size: 17px; }
.sh-date small { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* формы в панели */
.sh-kid { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.sh-kid > span:not(.av) { display: grid; }
.sh-photo {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px;
  border-radius: var(--radius-sm); border: 1.5px dashed var(--line-2);
  background: transparent; text-align: left; cursor: pointer; transition: border-color .2s, background-color .2s;
}
.sh-photo:hover { border-color: var(--accent); }
.sh-photo .ic { width: 22px; height: 22px; color: var(--accent); }
.sh-photo > span { display: grid; }
.sh-photo b { font-size: 13.5px; }
.sh-photo small { font-size: 12px; color: var(--muted); }
.sh-photo.on { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.sh-photo.on .ic { color: var(--ok); }

/* отчёты родителей */
.sh-rep { display: grid; gap: 9px; padding: 12px; border-radius: var(--radius); border: var(--bw) solid var(--line); background: var(--surface); }
.sh-rep-h { display: flex; align-items: center; gap: 10px; }
.sh-rep-h > span:not(.av) { flex: 1; min-width: 0; display: grid; font-size: 13.5px; }
.sh-rep-h small { font-size: 12px; }
.sh-att { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ok); font-weight: 600; }
.sh-att .ic { width: 15px; height: 15px; }
.sh-why { display: grid; gap: 8px; padding-top: 4px; }
.sh-why .chip { height: 28px; font-size: 12.5px; }

/* чек */
.sh-receipt {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text);
  background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 6px;
  padding: 16px 16px 14px; display: grid; gap: 8px;
}
.sh-rc-h { text-align: center; font-weight: 700; letter-spacing: .08em; padding-bottom: 8px; border-bottom: 1px dashed var(--line-2); }
.sh-rc-h small { font-weight: 400; letter-spacing: 0; color: var(--muted); }
.sh-rc-row { display: flex; justify-content: space-between; gap: 12px; }
.sh-rc-sum { font-weight: 700; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.sh-rc-f { color: var(--muted); font-size: 11.5px; text-align: center; }
.sh-rc-btn {
  display: inline-flex; align-items: center; gap: 4px; vertical-align: middle;
  height: 20px; padding: 0 7px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: var(--accent); font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.sh-rc-btn:hover { border-color: var(--accent); }
.sh-rc-btn .ic { width: 12px; height: 12px; }
.sh-rc-btn.off { color: var(--muted); cursor: default; }
.sh-rc-btn.off:hover { border-color: var(--line); }

/* касса */
.sh-fresh td { background: color-mix(in srgb, var(--warn-soft) 60%, transparent); }
.sh-cancel td { color: var(--muted); }
.sh-cancel td b, .sh-cancel td.r:nth-child(3) { text-decoration: line-through; }
.sh-more { justify-self: start; margin-top: 8px; }
.sh-strike { text-decoration: line-through; }

/* сборы */
.sh-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sh-col {
  display: grid; gap: 6px; padding: 12px; text-align: left; cursor: pointer;
  border-radius: var(--radius); border: var(--bw) solid var(--line); background: var(--surface);
  box-shadow: var(--shadow); transition: border-color .2s;
}
.sh-col:hover { border-color: var(--accent); }
.sh-col.on { border-color: var(--accent); background: var(--accent-soft); }
.sh-col b { font-size: 14px; line-height: 1.25; }
.sh-col-k { font-size: 11.5px; color: var(--muted); }
.sh-col .bar { height: 6px; }
.sh-sum { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.sh-donut { position: relative; width: 132px; height: 132px; }
.sh-donut-c { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; line-height: 1.1; text-align: center; }
.sh-donut-c b { font-size: 24px; }
.sh-donut-c small { font-size: 11.5px; color: var(--muted); }
.sh-stats { display: grid; gap: 8px; width: 100%; }
.sh-stat { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); border: var(--bw) solid var(--line); background: var(--surface); }
.sh-stat > span { display: grid; font-size: 13px; font-weight: 600; }
.sh-stat small { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.sh-stat b { font-size: 19px; letter-spacing: -.01em; white-space: nowrap; }
.sh-kidrow { flex-wrap: nowrap; gap: 8px; white-space: nowrap; }

/* расписание */
.sh-rbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: var(--bw) solid var(--line); }
.sh-rbar .tabs { border-bottom: 0; }
.sh-wnav { display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; padding-bottom: 4px; border-radius: var(--radius-sm); }
.sh-days { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.sh-dchip {
  display: grid; gap: 2px; justify-items: center; padding: 8px 4px; cursor: pointer;
  border-radius: var(--radius-sm); border: var(--bw) solid var(--line); background: var(--surface); color: var(--text);
  transition: border-color .2s, background-color .2s;
}
.sh-dchip small { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.sh-dchip b { font-size: 17px; }
.sh-dchip:hover { border-color: var(--accent); }
.sh-dchip.today small { color: var(--accent); }
.sh-dchip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sh-dchip.on small { color: var(--accent-ink); opacity: .85; }
.sh-week { display: grid; grid-template-columns: repeat(5, minmax(128px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.sh-wd { border-radius: var(--radius); border: var(--bw) solid var(--line); background: var(--surface); padding: 10px; display: grid; gap: 6px; align-content: start; }
.sh-wd.today { border-color: var(--accent); box-shadow: var(--focus); }
.sh-wd-h { font-size: 13px; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.sh-wd-h b { color: var(--text); text-transform: uppercase; }
.sh-wl { display: grid; gap: 1px; font-size: 13px; font-weight: 600; line-height: 1.3; }
.sh-wl small { font-size: 11px; color: var(--muted); font-weight: 500; }
.sh-wl .sh-take { font-size: 11px; }
.sh-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.sh-mday.today { border-color: var(--accent); }

/* события */
.sh-ev-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; align-items: start; }
.sh-ev-list { display: grid; gap: 6px; }
.sh-ev {
  display: flex; align-items: center; gap: 10px; padding: 8px; text-align: left; cursor: pointer;
  border-radius: var(--radius); border: var(--bw) solid var(--line); background: var(--surface); transition: border-color .2s;
}
.sh-ev:hover { border-color: var(--accent); }
.sh-ev.on { border-color: var(--accent); background: var(--accent-soft); }
.sh-ev > span:last-child { display: grid; min-width: 0; }
.sh-ev b { font-size: 13.5px; line-height: 1.25; }
.sh-ev small { font-size: 11.5px; color: var(--muted); }
.sh-ev.past .sh-date { background: var(--surface-2); color: var(--muted); }
.sh-ev-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.sh-ev-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sh-ev-top .pill { flex: none; }
.sh-resp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.sh-person { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.sh-budget { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.sh-budget-h { justify-content: space-between; font-size: 13.5px; }
.sh-bar2 { display: flex; height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.sh-bar2 i { display: block; height: 100%; transition: width .6s var(--ease); }
.sh-bar2 .sp { background: var(--accent); }
.sh-bar2 .pl { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 55%, transparent) 0 5px, color-mix(in srgb, var(--accent) 25%, transparent) 5px 10px); }
.li-i.sh-ok { background: var(--ok-soft); color: var(--ok); }
.sh-ir { display: flex; align-items: center; gap: 8px; }

/* лента */
.sh-lbar { flex-wrap: wrap; }
.sh-search { position: relative; flex: 1 1 280px; min-width: 0; }
.sh-search .ic { z-index: 1; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.sh-search .inp { padding-left: 34px; height: 36px; }
.sh-feed { padding: 4px 14px; }
.sh-fi { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); font-size: 13.5px; line-height: 1.45; }
.sh-fi:last-child { border-bottom: 0; }
.sh-fi.fresh { animation: shFresh 2.4s var(--ease); }
@keyframes shFresh { 0%, 30% { background: var(--accent-soft); box-shadow: -14px 0 0 var(--accent-soft), 14px 0 0 var(--accent-soft); } }
.sh-fi-m { flex: 1; min-width: 0; display: grid; gap: 4px; }
.sh-fi-s { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sh-fi-a { flex: none; font-weight: 700; white-space: nowrap; }
.sh-was { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.sh-was span { padding: 2px 8px; border-radius: 6px; background: var(--surface-2); }
.sh-was span:first-child { text-decoration: line-through; color: var(--muted); }
.sh-was span:last-child { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sh-was .ic { width: 14px; height: 14px; color: var(--muted); }

/* мини-превью на главной */
.sh-pv { display: grid; gap: 8px; }
.sh-pv-c { display: grid; gap: 6px; }
.sh-pv-f { min-height: 40px; }
.sh-pv-line { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface); border: var(--bw) solid var(--line); font-size: 12.5px; animation: plateIn .5s var(--ease) both; }
.sh-pv-line > span:not(.av) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-pv-line .num.up { color: var(--ok); }
.sh-pv-line .num.warn { color: var(--warn); }

/* узкое окно */
@container (max-width: 520px) {
  .sh-g2 { grid-template-columns: minmax(0, 1fr); }
  .sh-cols { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(200px, 78%); overflow-x: auto; padding-bottom: 4px; }
  .sh-sum { grid-template-columns: 1fr; justify-items: center; }
  .sh-ev-grid { grid-template-columns: minmax(0, 1fr); }
  .sh-ev-list { grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); overflow-x: auto; padding-bottom: 4px; }
  .sh-push { margin-left: 0; }
  .sh-todo { flex-wrap: wrap; }
  .sh-todo .li-r { width: 100%; text-align: left; padding-left: 46px; }
}
@container (max-width: 640px) {
  .sh-ev-grid { grid-template-columns: minmax(0, 1fr); }
  .sh-ev-list { grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); overflow-x: auto; padding-bottom: 4px; }
}
@container (max-width: 420px) {
  .sh-role .seg button { padding: 5px 8px; }
  .sh-days { gap: 4px; }
  .sh-dchip b { font-size: 15px; }
  .sh-fi-a { font-size: 12.5px; }
  .sh-wnav { width: 100%; justify-content: space-between; }
}
