/* Темы: data-bs-theme на <html> — «dark» и «light». Переключатель в base.html + localStorage app-bs-theme */
[data-bs-theme="dark"] {
  color-scheme: dark;
}
[data-bs-theme="light"] {
  color-scheme: light;
}

/* ── Бренд «Кадрика ПРО» ─────────────────────────────────────────────────── */
.app-brand {
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.app-brand-word {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}
.app-brand-logo {
  height: 2.05rem;
  width: auto;
  flex-shrink: 0;
  display: block;
}
.app-brand-name {
  font-weight: 600;
  transition: opacity 0.15s;
  letter-spacing: -0.04em;
}
.app-brand:hover .app-brand-name {
  opacity: 0.92;
}
.app-brand:hover .app-brand-logo {
  opacity: 0.92;
}
.app-brand-pro {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  padding: 0.28rem 0.45rem;
  border-radius: 0.3rem;
  vertical-align: middle;
  background: var(--kadrika-brand-pro-gradient);
  color: #fff !important;
  box-shadow: var(--kadrika-brand-pro-shadow);
}
[data-bs-theme="light"] .app-brand-pro {
  box-shadow: var(--kadrika-brand-pro-shadow-light);
}
.app-brand.app-brand-active .app-brand-pro {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.45), 0 2px 10px rgba(59, 130, 246, 0.4);
}

.app-brand--large {
  font-size: 1.55rem;
}
.app-brand--large .app-brand-logo {
  height: 2.55rem;
}

/* ── Страница входа ─────────────────────────────────────────────────────── */
.app-login-page {
  background: var(--kadrika-login-bg);
  color: var(--kadrika-login-text);
  margin: 0;
}
.login-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.login-scene__bg {
  position: absolute;
  inset: 0;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.03);
}
.login-scene__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(12, 8, 22, 0.12) 0%, rgba(12, 8, 22, 0.42) 100%),
    radial-gradient(ellipse at 50% 40%, transparent 0%, rgba(8, 6, 18, 0.32) 100%);
  z-index: 1;
}
.login-fireflies {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
}
.login-firefly {
  position: absolute;
  width: 5px;
  height: 5px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: #fef9c3;
  box-shadow: 0 0 6px #fde047, 0 0 14px rgba(251, 191, 36, 0.85), 0 0 22px rgba(253, 224, 71, 0.35);
  animation:
    login-firefly-float var(--ff-dur, 12s) ease-in-out infinite,
    login-firefly-blink var(--ff-blink, 2.5s) ease-in-out infinite;
  will-change: transform, opacity;
}
.login-firefly--warm {
  background: #fff7ed;
  box-shadow: 0 0 6px #fdba74, 0 0 14px rgba(251, 146, 60, 0.8), 0 0 20px rgba(254, 215, 170, 0.35);
}
.login-firefly:nth-child(3n) {
  width: 3px;
  height: 3px;
  margin: -1px 0 0 -1px;
}
.login-firefly:nth-child(5n)::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253, 224, 71, 0.35) 0%, transparent 70%);
}
@keyframes login-firefly-float {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(var(--ff-x1, 8px), var(--ff-y1, -6px)); }
  50% { transform: translate(var(--ff-x2, -10px), var(--ff-y2, 8px)); }
  75% { transform: translate(var(--ff-x3, 6px), var(--ff-y3, 4px)); }
}
@keyframes login-firefly-blink {
  0%, 100% { opacity: 0.12; }
  45% { opacity: 1; }
  55% { opacity: 0.35; }
  70% { opacity: 0.9; }
}
body.app-login-page main.app-login-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  margin: 0 auto;
  width: 100%;
  max-width: none;
  position: relative;
  z-index: 1;
}
/* Искры / звёздочки за курсором и пальцем */
.login-spark-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}
.login-spark {
  position: fixed;
  left: 0;
  top: 0;
  width: 5px;
  height: 5px;
  margin: 0;
  border-radius: 50%;
  background: var(--spark-color, #fff);
  box-shadow: 0 0 5px var(--spark-color), 0 0 10px var(--spark-color);
  animation: login-spark-fall var(--spark-dur, 0.75s) ease-out forwards;
  will-change: transform, opacity;
}
.login-spark--star {
  width: 8px;
  height: 8px;
  border-radius: 0;
  clip-path: polygon(
    50% 0%, 61% 38%, 98% 38%, 68% 59%,
    79% 100%, 50% 74%, 21% 100%, 32% 59%,
    2% 38%, 39% 38%
  );
  box-shadow: 0 0 6px var(--spark-color), 0 0 14px var(--spark-color);
}
@keyframes login-spark-fall {
  0% {
    opacity: 1;
    transform: translate(var(--spark-x), var(--spark-y)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(
      calc(var(--spark-x) + var(--spark-dx)),
      calc(var(--spark-y) + var(--spark-fall))
    ) scale(0.15);
  }
}
/* Магия при успешном входе */
body.login-magic-active .app-login-shell {
  pointer-events: none;
  animation: login-magic-card-out 0.5s ease forwards;
}
@keyframes login-magic-card-out {
  to {
    opacity: 0;
    transform: scale(0.9);
    filter: blur(6px);
  }
}
.login-magic-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at 50% 45%,
    rgba(59, 130, 246, 0.45) 0%,
    rgba(15, 17, 21, 0.94) 52%,
    #0a0c10 100%
  );
  opacity: 0;
  pointer-events: all;
}
.login-magic-overlay.login-magic-overlay--show {
  display: flex !important;
  animation: login-magic-overlay-in 0.45s ease forwards;
}
.login-magic-overlay[hidden]:not(.login-magic-overlay--show) {
  display: none !important;
}
@keyframes login-magic-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.login-magic-ring {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 30px rgba(96, 165, 250, 0.7), 0 0 60px rgba(168, 85, 247, 0.45);
  animation: login-magic-ring 1.3s ease-out forwards;
}
.login-magic-ring--2 {
  animation-delay: 0.15s;
  border-color: rgba(253, 224, 71, 0.5);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.55), 0 0 48px rgba(244, 114, 182, 0.35);
}
@keyframes login-magic-ring {
  0% {
    transform: scale(0.25);
    opacity: 1;
  }
  100% {
    transform: scale(5);
    opacity: 0;
  }
}
.login-magic-core {
  position: relative;
  z-index: 2;
  text-align: center;
  animation: login-magic-core-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}
.login-magic-core .app-home-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 18rem);
  max-width: 78vw;
  margin: 0 auto;
  line-height: 0;
  filter: drop-shadow(0 0 18px rgba(96, 165, 250, 0.55));
}
.login-magic-core .app-home-brand__img {
  display: block;
  width: min(100%, 18rem);
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.login-magic-text {
  margin: 0.85rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #e8eef8;
  text-shadow: 0 0 20px rgba(96, 165, 250, 0.6);
  animation: login-magic-text-pulse 1.2s ease-in-out 0.3s infinite;
}
@keyframes login-magic-core-in {
  from {
    opacity: 0;
    transform: scale(0.75) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
@keyframes login-magic-text-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}
body.app-login-page .app-login-shell {
  width: 288px;
  max-width: 100%;
  flex: 0 0 auto;
  margin: 0;
}
body.app-login-page .app-login-card {
  border-radius: 12px;
  width: 288px;
  max-width: 100%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: transparent !important;
  border: none !important;
  animation: login-card-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
/* Светящийся контур карточки */
body.app-login-page .app-login-card::before {
  content: "";
  position: absolute;
  inset: -45%;
  z-index: -2;
  background: conic-gradient(
    from 0deg,
    #3b82f6,
    #8b5cf6,
    #14b8a6,
    #ec4899,
    #3b82f6
  );
  animation: login-border-spin 8s linear infinite;
}
body.app-login-page .app-login-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 11px;
  background: rgba(14, 12, 24, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 24px rgba(59, 130, 246, 0.08);
}
@keyframes login-border-spin {
  to { transform: rotate(360deg); }
}
@keyframes login-card-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
body.app-login-page .app-login-card .card-body {
  padding: 1.15rem 1.2rem 1rem;
  position: relative;
  z-index: 1;
}
body.app-login-page .app-login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
  animation: login-item-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}
body.app-login-page .app-login-brand .app-home-brand {
  justify-content: center;
  width: 100%;
}
body.app-login-page .app-login-brand .app-home-brand__img {
  display: block;
  width: min(100%, 18rem);
  height: auto;
  max-width: 100%;
  object-fit: contain;
  animation: login-logo-glow 3.5s ease-in-out infinite;
}
@keyframes login-logo-glow {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.45)); }
}
body.app-login-page .app-login-subtitle {
  animation: login-item-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}
body.app-login-page .app-login-field {
  animation: login-item-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
body.app-login-page .app-login-field--user {
  animation-delay: 0.24s;
}
body.app-login-page .app-login-field--pass {
  animation-delay: 0.32s;
}
body.app-login-page .app-login-submit {
  animation: login-item-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow: 0 0 14px rgba(13, 110, 253, 0.28);
}
body.app-login-page .app-login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(13, 110, 253, 0.38);
}
body.app-login-page .app-login-submit:active {
  transform: translateY(0);
}
@keyframes login-item-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
body.app-login-page .app-login-alert {
  animation: login-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes login-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
body.app-login-page .app-login-input {
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  background-color: rgba(15, 17, 21, 0.65);
  border-color: rgba(59, 130, 246, 0.22);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1), 0 0 10px rgba(59, 130, 246, 0.06);
}
body.app-login-page .app-login-input:focus {
  border-color: rgba(59, 130, 246, 0.75);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25), 0 0 20px rgba(59, 130, 246, 0.22);
  transform: translateY(-1px);
  background-color: rgba(15, 17, 21, 0.85);
}
.app-login-password-wrap {
  position: relative;
}
.app-login-input--password {
  padding-right: 2.35rem;
}
.app-login-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--bs-secondary-color);
  opacity: 0.8;
  line-height: 1;
  cursor: pointer;
}
.app-login-password-toggle:hover,
.app-login-password-toggle:focus-visible {
  opacity: 1;
  color: var(--bs-body-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}
.app-login-password-toggle .bi {
  font-size: 1rem;
  width: 1rem;
  height: 1rem;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  body.app-login-page .app-login-card {
    background: rgba(22, 26, 34, 0.96) !important;
    border: 1px solid rgba(59, 130, 246, 0.35) !important;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.15);
  }
  body.app-login-page .app-login-card::before {
    display: none;
  }
  body.app-login-page .app-login-card::after {
    display: none;
  }
  body.app-login-page .app-login-card,
  body.app-login-page .app-login-card::before,
  body.app-login-page .login-firefly,
  body.app-login-page .app-login-brand,
  body.app-login-page .app-login-brand .app-home-brand__img,
  body.app-login-page .app-login-subtitle,
  body.app-login-page .app-login-field,
  body.app-login-page .app-login-submit,
  body.app-login-page .app-login-alert {
    animation: none !important;
  }
  body.app-login-page .app-login-input:focus,
  body.app-login-page .app-login-submit:hover {
    transform: none;
  }
}

/* Активный пункт навигации */
[data-bs-theme="dark"] .app-navbar .app-nav-orbit.app-nav-active {
  color: #fff;
  background-color: #0d6efd;
  border-color: #0d6efd;
}
[data-bs-theme="dark"] .app-navbar .app-nav-orbit.app-nav-active .app-nav-img {
  opacity: 1;
}
[data-bs-theme="light"] .app-navbar .app-nav-orbit.app-nav-active {
  color: #fff;
  background-color: #212529;
  border-color: #212529;
}
[data-bs-theme="light"] .app-navbar .app-nav-orbit.app-nav-active .app-nav-img {
  filter: brightness(0) invert(1);
  opacity: 1;
}
[data-bs-theme="light"] .app-navbar .app-nav-orbit.app-nav-active .app-nav-bi {
  color: #fff;
  opacity: 1;
}
[data-bs-theme="dark"] .app-navbar .app-nav-orbit.app-nav-active:hover,
[data-bs-theme="dark"] .app-navbar .app-nav-orbit.app-nav-active:focus {
  color: #fff;
  background-color: #0b5ed7;
  border-color: #0a58ca;
}
[data-bs-theme="light"] .app-navbar .app-nav-orbit.app-nav-active:hover,
[data-bs-theme="light"] .app-navbar .app-nav-orbit.app-nav-active:focus {
  color: #fff;
  background-color: #000;
  border-color: #000;
}

