/* Сброс отступов и базовые стили */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Poppins', Arial, sans-serif;
    background-color: #f9fafb;
    color: #333;
}


.alert {
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  white-space: pre-line;
}
.alert-success { background-color: #e0f2f1; color: #2e7d32; border-left: 4px solid #009688; }
.alert-error { background-color: #fdecea; color: #c0392b; border-left: 4px solid #e53935; }


/* Панель действий на странице чеков */
.header-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.header-bar .page-title {
  margin: 0;
  flex: 1 1 auto;
}

.button {
  display: inline-block;
  padding: 8px 16px;
  background-color: #627d98;
  color: white;
  border: none;
  border-radius: 6px;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.button:hover {
  background-color: #4b637d;
  color: white;
}

/* Форма загрузки Excel в header-bar */
.header-bar form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.header-bar input[type="file"] {
  font-size: 0.85rem;
  color: #555;
  border: 1px solid #d1d9e6;
  border-radius: 6px;
  padding: 5px 8px;
  background-color: #f0f4f8;
  cursor: pointer;
}

/* Адаптив для header-bar */
@media (max-width: 768px) {
  .header-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-bar .button,
  .header-bar form {
    width: 100%;
  }

  .header-bar input[type="file"] {
    width: 100%;
  }
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Меню слева */
.sidebar {
    flex: 0 0 16.6667%;
    background-color: #f0f4f8;
    color: #34495e;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-right: 1px solid #d1d9e6;
    font-weight: 600;
}

.sidebar a {
    color: #34495e;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 6px;
    transition: background-color 0.3s, color 0.3s;
}

.sidebar a:hover {
    background-color: #627d98;
    color: white;
}

.logout-button {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.logout-button:hover {
    background-color: #e63946;
}

/* Основной контент */
.content {
    flex: 1;
    padding: 30px;
    box-sizing: border-box;
    background-color: white;
    box-shadow: inset 0 0 10px #e0e6f1;
    border-radius: 8px;
    margin: 20px;
    min-width: 0; /* ⬅️ важно для flex */
    overflow-x: auto; /* если внутри таблица — она не выталкивает контейнер */
}

/* Заголовок + баланс */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-title {
    color: #34495e;
    font-weight: 600;
    font-size: 1.8rem;
}

.user-balance {
    font-weight: 600;
    font-size: 1.1rem;
    background-color: #dbe2ef;
    color: #1f2d3d;
    padding: 6px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Таблица платежей */
.company-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  font-family: 'Poppins', Arial, sans-serif;
  font-weight: 400;
}

.company-table th,
.company-table td {
  padding: 6px 8px;
  text-align: left;
  background-color: #f7f9fc;
  border: none;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(50,50,93,.1);
  transition: color 0.3s;
}

.company-table thead th {
  background-color: transparent;
  color: #627d98;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  box-shadow: none;
  padding-bottom: 6px;
}

.clickable-row {
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.3s, color 0.3s;
}

.clickable-row:hover {
  background-color: #627d98;
  color: white;
  box-shadow: 0 4px 12px rgba(98,125,152,0.3);
}

.clickable-row:hover td {
  color: blue;
}

/* Пагинация */
.pagination {
  margin-top: 20px;
  text-align: center;
}

.pagination ul {
  list-style: none;
  padding: 0;
  display: inline-flex;
  gap: 8px;
}

.pagination li {
  padding: 6px 12px;
  border-radius: 4px;
  background-color: #f0f4f8;
  font-weight: 500;
  color: #34495e;
}

.pagination li a {
  text-decoration: none;
  color: inherit;
}

.pagination li:hover {
  background-color: #627d98;
  color: white;
}

.pagination .disabled {
  opacity: 0.5;
  pointer-events: none;
}

.pagination .current-page {
  font-weight: bold;
  background-color: #dbe2ef;
}

/* Главная страница инструкции */
.instruction-list {
    max-width: 700px;
    line-height: 1.6;
    font-size: 1.1rem;
    color: #34495e;
    padding-left: 20px;
}

.instruction-list li {
    margin-bottom: 12px;
}

.instruction-list strong {
    color: #2c3e50;
}

.instruction-list em {
    font-style: italic;
    color: #5a6b7c;
}

.user-financial-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.user-balance {
  font-weight: 600;
  font-size: 1.1rem;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  background-color: #dbe2ef;
  transition: color 0.3s;
}

.user-balance.positive {
  color: #2e7d32; /* зелёный */
}

.user-balance.negative {
  color: #c0392b; /* красный */
}

.user-tariff {
  font-size: 0.95rem;
  color: #4a4a4a;
  font-weight: 500;
}

/* Создание чека */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.form-group textarea,
.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.btn-primary {
    background-color: #627d98;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #4b637d;
}

/* Страница просмотр чека */
.receipt-info p {
  margin-bottom: 8px;
  font-size: 16px;
}

.company-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.company-table th, .company-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
}

.company-table th {
  background-color: #f0f0f0;
}

.page-title {
  margin-bottom: 1rem;
  font-size: 24px;
}

/* подсветка статуса */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 600;
  border: 2px solid #2196F3; /* синий по умолчанию */
  color: #2196F3;
  background-color: #e3f2fd;
  transition: 0.2s ease-in-out;
}

.status-badge.done {
  border-color: #009688;
  color: #009688;
  background-color: #e0f2f1;
}

/* подсветка ошибок */
input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: #dc3545; /* красная рамка */
}

.text-danger {
  color: #dc3545;
  font-size: 0.875em;
}
/* Адаптив */
@media (max-width: 768px) {
    .container, .d-flex {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex: none;
        border-right: none;
        border-bottom: 1px solid #d1d9e6;
        padding: 10px 15px;
    }

    .content {
        margin: 0;
        padding: 15px;
        border-radius: 0;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .user-financial-info {
        align-items: flex-start;
    }
    .sidebar.collapse:not(.show) {
        display: none !important;
    }

    #items-table thead {
    display: none;
  }

  #items-table tbody tr {
    display: flex;
    flex-direction: column;
    border: 1px solid #ccc;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 6px;
    background-color: #f9f9f9;
  }

  #items-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
  }

  #items-table td:before {
    content: attr(data-label);
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 10px;
    color: #555;
  }

  .remove-row {
    align-self: flex-end;
    margin-top: 10px;
  }

  .btn,
  .btn-primary,
  .btn-danger {
    padding: 12px 16px;
    font-size: 1rem;
    width: 100%;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 1rem;
    padding: 12px;
  }

  .page-title {
    font-size: 1.5rem;
  }
  
}

