html {
  font-size: 16px;
  position: relative;
  min-height: 100%;
}
body {
  display: flex;
  flex-direction: column;
}
main {
  flex: 1 0 auto;
}
header, footer {
  flex-shrink: 0;
}

hr {
  margin: 0.75rem 0 !important;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.custom-date-input {
  padding: 5px 8px;
  border: 1px solid #3b3b3b;
  border-radius: 6px;
}

/* --- Типография --- */
.page-title-1 {
  font-size: 26px;
  font-size: clamp(1.375rem, 1.2917rem + 0.4167vw, 1.625rem);
  font-weight: 500;
}
.page-title-2 {
  font-size: 22px;
  font-size: clamp(1.25rem, 1.203rem + 0.2151vw, 1.375rem);
  font-weight: 500;
}
.page-title-3 {
  font-size: 18x;
  font-size: clamp(1rem, 0.9583rem + 0.2083vw, 1.125rem);
  font-weight: 500;
}
.page-title-4 {
  font-size: 16x;
  font-size: clamp(0.9375rem, 0.9167rem + 0.1042vw, 1rem);
  font-weight: 500;
}
.activity-item table,
.tariff-grid-values {
  font-size: 15px;
  font-size: clamp(0.8125rem, 0.7708rem + 0.2083vw, 0.9375rem);
}

/* ссылки */
.details-link {
  text-decoration: none;
  font-weight: 500;
}
.link-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.link-icon::after {
  content: "";
  display: inline-block;
  width: 0.675em;
  height: 0.675em;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  vertical-align: middle;
}
.pencil-icon::after {
  mask-image: url('/icons/pencil-fill.svg'); 
}

.box-arrow-up-right::after {
  mask-image: url('/icons/box-arrow-up-right.svg'); 
}

.repeat::after {
  mask-image: url('/icons/repeat.svg'); 
}

/* --- Главная страница --- */
.page-heading,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.page-heading {
  margin: 0.5rem 0 1rem;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}
.metric-card,
.content-panel,
.empty-state {
  border: 1px solid #eeeeee;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.034);
  transition: all 0.3s ease-in-out;
}
.metric-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100px;
  padding: 1.5rem;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}
.metric-card:hover,
.metric-card:focus {
  background-color: #dbedff;
  border-color: #e2edf8;
  color: inherit;
}
.metric-card strong {
  font-size: 2rem;
  line-height: 1;
}
.metric-label {
  color: #5d697a;
  font-weight: 500;
}
.content-panel {
  padding: 1.5rem 1rem;
  border-radius: 12px;
}
.empty-state {
  padding: 1rem;
  border-radius: 8px;
}
.empty-state p {
  margin: 0.35rem 0 0.75rem;
  color: #5d697a;
}

/* --- Хлебная крошка --- */
.breadcrumb {
  margin-bottom: 0.5rem !important;
}

/* --- Шапка сайта --- */
header #container-header {
  justify-content: start;
  align-items: center;
  color: white; 
}
header #container-header a,
#navbar-menu ul li a {
  color: white;
}


.to-event__date {
    font-weight: 600;
    white-space: nowrap;
}
.to-event__separator {
    color: var(--bs-secondary-color);
}
.to-event__name {
    color: var(--bs-secondary-color);
    font-size: .875em;
}

/* ограничение символов в названии компании в шапке */
.company-name-limit {
    display: inline-block;    
    max-width: 17ch; 
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 3ch), transparent 100%);
    mask-image: linear-gradient(to right, black calc(100% - 3ch), transparent 100%);
}

/* --- Навигация --- */
.nav-item .active {
  color: #54a5fc !important;
}
.turorg-logo-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.navbar-nav {
  gap: 0.25rem;
}
#turorg-header-navbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.turorg-user-name {
  display: flex;
  align-items: center;
  font-weight: 500;
}
.turorg-user-name::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* --- Тарифная сетка --- */
.tariff-grid-values {
  max-width: 390px;
  width: 100%;
}
.tariff-grid-card .tariff-grid-values:nth-child(odd) {
    background-color: #ecf5f8;
  }
