@font-face 
{
  font-family: 'Roboto';
  src: url('fonts/roboto-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Roboto';
  src: url('fonts/Roboto-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'Roboto';
  src: url('fonts/roboto-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}


html, body {
  font-family: 'Roboto', sans-serif;
  height: 100%;
  margin: 0;
  padding: 0;
  display: block;
  justify-content: center;  /* Горизонтальное выравнивание */
  align-items: center;      /* Вертикальное выравнивание */
  background: #f0f0f0;      /* Фон страницы */
  overflow: hidden;
}

input,
button,
select,
textarea {
  font-size: 16px; /* важно! */
}

/* Обёртка для анимации */
#Main {
  touch-action: manipulation; /* разрешает только тап и прокрутку */
  /*overflow: hidden;*/
}

/* Анимируемая страница */
.view-page {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  transition: transform 0.3s ease;
}

/* Стартовое положение новой страницы — справа */
.slide-in {
  transform: translateX(100%);
}

/* Анимация входа */
.slide-in-active {
  transform: translateX(0%);
}

/* Класс для скрытия старого содержимого */
.hidden {
  opacity: 0;
  transition: opacity 0.1s ease; /* Плавное скрытие */
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100vw; height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 30px 25px;
  width: 320px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  font-family: sans-serif;
}

.modal-content .logo {
  max-width: 150px;
  margin-bottom: 15px;
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #2e2e2e;
}

.modal-content input {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 10px 14px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.modal-content button {
  width: 100%;
  padding: 12px;
  background-color: #00A768; /* Цвет МегаФона */
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  margin-top: 15px;
  cursor: pointer;
  transition: background 0.3s;
}
.modal-content .error {
  color: red;
  margin-top: 10px;
  font-size: 14px;
}

.modalScan {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.85);
}

.modalScan-content {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.modalICC {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.modalICC-content {
  background-color: white;
  margin: 15% auto;
  padding: 20px;
  border-radius: 10px;
  width: 300px;
  text-align: center;
}

.modalICC-content input {
  width: 90%;
  padding: 10px;
  margin: 15px 0;
  font-size: 16px;
}

.modalICC-content button {
  padding: 10px 20px;
  font-size: 16px;
}

.closeICC {
  float: right;
  font-size: 24px;
  cursor: pointer;
}

#interactive {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.close-button {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 32px;
  color: white;
  cursor: pointer;
  z-index: 1000;
}

.container {
  max-width: 500px;    
  width: 90%; /* фиксированная ширина */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box; /* включает padding внутрь ширины */
  background: white;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-left: auto;
  margin-right: auto;
  margin-top: 25px;
}

.card h2 {
  color: #333;
}

.scan-btn, .phone-btn {
  margin-top: 15px;
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  color: white;
  background-color: #00A768;
  border-radius: 5px;
  font-size: 18px;
  cursor: pointer;
  font-weight: 700;
}

.phone-btn {
  background-color: white;
  color: #00A768;
  border: 2px solid #00A768;
}

input[type="text"] {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  box-sizing: border-box;
}

#scanner-container {
  margin-top: 20px;
  position: relative;
  width: 100%;
  height: 200px;
}

#scanner-frame {
  position: absolute;
  top: 40%;
  left: 50%;
  width: 150px; /* эквивалентно 42 мм при ~5px/mm */
  height: 350px; /* эквивалентно 15 мм */
  transform: translate(-50%, -50%);
  border: 2px solid red;
  box-sizing: border-box;
  z-index: 10;
  pointer-events: none;
  border-radius: 8px;
}

.bottom-nav {
  height: 50px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
}

.nav-item {
  color: #888;
  text-align: center;
  font-size: 13px;
  text-decoration: none;
}

.nav-item i {
  font-size: 22px;
  display: block;
}

.nav-item.active {
  color: #00A768;;
}

.badge {
  position: absolute;
  top: 2px;
 
  min-width: 15px;
  height: 15px;
  padding: 1px 1px;
  background: #ff3b30;       /* красный */
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.profile-header {
      padding: 20px;
      background: white;
      border-bottom: 1px solid #ddd;
      text-align: center;
      font-size: 22px;
      font-weight: bold;
    }

    .profile-card {
      background: white;
      margin: 10px 10px 10px 0px;
      border-radius: 8px;
    }

    .profile-main {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 10px;
    }

    .profile-main i {
      background: #00A768;
      color: white;
      border-radius: 50%;
      width: 20px;
      height: 20px;
      display: flex;
      padding: 10px;
      align-items: center;
      justify-content: center;
      font-size: 20px;
    }

    .profile-info {
      font-size: 16px;
    }

    .profile-info .name {
      font-weight: bold;
    }

    .profile-info .role {
      color: gray;
      font-size: 14px;
    }

    .profile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    padding: 12px 0;
}

.profile-item i {
    width: 20px;          /* фикс ширина для выравнивания */
    text-align: center;   /* иконка строго по центру */
    font-size: 20px;      /* размер иконки */
}


    .profile-actions {
      margin-top: 0px;
    }

    .profile-actions .profile-item {
      cursor: pointer;
    }

    .profile-actions .profile-item:hover {
      background: #f0f0f0;
    }
    
    .filters 
    {
      justify-content: center;
      margin-bottom: 10px;
      padding: 12px 0;
      border-bottom: 1px solid #eee;
    }
    
    .filters button {
      margin: 0 5px;
      padding: 6px 12px;
      border: none;
      background: #eee;
      border-radius: 5px;
      cursor: pointer;
    }
    
    .filters .active {
      background: #00A768;
      color: white;
    }
    
    .date-header {
      margin-top: 15px;
      font-weight: bold;
      color: #555;
    }
    
    .icc-row {
      display: flex;
      justify-content: space-between;
      padding: 8px 2px;
      border-bottom: 1px solid #ddd;
    }
    
    .icc-number {
      font-size: 16px;
    }
    
    .time {
      color: gray;
    }
    
    #iccList 
    {
      height: 100%; /* можно поменять под нужную высоту */
      overflow-y: auto; /* auto — чтобы скролл появлялся, когда нужно */
      -webkit-overflow-scrolling: touch; /* для плавности на iOS */
      scrollbar-width: thin; /* Firefox */
      scrollbar-color: rgba(0, 0, 0, 0.4) transparent; /* Firefox */
    }
    
    #iccList::-webkit-scrollbar {
      width: 6px;
    }
    
    #iccList::-webkit-scrollbar-track {
      background: transparent;
    }
    
    #iccList::-webkit-scrollbar-thumb {
      background-color: rgba(0, 0, 0, 0.4);
      border-radius: 4px;
    }
    
    
    .ChatModal-overlay {
      position: fixed;
      top: 0; left: 0;
      width: 100%; height: 100%;
      background: rgba(0, 0, 0, 0.5);
      display: flex; align-items: center; justify-content: center;
      z-index: 1000;
    }
    
    .ChatModal-content {
      background: white;
      width: 100%;
      height: calc(100% - 60px);
      border-radius: 10px;
      display: flex;
      flex-direction: column;
      padding: 10px;
      font-family: Arial, sans-serif;
    }
    
    .chat-header {
    display: flex;
    align-items: center;          /* ← вертикальное центрирование */
    justify-content: center;      /* ← центруем H2 по горизонтали */
    position: relative;
    padding: 15px;
    }
    .chat-close {
        position: absolute;
        right: 15px; 
        top: 40%;
        transform: translateY(-50%); /* ← центрируем крестик */
        font-size: 35px;
        cursor: pointer;
    }
    .chat-header h2 {
        margin: 0;
    }
    
    .chat-title {
      color: #00A768;
    }
    

    .chat-close:hover {
      color: #333;
    }
    
    .chat-messages {
      flex: 1;
      overflow-y: auto;
      border: 1px solid #ccc;
      padding: 10px 10px 10px 0px;
      border-radius: 6px;
      background: #f9f9f9;
      display: flex;
      flex-direction: column;
      gap: 6px;
      scrollbar-width: thin;
      scrollbar-color: #ccc transparent;
    }
    
    .chat-message {
      width: fit-content;
      max-width: 75%;
      padding: 10px 14px;
      border-radius: 16px;
      font-size: 14px;
      line-height: 1.4;
      word-wrap: break-word;
      animation: fadeIn 0.3s ease;
    }
    
    /* сообщение пользователя — вправо */
    .chat-row .chat-message.you {
      margin-left: auto;
      background-color: #d0f5e1;
      border-bottom-right-radius: 4px;
    }
    
    /* сообщение собеседника — влево */
    .chat-row .chat-message.other {
      margin-right: auto;
      background-color: #eaeaea;
      border-bottom-left-radius: 4px;
    }
    
    .chat-row {
      width: 100%;
      padding: 4px 6px;
      display: flex;
    }
    
    .chat-row.unread {
      background-color: #e6f7e6;
    }
    
    .chat-row.unread.fadeout {
      background-color: transparent;
      transition: background-color 0.6s ease;
    }


    .chat-input {
      display: flex;
      gap: 8px;

    }
    
    .chat-input input {
      flex: 1;
      padding: 10px;
      border-radius: 8px;
      border: 1px solid #ccc;
      font-size: 14px;
      outline: none;
    }
    
    .chat-input button {
      margin-top: 10px;
      height: 40px;    
      padding: 0px 16px;
      background-color: #00A768;
      border: none;
      border-radius: 8px;
      color: white;
      font-weight: bold;
      cursor: pointer;
      transition: background 0.2s;
    }
    
    .chat-input button:hover {
      background-color: #008d5c;
    }
    
    .chat-time {
      font-size: 11px;
      color: #888;
      margin-top: 4px;
      text-align: right;
    }
    
    .chat-date-group {
      text-align: center;
      font-size: 13px;
      font-weight: 500;
      color: #888;
      margin: 10px 0 5px;
    }


    
    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(6px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    
    /* Модальное окно */
    #modalPdfView {
      position: fixed;
      top: 0; 
      left: 0;
      width: 100%; 
      
      /* height: calc(100% - 60px); */
      
      height: 100%;
      display: none;
      background: rgba(0, 0, 0, 0.5);
      display: none; 
      align-items: center; 
      justify-content: center;
      z-index: 9999;
    }
    
    #pdfContent {
        position: relative;
        background: white;
        width: 100%;
        max-width: 420px;
    
        height: calc(100% - 60px);          /* модалка ограничена высотой экрана */
        overflow: hidden;          /* чтобы дочерние элементы не выходили */
    
        border-radius: 10px;
        padding: 10px;
        font-family: Arial, sans-serif;
        /* box-sizing: border-box;*/
    }
    
    /* Контейнер PDF занимает всё доступное пространство */
    #pdfContainer {
        border: 1px solid #ccc;      /* 👉 граница */
        border-radius: 8px;          /* 👉 закруглить углы */
        box-sizing: border-box;      /* чтобы padding не ломал размеры */
    
        background: #fafafa;         /* 👉 светлый фон — по желанию */
        max-height: calc(100% - 170px);  /* ✨ высота с учетом заголовка, табов и кнопок */
        overflow-y: auto;                /* скроллим только PDF */
    }

    
    /* ❗ Кнопка закрытия всегда сверху фиксирована */
    #closePdfBtn {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 10000;
        background: #fff;
        border: none;
        font-size: 22px;
        padding: 5px 10px;
        border-radius: 6px;
        cursor: pointer;
    }

    .pdf-page {
        width: 100%;
        display: flex;
        justify-content: center;
        overflow: hidden;
    }
    
    .pdf-page canvas {
        width: 100% !important;
        height: auto !important;
    }
    
    /* Табы */
    .tabs-scroll { overflow-x: auto; padding-left: 10px; padding-right: 10px; }
    .tabs { display: inline-flex; gap: 8px; }
    .tab-link {
        padding: 10px 14px;
        border-radius: 6px;
        background: #e3e3e3;
        border: none;
        white-space: nowrap;
    }
    .tab-link.active {
        background: #00A768;
        color: #fff;
    }
    
    
    #notifyModal .modal-content {
      max-width: 400px;
      text-align: center;
    }
    
    #notifyBtn {
      width: 100%;
      padding: 12px;
      font-size: 16px;
    }
    
    .notify-text {
      max-height: 50%;        /* можно 250–400 */
      overflow-y: auto;         /* вертикальная прокрутка */
      padding: 10px;
      text-align: left;
      white-space: pre-wrap;    /* сохраняет переносы строк */
      word-break: break-word;
      font-size: 16px;
    }


    #notifyModal h3,
    #notifyModal h2 {
      margin-top: -5px;     /* было ~20–30px */
      margin-bottom: 15px;
    }