/* ========== Тёмная тема ========== */
[data-bs-theme="dark"] body {
  background: #0f1115;
  color: #e7e7e7;
}
[data-bs-theme="dark"] main h1,
[data-bs-theme="dark"] main h2,
[data-bs-theme="dark"] main h3,
[data-bs-theme="dark"] main h4,
[data-bs-theme="dark"] main h5,
[data-bs-theme="dark"] main h6,
[data-bs-theme="dark"] main .h1,
[data-bs-theme="dark"] main .h2,
[data-bs-theme="dark"] main .h3,
[data-bs-theme="dark"] main .h4,
[data-bs-theme="dark"] main .h5,
[data-bs-theme="dark"] main .h6 {
  color: #eef2f7;
}
[data-bs-theme="dark"] main .card > h1.text-secondary,
[data-bs-theme="dark"] main .card > h2.text-secondary,
[data-bs-theme="dark"] main .card > h3.text-secondary,
[data-bs-theme="dark"] main .card > h4.text-secondary,
[data-bs-theme="dark"] main .card > h5.text-secondary,
[data-bs-theme="dark"] main .card > h6.text-secondary {
  color: #dce8f5 !important;
}
[data-bs-theme="dark"] .card {
  background: #171a21;
  border-color: #2a3140;
  color: #e8ecf4;
}
[data-bs-theme="dark"] .table {
  color: #e7e7e7;
}
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] textarea.form-control {
  background: #12151c;
  color: #e7e7e7;
  border-color: #2a3140;
}
[data-bs-theme="dark"] .form-control::placeholder {
  color: #7d8a9e;
  opacity: 1;
}
[data-bs-theme="dark"] .form-label {
  color: #dce3ee;
}
[data-bs-theme="dark"] .card .text-secondary {
  color: #c4d2e5 !important;
}
[data-bs-theme="dark"] .month-ref-details-native > summary .text-secondary {
  color: #5c6570 !important;
}
[data-bs-theme="dark"] .card .btn-outline-secondary {
  color: #c9d4e4;
  border-color: #5a6578;
}
[data-bs-theme="dark"] .card .btn-outline-secondary:hover {
  color: #f2f5f9;
  background: #2d3545;
  border-color: #6a7588;
}
[data-bs-theme="dark"] a:not(.btn):not(.navbar-brand):not(.nav-link) {
  color: #8ab4ff;
}
[data-bs-theme="dark"] .app-navbar {
  background: #12151c;
  border-color: #2a3140 !important;
}
[data-bs-theme="dark"] .app-navbar .navbar-brand {
  color: #f8f9fa;
}
[data-bs-theme="dark"] .app-navbar .text-secondary {
  color: #9eb0c8 !important;
}
[data-bs-theme="dark"] .shoot-busy-dates-panel,
[data-bs-theme="dark"] .app-inset-panel {
  background: #12151c !important;
}

/* Подсветка выбранной даты — назначение съёмки */
[data-bs-theme="dark"] #schedule-shoot-calendar-wrap .shoot-cal-pick-cell.shoot-cal-picked {
  box-shadow: inset 0 0 0 3px rgba(255, 214, 102, 0.95), 0 0 12px rgba(255, 220, 120, 0.55) !important;
  position: relative;
  z-index: 1;
}

/* Пустая ячейка графика: долгое нажатие — выходной (фотограф / ассистент) */
.shoot-cal-ph-empty,
.shoot-cal-as-empty {
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  cursor: default;
}

/* Параметры съёмки + сюжет (тёмная) */
[data-bs-theme="dark"] .shoot-schedule-params .shoot-plots-toggle-as-select {
  color: #e7e7e7;
  background-color: #12151c;
  border: 1px solid #2a3140;
}
[data-bs-theme="dark"] .shoot-schedule-params .shoot-plots-toggle-as-select:hover {
  border-color: #3d4658;
}
[data-bs-theme="dark"] .shoot-schedule-params .shoot-plots-toggle-chevron {
  color: #9eb0c8;
}
[data-bs-theme="dark"] .shoot-schedule-params .shoot-plots-panel {
  color: #e7e7e7;
  background-color: #12151c;
  border: 1px solid #2a3140;
  box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.45);
}
[data-bs-theme="dark"] .shoot-schedule-params .shoot-plots-panel .shoot-plots-row {
  border-color: #2a3140 !important;
}
[data-bs-theme="dark"] .shoot-schedule-params .shoot-plots-panel .form-check-label {
  color: #e7e7e7 !important;
}
[data-bs-theme="dark"] .shoot-schedule-params .shoot-plots-panel .form-check-input {
  border-color: #5a6578;
  background-color: #12151c;
}
[data-bs-theme="dark"] .shoot-schedule-params .shoot-plots-panel-footer {
  border-top: 1px solid #2a3140;
  background: #161a22;
}
[data-bs-theme="dark"] .shoot-schedule-params .shoot-param-hover:hover,
[data-bs-theme="dark"] .shoot-schedule-params .shoot-param-hover:focus-within {
  background: #2d3545;
  border-color: #6a7588;
  box-shadow: 0 0 0 1px rgba(106, 117, 136, 0.65);
}
[data-bs-theme="dark"] .shoot-schedule-params .shoot-param-hover:hover .form-control,
[data-bs-theme="dark"] .shoot-schedule-params .shoot-param-hover:hover .form-select,
[data-bs-theme="dark"] .shoot-schedule-params .shoot-param-hover:focus-within .form-control,
[data-bs-theme="dark"] .shoot-schedule-params .shoot-param-hover:focus-within .form-select {
  color: #f2f5f9;
  background: #242b38;
  border-color: #6a7588;
}
[data-bs-theme="dark"] .shoot-schedule-params .shoot-param-hover:hover .form-label,
[data-bs-theme="dark"] .shoot-schedule-params .shoot-param-hover:focus-within .form-label {
  color: #f2f5f9;
}
[data-bs-theme="dark"] .shoot-schedule-params .shoot-param-hover:hover .shoot-plots-toggle-as-select,
[data-bs-theme="dark"] .shoot-schedule-params .shoot-param-hover:focus-within .shoot-plots-toggle-as-select {
  color: #f2f5f9;
  background-color: #242b38;
  border-color: #6a7588;
}
[data-bs-theme="dark"] .shoot-schedule-params .shoot-param-hover:hover .shoot-plots-toggle-chevron,
[data-bs-theme="dark"] .shoot-schedule-params .shoot-param-hover:focus-within .shoot-plots-toggle-chevron {
  color: #c4d2e5;
}