/* Адаптивность таблицы на мобилке */
@media (max-width: 768px) {
  #items-table thead {
    display: none;
  }

  #items-table tbody tr {
    display: flex;
    flex-direction: column;
    border: 1px solid #ccc;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 6px;
    background-color: #f9f9f9;
  }

  #items-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
  }

  #items-table td:before {
    content: attr(data-label);
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 10px;
  }

  #items-table .remove-row {
    align-self: flex-end;
    margin-top: 10px;
  }

  .btn,
  .btn-primary,
  .btn-danger {
    padding: 12px 16px;
    font-size: 1rem;
    width: 100%;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 1rem;
    padding: 12px;
  }

  .page-title {
    font-size: 1.5rem;
  }
}

/*ширина товар*/
.wider-input {
  width: 400px !important;
  max-width: 100%;
}

/* жирный шрифт для не просмотренного чека*/
.bold-unviewed td {
  font-weight: bold;
  background-color: #fffde7; /* светло-жёлтый фон */
}

/*для изображения справа*/
.receipt-info-flex {
  display: inline-flex; /* inline-flex чтобы контейнер обтекал содержимое */
  align-items: flex-start;
  gap: 20px; /* небольшой отступ между текстом и QR */
  flex-wrap: nowrap; /* запретить перенос */
  max-width: 100%; /* чтобы не вылезал за контейнер */
}

.receipt-info-text {
  flex: none; /* не растягиваться */
}

.receipt-info-qr {
  flex: none; /* фиксированная ширина */
  max-width: 320px;
}

.qr-code-image {
  max-width: 320px;
  height: auto;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: block;
}

/* Сброс отступов и базовые стили */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Poppins', Arial, sans-serif;
    background-color: #f9fafb;
    color: #333;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Меню слева */
.sidebar {
    flex: 0 0 16.6667%;
    background-color: #f0f4f8;
    color: #34495e;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-right: 1px solid #d1d9e6;
    font-weight: 600;
}