.tariff-grid-card .tariff-grid-values:nth-child(even) {
    background-color: #d5e0e9;
  }

/* --- Слоты выбора времени начала события --- */
.time-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
    gap: 4px;
    align-items: stretch;
}
.time-grid-cards .card {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
}
.time-grid-cards .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.bg-light-gray {
  background-color: #b8b8b8;
  color: #6a6c6e;
}
.time-info {
  fill: #6a6c6e;
}
.venue-icon,
.person-icon {
  fill: #7b7b7c;
}

.icon-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.venue-person-iсon-block {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
/* Popup overlay */
.time-info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: .2s ease;
}
.time-info-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.time-info-block {
  width: min(700px, 95vw);
  max-height: 85vh;
  overflow: auto;
  padding: 1rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  font-size: 15px;
  font-size: clamp(0.8125rem, 0.7708rem + 0.2083vw, 0.9375rem);
  transform: scale(.98);
  transition: .2s ease;
}
.time-info-overlay.is-open .time-info-block {
    transform: scale(1);
}
body.popup-lock {
  overflow: hidden;
}
.icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
}

/* --- Список --- */
.table-fit {
    width: max-content;
    table-layout: auto;    
}
.table-fit th,
.table-fit td {
    white-space: nowrap;
    padding-inline: 1rem;
}
.action-column {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}
.action-column a,
.action-column .details-link {
    display: inline-block;
}

/* другая дата... */

.btn-link:focus,
.btn-link:active {
    box-shadow: none !important;
    outline: none !important;
}

.btn-link {
    text-decoration: none !important;
}

/* расписание доступности */
.schedule-rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    align-items: start;
}
.schedule-rule-card {
    width: 100%;
}

/* предстоящие события */
.summary-rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
    align-items: start;
    cursor: pointer;    
}
.summary-rule-card {
    width: 100%;
    transition: all .25s ease-in-out;
}
.summary-rule-card:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.068);
}

/* --- Медиа-запросы --- */

@media (max-width: 1199px) {
  .table-fit th,
  .table-fit td {
    white-space: normal;
    padding-inline: 0.5rem;
  }
  .long-text {
    max-width: 200px;
  }
}

@media (max-width: 991px) {
  html {
    font-size: 15px;
  }
  .turorg-logo-wrapper {
    flex-direction: row-reverse;
  }
  #navbar-menu {
  position: absolute;
  left: 0;  
  top: 50px;
  padding: 1.5rem 2.5rem;
  background-color: #373839;
  border-radius: 4px;
  z-index: 1000;
  }
}

@media (max-width: 767px) {
  html {
    font-size: 14px;
  }
  .company-name-limit {
    max-width: 11ch;
  }
  .table-fit {
    width: 100% !important;
    display: block;    
  }
  .table-fit thead {
    display: none;
  }
  .table-fit tbody {
    display: block;
  }
  .table-fit tr {
    display: block;
    margin-bottom: 12px;
    padding: 4px 2px;
    border: 1px solid #ced0d3;
    border-radius: 6px;      
  }
  .table-fit td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    line-height: 1.3;
    padding: 4px;
    white-space: normal;
    border: none;
  }
  .table-fit td::before {
    content: attr(data-label);
    font-weight: 500;
    color: #252525;
    margin-right: 8px;
    flex-shrink: 0;
  }
  .table-fit td:not([data-label])::before {
    content: "";
    margin: 0;
  }
  .long-text {
    max-width: 100%;
  }
  .action-column {
    justify-content: flex-end;
  }
  .action-column a,
  .action-column .details-link {
    display: flex;
  }
  .booking-details-item {
    padding-inline: 8px !important;
  }
}