/* --- Тёмная тема: календарь (единая «slate» палитра, без разнотона шапок) --- */
[data-bs-theme="dark"] .calendar-ref-layout {
  --cal-surface: #141820;
  --cal-raised: #1a202c;
  --cal-cell: #1e2530;
  --cal-cell-dim: #232b38;
  --cal-border: #2e3746;
  --cal-text: #dde4ef;
  --cal-text-muted: #97a3b8;
  --cal-weekend: #262f3d;
  --cal-muted-row: #252d38;
  background: var(--cal-surface);
  border-color: var(--cal-border) !important;
  color: var(--cal-text);
}
[data-bs-theme="dark"] .calendar-ref-layout .text-dark {
  color: var(--cal-text) !important;
}
[data-bs-theme="dark"] .calendar-ref-layout h1,
[data-bs-theme="dark"] .calendar-ref-layout h2,
[data-bs-theme="dark"] .calendar-ref-layout h3,
[data-bs-theme="dark"] .calendar-ref-layout h4,
[data-bs-theme="dark"] .calendar-ref-layout h5,
[data-bs-theme="dark"] .calendar-ref-layout h6,
[data-bs-theme="dark"] .calendar-ref-layout .h1,
[data-bs-theme="dark"] .calendar-ref-layout .h2,
[data-bs-theme="dark"] .calendar-ref-layout .h3,
[data-bs-theme="dark"] .calendar-ref-layout .h4,
[data-bs-theme="dark"] .calendar-ref-layout .h5,
[data-bs-theme="dark"] .calendar-ref-layout .h6 {
  color: #f0f4fa;
}
[data-bs-theme="dark"] .calendar-ref-layout .month-ref-accordion.card {
  background: transparent;
  border-color: var(--cal-border) !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .month-ref-accordion .month-ref-toggle {
  background: var(--cal-raised);
  color: var(--cal-text);
}
[data-bs-theme="dark"] .calendar-ref-layout .month-ref-accordion .month-ref-toggle:hover {
  background: var(--cal-cell-dim);
}
[data-bs-theme="dark"] .calendar-ref-layout .month-ref-details-native[open] > summary.month-ref-toggle {
  border-bottom: 1px solid var(--cal-border);
}
[data-bs-theme="dark"] .calendar-ref-layout .month-ref-details-native > summary .text-secondary {
  color: var(--cal-text-muted) !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .legend-scale-ref td {
  border-color: var(--cal-border);
  color: #12161d !important;
}
/* Чипы под шкалой: родитель с .text-dark даёт светлый цвет — на пастели нечитаемо */
[data-bs-theme="dark"] .calendar-ref-layout .legend-chip {
  border-color: var(--cal-border);
  color: #0f1419 !important;
  font-weight: 500;
}
[data-bs-theme="dark"] .calendar-ref-layout .legend-chip.legend-in-design {
  background: #b8a5dc !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .legend-chip.legend-in-print {
  background: #d894ae !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .legend-chip.legend-delivered {
  background: #7ab6d4 !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .legend-chip.legend-paid {
  background: #94a0b2 !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .legend-chip.legend-tentative {
  background: #6c757d !important;
  color: #f0f0f0 !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .shoot-cal .tentative-shoot-cell {
  background: #5a6268 !important;
  color: #f0f0f0 !important;
  box-shadow: inset 0 0 0 2px #adb5bd;
}
[data-bs-theme="dark"] .calendar-ref-layout .shoot-cal .tentative-shoot-cell a,
[data-bs-theme="dark"] .calendar-ref-layout .shoot-cal .tentative-shoot-cell .cell-sub {
  color: #f0f0f0 !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table.table {
  --bs-table-color: var(--cal-text);
  color: var(--cal-text);
}
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table.table > :not(caption) > * > *:not(.event):not(.first_class):not(.second_class):not(.third_class):not(.fourth_class):not(.fifth_class) {
  color: var(--cal-text);
}
/* Вся шапка таблицы — один тон, только выходные чуть темнее */
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table thead th {
  background: var(--cal-raised) !important;
  color: var(--cal-text) !important;
  border-color: var(--cal-border) !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table thead th.table-secondary {
  background: var(--cal-weekend) !important;
  color: var(--cal-text) !important;
  border-color: var(--cal-border) !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table .month-shoot-kind-cell {
  background: var(--cal-raised) !important;
  color: var(--cal-text-muted) !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table tbody .ref-lnr-cell {
  color: var(--cal-text);
  font-weight: 500;
}
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table tbody tr:not([class*="ph-row-"]) .ref-lnr-cell {
  background: var(--cal-cell);
}
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table tbody td.text-secondary {
  color: var(--cal-text-muted) !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table tbody tr:not([class*="ph-row-"]) td.fixed_width:not(.event) {
  background: var(--cal-cell) !important;
  color: var(--cal-text);
}
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table tbody tr:not([class*="ph-row-"]) td.fixed_width.table-active:not(.event) {
  background: var(--cal-weekend) !important;
  border-color: var(--cal-border) !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table tbody tr:first-child td {
  border-top-color: var(--cal-border) !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table .table-muted-cell {
  background: var(--cal-muted-row) !important;
  color: var(--cal-text-muted) !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .shoot-cal .cell-sub {
  color: #2a2a2a;
}
[data-bs-theme="dark"] .calendar-ref-layout .shoot-cal .event a {
  color: #0d4420 !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table.table-bordered {
  --bs-border-color: var(--cal-border);
}
[data-bs-theme="dark"] .calendar-ref-layout .legend-scale-ref.table-bordered {
  --bs-border-color: var(--cal-border);
}
[data-bs-theme="dark"] .calendar-ref-layout .month-ref-accordion .card-body {
  background: var(--cal-surface) !important;
  color: var(--cal-text);
  border-top-color: var(--cal-border) !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .text-muted {
  color: var(--cal-text-muted) !important;
}
/* Две строки шапки и блок ЛНР/фотограф в первых строках тела (тип съёмки + строки фотографов) */
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table thead tr:nth-child(-n + 2) > th {
  background: var(--cal-cell) !important;
  color: var(--cal-text) !important;
  border-color: var(--cal-border) !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table tbody tr:nth-child(-n + 4):not([class*="ph-row-"]) > td:nth-child(-n + 2):not(.event):not(.month-shoot-event-type-cell) {
  background: var(--cal-cell) !important;
  color: var(--cal-text) !important;
}
[data-bs-theme="dark"] .calendar-ref-layout .month-shoot-table {
  --ph-bg: var(--cal-cell);
  --ph-bg-side: var(--cal-cell-dim);
}

/* ========== Светлая тема ========== */
[data-bs-theme="light"] body {
  background: #e9eef5;
  color: #1a1f28;
}
[data-bs-theme="light"] main h1,
[data-bs-theme="light"] main h2,
[data-bs-theme="light"] main h3,
[data-bs-theme="light"] main h4,
[data-bs-theme="light"] main h5,
[data-bs-theme="light"] main h6,
[data-bs-theme="light"] main .h1,
[data-bs-theme="light"] main .h2,
[data-bs-theme="light"] main .h3,
[data-bs-theme="light"] main .h4,
[data-bs-theme="light"] main .h5,
[data-bs-theme="light"] main .h6 {
  color: #12161d;
}
[data-bs-theme="light"] main .card > h1.text-secondary,
[data-bs-theme="light"] main .card > h2.text-secondary,
[data-bs-theme="light"] main .card > h3.text-secondary,
[data-bs-theme="light"] main .card > h4.text-secondary,
[data-bs-theme="light"] main .card > h5.text-secondary,
[data-bs-theme="light"] main .card > h6.text-secondary {
  color: #3d4754 !important;
}
[data-bs-theme="light"] .card {
  background: #ffffff;
  border-color: #d8dee6;
  color: #1a1f28;
}
[data-bs-theme="light"] .table {
  color: #212529;
}
[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select,
[data-bs-theme="light"] textarea.form-control {
  background: #ffffff;
  color: #212529;
  border-color: #b8c4d4;
}
[data-bs-theme="light"] .form-control::placeholder {
  color: #6c757d;
  opacity: 1;
}
[data-bs-theme="light"] .form-label {
  color: #343a40;
}
[data-bs-theme="light"] .card .text-secondary {
  color: #5a6570 !important;
}
[data-bs-theme="light"] .month-ref-details-native > summary .text-secondary {
  color: #5c6570 !important;
}
[data-bs-theme="light"] .card .btn-outline-secondary {
  color: #495057;
  border-color: #adb5bd;
}
[data-bs-theme="light"] .card .btn-outline-secondary:hover {
  color: #212529;
  background: #e9ecef;
  border-color: #868e96;
}
[data-bs-theme="light"] a:not(.btn):not(.navbar-brand):not(.nav-link) {
  color: #0d6efd;
}
[data-bs-theme="light"] .app-navbar {
  background: #ffffff;
  border-color: #dee2e6 !important;
}
[data-bs-theme="light"] .app-navbar .navbar-brand {
  color: #212529;
}
[data-bs-theme="light"] .app-navbar .text-secondary {
  color: #6c757d !important;
}
[data-bs-theme="light"] .shoot-busy-dates-panel,
[data-bs-theme="light"] .app-inset-panel {
  background: #f1f4f8 !important;
}

/* --- Светлая тема: календарь (единая палитра, как у тёмного) --- */
[data-bs-theme="light"] .calendar-ref-layout {
  --cal-l-surface: #eef2f8;
  --cal-l-raised: #e4eaf4;
  --cal-l-cell: #ffffff;
  --cal-l-cell-soft: #f6f8fc;
  /* выходные: темнее будней; границы как у всей таблицы (без отдельной «тёмной» сетки) */
  --cal-l-weekend: #d2e2f4;
  --cal-l-border: #c2ccd8;
  --cal-l-text: #1a2433;
  --cal-l-text-muted: #556274;
  --cal-l-mutedcell: #e4e9f0;
  background: var(--cal-l-surface);
  border-color: var(--cal-l-border) !important;
  color: var(--cal-l-text);
}
[data-bs-theme="light"] .calendar-ref-layout h1,
[data-bs-theme="light"] .calendar-ref-layout h2,
[data-bs-theme="light"] .calendar-ref-layout h3,
[data-bs-theme="light"] .calendar-ref-layout h4,
[data-bs-theme="light"] .calendar-ref-layout h5,
[data-bs-theme="light"] .calendar-ref-layout h6,
[data-bs-theme="light"] .calendar-ref-layout .h1,
[data-bs-theme="light"] .calendar-ref-layout .h2,
[data-bs-theme="light"] .calendar-ref-layout .h3,
[data-bs-theme="light"] .calendar-ref-layout .h4,
[data-bs-theme="light"] .calendar-ref-layout .h5,
[data-bs-theme="light"] .calendar-ref-layout .h6 {
  color: var(--cal-l-text);
}
[data-bs-theme="light"] .calendar-ref-layout .text-dark {
  color: var(--cal-l-text) !important;
}
[data-bs-theme="light"] .calendar-ref-layout .month-ref-accordion.card {
  background: transparent;
  border-color: var(--cal-l-border) !important;
}
[data-bs-theme="light"] .calendar-ref-layout .month-ref-accordion .month-ref-toggle {
  background: var(--cal-l-raised);
  color: var(--cal-l-text);
}
[data-bs-theme="light"] .calendar-ref-layout .month-ref-accordion .month-ref-toggle:hover {
  background: var(--cal-l-cell-soft);
}
[data-bs-theme="light"] .calendar-ref-layout .month-ref-details-native[open] > summary.month-ref-toggle {
  border-bottom-color: var(--cal-l-border);
}
[data-bs-theme="light"] .calendar-ref-layout .month-ref-details-native > summary .text-secondary {
  color: var(--cal-l-text-muted) !important;
}
[data-bs-theme="light"] .calendar-ref-layout .legend-scale-ref td,
[data-bs-theme="light"] .calendar-ref-layout .legend-chip {
  border-color: var(--cal-l-border);
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table.table {
  --bs-table-color: var(--cal-l-text);
  color: var(--cal-l-text);
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table.table > :not(caption) > * > *:not(.event):not(.first_class):not(.second_class):not(.third_class):not(.fourth_class):not(.fifth_class) {
  color: var(--cal-l-text);
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table thead th {
  background: var(--cal-l-raised) !important;
  color: var(--cal-l-text) !important;
  border-color: var(--cal-l-border) !important;
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table thead .ref-lnr-header,
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table thead .ref-lnr-header * {
  color: var(--cal-l-text) !important;
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table thead th.table-secondary {
  background: var(--cal-l-weekend) !important;
  color: var(--cal-l-text) !important;
  border-color: var(--cal-l-border) !important;
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table .month-shoot-kind-cell {
  background: var(--cal-l-raised) !important;
  color: var(--cal-l-text-muted) !important;
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table tbody .ref-lnr-cell {
  color: var(--cal-l-text);
  font-weight: 500;
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table tbody tr:not([class*="ph-row-"]) .ref-lnr-cell {
  background: var(--cal-l-cell-soft);
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table tbody tr:not([class*="ph-row-"]) td.fixed_width:not(.event) {
  background: var(--cal-l-cell) !important;
  color: var(--cal-l-text);
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table tbody tr:not([class*="ph-row-"]) td.fixed_width.table-active:not(.event) {
  background: var(--cal-l-weekend) !important;
  border-color: var(--cal-l-border) !important;
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table tbody tr:first-child td {
  border-top: 2px solid var(--cal-l-border) !important;
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table .table-muted-cell {
  background: var(--cal-l-mutedcell) !important;
  color: var(--cal-l-text-muted) !important;
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table.table-bordered {
  --bs-border-color: var(--cal-l-border);
}
[data-bs-theme="light"] .calendar-ref-layout .legend-scale-ref.table-bordered {
  --bs-border-color: var(--cal-l-border);
}
[data-bs-theme="light"] .calendar-ref-layout .month-ref-accordion .card-body {
  background: var(--cal-l-surface) !important;
  color: var(--cal-l-text);
  border-top-color: var(--cal-l-border) !important;
}
[data-bs-theme="light"] .calendar-ref-layout .text-muted {
  color: var(--cal-l-text-muted) !important;
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table thead tr:nth-child(2) th {
  border-bottom-color: var(--cal-l-border) !important;
}
/* Две строки шапки: один светлый фон по всей ширине */
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table thead tr:nth-child(-n + 2) > th {
  background: var(--cal-l-cell) !important;
  color: var(--cal-l-text) !important;
  border-color: var(--cal-l-border) !important;
}
/* Первые строки тела: тип съёмки + ЛНР/фотограф */
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table tbody tr:nth-child(-n + 4):not([class*="ph-row-"]) > td:nth-child(-n + 2):not(.event):not(.month-shoot-event-type-cell) {
  background: var(--cal-l-cell) !important;
  color: var(--cal-l-text) !important;
}
[data-bs-theme="light"] .calendar-ref-layout .month-shoot-table {
  --ph-bg: var(--cal-l-cell);
  --ph-bg-side: var(--cal-l-cell-soft);
}

[data-bs-theme="light"] #schedule-shoot-calendar-wrap .shoot-cal-pick-cell.shoot-cal-picked {
  box-shadow: inset 0 0 0 3px rgba(245, 158, 11, 0.95), 0 0 10px rgba(245, 180, 60, 0.45) !important;
  position: relative;
  z-index: 1;
}

[data-bs-theme="light"] .shoot-schedule-params .shoot-plots-toggle-as-select {
  color: #212529;
  background-color: #ffffff;
  border: 1px solid #b8c4d4;
}
[data-bs-theme="light"] .shoot-schedule-params .shoot-plots-toggle-as-select:hover {
  border-color: #86b7fe;
}
[data-bs-theme="light"] .shoot-schedule-params .shoot-plots-toggle-chevron {
  color: #6c757d;
}
[data-bs-theme="light"] .shoot-schedule-params .shoot-plots-panel {
  color: #212529;
  background-color: #ffffff;
  border: 1px solid #b8c4d4;
  box-shadow: 0 0.35rem 1rem rgba(33, 37, 41, 0.12);
}
[data-bs-theme="light"] .shoot-schedule-params .shoot-plots-panel .shoot-plots-row {
  border-color: #dee2e6 !important;
}
[data-bs-theme="light"] .shoot-schedule-params .shoot-plots-panel .form-check-label {
  color: #212529 !important;
}
[data-bs-theme="light"] .shoot-schedule-params .shoot-plots-panel .form-check-input {
  border-color: #adb5bd;
  background-color: #ffffff;
}
[data-bs-theme="light"] .shoot-schedule-params .shoot-plots-panel-footer {
  border-top: 1px solid #dee2e6;
  background: #f8f9fa;
}
[data-bs-theme="light"] .shoot-schedule-params .shoot-param-hover:hover,
[data-bs-theme="light"] .shoot-schedule-params .shoot-param-hover:focus-within {
  background: #e9eef5;
  border-color: #86b7fe;
  box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.25);
}
[data-bs-theme="light"] .shoot-schedule-params .shoot-param-hover:hover .form-control,
[data-bs-theme="light"] .shoot-schedule-params .shoot-param-hover:hover .form-select,
[data-bs-theme="light"] .shoot-schedule-params .shoot-param-hover:focus-within .form-control,
[data-bs-theme="light"] .shoot-schedule-params .shoot-param-hover:focus-within .form-select {
  color: #212529;
  background: #ffffff;
  border-color: #86b7fe;
}
[data-bs-theme="light"] .shoot-schedule-params .shoot-param-hover:hover .form-label,
[data-bs-theme="light"] .shoot-schedule-params .shoot-param-hover:focus-within .form-label {
  color: #12161d;
}
[data-bs-theme="light"] .shoot-schedule-params .shoot-param-hover:hover .shoot-plots-toggle-as-select,
[data-bs-theme="light"] .shoot-schedule-params .shoot-param-hover:focus-within .shoot-plots-toggle-as-select {
  color: #212529;
  background-color: #ffffff;
  border-color: #86b7fe;
}
[data-bs-theme="light"] .shoot-schedule-params .shoot-param-hover:hover .shoot-plots-toggle-chevron,
[data-bs-theme="light"] .shoot-schedule-params .shoot-param-hover:focus-within .shoot-plots-toggle-chevron {
  color: #495057;
}

/* Общее: обёртки полей «Параметры съёмки» */
.shoot-schedule-params .shoot-plots-dropdown-wrap {
  position: relative;
}
.shoot-schedule-params .shoot-plots-toggle-as-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.375rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.shoot-schedule-params .shoot-plots-toggle-chevron {
  flex-shrink: 0;
  margin-left: 0.5rem;
  font-size: 0.7rem;
  opacity: 0.85;
}
.shoot-schedule-params .shoot-plots-panel {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 1080;
  flex-direction: column;
  max-height: 22rem;
  overflow: hidden;
  border-radius: 0.375rem;
}
.shoot-schedule-params .shoot-plots-panel.is-open {
  display: flex;
}
.shoot-schedule-params .shoot-plots-panel .shoot-plots-scroll {
  overflow-y: auto;
  max-height: 16rem;
  /* чуть воздуха слева: скругление панели + overflow:hidden иначе обрезают квадрат чекбокса */
  padding-left: 0.35rem;
  padding-right: 0.125rem;
}
.shoot-schedule-params .shoot-plots-panel .shoot-plots-row {
  margin-bottom: 0;
}
.shoot-schedule-params .shoot-plots-panel .form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}
.shoot-schedule-params .shoot-param-hover {
  padding: 0.5rem 0.65rem 0.65rem;
  margin: -0.15rem -0.35rem 0;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Шапка: круглые «орбитальные» кнопки — единый набор SVG 24×24 в слоте 1.25rem */
.app-nav-orbit {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
  font-size: 1.08rem;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols2", "Apple Symbols", "DejaVu Sans", sans-serif;
  letter-spacing: 0;
}

.app-nav-orbit--icon .app-nav-img {
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  max-width: 1.25rem;
  max-height: 1.25rem;
  object-fit: contain;
  object-position: center;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}
.app-nav-img--logout {
  transform: scale(1.12);
}
.app-nav-orbit--icon .app-nav-bi {
  font-size: 1.25rem;
  line-height: 1;
  pointer-events: none;
  flex-shrink: 0;
}
[data-bs-theme="dark"] .app-navbar .app-nav-orbit--icon:not(.app-nav-active) .app-nav-bi {
  opacity: 0.9;
}
[data-bs-theme="dark"] .app-navbar .app-nav-orbit--icon:hover .app-nav-bi,
[data-bs-theme="dark"] .app-navbar .app-nav-orbit--icon:focus .app-nav-bi,
[data-bs-theme="dark"] .app-navbar .app-nav-orbit.app-nav-active .app-nav-bi {
  opacity: 1;
}

/*
 * Тёмная шапка: PNG с прозрачным фоном (белый убран в ассетах).
 * invert(1) даёт светлую иконку без белого квадрата; без brightness(0) invert.
 */
[data-bs-theme="dark"] .app-navbar .app-nav-orbit--icon .app-nav-img {
  filter: invert(1);
  opacity: 0.9;
}
[data-bs-theme="dark"] .app-navbar .app-nav-orbit--icon:hover .app-nav-img,
[data-bs-theme="dark"] .app-navbar .app-nav-orbit--icon:focus .app-nav-img {
  filter: invert(1);
  opacity: 1;
}

/* Тёмная тема: убираем белую заливку Bootstrap на hover у outline-light */
[data-bs-theme="dark"] .app-navbar .app-nav-orbit.btn-outline-light {
  color: #e8ecf2;
  border-color: rgba(255, 255, 255, 0.28);
  background-color: transparent;
}
[data-bs-theme="dark"] .app-navbar .app-nav-orbit.btn-outline-light:hover,
[data-bs-theme="dark"] .app-navbar .app-nav-orbit.btn-outline-light:focus,
[data-bs-theme="dark"] .app-navbar .app-nav-orbit.btn-outline-light:active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: none;
}
[data-bs-theme="dark"] .app-navbar .app-nav-orbit.btn-outline-light:hover .app-nav-img,
[data-bs-theme="dark"] .app-navbar .app-nav-orbit.btn-outline-light:focus .app-nav-img,
[data-bs-theme="dark"] .app-navbar .app-nav-orbit.btn-outline-light:active .app-nav-img {
  filter: invert(1);
  opacity: 1;
}

/* Светлая шапка: чёрные иконки и обводка */
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-light {
  color: #212529;
  border-color: #212529;
}
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-light .app-nav-img {
  filter: brightness(0);
  opacity: 1;
}
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-light .app-nav-bi {
  color: #212529;
  opacity: 1;
}
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-light:hover,
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-light:focus,
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-light:active {
  color: #212529;
  background-color: #f3f4f6;
  border-color: #212529;
}
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-light:hover .app-nav-img,
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-light:focus .app-nav-img,
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-light:active .app-nav-img {
  filter: brightness(0);
  opacity: 1;
}
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-light:hover .app-nav-bi,
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-light:focus .app-nav-bi,
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-light:active .app-nav-bi {
  color: #212529;
  opacity: 1;
}

.app-nav-actions {
  gap: 0.35rem !important;
}

.app-nav-user {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 0 0.15rem;
  margin-left: 0.35rem;
  margin-right: 0.25rem;
}

[data-bs-theme="dark"] .app-navbar .app-nav-orbit.btn-outline-danger {
  border-color: rgba(220, 53, 69, 0.55);
  color: #f1aeb5;
}
[data-bs-theme="dark"] .app-navbar .app-nav-orbit.btn-outline-danger:hover,
[data-bs-theme="dark"] .app-navbar .app-nav-orbit.btn-outline-danger:focus {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

[data-bs-theme="light"] .app-navbar .app-theme-toggle.app-nav-orbit.btn-outline-secondary {
  color: #212529;
  border-color: #212529;
}
[data-bs-theme="light"] .app-navbar .app-theme-toggle.app-nav-orbit.btn-outline-secondary .app-nav-img {
  filter: brightness(0);
  opacity: 1;
}
[data-bs-theme="light"] .app-navbar .app-theme-toggle.app-nav-orbit.btn-outline-secondary:hover,
[data-bs-theme="light"] .app-navbar .app-theme-toggle.app-nav-orbit.btn-outline-secondary:focus {
  color: #212529;
  background-color: #f3f4f6;
  border-color: #212529;
}
[data-bs-theme="light"] .app-navbar .app-theme-toggle.app-nav-orbit.btn-outline-secondary:hover .app-nav-img,
[data-bs-theme="light"] .app-navbar .app-theme-toggle.app-nav-orbit.btn-outline-secondary:focus .app-nav-img {
  filter: brightness(0);
  opacity: 1;
}

[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-danger {
  color: #dc3545;
  border-color: #dc3545;
}
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-danger .app-nav-img--logout {
  filter: brightness(0) saturate(100%) invert(32%) sepia(95%) saturate(4200%) hue-rotate(334deg) brightness(95%) contrast(95%);
  opacity: 1;
}
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-danger:hover,
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-danger:focus {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-danger:hover .app-nav-img--logout,
[data-bs-theme="light"] .app-navbar .app-nav-orbit.btn-outline-danger:focus .app-nav-img--logout {
  filter: brightness(0) invert(1);
  opacity: 1;
}

/* ── Строки событий (лента, дашборд, календарь) ─────────── */
.event-list {
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  overflow: hidden;
}

.event-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--bs-border-color-translucent);
  transition: background 0.12s;
  min-width: 0;
}
.event-row:last-child { border-bottom: none; }
.event-row:hover { background: var(--bs-tertiary-bg); }

a.event-row,
a > .event-row {
  text-decoration: none;
  color: inherit;
  display: flex;
}

.event-row--clickable { cursor: pointer; }

.event-row--accordion {
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
}
.event-row--accordion.open { background: var(--bs-tertiary-bg); }

.event-row__school {
  font-size: 0.875rem;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.event-row__meta {
  font-size: 0.78rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-row__content {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 8px;
}
.event-row__meta--attention {
  max-width: none;
  color: var(--bs-warning-text-emphasis, #997404);
}
.event-row--attention {
  align-items: flex-start;
}
.event-row--attention .event-row__content {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.event-row--attention .event-row__school,
.event-row--attention .event-row__meta {
  width: 100%;
  max-width: 100%;
}
.event-row--attention .event-row__meta {
  flex-shrink: 1;
}
.event-row--attention .event-row__badge {
  align-self: center;
}
.dash-attention-hint {
  line-height: 1.35;
  margin-bottom: 0;
}
.event-row__badge { flex-shrink: 0; }
.event-row__chevron {
  font-size: 0.65rem;
  flex-shrink: 0;
  transition: transform 0.2s;
  color: var(--bs-secondary-color);
}
.event-row--accordion.open .event-row__chevron { transform: rotate(90deg); }

.event-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.event-status-dot-plan              { background: #6c757d; }
.event-status-dot-confirmed         { background: #0d6efd; }
.event-status-dot-done              { background: #198754; }
.event-status-dot-retouch           { background: #0dcaf0; }
.event-status-dot-proof             { background: #20c997; }
.event-status-dot-reshoot           { background: #ffc107; }
.event-status-dot-printing          { background: #6610f2; }
.event-status-dot-awaiting_delivery { background: #fd7e14; }
.event-status-dot-delivered         { background: #198754; }
.event-status-dot-paid              { background: #157347; }
.event-status-dot-refused           { background: #dc3545; }
.event-status-dot-canceled          { background: #dc3545; }
.event-status-dot-next_year         { background: #adb5bd; }
.event-status-dot-samples_left      { background: #20c997; }
.event-status-dot-callback          { background: #ffc107; }
.event-status-dot-proposal-call     { background: #94a3b8; }
.event-status-dot-proposal-shoot    { background: #14b8a6; }
.event-status-dot-proposal-reminder { background: #f59e0b; }
.event-row--proposal:hover { background: rgba(148, 163, 184, 0.08); }

@media (max-width: 575.98px) {
  .event-row--attention {
    gap: 6px;
    padding: 6px 8px;
  }
  .event-row--attention .event-row__school {
    font-size: 0.82rem;
  }
  .event-row--attention .event-row__meta {
    font-size: 0.74rem;
  }
  .event-row--attention .badge {
    font-size: 0.68rem;
    padding: 0.32rem 0.46rem;
  }
}

/* ── Пустое состояние ───────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.25rem;
  border: 1px dashed var(--bs-border-color);
  border-radius: 10px;
  background: var(--bs-tertiary-bg);
}
.empty-state--compact {
  padding: 0.85rem 0.5rem;
  border: none;
  background: transparent;
}
.empty-state__icon {
  font-size: 2rem;
  line-height: 1;
  color: var(--bs-secondary-color);
  opacity: 0.7;
  margin-bottom: 0.6rem;
}
.empty-state__icon .bi {
  width: 1em;
  height: 1em;
}
.empty-state--compact .empty-state__icon {
  font-size: 1.45rem;
  margin-bottom: 0.35rem;
}
.empty-state__title {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--bs-body-color);
}
.empty-state--compact .empty-state__title {
  font-size: 0.875rem;
  font-weight: 500;
}
.empty-state__text {
  margin: 0.35rem 0 0.85rem;
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
  max-width: 22rem;
}
.empty-state--compact .empty-state__text {
  font-size: 0.8rem;
  margin-bottom: 0.45rem;
}
.empty-state__cta {
  margin-top: 0.15rem;
}

.empty-inline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.15rem;
  min-height: 2rem;
}
.empty-inline__icon {
  font-size: 1.05rem;
  line-height: 1;
  color: var(--bs-secondary-color);
  opacity: 0.55;
  flex-shrink: 0;
}
.empty-inline__text {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  color: var(--bs-secondary-color);
}
.empty-inline__link {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--bs-secondary-color);
  text-decoration: none;
  white-space: nowrap;
}
.empty-inline__link:hover {
  color: var(--bs-body-color);
  text-decoration: underline;
}

/* ── Панель фильтров (лента, школы) ─────────────────────── */
.filter-panel { margin-bottom: 0.75rem; }

.filter-label {
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem 0.3rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 50rem;
  background: var(--bs-primary);
  color: #fff;
}

.filter-chip__remove {
  color: #fff;
  text-decoration: none;
  opacity: 0.85;
  line-height: 1;
}
.filter-chip__remove:hover {
  opacity: 1;
  color: #fff;
}

.filter-suggest-list .list-group-item { font-size: 0.85rem; }
.filter-suggest-kind {
  font-size: 0.68rem;
  color: var(--bs-secondary-color);
  margin-right: 0.35rem;
}

.schools-search-wrap {
  position: relative;
  overflow: visible;
}
.schools-filter-panel {
  overflow: visible;
}
.schools-filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  background: var(--bs-body-bg);
  color: inherit;
  text-align: left;
}
.schools-filter-toggle:hover,
.schools-filter-toggle:focus {
  background: var(--bs-tertiary-bg);
  color: inherit;
}
.schools-filter-summary__title {
  font-weight: 600;
  font-size: 0.92rem;
}
.schools-filter-summary__chevron {
  transition: transform 0.2s ease;
}
.schools-filter-toggle:not(.collapsed) .schools-filter-summary__chevron {
  transform: rotate(180deg);
}
@media (min-width: 768px) {
  .schools-filter-body {
    display: block !important;
    height: auto !important;
    visibility: visible !important;
  }
  .schools-filter-select {
    min-width: 160px;
  }
}
@media (max-width: 767.98px) {
  .schools-filter-body {
    margin-top: 0.5rem;
    padding: 0.65rem 0.85rem 0.85rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    background: var(--bs-body-bg);
    overflow: visible;
  }
  .schools-filter-summary__badge {
    font-size: 0.68rem;
    font-weight: 500;
  }
  .schools-filter-select {
    width: 100%;
    min-width: 0;
  }
  .schools-filter-neposedy {
    padding-top: 0.15rem;
  }
  .schools-filter-neposedy .form-check-label {
    font-size: 0.9rem;
  }
}
.schools-search {
  position: relative;
}
.schools-search-open {
  flex-shrink: 0;
}
.schools-suggest-list {
  display: block;
  position: fixed;
  z-index: 1080;
  max-height: min(320px, 50vh);
  overflow-y: auto;
  margin: 0;
  border-radius: 8px;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.28);
}
[data-bs-theme="light"] .schools-suggest-list {
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.12);
}
.schools-suggest-list[hidden] {
  display: none !important;
}
.schools-suggest-list--open {
  display: block;
}
.schools-suggest-item {
  cursor: pointer;
  border-left: 3px solid transparent;
}
.schools-suggest-item:hover,
.schools-suggest-item.active {
  border-left-color: var(--bs-primary);
  background: var(--bs-tertiary-bg);
}
.schools-suggest-item__main {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}
.schools-suggest-item__name {
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.schools-suggest-item__district {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  flex-shrink: 0;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.schools-suggest-item__hint {
  margin-top: 0.15rem;
  line-height: 1.3;
}
.schools-suggest-mark {
  padding: 0;
  background: rgba(255, 220, 0, 0.35);
  color: inherit;
  border-radius: 2px;
}
.schools-suggest-empty {
  cursor: default;
  pointer-events: none;
}
.schools-suggest-list--loading::before {
  content: 'Поиск…';
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}
@media (max-width: 767.98px) {
  .schools-search-wrap {
    z-index: 30;
  }
  .schools-suggest-list {
    max-height: min(240px, 40vh);
  }
}

/* ── Заголовок страницы ─────────────────────────────────── */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

/* ── Календарь: toolbar месяца + фильтры ─────────────────── */
.cal-page-toolbar {
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--bs-border-color);
}

.cal-toolbar-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}

.cal-month-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.cal-month-nav__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.5rem;
  padding: 0.35rem 0.85rem;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  border-radius: 999px;
  white-space: nowrap;
}

.cal-month-nav__btn {
  min-width: 2.15rem;
  padding: 0.3rem 0.5rem;
  font-size: 1.05rem;
  line-height: 1.2;
  border-radius: 8px;
}

[data-bs-theme="dark"] .cal-month-nav__pill {
  color: #e8f0ff;
  background: rgba(13, 110, 253, 0.16);
  border: 1px solid rgba(77, 159, 255, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .cal-month-nav__btn {
  color: #c9d4e4 !important;
  background: #161a22 !important;
  border: 1px solid #2a3140 !important;
}
[data-bs-theme="dark"] .cal-month-nav__btn:hover,
[data-bs-theme="dark"] .cal-month-nav__btn:focus-visible {
  color: #fff !important;
  background: #0d6efd !important;
  border-color: #0d6efd !important;
}

[data-bs-theme="light"] .cal-month-nav__pill {
  color: #1a3a6b;
  background: rgba(13, 110, 253, 0.1);
  border: 1px solid rgba(13, 110, 253, 0.22);
}

[data-bs-theme="light"] .cal-month-nav__btn {
  color: #495057 !important;
  background: #fff !important;
  border: 1px solid #ced4da !important;
}
[data-bs-theme="light"] .cal-month-nav__btn:hover,
[data-bs-theme="light"] .cal-month-nav__btn:focus-visible {
  color: #0d6efd !important;
  background: #f0f6ff !important;
  border-color: #0d6efd !important;
}

.cal-school-filter {
  flex: 1 1 10rem;
  min-width: 0;
  max-width: 20rem;
}
.cal-school-search {
  position: relative;
}
.cal-school-suggest-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 0.15rem;
}
@media (min-width: 768px) {
  .cal-school-filter {
    margin-left: auto;
  }
}

.cal-date-jump {
  position: relative;
  flex: 0 0 auto;
}

/* Телефон: «Другая дата» справа вверху, школа — второй строкой */
@media (max-width: 767.98px) {
  .cal-toolbar-main {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0.55rem;
  }
  .cal-month-nav {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .cal-date-jump {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
  }
  .cal-school-filter {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    width: 100%;
  }
  .cal-date-jump__form {
    right: 0;
    left: auto;
  }
}

.cal-date-jump__summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cal-date-jump__summary::-webkit-details-marker { display: none; }

[data-bs-theme="dark"] .cal-date-jump__summary {
  color: #9eb0c8;
  border: 1px solid #2a3140;
  background: transparent;
}
[data-bs-theme="dark"] .cal-date-jump__summary:hover,
[data-bs-theme="dark"] .cal-date-jump[open] .cal-date-jump__summary {
  color: #dce8f5;
  border-color: rgba(77, 159, 255, 0.45);
  background: rgba(13, 110, 253, 0.08);
}

[data-bs-theme="light"] .cal-date-jump__summary {
  color: #6c757d;
  border: 1px solid #ced4da;
  background: #fff;
}
[data-bs-theme="light"] .cal-date-jump__summary:hover,
[data-bs-theme="light"] .cal-date-jump[open] .cal-date-jump__summary {
  color: #0d6efd;
  border-color: #0d6efd;
  background: #f0f6ff;
}

.cal-date-jump__form {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.45rem 0.55rem;
  min-width: 16rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
[data-bs-theme="dark"] .cal-date-jump__form {
  background: #171a21;
  border: 1px solid #2a3140;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
[data-bs-theme="light"] .cal-date-jump__form {
  background: #fff;
  border: 1px solid #dee2e6;
}

.cal-date-jump__field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.cal-date-jump__field .form-control,
.cal-date-jump__field .form-select {
  width: auto;
  min-width: 5.5rem;
}
.cal-date-jump__field .form-select {
  min-width: 8.5rem;
}

[data-bs-theme="dark"] .app-inset-panel.cal-page-toolbar {
  border-color: #2a3140 !important;
}
[data-bs-theme="light"] .app-inset-panel.cal-page-toolbar {
  border-color: #dee2e6 !important;
}

[data-bs-theme="dark"] .page-header__actions .btn-outline-secondary {
  color: #c9d4e4;
  border-color: #5a6578;
  background: transparent;
}
[data-bs-theme="dark"] .page-header__actions .btn-outline-secondary:hover {
  color: #f2f5f9;
  background: #2d3545;
  border-color: #6a7588;
}

/* ── Навигация: лого по центру + drawer (все экраны) ──────── */
.app-navbar .app-nav-shell {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}
.app-nav-mobile-top {
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: center;
  width: 100%;
  min-height: 3rem;
}
.app-nav-drawer-toggle {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 1.45rem;
  line-height: 1;
  color: inherit;
  background: transparent;
}
.app-nav-drawer-toggle:hover,
.app-nav-drawer-toggle:focus-visible {
  background: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
}
.app-nav-mobile-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}
.app-nav-mobile-brand .app-brand,
.app-nav-mobile-brand .navbar-brand {
  margin: 0;
  justify-content: center;
}
.app-brand--mobile {
  font-size: 1.15rem;
}
.app-brand--mobile .app-brand-logo {
  height: 1.65rem;
}
.app-nav-mobile-spacer {
  width: 2.75rem;
}
.app-nav-top-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  max-width: 2.75rem;
}
.app-nav-top-end .app-nav-user {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  line-height: 1.2;
}
@media (min-width: 768px) {
  .app-nav-mobile-top {
    grid-template-columns: 2.75rem 1fr minmax(2.75rem, 8rem);
  }
  .app-nav-top-end {
    max-width: 8rem;
  }
  .app-nav-top-end .app-nav-user {
    font-size: 0.8rem;
  }
  .app-nav-drawer {
    width: min(20rem, 42vw);
  }
}

.app-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  display: none;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.app-nav-backdrop.is-open {
  display: block;
  opacity: 1;
}

.app-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1045;
  width: min(18.5rem, 88vw);
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0.65rem 1rem;
  transform: translateX(-105%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.28);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
[data-bs-theme="dark"] .app-nav-drawer {
  background: #12151c;
  border-right: 1px solid #2a3140;
  color: #e8ecf4;
  --app-drawer-icon: #c9d4e4;
  --app-drawer-icon-active: #4d9fff;
}
[data-bs-theme="light"] .app-nav-drawer {
  background: #fff;
  border-right: 1px solid #dee2e6;
  color: #1a1f28;
  --app-drawer-icon: #49566a;
  --app-drawer-icon-active: #0d6efd;
}
.app-nav-drawer.is-open {
  transform: translateX(0);
}
body.app-nav-drawer-open {
  overflow: hidden;
}

.app-nav-drawer-user {
  padding: 0.35rem 0.65rem 0.85rem;
  border-bottom: 1px solid var(--bs-border-color);
  margin-bottom: 0.5rem;
}
.app-nav-drawer-user__name {
  font-weight: 600;
  font-size: 0.95rem;
}
.app-nav-drawer-user__role {
  font-size: 0.78rem;
  text-transform: lowercase;
}

.app-nav-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 auto;
}
.app-nav-drawer-footer {
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--bs-border-color);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.app-nav-drawer-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  border: none;
  background: transparent;
}
.app-nav-drawer-link:hover,
.app-nav-drawer-link:focus-visible {
  background: var(--bs-tertiary-bg);
  color: inherit;
}
.app-nav-drawer-link.is-active {
  background: rgba(13, 110, 253, 0.16);
  color: #4d9fff;
}
[data-bs-theme="light"] .app-nav-drawer-link.is-active {
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
}
.app-nav-drawer-link--btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.app-nav-drawer-link .bi {
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  text-align: center;
  font-size: 1.25rem;
  line-height: 1.25rem;
  flex-shrink: 0;
  color: var(--app-drawer-icon, currentColor);
  opacity: 0.92;
}
.app-nav-drawer-icon {
  width: 1.25rem;
  min-width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.92;
}
[data-bs-theme="dark"] .app-nav-drawer-icon {
  filter: invert(1);
}
[data-bs-theme="light"] .app-nav-drawer-icon {
  filter: none;
}
.app-nav-drawer-link.is-active .app-nav-drawer-icon {
  opacity: 1;
}
.app-nav-drawer-link.is-active .bi {
  color: var(--app-drawer-icon-active, #0d6efd);
  opacity: 1;
}

/* ── Инструкции (/instructions) ─────────────────────────── */
.instructions-tabs .nav-link {
  font-size: 0.88rem;
  padding: 0.45rem 0.85rem;
  border-radius: 50rem;
}
.instructions-tabs .nav-link.active,
.instructions-tabs__chip {
  background-color: #0d6efd;
  color: #fff;
}
.instructions-tabs .nav-link.active .bi,
.instructions-tabs__chip .bi {
  color: #fff;
}
.instructions-tabs__chip {
  display: inline-flex;
  align-items: center;
  cursor: default;
  pointer-events: none;
}
[data-bs-theme="light"] .instructions-tabs .nav-link.active,
[data-bs-theme="light"] .instructions-tabs__chip {
  background-color: #0d6efd;
  color: #fff;
}
.instructions-intro {
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 52rem;
}
.instructions-step__figure {
  margin: 0;
  text-align: center;
}
.instructions-step__img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}
.instructions-step__img--phone {
  max-width: 220px;
  margin-inline: auto;
  display: block;
}
@media (min-width: 992px) {
  .instructions-step__img--phone {
    max-width: 200px;
  }
}

.instructions-book,
.instructions-steps {
  max-width: 52rem;
}

/* Единый блок: шаги UI и подразделы книги */
.instructions-book__block {
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
}
[data-bs-theme="dark"] .instructions-book__block {
  background: #1a1f28;
  border-color: #2a3140;
  color: #e8ecf2;
}
[data-bs-theme="light"] .instructions-book__block {
  background: #fff;
  border-color: #dee2e6;
  color: #212529;
}
.instructions-book__block .instructions-book__p,
.instructions-book__block .instructions-book__list,
.instructions-book__block .instructions-book__rule-text {
  color: inherit;
}
.instructions-book__block-title {
  font-weight: 600;
  margin: 0 0 0.55rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--bs-border-color);
}
.instructions-book__block--rule {
  border-color: rgba(13, 110, 253, 0.35);
  background: rgba(13, 110, 253, 0.08);
}
.instructions-book__block--rule .instructions-book__block-title {
  border-bottom-color: rgba(13, 110, 253, 0.25);
}

.instructions-book__hero,
.instructions-chapter,
.instructions-book__toc {
  padding: 1rem 1.1rem;
}
.instructions-book__hero--banner {
  padding: 0;
  overflow: hidden;
  line-height: 0;
}
.instructions-book__hero-banner {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}
.instructions-book__title {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.instructions-book__subtitle {
  font-size: 0.88rem;
}
.instructions-book__toc-list {
  padding-left: 1.15rem;
  font-size: 0.88rem;
  line-height: 1.55;
}
.instructions-book__toc-list a {
  text-decoration: none;
}
.instructions-book__toc-list a:hover {
  text-decoration: underline;
}
.instructions-chapter {
  scroll-margin-top: 4.5rem;
}
.instructions-chapter__title {
  font-weight: 700;
  padding-bottom: 0.65rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--bs-border-color);
}
.instructions-chapter__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.instructions-book__p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--bs-body-color);
  margin: 0 0 0.55rem;
}
.instructions-book__block > .instructions-book__p:last-child,
.instructions-book__list-group:last-child .instructions-book__list:last-child {
  margin-bottom: 0;
}
.instructions-book__block > *:last-child {
  margin-bottom: 0;
}

.instructions-book__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
  margin-bottom: 0.4rem;
}
.instructions-book__label--ok {
  color: #198754;
}
.instructions-book__label--bad {
  color: #dc3545;
}
.instructions-book__label--tip {
  color: #b58100;
}
.instructions-book__label--rule {
  color: #0d6efd;
  margin-bottom: 0.35rem;
}
[data-bs-theme="light"] .instructions-book__label--tip {
  color: #997404;
}

.instructions-book__list-group {
  margin-bottom: 0.55rem;
}
.instructions-book__list-group:last-child {
  margin-bottom: 0;
}
.instructions-book__list {
  font-size: 0.86rem;
  line-height: 1.55;
  margin: 0;
  padding-left: 1.2rem;
}
.instructions-book__list--check,
.instructions-book__list--ok,
.instructions-book__list--bad,
.instructions-book__list--tips,
.instructions-book__list--questions {
  list-style: none;
  padding-left: 0;
}
.instructions-book__list--check li,
.instructions-book__list--ok li,
.instructions-book__list--bad li,
.instructions-book__list--tips li,
.instructions-book__list--questions li,
.instructions-book__list--bullets li {
  position: relative;
  margin-bottom: 0.3rem;
}
.instructions-book__list--check li,
.instructions-book__list--ok li,
.instructions-book__list--bad li,
.instructions-book__list--tips li,
.instructions-book__list--questions li {
  padding-left: 1.35rem;
}
.instructions-book__list--check li::before {
  content: "☐";
  position: absolute;
  left: 0;
  color: var(--bs-secondary-color);
}
.instructions-book__list--ok li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: #198754;
}
.instructions-book__list--bad li::before {
  content: "✕";
  position: absolute;
  left: 0;
  color: #dc3545;
  font-weight: 700;
}
.instructions-book__list--tips li::before {
  content: "💡";
  position: absolute;
  left: 0;
}
.instructions-book__list--questions li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: #0d6efd;
}
.instructions-book__list li:last-child {
  margin-bottom: 0;
}

.instructions-book__rule-text {
  font-size: 0.88rem;
  line-height: 1.55;
}
.instructions-book__photo-note {
  font-size: 0.82rem;
  color: var(--bs-secondary-color);
  font-style: italic;
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px dashed var(--bs-border-color);
  background: var(--bs-body-bg);
}
.instructions-book__photo-figure {
  margin: 0.5rem 0 0;
}
.instructions-book__photo-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 10px;
  text-align: inherit;
}
.instructions-book__photo-btn:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 3px;
}
.instructions-book__photo-btn:hover .instructions-book__photo-img {
  border-color: var(--bs-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.instructions-book__photo-zoom-hint {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.95rem;
  pointer-events: none;
}
.instructions-book__photo-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--bs-border-color);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.instructions-step__photo-btn {
  width: auto;
  max-width: 100%;
}
.instructions-photo-dialog {
  padding: 0;
  border: 0;
  width: min(96vw, 1100px);
  max-width: 96vw;
  max-height: 96vh;
  background: transparent;
  color: var(--bs-body-color);
  overscroll-behavior: contain;
}
body.instructions-photo-scroll-lock {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}
html.instructions-photo-scroll-lock {
  overflow: hidden;
}
.instructions-photo-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}
.instructions-photo-dialog__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 96vh;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}
.instructions-photo-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--bs-border-color);
}
.instructions-photo-dialog__title {
  flex: 1;
  min-width: 0;
}
.instructions-photo-dialog__body {
  padding: 0.5rem;
  overflow: auto;
  text-align: center;
}
.instructions-photo-dialog__img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: calc(96vh - 4rem);
  margin: 0 auto;
  border-radius: 8px;
  background: #fff;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
@media (max-width: 767.98px) {
  .instructions-photo-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
  }
  .instructions-photo-dialog__panel {
    max-height: 100vh;
    border-radius: 0;
    min-height: 100vh;
  }
  .instructions-photo-dialog__img {
    max-height: calc(100vh - 3.5rem);
  }
}
.instructions-book__photo-caption {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--bs-secondary-color);
  text-align: center;
}

.instructions-book__next {
  padding: 1rem 1.1rem;
  max-width: 52rem;
}
.instructions-book__next-title {
  font-weight: 700;
  margin: 0;
}

/* Книга стандартов — защита от копирования и сохранения */
.instructions-protected {
  position: relative;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.instructions-protected img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: auto;
}
@media print {
  .instructions-protected,
  .instructions-photo-dialog {
    display: none !important;
  }
}

/* Карточка школы — педсостав */
.school-staff-accordion .school-staff-toggle,
.school-staff-details > summary.school-staff-toggle {
  cursor: pointer;
  list-style: none;
  background: var(--bs-body-bg);
  color: inherit;
}
.school-staff-details > summary.school-staff-toggle::-webkit-details-marker {
  display: none;
}
.school-staff-accordion .school-staff-toggle:hover,
.school-staff-details > summary.school-staff-toggle:hover {
  background: var(--bs-tertiary-bg);
}
.school-staff-accordion .school-staff-toggle:focus,
.school-staff-details > summary.school-staff-toggle:focus {
  box-shadow: inset 0 0 0 2px rgba(13, 110, 253, 0.45);
  outline: none;
}
.school-staff-details[open] > summary.school-staff-toggle {
  border-bottom: 1px solid rgba(13, 110, 253, 0.35);
}
.school-staff-toggle__chevron {
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}
.school-staff-details[open] .school-staff-toggle__chevron {
  transform: rotate(180deg);
}
.school-staff-details[open] .school-staff-toggle__hint {
  display: none !important;
}
.school-building-photos {
  box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.25);
}
.school-building-photos .school-site-gallery-photo {
  max-height: 280px;
}
.school-staff-card {
  border: 1px solid var(--bs-border-color, rgba(255, 255, 255, 0.12));
  border-radius: 0.5rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}
.school-staff-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: rgba(0, 0, 0, 0.2);
}
.school-staff-photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--bs-secondary-color);
}
.school-staff-body {
  padding: 0.65rem 0.75rem 0.75rem;
}
.school-staff-name {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.25;
}
.school-staff-post {
  margin-top: 0.25rem;
  line-height: 1.3;
}
.school-staff-email {
  display: inline-block;
  margin-top: 0.35rem;
  word-break: break-all;
}
.school-staff-extra {
  margin-top: 0.35rem;
  line-height: 1.3;
  white-space: pre-line;
}
.school-staff-card--key {
  border-color: rgba(13, 110, 253, 0.45);
}
.school-site-news-item + .school-site-news-item {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--bs-border-color, rgba(255, 255, 255, 0.08));
}
.school-site-gallery-card {
  border: 1px solid var(--bs-border-color, rgba(255, 255, 255, 0.12));
  border-radius: 0.5rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}
.school-site-gallery-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: rgba(0, 0, 0, 0.2);
}
.school-site-gallery-caption {
  padding: 0.5rem 0.65rem 0.65rem;
}

.assistant-test__prompt {
  white-space: pre-line;
  line-height: 1.45;
}
.assistant-test__options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.assistant-test__option {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--bs-border-color, rgba(255, 255, 255, 0.12));
  border-radius: 0.5rem;
  cursor: pointer;
  margin: 0;
}
.assistant-test__option:hover {
  background: var(--bs-tertiary-bg);
}
.assistant-test__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.assistant-test-review__option {
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem 0.25rem;
}
.assistant-test-review__option--picked {
  background: rgba(13, 110, 253, 0.08);
  border-radius: 0.35rem;
}
.assistant-test-review__mark {
  width: 1.4rem;
  flex-shrink: 0;
}
.assistant-test__photo-figure {
  margin: 0;
}
.assistant-test__photo-img {
  width: 100%;
  max-width: 28rem;
  height: auto;
  border-radius: 0.5rem;
  border: 1px solid var(--bs-border-color, rgba(255, 255, 255, 0.12));
  display: block;
  background: rgba(0, 0, 0, 0.15);
}
.assistant-test__photo-img--review {
  max-width: 20rem;
}
.assistant-test__photo-comment {
  resize: vertical;
  min-height: 8rem;
}
.assistant-test__photo-comment-review {
  white-space: pre-wrap;
  line-height: 1.45;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color, rgba(255, 255, 255, 0.12));
}

/* ── Предложение школе (CRM переговоров) ── */
.proposal-log-feed {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.proposal-log-day-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 0.5rem;
  background: var(--bs-body-bg);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.proposal-log-day-btn:hover,
.proposal-log-day-btn:focus-visible {
  border-color: rgba(13, 110, 253, 0.45);
  background: rgba(13, 110, 253, 0.06);
  box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.12);
  outline: none;
}
.proposal-log-day-btn__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.proposal-log-day-btn__date {
  font-size: 0.88rem;
  font-weight: 700;
}
.proposal-log-day-btn__count {
  font-size: 0.68rem;
  font-weight: 600;
}
.proposal-log-day-btn__preview {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.proposal-log-day-btn__line {
  font-size: 0.78rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proposal-log-day-btn__more {
  margin-top: 0.15rem;
}
.proposal-log-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: min(70vh, 520px);
  overflow-y: auto;
}
.proposal-log-modal-entry {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color-translucent);
}
.proposal-log-modal-entry__head {
  margin-bottom: 0.35rem;
  font-weight: 600;
}
.proposal-log-modal-entry__text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.92rem;
  line-height: 1.55;
}
.proposal-log-day-btn--fresh {
  animation: proposal-log-fresh 2.5s ease-out;
}
@keyframes proposal-log-fresh {
  from { background: rgba(13, 110, 253, 0.18); }
  to { background: transparent; }
}
.proposal-comments-panel {
  background: var(--bs-body-bg);
}
.proposal-save-bar {
  background: rgba(13, 110, 253, 0.06);
  border-color: rgba(13, 110, 253, 0.35) !important;
}
[data-bs-theme="light"] .proposal-save-bar {
  background: rgba(13, 110, 253, 0.04);
}
.proposal-section-filled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.22);
  color: #4ade80;
  font-size: 0.875rem;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
}
.proposal-section-filled .bi-check2,
.proposal-section-filled .bi-check-lg {
  font-size: 1.05em;
  font-weight: 700;
}
[data-bs-theme="light"] .proposal-section-filled {
  background: rgba(22, 163, 74, 0.16);
  color: #15803d;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.4);
}
.school-proposal-panel .proposal-contact-row {
  background: rgba(255, 255, 255, 0.02);
}
.proposal-msgtpl-copy-menu {
  max-height: 16rem;
  overflow-y: auto;
  min-width: 12rem;
}
.proposal-workflow .card-header {
  border-bottom-color: rgba(13, 110, 253, 0.25);
}
.proposal-workflow #proposal-workflow-outcome .btn-check:checked + .btn {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}
.proposal-booking-bridge {
  border-left: 4px solid var(--bs-success);
}
.proposal-timeline-feed .proposal-log-day-btn__line {
  font-size: 0.82rem;
}

.proposal-date-popover {
  width: 280px;
  max-width: calc(100vw - 16px);
  border: 1px solid var(--bs-border-color);
}
.proposal-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.proposal-cal-dow {
  font-size: 0.68rem;
  text-align: center;
  color: var(--bs-secondary-color);
  padding: 0.15rem 0;
}
.proposal-cal-day {
  position: relative;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--bs-body-color);
  font-size: 0.82rem;
  min-height: 2rem;
  padding: 0.15rem 0 0.35rem;
  cursor: pointer;
}
.proposal-cal-day:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--bs-border-color);
}
.proposal-cal-day--empty {
  pointer-events: none;
}
.proposal-cal-day-bars {
  display: flex;
  gap: 1px;
  justify-content: center;
  margin-top: 0.1rem;
  height: 4px;
}
.proposal-cal-day-bars span {
  flex: 1;
  max-width: 10px;
  border-radius: 2px;
  min-height: 4px;
}
.proposal-cal-legend-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Карточка школы — вкладки */
.school-detail-tabs .nav-link {
  font-weight: 500;
}
.school-detail-tab-action.nav-link {
  color: #6ea8fe;
  background: rgba(13, 110, 253, 0.14);
  border: 1px solid rgba(13, 110, 253, 0.45);
}
.school-detail-tab-action.nav-link .bi {
  color: inherit;
}

.school-staff-photo--empty .bi {
  width: 1.4rem;
  height: 1.4rem;
}
.school-detail-tab-action.nav-link:hover,
.school-detail-tab-action.nav-link:focus-visible {
  color: #9ec5fe;
  background: rgba(13, 110, 253, 0.22);
}
[data-bs-theme="light"] .school-detail-tabs .nav-link:not(.active) {
  color: #495057;
}
[data-bs-theme="light"] .school-detail-tabs .nav-link.active {
  color: #fff;
  background-color: #0d6efd;
}
[data-bs-theme="light"] .school-detail-tabs .nav-link.active .bi {
  color: #fff;
}
[data-bs-theme="light"] .school-detail-tab-action.nav-link {
  color: #0a58ca;
  background: #e7f1ff;
  border-color: #9ec5fe;
}
[data-bs-theme="light"] .school-detail-tab-action.nav-link:hover,
[data-bs-theme="light"] .school-detail-tab-action.nav-link:focus-visible {
  color: #084298;
  background: #cfe2ff;
  border-color: #6ea8fe;
}

/* Карточка школы — mobile */
@media (max-width: 767.98px) {
  .school-detail-header {
    flex-direction: column;
    align-items: stretch !important;
  }
  .school-detail-header__main {
    width: 100%;
  }
  .school-detail-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.35rem;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
  }
  .school-detail-tabs::-webkit-scrollbar {
    display: none;
  }
  .school-detail-tabs .nav-item {
    flex: 1 0 auto;
  }
  .school-detail-tabs .nav-link {
    white-space: nowrap;
    padding: 0.45rem 0.75rem;
    font-size: 0.88rem;
  }
  .school-proposal-panel .proposal-contact-row .proposal-contact-save,
  .school-proposal-panel .proposal-contact-row .proposal-contact-remove {
    width: 100%;
  }
  .school-proposal-panel #proposal-save-contacts,
  .school-proposal-panel #proposal-add-contact,
  .school-proposal-panel #proposal-prefill-director {
    flex: 1 1 auto;
  }
  .proposal-date-popover {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
    top: auto !important;
    width: min(280px, calc(100vw - 1rem));
  }
}

/* ── Шаблоны сообщений ─────────────────────────────────────────────────── */
.msgtpl-page-header {
  max-width: none;
}
.msgtpl-layout-hint {
  max-width: none;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color-translucent);
}
.msgtpl-nav-home {
  padding: 0;
}
.msgtpl-fold--home {
  margin: 0;
}
.msgtpl-fold-siblings--roots {
  border-top: none;
}
.msgtpl-fold-siblings--roots .msgtpl-root-island {
  display: flex;
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--bs-border-color-translucent);
  border-radius: 0;
  background: var(--bs-body-bg);
  text-align: left;
  font: inherit;
  color: inherit;
}
.msgtpl-fold-siblings--roots .msgtpl-root-island:hover {
  background: var(--bs-tertiary-bg);
}
.msgtpl-fold-siblings--roots .msgtpl-root-island:last-child {
  border-bottom: none;
}
.msgtpl-fold-row__fav-icon {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--bs-warning);
  opacity: 0.92;
  margin-right: 0.15rem;
}
.msgtpl-nav-back {
  text-decoration: none;
  color: var(--bs-secondary-color);
}
.msgtpl-nav-back:hover {
  color: var(--bs-primary);
}
.msgtpl-favorites-open {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.msgtpl-fav-open {
  border: 1px solid var(--bs-border-color);
  border-radius: 12px;
  background: var(--bs-body-bg);
  overflow: hidden;
}
.msgtpl-fav-open.is-active {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 1px var(--bs-primary-border-subtle, var(--bs-primary));
}
.msgtpl-page--nav-home .msgtpl-split__preview {
  border: none;
  background: transparent;
  padding: 0.35rem 0.15rem 0.35rem 0;
}
@media (min-width: 992px) {
  .msgtpl-page--nav-home .msgtpl-split {
    grid-template-columns: minmax(220px, 26%) minmax(0, 1fr);
  }
  .msgtpl-page--nav-home .msgtpl-split__nav {
    padding-right: 0.25rem;
  }
}
.msgtpl-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: start;
}
@media (min-width: 992px) {
  .msgtpl-split {
    grid-template-columns: minmax(240px, 36%) minmax(0, 1fr);
    gap: 1rem;
    min-height: calc(100vh - 10rem);
  }
  .msgtpl-split__nav {
    position: sticky;
    top: 0.75rem;
    max-height: calc(100vh - 6rem);
    overflow: auto;
  }
  .msgtpl-split__preview {
    position: sticky;
    top: 0.75rem;
    max-height: calc(100vh - 6rem);
    overflow: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    background: var(--bs-body-bg);
    padding: 0.85rem 1rem;
  }
  .msgtpl-split:not(.msgtpl-split--has-preview) .msgtpl-split__preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 12rem;
  }
}
.msgtpl-split__empty {
  text-align: center;
  color: var(--bs-secondary-color);
  padding: 2rem 1rem;
}
.msgtpl-split__empty-icon {
  display: block;
  font-size: 2rem;
  opacity: 0.35;
  margin-bottom: 0.5rem;
}
.msgtpl-fold-wrap {
  max-width: none;
}
.msgtpl-fold {
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bs-body-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.msgtpl-page--layout-edit .msgtpl-fold {
  border-color: var(--bs-primary-border-subtle, var(--bs-primary));
  box-shadow: 0 0 0 2px var(--bs-primary-bg-subtle);
}
.msgtpl-fold-item {
  border-bottom: 1px solid var(--bs-border-color-translucent);
}
.msgtpl-fold-item:last-child {
  border-bottom: none;
}
.msgtpl-fold-item--was-hidden > .msgtpl-fold-row .msgtpl-fold-row__label {
  color: var(--bs-secondary-color);
}
.msgtpl-fold-item--user-hidden {
  display: none;
}
.msgtpl-page--layout-edit .msgtpl-fold-item--user-hidden {
  display: block;
}
.msgtpl-fold-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--bs-secondary-color);
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color-translucent);
}
.msgtpl-fold-item--dragging {
  opacity: 0.45;
}
.msgtpl-fold-item--drag-over > .msgtpl-fold-row {
  background: var(--bs-primary-bg-subtle);
}
.msgtpl-fold-row__hide {
  flex-shrink: 0;
  display: none;
  line-height: 1;
  color: var(--bs-secondary-color);
  text-decoration: none;
}
.msgtpl-page--layout-edit .msgtpl-fold-row__hide {
  display: inline-flex;
}
.msgtpl-fold-row__hide:hover,
.msgtpl-fold-row__hide:focus {
  color: var(--bs-body-color);
}
.msgtpl-fold-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  padding-left: calc(0.75rem + min(var(--msgtpl-depth, 0), 2) * 0.85rem);
  margin: 0;
  list-style: none;
  cursor: pointer;
  background: var(--bs-body-bg);
  color: inherit;
  font-size: 0.9rem;
  line-height: 1.3;
  user-select: none;
}
.msgtpl-fold-row--depth-0 {
  font-weight: 600;
  font-size: 0.95rem;
}
.msgtpl-fold-row--depth-0 .msgtpl-fold-row__label {
  letter-spacing: 0.01em;
}
.msgtpl-fold-row__root-icon {
  flex-shrink: 0;
  font-size: 1rem;
  opacity: 0.7;
  margin-right: 0.2rem;
}
.msgtpl-fold-row::-webkit-details-marker {
  display: none;
}
.msgtpl-fold-row--folder::before {
  content: "";
  flex-shrink: 0;
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.45;
  transition: transform 0.15s ease;
}
.msgtpl-fold-item--folder[open] > .msgtpl-fold-row--folder::before {
  transform: rotate(45deg);
}
.msgtpl-fold-row--tpl::before {
  display: none;
}
.msgtpl-fold-row__tpl-icon {
  flex-shrink: 0;
  font-size: 0.82rem;
  opacity: 0.55;
  margin-right: 0.15rem;
}
.msgtpl-fold-row--link {
  text-decoration: none;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}
.msgtpl-tpl-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}
.msgtpl-tpl-row .msgtpl-fold-row--link,
.msgtpl-tpl-row > .msgtpl-fold-row--tpl {
  flex: 1;
  min-width: 0;
  border-bottom: none;
}
.msgtpl-tpl-row.is-active .msgtpl-fold-row--link,
.msgtpl-tpl-row.is-active > .msgtpl-fold-row--tpl {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--bs-primary);
}
.msgtpl-tpl-row.is-active .msgtpl-fold-row__tpl-icon {
  opacity: 0.85;
  color: var(--bs-primary);
}
.msgtpl-fav-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--bs-secondary-color);
  opacity: 0.35;
  line-height: 1;
  transition: opacity 0.12s ease, color 0.12s ease;
}
.msgtpl-tpl-row:hover .msgtpl-fav-btn,
.msgtpl-view__head .msgtpl-fav-btn {
  opacity: 0.75;
}
.msgtpl-fav-btn:hover,
.msgtpl-fav-btn:focus {
  opacity: 1;
  color: var(--bs-body-color);
}
.msgtpl-fav-btn--on {
  opacity: 1;
  color: var(--bs-warning);
}
.msgtpl-fav-btn--on:hover,
.msgtpl-fav-btn--on:focus {
  color: var(--bs-warning);
}
.msgtpl-fav-btn .bi {
  font-size: 0.82rem;
  pointer-events: none;
}
.msgtpl-view__head .msgtpl-fav-btn {
  width: 1.65rem;
  opacity: 0.85;
}
.msgtpl-fold-row--link.msgtpl-fold-row--tpl .msgtpl-fold-row__tpl-icon {
  opacity: 0.4;
}
.msgtpl-fold-row--link:hover {
  background: var(--bs-tertiary-bg);
}
.msgtpl-tpl-row.is-active .msgtpl-fold-row--link:hover {
  background: var(--bs-primary-bg-subtle);
}
.msgtpl-fold-row--link.is-active,
.msgtpl-fold-row--tpl.is-active {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--bs-primary);
}
.msgtpl-fold-row--link.is-active .msgtpl-fold-row__tpl-icon,
.msgtpl-fold-row--tpl.is-active .msgtpl-fold-row__tpl-icon {
  opacity: 0.85;
  color: var(--bs-primary);
}
.msgtpl-fold-item[open] > .msgtpl-fold-row {
  background: var(--bs-tertiary-bg);
}
.msgtpl-fold-item[open] > .msgtpl-fold-row.is-active {
  background: var(--bs-primary-bg-subtle);
}
.msgtpl-fold-row__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msgtpl-fold-row--folder .msgtpl-fold-row__label {
  cursor: grab;
  touch-action: none;
}
.msgtpl-fold-row--folder .msgtpl-fold-row__label:active {
  cursor: grabbing;
}
.msgtpl-fold-row__add {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--bs-secondary-color);
  line-height: 1;
  opacity: 0.55;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.msgtpl-fold-row:hover .msgtpl-fold-row__add,
.msgtpl-fold-row__add:focus {
  opacity: 1;
  color: var(--bs-body-color);
  background: var(--bs-tertiary-bg);
}
.msgtpl-fold-row__add .bi {
  font-size: 0.9rem;
  pointer-events: none;
}
.msgtpl-fold-row--tpl {
  font-size: 0.88rem;
  cursor: pointer;
}
.msgtpl-fold-body {
  border-top: 1px solid var(--bs-border-color-translucent);
}
.msgtpl-fold-body .msgtpl-fold-item {
  border-bottom: none;
}
.msgtpl-fold-body > .msgtpl-fold-item:last-child .msgtpl-fold-row,
.msgtpl-fold-body > .msgtpl-fold-row--link:last-child,
.msgtpl-fold-body > .msgtpl-tpl-row:last-child {
  border-bottom: none;
}
.msgtpl-fold-empty {
  padding: 0.55rem 0.75rem;
  padding-left: calc(0.75rem + min(var(--msgtpl-depth, 1), 2) * 0.85rem + 1.1rem);
}
.msgtpl-panel {
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  background: var(--bs-body-bg);
  padding: 0.75rem;
  min-height: 120px;
}
.msgtpl-panel__title {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
  color: var(--bs-secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.msgtpl-cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  padding-left: calc(0.55rem + var(--msgtpl-depth, 0) * 0.85rem);
  border-radius: 8px;
  font-size: 0.88rem;
  color: inherit;
}
.msgtpl-cat-link--depth-0 {
  font-weight: 600;
}
.msgtpl-cat-link__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msgtpl-breadcrumb a {
  color: var(--bs-secondary-color);
  text-decoration: none;
}
.msgtpl-breadcrumb a:hover {
  color: var(--bs-primary);
}
.msgtpl-branch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.msgtpl-cat-link.active {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  font-weight: 600;
}
.msgtpl-template-list {
  overflow-y: auto;
  max-height: min(70vh, 640px);
}
.msgtpl-template-item {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.msgtpl-template-item:hover {
  background: var(--bs-tertiary-bg);
}
.msgtpl-template-item.is-active {
  border-color: var(--bs-primary);
  background: var(--bs-primary-bg-subtle);
}
.msgtpl-link-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
  align-items: center;
}
.msgtpl-view__title {
  font-weight: 600;
}
.msgtpl-view__head--sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -0.15rem -0.25rem 0.65rem;
  padding: 0.15rem 0.25rem 0.65rem;
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color-translucent);
}
.msgtpl-view__head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.msgtpl-view__head-start {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
}
.msgtpl-view__head-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}
.msgtpl-char-count {
  flex-shrink: 0;
  white-space: nowrap;
}
.msgtpl-view__actions {
  flex-shrink: 0;
}
.msgtpl-more-btn.dropdown-toggle::after {
  display: none;
}
.msgtpl-more-btn {
  min-width: 2rem;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  font-size: 1.1rem;
  line-height: 1;
}
.msgtpl-preview-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.55;
  padding: 0.9rem 1rem;
  border-radius: 14px 14px 14px 4px;
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color-translucent);
  max-height: min(55vh, 480px);
  overflow-y: auto;
  margin: 0;
}
@media (min-width: 992px) {
  .msgtpl-split--has-preview .msgtpl-preview-body {
    max-height: none;
    min-height: 8rem;
  }
}
.msgtpl-var {
  color: var(--bs-primary);
  font-weight: 600;
  background: var(--bs-primary-bg-subtle);
  border-radius: 3px;
  padding: 0 0.12em;
}
.msgtpl-preview-body:empty::before {
  content: "Текст шаблона пока не заполнен";
  color: var(--bs-secondary-color);
  font-style: italic;
}
.msgtpl-view-section__label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
  margin-bottom: 0.4rem;
}
.msgtpl-view-section__summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.msgtpl-view-section__summary::-webkit-details-marker {
  display: none;
}
.msgtpl-view-section__summary::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.35rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.5;
  vertical-align: 0.1em;
  transition: transform 0.12s ease;
}
.msgtpl-view-section--photos[open] > .msgtpl-view-section__summary::before {
  transform: rotate(45deg);
}
.msgtpl-photos-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}
.msgtpl-photos-strip .msgtpl-photo-thumb {
  flex: 0 0 72px;
  width: 72px;
}
.msgtpl-preview-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}
.msgtpl-preview-link:last-child {
  border-bottom: none;
}
.msgtpl-photo-thumb {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  aspect-ratio: 1;
}
.msgtpl-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.msgtpl-photos-grid--view {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}
.msgtpl-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--bs-success);
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.msgtpl-toast--err {
  background: var(--bs-danger);
}
#msgtpl-edit-modal .modal-body {
  padding-top: 0.75rem;
}
@media (max-width: 767.98px) {
  .msgtpl-link-row {
    grid-template-columns: 1fr;
  }
  .msgtpl-view__head-top {
    align-items: flex-start;
  }
  .msgtpl-view__head-end {
    width: 100%;
    justify-content: flex-end;
  }
  .msgtpl-layout .col-lg-2,
  .msgtpl-layout .col-lg-3,
  .msgtpl-layout .col-lg-7 {
    width: 100%;
  }
}
.msgtpl-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
}
.msgtpl-photo-card--uploading {
  opacity: 0.85;
  pointer-events: none;
}
.msgtpl-photo-card__pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  aspect-ratio: 1;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  text-align: center;
  padding: 0.35rem;
}
.msgtpl-photo-card__pending small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msgtpl-photo-card--done {
  animation: msgtpl-photo-in 0.25s ease;
}
@keyframes msgtpl-photo-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.msgtpl-photo-card {
  position: relative;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 0.35rem;
  background: var(--bs-tertiary-bg);
  cursor: grab;
}
.msgtpl-photo-card__img {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
}
.msgtpl-photo-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.msgtpl-photo-card .msgtpl-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 0 0.35rem;
  line-height: 1.2;
}
.msgtpl-body {
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
}
.msgtpl-search-results {
  max-height: 220px;
  overflow-y: auto;
}

