/* Small responsive overrides to patch layout issues quickly. */

.apr-training-apps{
  max-height: 50vh !important;
}

.apr-work-requests__groups{
  max-height: 50vh !important;
}

/* Шапка автошколы V2: редактирование контактов (руководитель / администратор) */
.apr-school-contacts-wrap--editable{
  position:relative;
  padding-top:44px;
  margin-top:0.75rem;
}
.apr-school-contacts__toolbar{
  position:absolute;
  top:0;
  right:0;
  display:flex;
  gap:6px;
  align-items:center;
}
.apr-school-contact-lines{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.apr-contact-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  justify-content:space-between;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--soft-panel);
}
.apr-contact-row__link{
  flex:1 1 auto;
  min-width:0;
  color:var(--text);
  text-decoration:none;
  word-break:break-word;
}
.apr-contact-row__link:hover{
  text-decoration:underline;
}
.apr-contact-row__placeholder{
  flex:1 1 auto;
  min-width:0;
  color:var(--muted);
  font-size:14px;
}
.apr-contact-row__actions{
  display:inline-flex;
  gap:4px;
  flex-shrink:0;
}
.apr-contact-row__btn{
  width:36px;
  height:36px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--chip-bg);
  color:var(--text);
  cursor:pointer;
}
.apr-contact-row__btn:hover{
  background:var(--chip-bg-hover);
}
.apr-contact-row__btn--primary{
  border-color:rgba(124,58,237,.45);
  background:rgba(124,58,237,.18);
}
.apr-contact-row__btn--danger:hover{
  border-color:rgba(239,68,68,.45);
  background:rgba(239,68,68,.12);
}
body.apr-light .apr-contact-row{
  background:rgba(255,255,255,.72);
}

.apr-contact-row__slot{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1 1 auto;
  min-width:0;
}
.apr-contact-row__slot--empty .fa{
  color:var(--muted);
  flex-shrink:0;
}
.apr-contact-row__underscore{
  display:block;
  flex:1 1 auto;
  min-width:0;
  font-family:ui-monospace,Consolas,'Courier New',monospace;
  font-size:13px;
  letter-spacing:0.04em;
  color:var(--muted);
  opacity:.72;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

/* Модальное окно контактов школы */
.apr-modal--school-contacts{
  position:fixed;
  inset:0;
  z-index:2147483646;
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  box-sizing:border-box;
}
.apr-modal--school-contacts.is-open{
  display:flex;
}
.apr-modal--school-contacts .apr-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(2,6,23,.72);
  backdrop-filter:blur(8px);
}
body.apr-light .apr-modal--school-contacts .apr-modal__backdrop{
  background:rgba(15,23,42,.35);
}
.apr-modal--school-contacts .apr-modal__dialog{
  position:relative;
  z-index:1;
  width:100%;
  max-width:440px;
  max-height:min(90vh,640px);
  overflow:auto;
  border-radius:16px;
  border:1px solid var(--border);
  background:var(--card-bg);
  box-shadow:var(--shadow);
  padding:22px 22px 18px;
}
.apr-modal--school-contacts .apr-modal__close{
  position:absolute;
  top:10px;
  right:12px;
  width:40px;
  height:40px;
  border:none;
  border-radius:10px;
  background:transparent;
  color:var(--muted);
  font-size:26px;
  line-height:1;
  cursor:pointer;
}
.apr-modal--school-contacts .apr-modal__close:hover{
  color:var(--text);
  background:var(--chip-bg-hover);
}
.apr-modal--school-contacts .apr-modal__title{
  margin:0 44px 14px 0;
  font-size:1.15rem;
  font-weight:700;
  color:var(--text);
}
.apr-modal--school-contacts .apr-modal__body{
  margin-bottom:18px;
}
.apr-modal--school-contacts .apr-modal__hint{
  color:var(--muted);
  font-size:14px;
  line-height:1.55;
}
.apr-modal--school-contacts .apr-modal__footer{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-end;
}

@media (max-width: 520px) {
  /* Training applications: prevent FIO overlapping stickers */
  .apr-training-app__stickers{
    position: static !important;
    justify-content: flex-end;
    margin: 0 0 10px;
  }
  .apr-training-app__fio{
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

