/* Служебные записки: страница руководителя (/teacher/memos, views/teacher/memos.php)
   и блок на экране сборника у администратора (views/admin/_memos.php).
   Только классы .sb-memo*; размеры шрифта – 20/17/15/14/13 px, скругления – var(--sb-radius*). */

/* ---------------------------------------------------- общее: строка «От кого» / «Кому» -- */
/* тихие действия – без подчёркивания (подчёркиваются только ссылки внутри текста); при наведении – подчёркивание */
.sb-memo .sb-link-btn, .sb-memo-all { text-decoration: none; }
.sb-memo .sb-link-btn:hover, .sb-memo-all:hover { text-decoration: underline; text-underline-offset: .2em; }
.sb-memo-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .125rem .5rem; font-size: .875rem; line-height: 1.5; }
.sb-memo-k { color: var(--sb-muted); }
.sb-memo-v { color: var(--sb-ink); min-width: 0; overflow-wrap: anywhere; }
.sb-memo-edit > summary { list-style: none; cursor: pointer; font-size: .875rem; min-height: 0; }
.sb-memo-edit > summary::-webkit-details-marker { display: none; }
.sb-memo-edit[open] { flex-basis: 100%; }
.sb-memo-edit[open] > summary { color: var(--sb-muted); }
.sb-memo-form { display: grid; gap: .5rem; max-width: 36rem; margin-top: .5rem; }
.sb-memo-btns { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.sb-memo-form .sb-memo-btns { margin-top: .25rem; }

/* ------------------------------------------------------------ руководитель: таблица -- */
.sb-memo-table { margin-bottom: 0; }
.sb-memo-table > thead th { padding-top: .375rem; padding-bottom: .375rem; }
.sb-memo-table > tbody td { padding: .75rem .75rem; vertical-align: top; }
.sb-memo-table .sb-memo-c-chk { width: 3.5rem; }
.sb-memo-table .sb-memo-c-who { width: 28%; }
.sb-memo-table .sb-memo-c-state { width: 13.5rem; }
.sb-memo-table .sb-chk { width: 34px; height: 34px; margin: -.375rem 0 -.375rem -.25rem; }
.sb-memo-table > thead .sb-chk { margin-top: -.5rem; margin-bottom: -.5rem; }
.sb-memo-table > thead .form-check-input { border-color: #fff; }
.sb-memo-title a { font-weight: 500; overflow-wrap: anywhere; }
.sb-memo-who { color: var(--sb-ink-2); overflow-wrap: anywhere; }
.sb-memo-state .sb-status { font-size: .8125rem; }

.sb-memo-act { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--sb-line); }
.sb-memo-sure { flex-basis: 100%; margin: 0; font-size: .875rem; color: var(--sb-ink); }
/* все подтверждены – в строке одна тихая «Снять подтверждение»: ровно по левому краю */
@media (min-width: 768px) { .sb-memo-act > .btn-sb-quiet:first-child { margin-left: -.75rem; } }

/* ---------------------------------------------------------- руководитель: скачать -- */
.sb-memo-dl { display: grid; gap: .75rem; }
.sb-memo-get { display: grid; gap: .75rem; }
.sb-memo-mode { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin: 0; padding: 0; border: 0; }
.sb-memo-mode .form-check { margin: 0; font-size: .875rem; }
.sb-memo-dl .sb-muted { font-size: .8125rem; }

/* ------------------------------------------------- администратор: по руководителям -- */
.sb-memo-sum { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; }
.sb-memo-sum .sb-link-btn { min-height: 0; }
.sb-memo-adm { width: 100%; margin: .75rem 0 0; font-size: .875rem; --bs-table-bg: transparent; }
.sb-memo-adm > tbody > tr > * { padding: .625rem 1rem .625rem 0; vertical-align: middle; border-bottom: 1px solid var(--sb-line); }
.sb-memo-adm > tbody > tr:first-child > * { border-top: 1px solid var(--sb-line); }
.sb-memo-adm > tbody > tr:last-child > * { border-bottom: 0; }
.sb-memo-adm > tbody > tr > *:last-child { padding-right: 0; text-align: right; }
.sb-memo-name { font-weight: 500; color: var(--sb-ink); text-align: left; width: 32%; }
.sb-memo-n .sb-status { font-weight: 400; }
.sb-memo-dlc { white-space: nowrap; }
.sb-memo-dlc .sb-link-btn, .sb-memo-rem .sb-link-btn { min-height: 0; }
.sb-memo-all { margin-left: .75rem; font-size: .8125rem; color: var(--sb-brand-700); }
.sb-memo-rem form { display: inline; }
.sb-memo-rem .sb-muted { font-size: .8125rem; }

/* ------------------------------------------------------------------------ телефон -- */
@media (max-width: 767.98px) {
  /* руководитель: строка таблицы – карточка «галочка | название, авторы, отметка» */
  .sb-memo-table { table-layout: auto; }
  .sb-memo-table, .sb-memo-table > thead, .sb-memo-table > tbody { display: block; width: 100%; }
  .sb-memo-table > thead > tr { display: flex; align-items: center; border-radius: var(--sb-radius-lg) var(--sb-radius-lg) 0 0; background: #017b80; }
  .sb-memo-table > thead th { display: block; width: auto !important; border: 0; background: transparent; }
  .sb-memo-table > thead th.sb-memo-c-who, .sb-memo-table > thead th.sb-memo-c-state { display: none; }
  .sb-memo-table > tbody > tr { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); grid-template-areas: "chk title" "chk who" "chk state"; row-gap: .25rem; padding: .875rem 0; border-bottom: 1px solid var(--sb-line); }
  .sb-memo-table > tbody > tr:last-child { border-bottom: 0; padding-bottom: 0; }
  .sb-memo-table > tbody > tr > td { display: block; padding: 0 !important; border: 0; }
  .sb-memo-table .sb-memo-chk { grid-area: chk; }
  .sb-memo-table .sb-memo-title { grid-area: title; font-size: .9375rem; }
  .sb-memo-table .sb-memo-who { grid-area: who; font-size: .875rem; }
  .sb-memo-table .sb-memo-state { grid-area: state; }
  .sb-memo-table .sb-chk { width: 44px; height: 44px; margin: -.625rem 0 0 -.625rem; }
  .sb-memo-table > thead .sb-chk { margin: 0 0 0 .125rem; }
  .sb-memo-act > .btn, .sb-memo-get .btn { width: 100%; }
  .sb-memo-mode { flex-direction: column; }
  .sb-memo-mode .form-check { min-height: 44px; display: flex; align-items: center; gap: .5rem; padding-left: 0; }
  .sb-memo-mode .form-check-input { float: none; margin: 0; }
  .sb-memo-edit > summary, .sb-memo .sb-link-btn { min-height: 44px; }
  .sb-memo-form .btn { width: 100%; }

  /* администратор: имя и «подтверждено» сверху, действия под ними */
  .sb-memo-adm, .sb-memo-adm > tbody { display: block; }
  .sb-memo-adm > tbody > tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name n" "dl rem"; align-items: center; column-gap: 1rem; padding: .625rem 0; border-bottom: 1px solid var(--sb-line); }
  .sb-memo-adm > tbody > tr:first-child { border-top: 1px solid var(--sb-line); }
  .sb-memo-adm > tbody > tr:last-child { border-bottom: 0; }
  .sb-memo-adm > tbody > tr > * { display: block; padding: 0 !important; border: 0 !important; width: auto; }
  .sb-memo-adm .sb-memo-name { grid-area: name; }
  .sb-memo-adm .sb-memo-n { grid-area: n; text-align: right; }
  .sb-memo-adm .sb-memo-dlc { grid-area: dl; }
  .sb-memo-adm .sb-memo-rem { grid-area: rem; }
  .sb-memo-all { display: inline-flex; align-items: center; min-height: 44px; }
}