/* Шаблоны сообщений — светлая тема (контраст и читаемость) */
[data-bs-theme="light"] .msgtpl-preview-body {
  background: #f0f4f8;
  border-color: #c5d0dc;
}
[data-bs-theme="light"] .msgtpl-preview-body:empty::before {
  color: #6c757d;
}
[data-bs-theme="light"] .msgtpl-page--layout-edit .msgtpl-fold {
  border-color: rgba(13, 110, 253, 0.42);
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.14);
}
[data-bs-theme="light"] .msgtpl-layout-hint {
  background: #f1f3f5;
  color: #495057;
  border-color: #dee2e6;
}
[data-bs-theme="light"] .msgtpl-fold-row--folder::before {
  opacity: 0.58;
}
[data-bs-theme="light"] .msgtpl-fold-row__root-icon,
[data-bs-theme="light"] .msgtpl-fold-row__tpl-icon {
  opacity: 0.68;
  color: #495057;
}
[data-bs-theme="light"] .msgtpl-fold-row--link.msgtpl-fold-row--tpl .msgtpl-fold-row__tpl-icon {
  opacity: 0.55;
}
[data-bs-theme="light"] .msgtpl-fold-row__add {
  opacity: 0.78;
  color: #5c6670;
}
[data-bs-theme="light"] .msgtpl-fold-row:hover .msgtpl-fold-row__add,
[data-bs-theme="light"] .msgtpl-fold-row__add:focus {
  color: #212529;
  background: #e9ecef;
}
[data-bs-theme="light"] .msgtpl-fold-row__hide {
  color: #5c6670;
}
[data-bs-theme="light"] .msgtpl-fold-row__hide:hover,
[data-bs-theme="light"] .msgtpl-fold-row__hide:focus {
  color: #212529;
}
[data-bs-theme="light"] .msgtpl-fold-item[open] > .msgtpl-fold-row {
  background: #f1f3f5;
}
[data-bs-theme="light"] .msgtpl-fold-row--link:hover {
  background: #f1f3f5;
}
[data-bs-theme="light"] .msgtpl-fold-row--link.is-active,
[data-bs-theme="light"] .msgtpl-fold-row--tpl.is-active {
  background: rgba(13, 110, 253, 0.1);
  color: #0a58ca;
}
[data-bs-theme="light"] .msgtpl-var {
  color: #0a58ca;
  background: rgba(13, 110, 253, 0.12);
}
[data-bs-theme="light"] .msgtpl-split__preview {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.12);
}
[data-bs-theme="light"] .msgtpl-view__head--sticky {
  background: #fff;
}
[data-bs-theme="light"] .msgtpl-fold-siblings--roots .msgtpl-root-island:hover {
  background: #f1f3f5;
}
[data-bs-theme="light"] .msgtpl-fav-btn--on {
  color: #cc9a06;
}
[data-bs-theme="light"] .msgtpl-fold-item--drag-over > .msgtpl-fold-row {
  background: rgba(13, 110, 253, 0.09);
}
[data-bs-theme="light"] .msgtpl-fold-badge {
  background: #e9ecef;
  color: #495057;
  border-color: #ced4da;
}
[data-bs-theme="light"] .msgtpl-fold-item--was-hidden > .msgtpl-fold-row .msgtpl-fold-row__label {
  color: #6c757d;
}
[data-bs-theme="light"] .msgtpl-more-btn {
  border-color: #adb5bd;
  color: #212529;
}

