:root {
  --bs-body-font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
html {
  font-size: 16px;
  position: relative;
  min-height: 100%;
}
body {
  display: flex;
  flex-direction: column;
}
.content-width {
  max-width: 1680px;
  margin-inline: auto;
}
hr {
  opacity: 0.15;
}

main {
  flex: 1 0 auto;
}
header, footer {
  flex-shrink: 0;
}
.header-nav {
  font-size: 15px;
  font-weight: 300;
}
.btn {
  font-size: 0.875rem;
}
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: none !important; outline: 0 !important;
}
.my-custom-btn {
  font-size: 14px;
  --bs-btn-padding-y: 4px;
  --bs-btn-padding-x: 12px;
}
.rates-btn {
  font-size: 14px;
  --bs-btn-padding-y: 2px;
  --bs-btn-padding-x: 8px;
}

.list-group-item:nth-child(even) {
  background-color: var(--bs-secondary-bg);
}
.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;
}
.date-filter {
  margin-top: 12px;
}
.top-filter {
  margin-top: 16px;
}

/* --- Типография --- */
.page-title-1 {
  font-size: 24px;
  font-size: clamp(1.375rem, 1.3261rem + 0.2174vw, 1.5rem);
  font-weight: 500;
}
.page-title-2 {
  font-size: 21px;
  font-size: clamp(1.1875rem, 1.1386rem + 0.2174vw, 1.3125rem);
  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;
}
mark {
    background-color: #fafdcf;  
    padding: 0.1em;
    border-radius: 4px;
}
.program-duration {
  font-size: 0.875rem;
  font-size: clamp(0.8125rem, 0.7708rem + 0.2083vw, 0.9375rem);
}

/* Таблицы и списки */
.activity-item table,
.tariff-grid-values {
  font-size: 15px;
  font-size: clamp(0.8125rem, 0.7708rem + 0.2083vw, 0.9375rem);
}
.table {
    font-size: 0.9375rem;
}

.table-sm {
    font-size: 0.875rem;
}
.booking-details-item {
  font-size: 15px;
  padding: 0.5rem 0.75rem;
  background-color: #f6f9fa;
  border: 1px solid var(--bs-border-color);
  max-width: 720px;
}
.booking-customer {
  font-size: 15px;
}
.description-block {
  font-size: 15px;
  line-height: 1.35;
}


/* --- Хлебные крошки --- */
.breadcrumb {
  font-size: 0.9375rem;
  margin-block: 0.5rem !important;
}
.breadcrumb a {
  text-decoration: none;
  color: var(--bs-primary-text-emphasis) !important;
}

/* ссылки */
.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'); 
}
.info-circle,
.house-fill,
.person-fill {
  fill: #25252569;
  transition: fill 0.3s ease-in-out;
}
.person-fill-header {
  fill: var(--bs-body-bg);
}
.check-lg {
  fill: var(--bs-success);
}
.ban {
  fill: var(--bs-danger);
}
.info-circle:hover,
.info-circle:focus {
  fill: #252525b9;
}
.icon-white {
  fill: var(--bs-body-bg);
}

.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: 18px 0;
}
.page-heading__title {
  margin: 0;
}
.page-heading__actions {
  display: flex;
  flex-wrap: wrap;
}
.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;
}

/* Ближайшие события */
@media (max-width: 576px) {
  .responsive-events-table thead {
    display: none;
  }
  .responsive-events-table,
  .responsive-events-table tbody,
  .responsive-events-table tr,
  .responsive-events-table td {
    display: block;
    width: 100%;
  }
  .responsive-events-table tr {
    margin-bottom: 1rem;
    border: 1px solid #b3b3b3;
    border-radius: 8px;
    padding: 6px;
  }
  .responsive-events-table td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .35rem 0;
    border: none;
  }
  .responsive-events-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--bs-secondary);
    flex: 0 0 40%;
  }
  .responsive-events-table td.action-column {
    justify-content: flex-end;
  }
  .responsive-events-table td.action-column::before {
    content: "";
  }
  .content-panel {
    padding: 1rem 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
}

/* --- Шапка сайта --- */
header #container-header {
  justify-content: start;
  align-items: center;
  color: white; 
}
header #container-header a,
#navbar-menu ul li a {
  color: white;
}
.header-logo {
  width: 28px;
  margin-inline: 6px;
}

.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;
    color: var(--bs-warning);
    font-size: 15px;  
    max-width: 12ch;
}

/* --- Навигация --- */
.nav-item .active {
  color: #54a5fc !important;
}
.turorg-logo-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.navbar-nav {
  gap: 0.25rem;
}
#header-navbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.user-name {
  display: flex;
  align-items: center;
  font-weight: 500;
}

/* --- Тарифная сетка --- */
.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 {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
    gap: 4px;
    align-items: stretch;
    max-width: 1140px;
}
.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;
}
.time-info-icon {
  z-index: 1800;
}
.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(600px, 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%;
    position: relative;
}

/* предстоящие события */
.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) {
  .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) {
  .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;
  }
}

@media (max-width: 491px) {
  .page-heading {
    flex-direction: column;
    gap: 0.5rem;
  }
  .empty-state__buttons {
    flex-direction: column;
  }
}

@media (max-width: 391px) {
  .upcoming-events {
    flex-direction: column;
  }
}