.sidebar a {
    color: #34495e;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 6px;
    transition: background-color 0.3s, color 0.3s;
}

.sidebar a:hover {
    background-color: #627d98;
    color: white;
}

.logout-button {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.logout-button:hover {
    background-color: #e63946;
}

/* Основной контент */
.content {
    flex: 1;
    padding: 30px;
    box-sizing: border-box;
    background-color: white;
    box-shadow: inset 0 0 10px #e0e6f1;
    border-radius: 8px;
    margin: 20px;
    min-width: 0; /* ⬅️ важно для flex */
    overflow-x: auto; /* если внутри таблица — она не выталкивает контейнер */
}

/* Заголовок + баланс */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-title {
    color: #34495e;
    font-weight: 600;
    font-size: 1.8rem;
}

.user-balance {
    font-weight: 600;
    font-size: 1.1rem;
    background-color: #dbe2ef;
    color: #1f2d3d;
    padding: 6px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Таблица платежей */
.company-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  font-family: 'Poppins', Arial, sans-serif;
  font-weight: 400;
}

.company-table th,
.company-table td {
  padding: 6px 8px;
  text-align: left;
  background-color: #f7f9fc;
  border: none;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(50,50,93,.1);
  transition: color 0.3s;
}

.company-table thead th {
  background-color: transparent;
  color: #627d98;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  box-shadow: none;
  padding-bottom: 6px;
}

.clickable-row {
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.3s, color 0.3s;
}

.clickable-row:hover {
  background-color: #627d98;
  color: white;
  box-shadow: 0 4px 12px rgba(98,125,152,0.3);
}

.clickable-row:hover td {
  color: blue;
}

/* Пагинация */
.pagination {
  margin-top: 20px;
  text-align: center;
}

.pagination ul {
  list-style: none;
  padding: 0;
  display: inline-flex;
  gap: 8px;
}

.pagination li {
  padding: 6px 12px;
  border-radius: 4px;
  background-color: #f0f4f8;
  font-weight: 500;
  color: #34495e;
}

.pagination li a {
  text-decoration: none;
  color: inherit;
}

.pagination li:hover {
  background-color: #627d98;
  color: white;
}

.pagination .disabled {
  opacity: 0.5;
  pointer-events: none;
}

.pagination .current-page {
  font-weight: bold;
  background-color: #dbe2ef;
}

/* Главная страница инструкции */
.instruction-list {
    max-width: 700px;
    line-height: 1.6;
    font-size: 1.1rem;
    color: #34495e;
    padding-left: 20px;
}

.instruction-list li {
    margin-bottom: 12px;
}

.instruction-list strong {
    color: #2c3e50;
}

.instruction-list em {
    font-style: italic;
    color: #5a6b7c;
}

.user-financial-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.user-balance {
  font-weight: 600;
  font-size: 1.1rem;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  background-color: #dbe2ef;
  transition: color 0.3s;
}

.user-balance.positive {
  color: #2e7d32; /* зелёный */
}

.user-balance.negative {
  color: #c0392b; /* красный */
}

.user-tariff {
  font-size: 0.95rem;
  color: #4a4a4a;
  font-weight: 500;
}

/* Создание чека */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.form-group textarea,
.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.btn-primary {
    background-color: #627d98;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #4b637d;
}

/* Страница просмотр чека */
.receipt-info p {
  margin-bottom: 8px;
  font-size: 16px;
}

.company-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.company-table th, .company-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
}

.company-table th {
  background-color: #f0f0f0;
}

.page-title {
  margin-bottom: 1rem;
  font-size: 24px;
}

/* подсветка статуса */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 600;
  border: 2px solid #2196F3; /* синий по умолчанию */
  color: #2196F3;
  background-color: #e3f2fd;
  transition: 0.2s ease-in-out;
}

.status-badge.done {
  border-color: #009688;
  color: #009688;
  background-color: #e0f2f1;
}

/* подсветка ошибок */
input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: #dc3545; /* красная рамка */
}