/* ── Подсказка «?» (ui-help-hint) ───────────────────────────────────────── */
.ui-help-hint {
  display: inline-block;
  position: relative;
  vertical-align: middle;
  line-height: 1;
  flex-shrink: 0;
}
.ui-help-hint--block {
  display: block;
  width: 100%;
}
.ui-help-hint__mark {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  padding: 0;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  color: var(--bs-secondary-color);
  opacity: 0.4;
  border: 1px solid currentColor;
  border-radius: 50%;
  user-select: none;
  background: transparent;
}
.ui-help-hint__mark::-webkit-details-marker,
.ui-help-hint__mark::marker {
  display: none;
  content: '';
}
.ui-help-hint:hover .ui-help-hint__mark,
.ui-help-hint[open] .ui-help-hint__mark {
  opacity: 0.8;
}
.ui-help-hint__panel {
  position: absolute;
  z-index: 1080;
  top: calc(100% + 5px);
  left: 0;
  min-width: 11rem;
  max-width: min(24rem, 92vw);
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  background: var(--bs-body-bg);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.ui-help-hint--block .ui-help-hint__panel {
  position: static;
  max-width: none;
  width: 100%;
  margin-top: 0.35rem;
  box-shadow: none;
}
.ui-help-hint__panel > :last-child {
  margin-bottom: 0;
}
.ui-help-hint__pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--bs-body-color);
  max-height: 14rem;
  overflow: auto;
}
.ui-label-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