.text-danger {
  color: #dc3545;
  font-size: 0.875em;
}
/* Адаптив */
@media (max-width: 768px) {
    .container, .d-flex {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex: none;
        border-right: none;
        border-bottom: 1px solid #d1d9e6;
        padding: 10px 15px;
    }

    .content {
        margin: 0;
        padding: 15px;
        border-radius: 0;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .user-financial-info {
        align-items: flex-start;
    }
    .sidebar.collapse:not(.show) {
        display: none !important;
    }

    #items-table thead {
    display: none;
  }

  #items-table tbody tr {
    display: flex;
    flex-direction: column;
    border: 1px solid #ccc;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 6px;
    background-color: #f9f9f9;
  }

  #items-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
  }

  #items-table td:before {
    content: attr(data-label);
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 10px;
    color: #555;
  }

  .remove-row {
    align-self: flex-end;
    margin-top: 10px;
  }

  .btn,
  .btn-primary,
  .btn-danger {
    padding: 12px 16px;
    font-size: 1rem;
    width: 100%;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 1rem;
    padding: 12px;
  }

  .page-title {
    font-size: 1.5rem;
  }
  
}

/* Адаптивность таблицы на мобилке */
@media (max-width: 768px) {
  #items-table thead {
    display: none;
  }

  #items-table tbody tr {
    display: flex;
    flex-direction: column;
    border: 1px solid #ccc;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 6px;
    background-color: #f9f9f9;
  }

  #items-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
  }

  #items-table td:before {
    content: attr(data-label);
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 10px;
  }

  #items-table .remove-row {
    align-self: flex-end;
    margin-top: 10px;
  }

  .btn,
  .btn-primary,
  .btn-danger {
    padding: 12px 16px;
    font-size: 1rem;
    width: 100%;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 1rem;
    padding: 12px;
  }

  .page-title {
    font-size: 1.5rem;
  }
}

/*ширина товар*/
.wider-input {
  width: 400px !important;
  max-width: 100%;
}

/* жирный шрифт для не просмотренного чека*/
.bold-unviewed td {
  font-weight: bold;
  background-color: #fffde7; /* светло-жёлтый фон */
}

/*для изображения справа*/
.receipt-info-flex {
  display: inline-flex; /* inline-flex чтобы контейнер обтекал содержимое */
  align-items: flex-start;
  gap: 20px; /* небольшой отступ между текстом и QR */
  flex-wrap: nowrap; /* запретить перенос */
  max-width: 100%; /* чтобы не вылезал за контейнер */
}

.receipt-info-text {
  flex: none; /* не растягиваться */
}

.receipt-info-qr {
  flex: none; /* фиксированная ширина */
  max-width: 320px;
}

.qr-code-image {
  max-width: 320px;
  height: auto;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: block;
}

/*под мобилу*/
@media (max-width: 576px) {
  .search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form input[type="text"],
  .search-form button {
    width: 100%;
  }
}

/*group_balances*/
.group-name {
    font-size: 0.9em;
    color: #666;
}

.toggle-individual-balances {
    font-size: 0.85em;
    color: #007bff;
    cursor: pointer;
    margin-top: 5px;
}

.group-balances {
    margin-top: 8px;
    padding-left: 10px;
}

.group-balances .group-member {
    font-size: 0.85em;
    color: #444;
}

.hidden {
    display: none;
}

.user-balance.positive {
  color: green;
}

.user-balance.negative {
  color: red;
}

.group-member {
  margin-left: 20px;
  font-size: 0.9em;
}

/* стили для информации об телеграмм уведомлениях  */
.page-title {
    font-size: 24px;
    margin-bottom: 16px;
    color: #333;
}

.instruction-list {
    padding-left: 20px;
    list-style: decimal;
    margin-bottom: 40px;
}

.instruction-list li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.telegram-info {
    background-color: #f1f9ff;
    border-left: 4px solid #00bfff;
    padding: 16px 20px;
    margin-bottom: 30px;
    border-radius: 6px;
}

.telegram-info h3 {
    margin-top: 0;
    color: #0077cc;
}

.telegram-info a {
    color: #0077cc;
    text-decoration: none;
}

.telegram-info a:hover {
    text-decoration: underline;
}

.support-contact {
    font-size: 16px;
    margin-top: 20px;
    padding: 10px;
    background: #f9f9f9;
    border-left: 4px solid #aaa;

}

/* Стиль для графика работы */
.holiday-schedule {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 15px;
    margin-bottom: 30px;
    border-radius: 6px;  

}