body {
	font-family: Arial, sans-serif;
	margin: 0 30px;
	color: #222;
	line-height: 1.4;
}
h2 {
	margin-bottom: 5px;
}
.header-bar {
    z-index: 10;
}
.container {
	max-width: 950px;
	margin: 0 auto;
	padding: 20px 15px 20px 15px;
	box-sizing: border-box;
}
.payment-box {
	display: none;
}
#actions {
	padding-bottom: 70px;
	margin-top: 120px;
}
button {
	padding: 10px 15px;
	margin-right: 8px;
	cursor: pointer;
	font-size: 14px;
	border: none;
}

#invoice-date,
#invoice-current-date {
	border-bottom: 1px dotted #ccc;
	padding-bottom: 10px;
}
#archive-select,
#buyer-select, 
#buyerFilter,
#yearFilter {
	height: 36px;
	border-color: #cae2fc;
	margin-left: 5px;
}

#archive-select,
#buyerFilter {
    width: 160px;
}
#add-buyer-btn,
#actions > button:nth-child(1) {
	background: #2196f3;
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}
#add-buyer-btn:hover,
#actions > button:nth-child(1):hover {
	background: #1c7bc9;
	color: #fff;
}

#actions > button:nth-child(2) {
	background: #8bc34a;
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}
#actions > button:nth-child(2):hover {
	background: #6e9b3b;
	color: #fff;
}
#actions .save-invoice-btn:not(:disabled) {
    background: #4caf50;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

#actions .save-invoice-btn:not(:disabled):hover {
    background: #3f9643;
    color: #fff;
}

.btn-pdf, .btn-excel {
  background: none !important;
  border: none;
  padding: 0px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
  margin-right: 10px;
}

.btn-pdf:hover, .btn-excel:hover {
  transform: scale(1.1); /* слегка увеличиваем при ховере */
}

.icon-pdf {
    width: 26px;
    height: 26px;
}
.icon-excel {
    width: 29px;
    height: 29px;
}
#delete-invoice-btn {
    display: inline-flex;
}
#delete-invoice-btn,
#delete-buyer-btn {
	color: #ff5722;
	padding: 3px 7px;
	border-radius: 50%;
	width: auto !important;
	transition: background-color 0.5s ease;
}

#delete-invoice-btn:hover,
#delete-buyer-btn:hover {
	color: #ffffff;
	padding: 3px 7px;
	border-radius: 50%;
	width: auto !important;
	background: #ff5722;
	transition: background-color 0.5s ease;
}

#delete-invoice-btn .tooltip-text,
#delete-buyer-btn .tooltip-text {
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	margin-bottom: 6px;
	background: #000000b0;
	color: #fff;
	padding: 4px 8px;
	font-size: 12px;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.8s ease;
}

#delete-invoice-btn:hover .tooltip-text,
#delete-buyer-btn:hover .tooltip-text {
	opacity: 1;
	visibility: visible;
}
.tooltip-btn {
	position: relative;
	background: #f0f7ff;
}

.tooltip-text {
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	margin-bottom: 6px;
	background: #000000b0;
	color: #fff;
	padding: 4px 8px;
	font-size: 12px;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.8s ease;
}

.tooltip-btn:hover .tooltip-text {
	opacity: 1;
	visibility: visible;
}
.actions-number {
	width: 18px;
}
.actions-cell {
    width: 30px;
    text-align: center;
    vertical-align: middle;
    padding: 5px 0 0 5px;
}
.add-row {
    background: none;
    color: #2196f3;
}
.add-row:hover {
    opacity: .80;
}
.delete-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.delete-icon {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    transition: filter 0.2s;
    opacity: .58;
}

.tooltip-btn:hover .delete-icon {
    opacity: 1;
}

#invoice-table > tbody > tr > td.actions-cell > div > button:nth-child(1) {
	color: #8bc34a;
}
#invoice-table > tbody > tr > td.actions-cell > div > button:nth-child(2) {
	color: #f44336;
}
#invoice-table > tbody > tr > td.actions-cell > div > button {
	font-size: 20px;
	padding: 0;
	width: 20px;
	height: 20px;
	align-items: center;
	background: none;
	margin: 0;
	border-radius: 50%;
}
#buyer-block input {
    outline: none;
    background: transparent;
    font-size: 16px;
    font-family: inherit;
    width: 100%;
    margin: 2px 0;
    padding: 0;
}


table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 15px;
}
table th,
table td {
	border: 1px solid #cae2fc;
	padding: 8px;
	text-align: left;
}
table th {
	background: #f0f7ff;
}

/* Убираем стрелки у number-input, оставляя цифры */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
}

input[type='text'],
input[type='number'] {
	width: 100%;
	border: none;
	outline: none;
	background: transparent;
	font-size: 14px;
}
.actions-quantity {
    width: 58px;
}
.pdv-select {
    border: none;
    background: transparent;
    padding: 5px 0;
    cursor: pointer;
}
#product-count {
    margin-top: 20px;
}
#pdv-text {
    margin-top: 4px;
    font-size: 13px;
}
.total-block {
    margin-top: 7px;
    text-align: right;
    font-size: 16px;
    font-weight: 400;
}
.total-block-left {
    margin-top: 10px;
}
#grand-total {
	font-weight: bold;
}
.signature {
	margin-top: 40px;
}

.payment-box {
	margin-top: 20px;
	border: 2px solid #000;
	padding: 20px;
}
.payment-title {
	text-align: center;
	font-weight: bold;
	font-size: 18px;
	margin-bottom: 25px;
}
.row {
	display: flex;
	align-items: center;
	margin-bottom: 10px;
}
.label {
	width: 160px;
	font-weight: normal;
}
.value {
	font-weight: bold;
}
.box {
	border: 2px solid #000;
	padding: 8px 15px;
	font-weight: bold;
	margin-left: 10px;
}
.iban-box {
	border: 2px solid #000;
	padding: 8px 15px;
	font-weight: bold;
	margin-left: 10px;
	flex-grow: 1;
	max-width: 300px;
}

#select {
	margin-top: 20px;
}
#buyer-block {
	margin-top: 20px;
}

.archive-block {
	margin: 0 0 20px 0;
	float: right;
}
#amount-text {
	display: inline-block;
}
#amount-text::first-letter {
	text-transform: uppercase;
}

.signature-block {
	margin: 60px 0 100px 0;
	font-weight: bold;
	display: flex;
	flex-direction: column;
	height: 70px;
}

.signature-images {
	position: relative;
	font-weight: bold;
	height: 50px;
	line-height: 60px;
}

.signature-img {
	height: 88px;
	position: absolute;
	left: 10%;
	bottom: 40%;
}

.seal-img {
	height: 140px;
	position: absolute;
	left: 19%;
	bottom: -70%;
	transform: rotate(354deg);
	transform-origin: center;
}

.container.hide-signature .signature-images {
	display: none !important;
}

.privacy-policy,
.oferta {
    font-size: 12px;
}

button:disabled {
    opacity: 0.5; /* полупрозрачная */
    cursor: not-allowed; /* курсор "запрещено" */
    background-color: #cccccc; /* серый фон */
    color: #666666; /* серый текст */
    border: 1px solid #999999;
    pointer-events: none; /* не реагирует на hover */
}

/* Стили для блока реквизитов покупателя */
#buyer-block .buyer-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

#buyer-block .buyer-label {
    font-weight: normal;
    text-align: left;
    color: #333;
}

#buyer-block .buyer-input {
    flex: 1;
    border: none;
}

/* Чтобы "Договір:" был выровнен по верху (если текст длинный) */
#buyer-block .contract-row .buyer-label {
    align-self: flex-start;
    margin-top: 10px;
}

#buyer-block #buyer-contract {
       margin-top: 10px; 
}

/* Адаптивность на мобильных устройствах */
@media (max-width: 600px) {
    #buyer-block .buyer-input {
        min-width: auto;
        width: 100%;
    }
}

/* Дополнительно: улучшаем общий вид полей в блоке (название и адрес — на всю ширину) */
#buyer-block > input[type="text"] {
    width: 100%;
    font-size: 16px;
    box-sizing: border-box;
}

/* Стили для кнопки "Зберегти зміни реквізитів" */
#save-buyer-changes {
    margin: 20px 0 10px 0;
    padding: 10px 15px;
    background-color: #8bc34a;
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s, color 0.2s;
}

#save-buyer-changes:hover {
    background-color: #6e9b3b;
}
.buyer-input::placeholder {
    font-size: 12px;
    opacity: 0.7;
}

/* Футер */
.footer {
    padding-top: 30px;
}
.footer-menu {
    display: flex;
    justify-content: space-between;
    /* align-items: center; */
    padding: 15px 0;
    border-top: 1px solid #ccc;
    font-size: 12px;
}
a.footer-contacts span,
a.footer-adres span {
    font-size: 12px;
    color: #555555;
}
.footer-link {
    color: #222222;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-link:hover {
    color: #1c7bc9;
    text-decoration: underline;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}


/* === Адаптация === */

@media (max-width: 1023px) {
	body {
		margin: 20px;
	}
	.container {
		padding: 0px 15px 10px 15px;
	}
	.row {
		flex-wrap: wrap;
	}
	.iban-box {
		max-width: none;
		flex: 1;
	}
}


@media (max-width: 767px) {
	body {
		/* margin: 15px; */
	}
	.container {
		padding: 0px 10px;
	}

	h2 {
		font-size: 1.5em;
	}
	#actions button,
	#add-buyer-btn,
	#delete-buyer-btn {
		margin: 8px 0;
	}

	.row {
		flex-direction: column;
		align-items: flex-start;
	}
	.label {
		width: auto;
		margin-bottom: 5px;
	}
	.box,
	.iban-box {
		margin-left: 0;
		width: 100%;
		box-sizing: border-box;
	}
	.iban-box {
		margin-top: 5px;
		font-size: 14px;
	}

	/* Таблица с горизонтальной прокруткой */
	.table-wrapper {
		overflow-x: auto;
		margin-top: 20px;
	}

	table {
		min-width: 700px;
	}

	/* Подпись и печать — один под другим */
	.signature-images {
		/* left: 8%; */
	}

	.signature-img,
	.seal-img {
		max-width: 220px;
	}
	.signature-img {
		left: 18%;
	}

	.seal-img {
		transform: rotate(354deg) scale(0.9);
		left: 32%;
	}
}

@media screen and (max-width: 480px) {
	.container {
		max-width: 480px;
		padding: 0;
		margin-bottom: 100px;
	}
	.signature-wrote {
		font-size: 14px;
	}
	.signature-images {
		/* left: 10%; */
	}
	.signature-img {
		max-width: 180px;
		bottom: 40%;
		left: 20%;
	}
	.seal-img {
		max-width: 200px;
		transform: rotate(354deg) scale(0.8);
		bottom: -60%;
		left: 35%;
		height: 165px;
	}
	.actions-cell {
		width: 100%;
	}
	.btn-pdf, .btn-excel {
    }
    #buyerFilter, #yearFilter {
        float: right;
    }
    #archive-select, #buyerFilter, #yearFilter {
        width: 45%;
    }
    
    #archive-select, #buyer-select, #buyerFilter, #yearFilter {
        margin: 0;
    }
	#actions button,
	#delete-buyer-btn {
		width: 100%;
		margin: 3px 0;
	}
	
	#delete-buyer-btn {
    order: 1;
    position: absolute;
    right: 5%;
	}

	#add-buyer-btn {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
}
	.archive-block {
	    width: 100%;
		margin: 3px 0 20px 0;
	}
	#buyer-select {
		margin: 10px 0px 0px 0px;
		width: 100%;
		padding-left: 5px;
		order: 2;
	}
	table {
		min-width: 0;
	}
	.table-wrapper {
		overflow-x: visible;
	}

	#invoice-table thead {
		display: none;
	}

	#invoice-table,
	#invoice-table tbody {
		display: block;
		width: 100%;
	}
    .tooltip-text {
        display: none;
    }
    
    .footer-menu {
        flex-direction: column;
        gap: 10px;
    }
    #actions label b {
        display: none;
    }
    #select {
    display: grid;
    }

	/* === КАРТОЧКА === */
	#invoice-table tr {
		display: grid;
		grid-template-columns: auto 1fr;
		gap: 5px 12px;
		border: 1px solid #cae2fc;
		border-radius: 8px;
		margin-bottom: 14px;
		padding: 10px 20px 10px 10px;
		background: #fff;

	}

	/* === БАЗОВО ДЛЯ ЯЧЕЕК === */
	#invoice-table td {
		display: block;
		align-items: center;
		justify-content: space-between;
		border: none;
		padding: 5px;
	}

	/* === № СЛЕВА ВВЕРХУ === */
	#invoice-table td:first-child {
		grid-column: 1;
		grid-row: 1;
		font-weight: bold;
		font-size: 16px;
		color: #2196f3;
	}

	/* === ACTIONS СПРАВА ВВЕРХУ === */
	#invoice-table td.actions-cell {
		grid-column: 2;
		grid-row: 1;
		justify-content: flex-end;
		display: flex;
	}

	#invoice-table td.actions-cell > div {
		grid-column: 2;
		grid-row: 1;
		justify-content: flex-end;
		display: flex;
		gap: 5px;
	}

	/* === ОСТАЛЬНЫЕ СТРОКИ === */
	#invoice-table td:not(:first-child):not(.actions-cell) {
		grid-column: 1 / -1;
		color: #555;
	}

	/* === ПОДПИСИ === */
	#invoice-table td::before {
		content: '';
		font-size: 12px;
		color: #7a7a7a;
		flex: 0 0 25%;
		padding-left: 12px;
	}
	#invoice-table td:nth-child(1)::before {
		content: '№';
		color: #2196f3;
		padding: 0;
	}
	#invoice-table td:nth-child(2)::before {
		content: 'Найменування';
	}
	#invoice-table td:nth-child(3)::before {
		content: 'Кіл-сть';
	}
	#invoice-table td:nth-child(4)::before {
		content: 'Од.';
	}
	#invoice-table td:nth-child(4) {
		display: none;
	}
	#invoice-table td:nth-child(5)::before {
		content: 'Ціна';
	}

	#invoice-table td:nth-child(6)::before {
		content: 'Сума';
		font-size: 14px;
	}
	#invoice-table td:nth-child(6) {
		display: flex;
	}

	/* === СУММА === */
	#invoice-table td.sum {
		border-top: 2px solid #2196f3;
		padding-top: 12px;
		font-weight: 600;
		margin-top: 10px;
	}

	/* === INPUT === */
	#invoice-table input {
		width: 100%;
		border: 1px dotted #ededed;
		padding: 10px 0 10px 10px;
		margin-top: 5px;
	}
}


@media print {
    body {
        margin: 40px;
        padding: 0;
    }
    @page {
        margin: 0.5cm; /* или 0, если хочешь совсем без полей */
        size: A4 portrait;
    }
	#actions,
	#select,
	#toggle-signature,
	#buyer-select,
	#login-icon,
	.header-bar,
	.header-personal-bar,
	.header-line,
	.code,
	.archive-block,
	.actions-cell,
	.tax-vat,
	.footer {
		display: none !important;
	}
	button {
		display: none !important;
	}
	input {
		border: none !important;
	}
	input[type='text'],
	input[type='number'],
	#buyer-block,
	#buyer-block > input[type="text"],
	#buyer-block input,
	#buyer-block .buyer-row,
	#pdv-text {
		border: none;
		outline: none;
		background: transparent;
		font-size: 12px;
	}
	.container {
		max-width: none;
		padding: 0;
		font-size: 12px;
	}
	.payment-box {
		display: none;
	}
	#actions {
		margin-bottom: 20px;
	}
	.payment-title {
		font-size: 14px;
	}
	table th,
	table td {
		border: 1px solid #bbbbbb;
	}
	#invoice-table {
		width: 100%;
	}
	.table-wrapper {
		display: table;
	}
	.table {
		min-width: auto;
		width: 100%;
	}
	.actions-quantity {
		width: 60px;
	}
	#invoice-table > tbody > tr > td:nth-child(5) > input[type='number'] {
		width: 75px;
	}
	#invoice-table > tbody > tr > td:nth-child(5) {
	}
	.total-block {
        font-size: 12px;
	}
	.signature-wrote {
		font-size: 14px;
	}
	.signature-block {
    margin: 60px 0 0px 0;
	}
	.signature-images {
		position: relative;
		font-weight: bold;
		height: 50px;
		line-height: 60px;
	}

	.signature-img {
		height: 80px;
		position: absolute;
		left: 11%;
		bottom: 44%;
	}

	.seal-img {
		height: 145px;
		position: absolute;
		left: 20%;
		bottom: -100%;
		transform: rotate(354deg);
		transform-origin: center;
	}
}

/* promo.css */
.promo-button {
    display: inline-block;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.18;
    background: linear-gradient(90deg, #f7c86d, #76baf1, #a75fff, #ff60df);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    background-size: 300% 100%;
    animation: gradientFlow 8s ease-in-out infinite;
}
#promo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none; /* по умолчанию скрыто */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

#promo-modal.show {
    display: flex; /* открыто */
    opacity: 1;
    visibility: visible;
}

/* Модальне вікно */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {max-width: 800px;width: 90%;max-height: 90vh;overflow-y: auto;border-radius: 16px;box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);padding: 40px;text-align: left;position: relative;background: rgba(15, 23, 42, 0.92);backdrop-filter: blur(16px) saturate(160%);-webkit-backdrop-filter: blur(16px) saturate(160%);}

/* Заголовки */
.modal-content h1 {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin: 0 0 1.4rem 0;
  padding-right: 80px; /* місце під кнопку закриття */

  /* Переливчастий градієнт */
  background: linear-gradient(90deg, #fc84e4, #76baf1, #2196f3, #fc84e4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;

  /* Анімація */
  background-size: 300% 100%;
  animation: gradientFlow 8s ease-in-out infinite;
}

/* Повільніша, спокійніша версія (рекомендую для основного заголовка) */
.modal-content h1.slow {
  background-size: 400% 100%;
  animation-duration: 12s;
}

/* Швидша версія (якщо хочеш більше динаміки) */
.modal-content h1.fast {
  background-size: 200% 100%;
  animation-duration: 5s;
}

/* Сама анімація */
@keyframes gradientFlow {
  0%   { background-position: 0% center; }
  50%  { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* На випадок, якщо користувач увімкнув reduced motion (доступність) */
@media (prefers-reduced-motion: reduce) {
  .modal-content h1 {
    animation: none !important;
    background: linear-gradient(90deg, #fc84e4, #76baf1, #2196f3) !important;
  }
}

/* Опціонально: при наведенні курсора — трохи прискорюється */
.modal-content h1:hover {
  animation-duration: 4s;
  animation-timing-function: linear;
}

.modal-content h2 {
  font-size: 1.6rem;
  font-weight: 680;
  color: #ffffff;
  margin: 2.2rem 0 1rem;
  position: relative;
  padding-left: 0;
}

.modal-content h2::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 175px;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  border-radius: 3px;
}

.modal-content h3 {
  font-size: 1.32rem;
  font-weight: 650;
  color: #accef8;
  margin: 1.6rem 0 0.9rem;
}

/* Текст */
.modal-content p {
  font-size: 1.08rem;
  line-height: 1.78;
  color: #cbd5e1;
  margin: 0 0 1.3rem;
}

.modal-content strong {
  color: #accef8;
  font-weight: 620;
}

/* Список */
.modal-content ul {
  list-style: none;
  padding-left: 0;
  margin: 1.2rem 0 2rem;
}

.modal-content ul li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 0.9rem;
  font-size: 1.07rem;
  color: #cbd5e1;
}

.modal-content ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #a78bfa;
  font-size: 1.3rem;
  line-height: 1;
  top: 2px;
}

/* Акцентний блок в кінці */
.modal-content p[style*="text-align: center"] {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 16px;
  padding: 28px 24px;
  font-size: 1.18rem !important;
  line-height: 1.65;
  color: #ffffff;
  margin: 2.5rem auto 1.8rem;
  max-width: 640px;
}

/* Фінальний великий заголовок */
.modal-content h1:last-child {
  text-align: center;
  font-size: 2.0rem;
  margin: 2.8rem 0 1rem;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.04em;
}
@media (max-width: 560px) {
    .promo-button{
        display: none;
    }
}

/* login.css */
/* Блок для позиционирования иконки входа */
.login {
    display: flex;
    right: 0;
    position: absolute;
    top: 0;
}

/* Иконка входа (ключик) */
#login-icon {
    cursor: pointer;
    display: flex;
    float: right;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

/* Эффект наведения на иконку входа */
#login-icon:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
/* Иконка смены пароля (ключик) */
#password-icon {
    cursor: pointer;
    display: flex;
    float: right;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Эффект наведения на иконку входа */
#password-icon:hover {
    background: white;
    transform: scale(1.1);
}

/* Основной блок верхней панели (код, демо, кнопки) */
.code {
position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 998;
    color: white;
    font-family: 'Segoe UI', sans-serif;
    max-width: 950px;
    margin: 0 auto;
    box-sizing: border-box;
    gap: 20px;

    font-size: 18px;
    font-weight: 600;}

.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu-dropdown a {
    display: block;
    padding: 12px 20px 12px 20px;
    position: relative;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.user-menu-dropdown a::before {
    content: attr(data-icon); /* берёт иконку из data-icon */
    position: absolute;
    left: 20px; /* расстояние от левого края */
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px; /* размер иконки */
}

.user-menu-dropdown a:hover {
    background: #f0f7ff;
}

.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 7px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    padding: 10px 0;
    min-width: 200px;
    opacity: 0; /* скрыто по умолчанию */
    visibility: hidden; /* скрыто */
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}
.user-menu-dropdown svg {
    stroke: #2196f3; /* цвет как текст */
    margin: 0px 7px -6px 0; /* отступ от текста */
    width: 20px;
    height: 22px;
}
.user-menu-dropdown.open {
    opacity: 1; /* видно */
    visibility: visible;
}



.user-menu-trigger {
    cursor: pointer;
    display: flex;
    float: right;
    font-size: 26px;
    background: rgba(255, 255, 255, 0.9);
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

.user-menu-trigger:hover {

    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.2);
}


/* Стили для текста "КОД:" и "ДЕМО РАХУНОК" */
a.code-label,
.code span {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    border-radius: 7px;
    padding: 12px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Стили для кликабельных элементов (КОД, ДЕМО) */
a.code-label,
.code-label,
.demo-label {
    color: white !important;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    z-index: 2;

    font-size: 16px;
    font-weight: bold;}

/* Эффект наведения и активного состояния для кликабельных элементов */
.code-label:hover,
.code-label:active,
.demo-label:hover,
.demo-label:active {
    color: white !important;
    opacity: 0.95;
}

a.code-label:hover,
a.code-label:active {
    color: white !important;
    background: linear-gradient(135deg, #153366, #112c5c); 
}

/* Модальное окно логина */
#login-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in-out;
}

/* Контент модального окна логина */
.login-modal-content {
    background: #f6f7fc;
    margin: 15% auto;
    padding: 10px 30px 40px 30px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 350px;
    text-align: center;
    animation: slideIn 0.5s ease-out;
}

/* Кнопка закрытия модалки */
.close-btn {
    color: #cecece;
    float: right;
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s;
}

/* Эффект наведения на кнопку закрытия */
.close-btn:hover {
    color: #000;
}

/* Форма логина */
#login-form,
#change-password-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 20px;
}
#password-message {
    color: red;
    padding-top: 10px;
    font-size: 12px;
}

/* Группа ввода с плавающим лейблом */
.input-group {
    position: relative;
}

/* Поле ввода */
.input-group input {
    width: 100%;
    padding: 12px 12px 12px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    background: transparent;
    transition: border 0.3s;
    box-sizing: border-box;
}

/* Плавающий лейбл */
.input-group label {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    font-size: 16px;
    color: #999;
    pointer-events: none;
    transition: all 0.3s ease;
    padding: 0 6px;
    background: #f6f7fc;
}

/* Состояние фокуса и заполненного поля */
.input-group input:focus,
.input-group input:valid {
    border-color: #8bc34a;
    outline: none;
}

/* Подъём лейбла при фокусе или заполнении */
.input-group input:focus + label,
.input-group input:valid + label {
    top: 0;
    font-size: 12px;
    color: #8bc34a;
    font-weight: 500;
}

/* Группа чекбокса */
.checkbox-group {
    margin: -10px;
    text-align: left;
    padding-left: 12px;
}

/* Кастомный чекбокс */
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    user-select: none;
}

/* Скрываем стандартный чекбокс */
.checkbox-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Квадратик чекбокса */
.checkbox-mark {
    width: 15px;
    height: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: relative;
}

/* Галочка при выборе */
.custom-checkbox input:checked + .checkbox-mark {
    background: #4caf50;
    border-color: #4caf50;
}

/* Галочка (псевдоэлемент) */
.custom-checkbox input:checked + .checkbox-mark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Эффект наведения на чекбокс */
.custom-checkbox:hover .checkbox-mark {
    border-color: #4caf50;
}

/* Фокус для клавиатуры */
.custom-checkbox input:focus-visible + .checkbox-mark {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

/* Текст чекбокса */
.checkbox-text {
    line-height: 1.4;
}

/* Кнопка формы логина */
#login-form button,
#change-password-form button {
    background-color: #2196f3;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    margin: 10px 0 0 0;
}

/* Эффект наведения на кнопку логина */
#login-form button:hover,
#change-password-form button:hover {
    background-color: #8bc34a;
}

/* Анимация появления модалки */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Анимация слайда модалки */
@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Основной хедер */
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(to bottom, #1e3c72, #2a5298);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.header-personal-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
    z-index: 1;
}

/* Внутренний контейнер хедера */
.header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    display: flex;
    align-items: center;
    /* justify-content: space-between; */
    padding: 0 15px;
    z-index: 998;
    color: white;
    font-family: 'Segoe UI', sans-serif;
    max-width: 950px;
    margin: 0 auto;
    box-sizing: border-box;
    gap: 20px;
}

/* Левая часть — DEMO */
.header-left {
    flex: 0 0 auto;
}

/* Плашка DEMO */
.demo-label {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Контейнер бегущей строки */
.marquee-container {
    flex: 1;
    overflow: hidden;
    /* margin: 0 10px; */
    position: relative;
}

/* Бегущая строка */
.marquee {
    display: flex;
    /* white-space: nowrap; */
    float: right;
}

/* Текст бегущей строки */
.marquee span {
    font-size: 15px;
    color: rgb(37 72 135);
    padding-right: 30px;
    background: none;
    box-shadow: none;
}

/* Анимация бегущей строки */
@keyframes marquee {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Правая часть — иконка входа */
.header-right {
    flex: 0 0 auto;
    position: absolute;
    display: flex;
    right: 0;
    padding-right: 15px;
}

/* Эффект наведения на иконку входа в хедере */
#login-icon:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Ссылки на телефоны */
.phone-link {
    color: inherit;
    text-decoration: none;
    margin: 0px 10px;
    font-weight: 400;
}

/* Эффект наведения на телефоны */
.phone-link:hover {
    text-decoration: underline;
}

/* Линия под хедером */
.header-line {
    margin-top: 100px;
}

/* Кнопка оплаты в хедере */
.payment-header-btn {
    background: #ff9b06;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    margin-left: 20px;
}
#open-payment-modal {
    position: absolute;
    display: flex;
    right: 70px;
}

/* Эффект наведения на кнопку оплаты */
.payment-header-btn:hover {
    background: #ea8d03;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#change-password-modal {
    display: none;
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin: 0 10px;
}

.green { background: #4CAF50; color: white; }
.red { background: #f44336; color: white; }

.modal-message {
    margin-top: 15px;
    color: red;
    min-height: 20px;
}





/* Responsive для мобильных */
@media (max-width: 600px) {
    .payment-modal-content {
        margin: 30% auto;
        width: 80%;
    }

    .marquee-container {
    }

    .phone-link {
        color: inherit;
    }
    .demo-label {
        font-size: 14px;
        padding: 15px 15px;
    }
    
    #open-payment-modal {
        padding: 15px 15px;
        font-size: 12px;
        right: 60px;
}
}

/* Цвет телефонов на мобильных */
@media (max-width: 768px) {
    .marquee span {
        font-size: 12px;
        padding-right: 10px;
    }

    .marquee {
    }
    .phone-link {
        color: inherit;
    }
}

/* Модалка оплаты — полностью новые классы */
.payment-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-in-out;
}

/* Контент модалки оплаты */
.payment-content {
    background: #f6f7fc;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 350px;
    text-align: center;
    animation: slideIn 0.5s ease-out;
}

/* Крестик закрытия модалки оплаты */
.payment-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Эффект наведения на крестик оплаты */
.payment-close:hover {
    color: #000;
}

/* Форма оплаты */
.payment-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 28px;
    z-index: 1;
    position: relative;
}

/* Кнопка оплаты в модалке */
.payment-form button {
    background-color: #4CAF50;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    width: 100%;
    margin: 10px 0;
}

/* Эффект наведения на кнопку оплаты */
.payment-form button:hover {
    background-color: #45a049;
}

/* Группа ввода для оплаты */
.payment-group {
    position: relative;
}

/* Поле ввода в оплате */
.payment-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    background: transparent;
    box-sizing: border-box;
    transition: border 0.3s;
}

/* Плавающий лейбл в оплате */
.payment-group label {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    font-size: 16px;
    color: #999;
    pointer-events: none;
    transition: all 0.3s ease;
    background: #f6f7fc;
    padding: 0 8px;
}

/* Фокус и заполненное поле в оплате */
.payment-group input:focus,
.payment-group input:not(:placeholder-shown) {
    border-color: #4CAF50;
    outline: none;
}

/* Подъём лейбла в оплате */
.payment-group input:focus + label,
.payment-group input:not(:placeholder-shown) + label {
    top: 0px;
    font-size: 12px;
    color: #4CAF50;
    font-weight: 600;
}

/* Неактивная кнопка оплаты */
#payBtn:disabled {
    background-color: #bfc5cc;
    color: #6b7280;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Активная кнопка оплаты + hover */
#payBtn:not(:disabled):hover {
    background-color: #165fb3;
}

/* Красный текст в модалке оплаты (третье сообщение) */
#payment-modal > div > span:nth-child(3) {
    color: #ff9b06;
}

#payment-modal h3 {
    margin: 18px 0 5px 0;
}

/* Buyer modal adjustments */
#buyer-modal .payment-content {
    height: max-content;
}

#buyer-modal h3 {
    color: #222;
}

/* Auth header */
.header-bar-auth {
    background: #fff;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.06);
}

.header-bar-auth .header {
    color: #222;
}

.header-bar-auth .demo-label {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
}

.auth-header-right {
    align-items: center;
    gap: 14px;
}

.header-export-btn {
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    background: transparent !important;
    border: none;
    border-radius: 10px;
}

.header-export-btn:hover {
    background: #f3f7ff !important;
    transform: translateY(-1px) scale(1.04);
}

.header-export-btn .icon-pdf {
    width: 28px;
    height: 28px;
}

.header-export-btn .icon-excel {
    width: 32px;
    height: 32px;
}


/* Print: wrap invoice table input/select values as normal text */
@media print {
    body.invoice-printing #invoice-table td[data-print-text] {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
        height: auto !important;
        vertical-align: top !important;
    }

    body.invoice-printing #invoice-table td[data-print-text] input,
    body.invoice-printing #invoice-table td[data-print-text] select {
        display: none !important;
    }

    body.invoice-printing #invoice-table td[data-print-text]::after {
        content: attr(data-print-text);
        display: block;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        word-break: normal;
        line-height: 1.25;
    }

    body.invoice-printing #invoice-table td:nth-child(2) {
        min-width: 220px !important;
        max-width: 340px !important;
    }
}


/* Print: keep numeric invoice columns on one line */
@media print {
    body.invoice-printing #invoice-table td:nth-child(3)[data-print-text],
    body.invoice-printing #invoice-table td:nth-child(4)[data-print-text],
    body.invoice-printing #invoice-table td:nth-child(5)[data-print-text],
    body.invoice-printing #invoice-table td:nth-child(6)[data-print-text],
    body.invoice-printing #invoice-table td:nth-child(7)[data-print-text] {
        white-space: nowrap !important;
        overflow-wrap: normal !important;
        word-break: keep-all !important;
    }

    body.invoice-printing #invoice-table td:nth-child(3)[data-print-text]::after,
    body.invoice-printing #invoice-table td:nth-child(4)[data-print-text]::after,
    body.invoice-printing #invoice-table td:nth-child(5)[data-print-text]::after,
    body.invoice-printing #invoice-table td:nth-child(6)[data-print-text]::after,
    body.invoice-printing #invoice-table td:nth-child(7)[data-print-text]::after {
        white-space: nowrap !important;
        overflow-wrap: normal !important;
        word-break: keep-all !important;
    }

    body.invoice-printing #invoice-table td:nth-child(5),
    body.invoice-printing #invoice-table th:nth-child(5) {
        min-width: 72px !important;
    }

    body.invoice-printing #invoice-table td:nth-child(7),
    body.invoice-printing #invoice-table th:nth-child(7) {
        min-width: 85px !important;
    }

    body.invoice-printing #invoice-table td:nth-child(2)[data-print-text],
    body.invoice-printing #invoice-table td:nth-child(2)[data-print-text]::after {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }
}


/* Print: vertically center all invoice table cells */
@media print {
    body.invoice-printing #invoice-table th,
    body.invoice-printing #invoice-table td,
    body.invoice-printing #invoice-table td[data-print-text] {
        vertical-align: middle !important;
    }

    body.invoice-printing #invoice-table td[data-print-text]::after {
        vertical-align: middle !important;
    }
}


/* Invoice table: keep numeric columns in one line on screen and print */
#invoice-table th:nth-child(3),
#invoice-table td:nth-child(3),
#invoice-table th:nth-child(4),
#invoice-table td:nth-child(4),
#invoice-table th:nth-child(5),
#invoice-table td:nth-child(5),
#invoice-table th:nth-child(6),
#invoice-table td:nth-child(6),
#invoice-table th:nth-child(7),
#invoice-table td:nth-child(7) {
    white-space: nowrap;
    vertical-align: middle;
}

#invoice-table th:nth-child(5),
#invoice-table td:nth-child(5) {
    min-width: 120px;
}

#invoice-table th:nth-child(7),
#invoice-table td:nth-child(7) {
    min-width: 130px;
}

#invoice-table td:nth-child(7) {
    text-align: right;
}

#invoice-table td:nth-child(2) {
    vertical-align: middle;
}

@media print {
    body.invoice-printing #invoice-table th:nth-child(5),
    body.invoice-printing #invoice-table td:nth-child(5) {
        min-width: 78px !important;
    }

    body.invoice-printing #invoice-table th:nth-child(7),
    body.invoice-printing #invoice-table td:nth-child(7) {
        min-width: 95px !important;
    }

    body.invoice-printing #invoice-table td:nth-child(5)[data-print-text],
    body.invoice-printing #invoice-table td:nth-child(7)[data-print-text],
    body.invoice-printing #invoice-table td:nth-child(5)[data-print-text]::after,
    body.invoice-printing #invoice-table td:nth-child(7)[data-print-text]::after {
        white-space: nowrap !important;
        overflow-wrap: normal !important;
        word-break: keep-all !important;
    }
}


/* Screen: wrap invoice description and vertically center table cells */
#invoice-table th,
#invoice-table td {
    vertical-align: middle;
}

#invoice-table td:nth-child(2) {
    white-space: normal;
    vertical-align: middle;
}

#invoice-table textarea.invoice-description-field {
    display: block;
    width: 100%;
    min-height: 1.35em;
    max-height: none;
    box-sizing: border-box;
    border: 0;
    outline: 0;
    padding: 0;
    margin: 0;
    resize: none;
    overflow: hidden;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

#invoice-table textarea.invoice-description-field:focus {
    outline: none;
}


/* Invoice table: old project width behavior */
#invoice-table {
    table-layout: auto !important;
    width: 100%;
}

#invoice-table th:nth-child(1),
#invoice-table td:nth-child(1) {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    text-align: center;
}

#invoice-table th:nth-child(2),
#invoice-table td:nth-child(2) {
    width: 46%;
    min-width: 420px;
    max-width: 420px;
}

#invoice-table th:nth-child(3),
#invoice-table td:nth-child(3) {
    width: 1%;
    min-width: 86px;
    white-space: nowrap;
}

#invoice-table th:nth-child(4),
#invoice-table td:nth-child(4) {
    width: 1%;
    min-width: 58px;
    white-space: nowrap;
}

#invoice-table th:nth-child(5),
#invoice-table td:nth-child(5) {
    width: 1%;
    min-width: 118px;
    white-space: nowrap;
}

#invoice-table th:nth-child(6),
#invoice-table td:nth-child(6) {
    width: 1%;
    min-width: 128px;
    white-space: nowrap;
}

#invoice-table th:nth-child(7),
#invoice-table td:nth-child(7) {
    width: 1%;
    min-width: 118px;
    white-space: nowrap;
    text-align: right;
}

#invoice-table th:nth-child(8),
#invoice-table td:nth-child(8) {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    text-align: center;
}

#invoice-table th,
#invoice-table td {
    vertical-align: middle !important;
}

#invoice-table textarea.invoice-description-field {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Very wide sums may expand the amount column, not the description column */
#invoice-table td:nth-child(7),
#invoice-table th:nth-child(7) {
    max-width: none !important;
}

@media print {
    #invoice-table th:nth-child(2),
    #invoice-table td:nth-child(2) {
        min-width: 230px !important;
        max-width: 330px !important;
        width: 330px !important;
    }

    #invoice-table th:nth-child(5),
    #invoice-table td:nth-child(5) {
        min-width: 76px !important;
        width: 76px !important;
    }

    #invoice-table th:nth-child(7),
    #invoice-table td:nth-child(7) {
        min-width: 92px !important;
        width: auto !important;
    }
}


/* Fix: invoice table must not overflow page/container */
#invoice-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
}

#invoice-table th,
#invoice-table td {
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

/* Fixed small columns */
#invoice-table th:nth-child(1),
#invoice-table td:nth-child(1) {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    text-align: center;
}

#invoice-table th:nth-child(8),
#invoice-table td:nth-child(8) {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    text-align: center;
}

/* Description takes remaining space and may wrap */
#invoice-table th:nth-child(2),
#invoice-table td:nth-child(2) {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    white-space: normal !important;
    overflow: hidden !important;
}

#invoice-table textarea.invoice-description-field {
    min-width: 0 !important;
    width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* Numeric/service columns stay compact and do not wrap */
#invoice-table th:nth-child(3),
#invoice-table td:nth-child(3) {
    width: 78px !important;
    min-width: 78px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(4),
#invoice-table td:nth-child(4) {
    width: 54px !important;
    min-width: 54px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(5),
#invoice-table td:nth-child(5) {
    width: 112px !important;
    min-width: 112px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(6),
#invoice-table td:nth-child(6) {
    width: 120px !important;
    min-width: 120px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(7),
#invoice-table td:nth-child(7) {
    width: 1% !important;
    min-width: 116px !important;
    max-width: none !important;
    white-space: nowrap !important;
    text-align: right !important;
}

/* On smaller screens, give description less priority but keep table inside container */
@media screen and (max-width: 1100px) {
    #invoice-table th:nth-child(3),
    #invoice-table td:nth-child(3) {
        width: 70px !important;
        min-width: 70px !important;
    }

    #invoice-table th:nth-child(5),
    #invoice-table td:nth-child(5) {
        width: 100px !important;
        min-width: 100px !important;
    }

    #invoice-table th:nth-child(6),
    #invoice-table td:nth-child(6) {
        width: 112px !important;
        min-width: 112px !important;
    }

    #invoice-table th:nth-child(7),
    #invoice-table td:nth-child(7) {
        min-width: 108px !important;
    }
}


/* Invoice table: fixed 400px description column */
#invoice-table th:nth-child(2),
#invoice-table td:nth-child(2) {
    width: 400px !important;
    min-width: 400px !important;
    max-width: 400px !important;
    white-space: normal !important;
    overflow: hidden !important;
}

#invoice-table textarea.invoice-description-field {
    width: 100% !important;
    max-width: 400px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* Keep the table inside the page with 400px description */
#invoice-table th:nth-child(3),
#invoice-table td:nth-child(3) {
    width: 70px !important;
    min-width: 70px !important;
}

#invoice-table th:nth-child(4),
#invoice-table td:nth-child(4) {
    width: 50px !important;
    min-width: 50px !important;
}

#invoice-table th:nth-child(5),
#invoice-table td:nth-child(5) {
    width: 100px !important;
    min-width: 100px !important;
}

#invoice-table th:nth-child(6),
#invoice-table td:nth-child(6) {
    width: 110px !important;
    min-width: 110px !important;
}

#invoice-table th:nth-child(7),
#invoice-table td:nth-child(7) {
    width: auto !important;
    min-width: 110px !important;
    max-width: none !important;
    white-space: nowrap !important;
    text-align: right !important;
}


/* Invoice table: real 400px useful width for description field */
#invoice-table th:nth-child(2),
#invoice-table td:nth-child(2) {
    width: 418px !important;
    min-width: 418px !important;
    max-width: 418px !important;
}

#invoice-table textarea.invoice-description-field {
    width: 400px !important;
    min-width: 400px !important;
    max-width: 400px !important;
}


/* Invoice table: description font size */
#invoice-table td:nth-child(2),
#invoice-table td:nth-child(2) input,
#invoice-table td:nth-child(2) textarea,
#invoice-table textarea.invoice-description-field {
    font-size: 14px !important;
    line-height: 1.25 !important;
}

@media print {
    body.invoice-printing #invoice-table td:nth-child(2),
    body.invoice-printing #invoice-table td:nth-child(2)::after,
    body.invoice-printing #invoice-table td:nth-child(2)[data-print-text]::after {
        font-size: 14px !important;
        line-height: 1.25 !important;
    }
}


/* Invoice table: keep inside page, long amounts overflow to the left */
#invoice-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    overflow: visible !important;
}

#invoice-table th,
#invoice-table td {
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

/* fixed columns */
#invoice-table th:nth-child(1),
#invoice-table td:nth-child(1) {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    text-align: center !important;
}

#invoice-table th:nth-child(2),
#invoice-table td:nth-child(2) {
    width: 418px !important;
    min-width: 418px !important;
    max-width: 418px !important;
    overflow: hidden !important;
    white-space: normal !important;
}

#invoice-table textarea.invoice-description-field {
    width: 400px !important;
    min-width: 400px !important;
    max-width: 400px !important;
    font-size: 14px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

#invoice-table th:nth-child(3),
#invoice-table td:nth-child(3) {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(4),
#invoice-table td:nth-child(4) {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(5),
#invoice-table td:nth-child(5) {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(6),
#invoice-table td:nth-child(6) {
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(7),
#invoice-table td:nth-child(7) {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
    white-space: nowrap !important;
    text-align: right !important;
    overflow: visible !important;
    direction: ltr !important;
}

#invoice-table td:nth-child(7) {
    position: relative !important;
    z-index: 2 !important;
}

#invoice-table th:nth-child(8),
#invoice-table td:nth-child(8) {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    text-align: center !important;
}

/* price input should stay inside its own cell */
#invoice-table td:nth-child(5) input {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-align: right !important;
    overflow: hidden !important;
}

/* sum text: right edge stays fixed, overflow goes left */
#invoice-table td:nth-child(7) {
    text-align: right !important;
    white-space: nowrap !important;
}

@media print {
    body.invoice-printing #invoice-table {
        table-layout: fixed !important;
        width: 100% !important;
        overflow: visible !important;
    }

    body.invoice-printing #invoice-table td:nth-child(7)[data-print-text],
    body.invoice-printing #invoice-table td:nth-child(7)[data-print-text]::after {
        text-align: right !important;
        white-space: nowrap !important;
        overflow: visible !important;
        direction: ltr !important;
    }
}


/* Final invoice table behavior like old project */
#invoice-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    overflow: visible !important;
}

#invoice-table th,
#invoice-table td {
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

/* № */
#invoice-table th:nth-child(1),
#invoice-table td:nth-child(1) {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    text-align: center !important;
}

/* Найменування: useful text width around 400px */
#invoice-table th:nth-child(2),
#invoice-table td:nth-child(2) {
    width: 418px !important;
    min-width: 418px !important;
    max-width: 418px !important;
    overflow: hidden !important;
    white-space: normal !important;
}

#invoice-table textarea.invoice-description-field {
    width: 400px !important;
    min-width: 400px !important;
    max-width: 400px !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* Compact fixed columns */
#invoice-table th:nth-child(3),
#invoice-table td:nth-child(3) {
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(4),
#invoice-table td:nth-child(4) {
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(5),
#invoice-table td:nth-child(5) {
    width: 95px !important;
    min-width: 95px !important;
    max-width: 95px !important;
    white-space: nowrap !important;
}

#invoice-table td:nth-child(5) input {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-align: right !important;
    overflow: hidden !important;
}

#invoice-table th:nth-child(6),
#invoice-table td:nth-child(6) {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    white-space: nowrap !important;
}

/* Сума: right edge is fixed, long text goes LEFT */
#invoice-table th:nth-child(7),
#invoice-table td:nth-child(7) {
    width: 122px !important;
    min-width: 122px !important;
    max-width: 122px !important;
    position: relative !important;
    overflow: visible !important;
    white-space: nowrap !important;
    text-align: right !important;
}

#invoice-table td:nth-child(7) {
    color: transparent !important;
    z-index: 3 !important;
}

#invoice-table td:nth-child(7) .invoice-sum-text {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: block !important;
    white-space: nowrap !important;
    color: #222 !important;
    text-align: right !important;
    pointer-events: none !important;
}

/* delete column */
#invoice-table th:nth-child(8),
#invoice-table td:nth-child(8) {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    text-align: center !important;
}

@media print {
    body.invoice-printing #invoice-table {
        table-layout: fixed !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.invoice-printing #invoice-table td:nth-child(7) .invoice-sum-text {
        right: 6px !important;
        white-space: nowrap !important;
    }
}


/* Final fix: amount stays inside its own cell */
#invoice-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
}

#invoice-table th,
#invoice-table td {
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

#invoice-table th:nth-child(2),
#invoice-table td:nth-child(2) {
    width: 418px !important;
    min-width: 418px !important;
    max-width: 418px !important;
    white-space: normal !important;
    overflow: hidden !important;
}

#invoice-table textarea.invoice-description-field {
    width: 400px !important;
    min-width: 400px !important;
    max-width: 400px !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
}

#invoice-table th:nth-child(7),
#invoice-table td:nth-child(7) {
    width: auto !important;
    min-width: 125px !important;
    max-width: none !important;
    white-space: nowrap !important;
    text-align: right !important;
    overflow: hidden !important;
    color: #222 !important;
    position: static !important;
}

#invoice-table td:nth-child(7) .invoice-sum-text {
    position: static !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-align: right !important;
    color: #222 !important;
    pointer-events: auto !important;
}

/* Compact columns so amount has room */
#invoice-table th:nth-child(1),
#invoice-table td:nth-child(1) {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
}

#invoice-table th:nth-child(3),
#invoice-table td:nth-child(3) {
    width: 62px !important;
    min-width: 62px !important;
    max-width: 62px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(4),
#invoice-table td:nth-child(4) {
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(5),
#invoice-table td:nth-child(5) {
    width: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(6),
#invoice-table td:nth-child(6) {
    width: 98px !important;
    min-width: 98px !important;
    max-width: 98px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(8),
#invoice-table td:nth-child(8) {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
}

@media print {
    body.invoice-printing #invoice-table td:nth-child(7),
    body.invoice-printing #invoice-table td:nth-child(7)[data-print-text] {
        color: #222 !important;
        position: static !important;
        overflow: hidden !important;
        text-align: right !important;
        white-space: nowrap !important;
    }

    body.invoice-printing #invoice-table td:nth-child(7) .invoice-sum-text {
        position: static !important;
        transform: none !important;
        display: block !important;
        width: 100% !important;
        text-align: right !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }
}


/* Stable invoice table: fixed description, amount inside cell */
#invoice-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

#invoice-table th,
#invoice-table td {
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

/* № */
#invoice-table th:nth-child(1),
#invoice-table td:nth-child(1) {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    text-align: center !important;
}

/* Найменування: 400px useful text width */
#invoice-table th:nth-child(2),
#invoice-table td:nth-child(2) {
    width: 418px !important;
    min-width: 418px !important;
    max-width: 418px !important;
    white-space: normal !important;
    overflow: hidden !important;
}

#invoice-table textarea.invoice-description-field {
    width: 400px !important;
    min-width: 400px !important;
    max-width: 400px !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* Кіл-сть */
#invoice-table th:nth-child(3),
#invoice-table td:nth-child(3) {
    width: 62px !important;
    min-width: 62px !important;
    max-width: 62px !important;
    white-space: nowrap !important;
}

/* Од. */
#invoice-table th:nth-child(4),
#invoice-table td:nth-child(4) {
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    white-space: nowrap !important;
}

/* Ціна */
#invoice-table th:nth-child(5),
#invoice-table td:nth-child(5) {
    width: 95px !important;
    min-width: 95px !important;
    max-width: 95px !important;
    white-space: nowrap !important;
}

#invoice-table td:nth-child(5) input {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-align: right !important;
}

/* ПДВ */
#invoice-table th:nth-child(6),
#invoice-table td:nth-child(6) {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    white-space: nowrap !important;
}

/* Сума */
#invoice-table th:nth-child(7),
#invoice-table td:nth-child(7) {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    white-space: nowrap !important;
    text-align: right !important;
    overflow: hidden !important;
    color: #222 !important;
    position: static !important;
}

#invoice-table td:nth-child(7) .invoice-sum-text {
    position: static !important;
    transform: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-align: right !important;
    color: #222 !important;
}

/* delete */
#invoice-table th:nth-child(8),
#invoice-table td:nth-child(8) {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    text-align: center !important;
}

@media print {
    body.invoice-printing #invoice-table {
        table-layout: fixed !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.invoice-printing #invoice-table td:nth-child(7),
    body.invoice-printing #invoice-table td:nth-child(7)[data-print-text] {
        width: 95px !important;
        min-width: 95px !important;
        max-width: 95px !important;
        text-align: right !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        color: #222 !important;
        position: static !important;
    }

    body.invoice-printing #invoice-table td:nth-child(7) .invoice-sum-text {
        position: static !important;
        transform: none !important;
        display: block !important;
        width: 100% !important;
        text-align: right !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        color: #222 !important;
    }
}


/* Dynamic invoice table widths:
   default name field 400px, can shrink to 370px only when sum grows */
#invoice-table {
    --invoice-name-cell-width: 418px;
    --invoice-name-field-width: 400px;
    --invoice-sum-cell-width: 150px;

    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

#invoice-table th,
#invoice-table td {
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

#invoice-table th:nth-child(1),
#invoice-table td:nth-child(1) {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    text-align: center !important;
}

#invoice-table th:nth-child(2),
#invoice-table td:nth-child(2) {
    width: var(--invoice-name-cell-width) !important;
    min-width: var(--invoice-name-cell-width) !important;
    max-width: var(--invoice-name-cell-width) !important;
    white-space: normal !important;
    overflow: hidden !important;
}

#invoice-table textarea.invoice-description-field {
    width: var(--invoice-name-field-width) !important;
    min-width: var(--invoice-name-field-width) !important;
    max-width: var(--invoice-name-field-width) !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

#invoice-table th:nth-child(3),
#invoice-table td:nth-child(3) {
    width: 62px !important;
    min-width: 62px !important;
    max-width: 62px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(4),
#invoice-table td:nth-child(4) {
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(5),
#invoice-table td:nth-child(5) {
    width: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
    white-space: nowrap !important;
}

#invoice-table td:nth-child(5) input {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-align: right !important;
}

#invoice-table th:nth-child(6),
#invoice-table td:nth-child(6) {
    width: 98px !important;
    min-width: 98px !important;
    max-width: 98px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(7),
#invoice-table td:nth-child(7) {
    width: var(--invoice-sum-cell-width) !important;
    min-width: var(--invoice-sum-cell-width) !important;
    max-width: var(--invoice-sum-cell-width) !important;
    white-space: nowrap !important;
    text-align: right !important;
    overflow: hidden !important;
    color: #222 !important;
    position: static !important;
}

#invoice-table td:nth-child(7) .invoice-sum-text {
    position: static !important;
    transform: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-align: right !important;
    color: #222 !important;
}

#invoice-table th:nth-child(8),
#invoice-table td:nth-child(8) {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    text-align: center !important;
}


/* FINAL dynamic width override: name 400px -> 370px, sum 150px -> 180px */
#invoice-table {
    --invoice-name-cell-width: 418px;
    --invoice-name-field-width: 400px;
    --invoice-sum-cell-width: 150px;
    table-layout: fixed !important;
    width: 100% !important;
    max-width: 100% !important;
}

#invoice-table th:nth-child(2),
#invoice-table td:nth-child(2) {
    width: var(--invoice-name-cell-width) !important;
    min-width: var(--invoice-name-cell-width) !important;
    max-width: var(--invoice-name-cell-width) !important;
}

#invoice-table textarea.invoice-description-field {
    width: var(--invoice-name-field-width) !important;
    min-width: var(--invoice-name-field-width) !important;
    max-width: var(--invoice-name-field-width) !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
}

#invoice-table th:nth-child(7),
#invoice-table td:nth-child(7) {
    width: var(--invoice-sum-cell-width) !important;
    min-width: var(--invoice-sum-cell-width) !important;
    max-width: var(--invoice-sum-cell-width) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-align: right !important;
}

#invoice-table td:nth-child(7) .invoice-sum-text {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-align: right !important;
}


/* FINAL table layout:
   name field 400px by default, shrinks to 370px only when amount needs space */
#invoice-table {
    --invoice-name-cell-width: 418px;
    --invoice-name-field-width: 400px;
    --invoice-sum-cell-width: 150px;

    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    overflow: hidden !important;
}

#invoice-table th,
#invoice-table td {
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

/* № */
#invoice-table th:nth-child(1),
#invoice-table td:nth-child(1) {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    text-align: center !important;
}

/* Найменування */
#invoice-table th:nth-child(2),
#invoice-table td:nth-child(2) {
    width: var(--invoice-name-cell-width) !important;
    min-width: var(--invoice-name-cell-width) !important;
    max-width: var(--invoice-name-cell-width) !important;
    white-space: normal !important;
    overflow: hidden !important;
}

#invoice-table textarea.invoice-description-field,
#invoice-table td:nth-child(2) input,
#invoice-table td:nth-child(2) textarea {
    width: var(--invoice-name-field-width) !important;
    min-width: var(--invoice-name-field-width) !important;
    max-width: var(--invoice-name-field-width) !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* Кіл-сть */
#invoice-table th:nth-child(3),
#invoice-table td:nth-child(3) {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
    white-space: nowrap !important;
    text-align: center !important;
}

/* Од. */
#invoice-table th:nth-child(4),
#invoice-table td:nth-child(4) {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    white-space: nowrap !important;
    text-align: center !important;
}

/* Ціна */
#invoice-table th:nth-child(5),
#invoice-table td:nth-child(5) {
    width: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
    white-space: nowrap !important;
}

#invoice-table td:nth-child(5) input {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-align: right !important;
}

/* ПДВ */
#invoice-table th:nth-child(6),
#invoice-table td:nth-child(6) {
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
    white-space: nowrap !important;
}

/* Сума */
#invoice-table th:nth-child(7),
#invoice-table td:nth-child(7) {
    width: var(--invoice-sum-cell-width) !important;
    min-width: var(--invoice-sum-cell-width) !important;
    max-width: var(--invoice-sum-cell-width) !important;
    white-space: nowrap !important;
    text-align: right !important;
    overflow: hidden !important;
    color: #222 !important;
    position: static !important;
}

#invoice-table td:nth-child(7) .invoice-sum-text {
    position: static !important;
    transform: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-align: right !important;
    color: #222 !important;
}

/* delete */
#invoice-table th:nth-child(8),
#invoice-table td:nth-child(8) {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    text-align: center !important;
}


/* FINAL: digit-based invoice table width */
#invoice-table {
    --invoice-name-cell-width: 418px;
    --invoice-name-field-width: 400px;
    --invoice-sum-cell-width: 150px;

    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    overflow: hidden !important;
}

#invoice-table.invoice-amount-wide-final {
    --invoice-name-cell-width: 388px;
    --invoice-name-field-width: 370px;
    --invoice-sum-cell-width: 180px;
}

#invoice-table th,
#invoice-table td {
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

#invoice-table th:nth-child(1),
#invoice-table td:nth-child(1) {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    text-align: center !important;
}

#invoice-table th:nth-child(2),
#invoice-table td:nth-child(2) {
    width: var(--invoice-name-cell-width) !important;
    min-width: var(--invoice-name-cell-width) !important;
    max-width: var(--invoice-name-cell-width) !important;
    white-space: normal !important;
    overflow: hidden !important;
}

#invoice-table textarea.invoice-description-field,
#invoice-table td:nth-child(2) input,
#invoice-table td:nth-child(2) textarea {
    width: var(--invoice-name-field-width) !important;
    min-width: var(--invoice-name-field-width) !important;
    max-width: var(--invoice-name-field-width) !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

#invoice-table th:nth-child(3),
#invoice-table td:nth-child(3) {
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;
    white-space: nowrap !important;
    text-align: center !important;
}

#invoice-table th:nth-child(4),
#invoice-table td:nth-child(4) {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    white-space: nowrap !important;
    text-align: center !important;
}

#invoice-table th:nth-child(5),
#invoice-table td:nth-child(5) {
    width: 84px !important;
    min-width: 84px !important;
    max-width: 84px !important;
    white-space: nowrap !important;
}

#invoice-table td:nth-child(5) input {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-align: right !important;
}

#invoice-table th:nth-child(6),
#invoice-table td:nth-child(6) {
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
    white-space: nowrap !important;
}

#invoice-table th:nth-child(7),
#invoice-table td:nth-child(7) {
    width: var(--invoice-sum-cell-width) !important;
    min-width: var(--invoice-sum-cell-width) !important;
    max-width: var(--invoice-sum-cell-width) !important;
    white-space: nowrap !important;
    text-align: right !important;
    overflow: hidden !important;
    color: #222 !important;
    position: static !important;
}

#invoice-table td:nth-child(7) .invoice-sum-text {
    position: static !important;
    transform: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-align: right !important;
    color: #222 !important;
}

#invoice-table th:nth-child(8),
#invoice-table td:nth-child(8) {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    text-align: center !important;
}


/* Print fix: hide textarea too, otherwise description is duplicated */
@media print {
    body.invoice-printing #invoice-table td[data-print-text] textarea,
    body.invoice-printing #invoice-table td[data-print-text] input,
    body.invoice-printing #invoice-table td[data-print-text] select {
        display: none !important;
    }
}


/* Tooltip fix: delete buttons near right edge show tooltip to the left */
#invoice-table .tooltip-btn,
#delete-invoice-btn,
#delete-buyer-btn {
    position: relative;
    overflow: visible !important;
}

#invoice-table td:last-child,
#invoice-table th:last-child {
    overflow: visible !important;
}

#invoice-table .tooltip-btn::after,
#delete-invoice-btn::after,
#delete-buyer-btn::after {
    left: auto !important;
    right: 0 !important;
    transform: none !important;
    white-space: nowrap !important;
    max-width: none !important;
    z-index: 99999 !important;
}

#invoice-table .tooltip-btn::before,
#delete-invoice-btn::before,
#delete-buyer-btn::before {
    left: auto !important;
    right: 12px !important;
    transform: none !important;
}


/* Tooltip fix: row delete tooltip opens to the left */
#invoice-table td.actions-cell {
    overflow: visible !important;
}

#invoice-table .actions-cell .tooltip-btn {
    position: relative !important;
    overflow: visible !important;
}

#invoice-table .actions-cell .tooltip-btn .tooltip-text {
    left: auto !important;
    right: 100% !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    margin-right: 8px !important;
    margin-left: 0 !important;
    white-space: nowrap !important;
    z-index: 99999 !important;
}


/* Tooltip fix: row delete tooltip opens top-left */
#invoice-table td.actions-cell {
    overflow: visible !important;
}

#invoice-table .actions-cell .delete-btn {
    position: relative !important;
    overflow: visible !important;
}

#invoice-table .actions-cell .delete-btn .tooltip-text {
    left: auto !important;
    right: 0 !important;
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    transform: none !important;
    margin: 0 !important;
    white-space: nowrap !important;
    z-index: 99999 !important;
}


/* Tooltip fix: row delete tooltip opens top-left */
#invoice-table td.actions-cell {
    overflow: visible !important;
}

#invoice-table .actions-cell .delete-btn {
    position: relative !important;
    overflow: visible !important;
}

#invoice-table .actions-cell .delete-btn .tooltip-text {
    left: auto !important;
    right: 0 !important;
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    transform: none !important;
    margin: 0 !important;
    white-space: nowrap !important;
    z-index: 99999 !important;
}


/* Blade include: site footer */
.site-footer {
    display: block !important;
    margin-top: 70px !important;
    padding-bottom: 35px !important;
    clear: both !important;
}

.site-footer__inner {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(120px, 1fr)) !important;
    gap: 32px !important;
    padding-top: 28px !important;
    border-top: 1px solid #ccc !important;
    font-size: 16px !important;
    align-items: start !important;
}

.site-footer__link {
    color: #222 !important;
    text-decoration: none !important;
    font-weight: 400 !important;
}

.site-footer__link:hover {
    color: #1c7bc9 !important;
    text-decoration: underline !important;
}

.site-footer__support {
    color: #555 !important;
    line-height: 1.45 !important;
}

.site-footer__support strong {
    color: #222 !important;
    font-weight: 500 !important;
}

.site-footer__support span {
    color: #555 !important;
}

@media (max-width: 767px) {
    .site-footer {
        margin-top: 40px !important;
    }

    .site-footer__inner {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        font-size: 14px !important;
    }
}

@media print {
    .site-footer {
        display: none !important;
    }
}


/* Direct simple footer */
.app-footer {
    display: flex !important;
    justify-content: space-between;
    gap: 24px;
    margin-top: 70px;
    padding: 28px 0 35px;
    border-top: 1px solid #ccc;
    font-size: 16px;
}

.app-footer__link {
    color: #222;
    text-decoration: none;
    font-weight: 400;
}

.app-footer__link:hover {
    color: #1c7bc9;
    text-decoration: underline;
}

.simple-page {
    padding: 50px 0;
}

.simple-page h1 {
    margin: 0 0 20px;
    font-size: 32px;
}

.simple-page p {
    font-size: 17px;
    line-height: 1.6;
}

.simple-page-back {
    color: #1c7bc9;
    text-decoration: none;
}

.simple-page-back:hover {
    text-decoration: underline;
}

@media (max-width: 767px) {
    .app-footer {
        flex-direction: column;
        gap: 12px;
        margin-top: 40px;
        font-size: 14px;
    }
}

@media print {
    .app-footer {
        display: none !important;
    }
}

/* Static footer pages */
.static-page {
    max-width: 820px;
    padding: 70px 0;
}

.static-page h1 {
    margin: 0 0 24px;
    font-size: 36px;
    line-height: 1.2;
}

.static-page p {
    font-size: 18px;
    line-height: 1.6;
}

.static-page-back {
    color: #1c7bc9;
    text-decoration: none;
    font-weight: 600;
}

.static-page-back:hover {
    text-decoration: underline;
}


@media (max-width: 767px) {


}


.code-label {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}


/* Header service modal */
.promo-button:hover {
    color: #1c7bc9;
    text-decoration: underline;
}

.service-info-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
}

.service-info-modal.is-open {
    display: block;
}

.service-info-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.service-info-modal__content {
    position: relative;
    max-width: 980px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    margin: 40px auto;
    padding: 42px 54px;
    border-radius: 18px;
    background: #111827;
    color: #dbe7f7;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
}

.service-info-modal__close {
    position: absolute;
    top: 22px;
    right: 28px;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.service-info-modal h2 {
    max-width: 760px;
    margin: 0 0 30px;
    font-size: 38px;
    line-height: 1.18;
    color: #62a8ff;
}

.service-info-modal h3 {
    display: inline-block;
    margin: 26px 0 18px;
    color: #ffffff;
    font-size: 28px;
}

.service-info-modal p,
.service-info-modal li {
    font-size: 20px;
    line-height: 1.75;
}

.service-info-modal strong,
.service-info-modal__accent {
    color: #b9d8ff;
    font-weight: 800;
}

.service-info-modal ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.service-info-modal li {
    position: relative;
    padding-left: 34px;
    margin-bottom: 10px;
}

.service-info-modal li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #a78bfa;
    font-weight: 800;
}

body.service-info-modal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    

    .service-info-modal__content {
        max-height: calc(100vh - 30px);
        margin: 15px;
        padding: 28px 22px;
        border-radius: 14px;
    }

    .service-info-modal h2 {
        font-size: 27px;
    }

    .service-info-modal h3 {
        font-size: 22px;
    }

    .service-info-modal p,
    .service-info-modal li {
        font-size: 16px;
        line-height: 1.6;
    }
}

@media print {
    .promo-button,
    .service-info-modal {
        display: none !important;
    }
}


/* Payment modal always centered */
.payment-overlay {
    position: fixed !important;
    inset: 0 !important;
    box-sizing: border-box !important;
    padding: 24px 15px !important;
    overflow: hidden !important;
}

.payment-overlay[style*="display: block"],
.payment-overlay[style*="display:block"],
.payment-overlay[style*="display: flex"],
.payment-overlay[style*="display:flex"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}



/* Accessibility fixes */
#open-payment-modal.payment-header-btn,
.payment-header-btn {
    background: #92400e !important;
    color: #ffffff !important;
    border-color: #78350f !important;
}

button[onclick="newInvoice()"] {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
}

button:not(.header-export-btn)[onclick="printInvoice()"] {
    background: #16a34a !important;
    color: #ffffff !important;
    border-color: #16a34a !important;
}

#add-buyer-btn {
    background: #075985 !important;
    color: #ffffff !important;
    border-color: #075985 !important;
}




/* Accessibility button hover states */
button:not(.header-export-btn)[onclick="printInvoice()"],
button[onclick="newInvoice()"],
#add-buyer-btn {
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

button:not(.header-export-btn)[onclick="printInvoice()"]:hover {
    background: #15803d !important;
    border-color: #15803d !important;
    box-shadow: 0 8px 18px rgba(21, 128, 61, 0.22);
}

button:not(.header-export-btn)[onclick="printInvoice()"]:active {
    background: #166534 !important;
    border-color: #166534 !important;
    box-shadow: none;
}

button[onclick="newInvoice()"]:hover,
#add-buyer-btn:hover {
    background: #075985 !important;
    border-color: #075985 !important;
    box-shadow: 0 8px 18px rgba(7, 89, 133, 0.22);
}

button[onclick="newInvoice()"]:active,
#add-buyer-btn:active {
    background: #0369a1 !important;
    border-color: #0369a1 !important;
    box-shadow: none;
}


/* Final button colors */
#open-payment-modal.payment-header-btn,
.payment-header-btn {
    background: #ff6c00 !important;
    color: #ffffff !important;
    border-color: #ff6c00 !important;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

#open-payment-modal.payment-header-btn:hover,
.payment-header-btn:hover {
    background: #e85f00 !important;
    border-color: #e85f00 !important;
    box-shadow: 0 8px 18px rgba(255, 108, 0, 0.24);
}

#open-payment-modal.payment-header-btn:active,
.payment-header-btn:active {
    background: #cc5200 !important;
    border-color: #cc5200 !important;
    box-shadow: none;
}

#add-buyer-btn {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

#add-buyer-btn:hover {
    background: #075985 !important;
    border-color: #075985 !important;
    box-shadow: 0 8px 18px rgba(7, 89, 133, 0.22);
}

#add-buyer-btn:active {
    background: #0369a1 !important;
    border-color: #0369a1 !important;
    box-shadow: none;
}


/* Empty invoice date visibility */
#invoice-date:empty {
    display: none !important;
}

#invoice-date:focus,
#invoice-date:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}


/* Payment modal green focus only */
.payment-content input:focus,
.payment-content input:focus-visible,
.payment-content textarea:focus,
.payment-content textarea:focus-visible,
.payment-content select:focus,
.payment-content select:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border-color: #48b34e !important;
}

.payment-content input:focus + label,
.payment-content textarea:focus + label,
.payment-content select:focus + label {
    color: #48b34e !important;
}

.payment-content input:invalid,
.payment-content input:invalid:focus,
.payment-content input:invalid:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.payment-content input:required:invalid {
    box-shadow: none !important;
}


/* Remove ugly black focus from form fields */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: none !important;
}


/* Invoice number width */
#invoice-number {
    width: 50%;
    max-width: 100%;
}


/* Invoice number mobile width */
@media (max-width: 820px) {
    #invoice-number {
        width: 100% !important;
        max-width: 100% !important;
    }
}


/* Remove black focus outline everywhere */
*:focus-visible,
*:focus {
    outline: none !important;
}


/* Phone prefix mask */
.phone-group {
    position: relative;
}


/* Save buyer button green */
#save-buyer-btn {
    background: #16a34a !important;
    color: #ffffff !important;
    border-color: #16a34a !important;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

#save-buyer-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.25);
}


#save-buyer-btn:not(:disabled):hover {
    background: #15803d !important;
    border-color: #15803d !important;
    box-shadow: 0 8px 18px rgba(21, 128, 61, 0.22);
}

#save-buyer-btn:not(:disabled):active {
    background: #166534 !important;
    border-color: #166534 !important;
    box-shadow: none;
}


/* Add buyer button save mode green */
#add-buyer-btn[data-mode="save"] {
    background: #16a34a !important;
    color: #ffffff !important;
    border-color: #16a34a !important;
}

#add-buyer-btn[data-mode="save"]:hover {
    background: #15803d !important;
    border-color: #15803d !important;
    box-shadow: 0 8px 18px rgba(21, 128, 61, 0.22);
}

#add-buyer-btn[data-mode="save"]:active {
    background: #166534 !important;
    border-color: #166534 !important;
    box-shadow: none;
}


/* Compact custom selects: archive, buyer, year */
.compact-select-native-hidden {
    display: none !important;
}

.compact-dropdown {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    flex: 0 0 auto;
}

.compact-dropdown-toggle {
    width: 100%;
    padding: 0 34px 0 10px;
    border: 1px solid #cae2fc;
    background: #ffffff;
    color: #111827;
    text-align: left;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.compact-dropdown-toggle::after {
    content: "⌄";
    position: absolute;
    right: 10px;
    top: 40%;
    transform: translateY(-52%);
    font-size: 16px;
    line-height: 1;
}

.compact-dropdown.has-selected-value .compact-dropdown-toggle {
    padding-right: 10px;
}

.compact-dropdown.has-selected-value .compact-dropdown-toggle::after {
    display: none;
}

.compact-dropdown-menu {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 2px);
    z-index: 1000;
    width: max-content;
    min-width: 100%;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #d7deea;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    box-sizing: border-box;
}

.compact-dropdown.is-open .compact-dropdown-menu {
    display: block;
}

.compact-dropdown-item {
    display: block;
    width: 100%;
    min-width: 100%;
    padding: 0 12px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #222222;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    box-sizing: border-box;
}

.compact-dropdown-item:hover,
.compact-dropdown-item.is-selected {
    background: #0284c7;
    color: #ffffff;
}



/* Year dropdown width fix */
.year-filter-dropdown {
    min-width: 100px;
}

.year-filter-dropdown .compact-dropdown-toggle {
    min-width: 100px;
}

.year-filter-dropdown .compact-dropdown-menu {
    min-width: 100px;
}








/* Cabinet simple red delete x */
.media-delete-form {
    display: none !important;
}

button.media-delete-btn,
.hint button.media-delete-btn,
.media-delete-btn {
    all: unset !important;
    display: inline-block !important;
    margin-left: 8px !important;
    color: #dc2626 !important;
    font-size: 26px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    vertical-align: -3px !important;
    font-family: Arial, sans-serif !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

button.media-delete-btn:hover,
.hint button.media-delete-btn:hover,
.media-delete-btn:hover {
    color: #991b1b !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Sticky close button inside service info modal */
.service-info-modal__content {
    position: relative;
}

.service-info-modal__content > .close-btn[data-service-info-close] {
    position: sticky;
    top: 12px;
    z-index: 30;
    float: none;
    margin-left: auto;
    margin-right: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}

/* Soft validation messages for requisites */
.requisites-validation-warning {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.requisites-validation-message {
    display: none;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.35;
    color: #b45309;
}

/* Compact validation message inside registration fields */
.payment-group {
    position: relative;
}

.payment-group .requisites-validation-message--inside {
    position: absolute;
    bottom: 5px;
    margin: 0;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
    font-size: 10.5px;
    line-height: 1.15;
    color: #ff9b06;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payment-group input.requisites-validation-warning {
    padding-bottom: 18px;
}


.share-invoice-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin: 0;
}

.share-invoice-icon {
    width: 26px;
    height: 26px;
    display: block;
}


@media screen and (max-width: 768px) {
    #invoice-table,
    #invoice-table tbody {
        display: block;
        width: 100%;
        max-width: 100%;
        border: 0;
        box-sizing: border-box;
        overflow: visible;
    }

    #invoice-table thead {
        display: none;
    }

    #invoice-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 14px 12px;
        width: 100%;
        max-width: 100%;
        margin: 0 0 18px;
        padding: 18px;
        border: 1px solid #cae2fc;
        border-radius: 14px;
        background: #ffffff;
        box-shadow: 0 4px 16px rgba(30, 155, 255, 0.08);
        box-sizing: border-box;
        overflow: hidden;
    }

    #invoice-table tbody td {
        display: block;
        width: auto;
        min-width: 0;
        max-width: 100%;
        padding: 0;
        border: 0;
        background: transparent;
        box-sizing: border-box;
    }

    #invoice-table tbody td::before {
        display: block;
        margin: 0 0 7px;
        color: #777777;
        font-size: 14px;
        line-height: 1.2;
        font-weight: 500;
    }

    #invoice-table tbody td:nth-child(1) {
        grid-column: 1 / 3;
        grid-row: 1;
        display: flex;
        align-items: center;
        gap: 10px;
        color: #1e9bff;
        font-size: 18px;
        font-weight: 700;
    }

    #invoice-table tbody td:nth-child(1)::before {
        display: none;
    }

    #invoice-table tbody td:nth-child(8) {
        grid-column: 3 / 4;
        grid-row: 1;
        text-align: right;
    }

    #invoice-table tbody td:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    #invoice-table tbody td:nth-child(2)::before {
        content: "Найменування";
    }

    #invoice-table tbody td:nth-child(3) {
        grid-column: 1 / 2;
        grid-row: 3;
    }

    #invoice-table tbody td:nth-child(3)::before {
        content: "Кіл-сть";
    }

    #invoice-table tbody td:nth-child(4) {
        grid-column: 2 / 3;
        grid-row: 3;
    }

    #invoice-table tbody td:nth-child(4)::before {
        content: "Од.";
    }

    #invoice-table tbody td:nth-child(5) {
        grid-column: 3 / 4;
        grid-row: 3;
    }

    #invoice-table tbody td:nth-child(5)::before {
        content: "Ціна";
    }

    #invoice-table tbody td:nth-child(6) {
        grid-column: 1 / -1;
        grid-row: 4;
    }

    #invoice-table tbody td:nth-child(6)::before {
        content: "ПДВ";
    }

    #invoice-table tbody td:nth-child(7) {
        grid-column: 1 / -1;
        grid-row: 5;
        padding-top: 12px;
        border-top: 3px solid #1e9bff;
        text-align: right;
    }

    #invoice-table tbody td:nth-child(7)::before {
        content: "Сума";
        text-align: left;
    }

    #invoice-table input,
    #invoice-table select,
    #invoice-table textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
        font-size: 16px;
    }

    #invoice-table tbody td:nth-child(2) input,
    #invoice-table tbody td:nth-child(2) textarea,
    #invoice-table tbody td:nth-child(2) [contenteditable="true"],
    #invoice-table .item-name {
        display: block;
        width: 100% !important;
        min-height: 58px;
        padding: 12px 14px;
        border: 1px solid #d7e8fb !important;
        border-radius: 12px;
        background: #ffffff !important;
        color: #222222;
        line-height: 1.35;
        box-sizing: border-box;
    }

    #invoice-table tbody td:nth-child(2) input:empty,
    #invoice-table tbody td:nth-child(2) textarea:empty {
        min-height: 58px;
    }

    #invoice-table tbody td:nth-child(3) input,
    #invoice-table tbody td:nth-child(5) input {
        height: 46px;
        padding: 8px 10px;
        border: 1px solid #d7e8fb !important;
        border-radius: 12px;
        background: #ffffff !important;
        text-align: center;
    }

    #invoice-table tbody td:nth-child(4) input,
    #invoice-table tbody td:nth-child(4) select {
        height: 46px;
        padding: 8px 10px;
        border: 1px solid #d7e8fb !important;
        border-radius: 12px;
        background-color: #ffffff !important;
        text-align: center;
    }

    #invoice-table tbody td:nth-child(6) select {
        height: 48px;
        padding: 8px 42px 8px 14px;
        border: 1px solid #d7e8fb !important;
        border-radius: 12px;
        background-color: #ffffff !important;
        font-size: 17px;
    }

    #invoice-table tbody td:nth-child(7) {
        font-size: 18px;
        font-weight: 700;
        color: #222222;
    }

    #invoice-table .delete-row,
    #invoice-table .delete-item,
    #invoice-table .remove-item,
    #invoice-table button[class*="delete"],
    #invoice-table button[class*="remove"] {
        width: 38px;
        height: 38px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #5bbbd8;
        font-size: 22px;
        line-height: 38px;
        text-align: center;
    }
}


@media screen and (max-width: 768px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
        -webkit-text-size-adjust: 100%;
    }

    #invoice-table {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        border: 0 !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }

    #invoice-table thead {
        display: none !important;
    }

    #invoice-table tbody {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    #invoice-table tbody tr {
        display: grid !important;
        grid-template-columns: 64px minmax(0, 1fr) 88px !important;
        gap: 16px 8px !important;
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        margin: 0 auto 18px !important;
        padding: 14px !important;
        border: 1px solid #cfe6ff !important;
        border-radius: 18px !important;
        background: #ffffff !important;
        box-shadow: 0 8px 24px rgba(30, 155, 255, 0.08) !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    #invoice-table tbody td {
        display: block !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    #invoice-table tbody td::before {
        display: block !important;
        margin: 0 0 8px !important;
        color: #687386 !important;
        font-size: 15px !important;
        line-height: 1.2 !important;
        font-weight: 800 !important;
    }

    #invoice-table tbody td:nth-child(1) {
        grid-column: 1 / 2 !important;
        grid-row: 1 !important;
        color: #1e9bff !important;
        font-size: 28px !important;
        line-height: 42px !important;
        font-weight: 800 !important;
    }

    #invoice-table tbody td:nth-child(1)::before,
    #invoice-table tbody td:nth-child(8)::before {
        display: none !important;
    }

    #invoice-table tbody td:nth-child(8) {
        grid-column: 3 / 4 !important;
        grid-row: 1 !important;
        text-align: right !important;
    }

    #invoice-table tbody td:nth-child(2) {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        overflow: visible !important;
    }

    #invoice-table tbody td:nth-child(2)::before {
        content: "Найменування";
    }

    #invoice-table tbody td:nth-child(2) input {
        display: none !important;
    }

    #invoice-table tbody td:nth-child(2) textarea.invoice-description-field {
        display: block !important;
        width: 100% !important;
        min-height: 92px !important;
        margin: 0 !important;
        padding: 14px 16px !important;
        border: 1px solid #d7e8fb !important;
        border-radius: 14px !important;
        background: #ffffff !important;
        color: #222222 !important;
        font-size: 17px !important;
        line-height: 1.35 !important;
        box-sizing: border-box !important;
        resize: vertical !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    #invoice-table tbody td:nth-child(3) {
        grid-column: 1 / 2 !important;
        grid-row: 3 !important;
    }

    #invoice-table tbody td:nth-child(3)::before {
        content: "Кількість";
    }

    #invoice-table tbody td:nth-child(5) {
        grid-column: 2 / 3 !important;
        grid-row: 3 !important;
    }

    #invoice-table tbody td:nth-child(5)::before {
        content: "Ціна";
    }

    #invoice-table tbody td:nth-child(6) {
        grid-column: 3 / 4 !important;
        grid-row: 3 !important;
    }

    #invoice-table tbody td:nth-child(6)::before {
        content: "ПДВ";
    }

    #invoice-table tbody td:nth-child(4) {
        display: none !important;
    }

    #invoice-table tbody td:nth-child(3) input,
    #invoice-table tbody td:nth-child(5) input,
    #invoice-table tbody td:nth-child(6) select {
        width: 100% !important;
        height: 54px !important;
        min-width: 0 !important;
        border: 1px solid #d7e8fb !important;
        border-radius: 14px !important;
        background-color: #ffffff !important;
        color: #222222 !important;
        font-size: 16px !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    #invoice-table tbody td:nth-child(3) input {
        padding: 8px 6px !important;
    }

    #invoice-table tbody td:nth-child(5) input {
        padding: 8px 8px !important;
        font-size: 17px !important;
    }

    #invoice-table tbody td:nth-child(6) select {
        padding: 8px 18px 8px 8px !important;
        font-size: 14px !important;
        text-align: left !important;
    }

    #invoice-table tbody td:nth-child(7) {
        grid-column: 1 / -1 !important;
        grid-row: 4 !important;
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) !important;
        align-items: baseline !important;
        gap: 12px !important;
        margin-top: 2px !important;
        padding-top: 16px !important;
        border-top: 3px solid #1e9bff !important;
        color: #111111 !important;
        font-size: 28px !important;
        line-height: 1.15 !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-align: right !important;
    }

    #invoice-table tbody td:nth-child(7)::before {
        content: "Сума";
        margin: 0 !important;
        color: #687386 !important;
        font-size: 24px !important;
        line-height: 1.15 !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
    }

    #invoice-table tbody td:nth-child(7) .invoice-sum-text {
        display: block !important;
        min-width: 0 !important;
        white-space: nowrap !important;
        text-align: right !important;
        overflow: hidden !important;
    }

    #invoice-table tbody td:nth-child(8) button,
    #invoice-table .actions-cell button,
    #invoice-table button[class*="delete"],
    #invoice-table button[class*="remove"] {
        width: 42px !important;
        height: 42px !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        color: #5bbbd8 !important;
        font-size: 24px !important;
        line-height: 42px !important;
        text-align: center !important;
    }
}

@media screen and (max-width: 390px) {
    #invoice-table tbody tr {
        grid-template-columns: 60px minmax(0, 1fr) 82px !important;
        gap: 14px 7px !important;
        padding: 12px !important;
    }

    #invoice-table tbody td:nth-child(7) {
        font-size: 26px !important;
    }
}

@media screen and (max-width: 768px) {
    #invoice-table,
    #invoice-table tbody {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }

    #invoice-table tbody tr {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 18px !important;
        padding: 18px !important;
        box-sizing: border-box !important;
        display: grid !important;
        grid-template-columns: 76px minmax(0, 1fr) 118px !important;
        gap: 18px 12px !important;
        overflow: hidden !important;
    }

    #invoice-table tbody td {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    #invoice-table tbody td:nth-child(2) {
        grid-column: 1 / -1 !important;
        overflow: visible !important;
    }

    #invoice-table tbody td:nth-child(2) textarea.invoice-description-field {
        width: 100% !important;
        min-height: 92px !important;
        padding: 14px 16px !important;
        font-size: 17px !important;
        line-height: 1.35 !important;
        box-sizing: border-box !important;
    }

    #invoice-table tbody td:nth-child(3) {
        grid-column: 1 / 2 !important;
    }

    #invoice-table tbody td:nth-child(5) {
        grid-column: 2 / 3 !important;
    }

    #invoice-table tbody td:nth-child(6) {
        grid-column: 3 / 4 !important;
    }

    #invoice-table tbody td:nth-child(3)::before,
    #invoice-table tbody td:nth-child(5)::before,
    #invoice-table tbody td:nth-child(6)::before {
        font-size: 15px !important;
        margin-bottom: 8px !important;
        white-space: nowrap !important;
    }

    #invoice-table tbody td:nth-child(3) input,
    #invoice-table tbody td:nth-child(5) input,
    #invoice-table tbody td:nth-child(6) select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 54px !important;
        box-sizing: border-box !important;
    }

    #invoice-table tbody td:nth-child(5) input {
        font-size: 18px !important;
        padding: 8px 10px !important;
    }

    #invoice-table tbody td:nth-child(6) select {
        font-size: 15px !important;
        padding: 8px 24px 8px 10px !important;
    }

    #invoice-table tbody td:nth-child(7) {
        grid-column: 1 / -1 !important;
        display: flex !important;
        align-items: baseline !important;
        justify-content: space-between !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-top: 16px !important;
        border-top: 3px solid #1e9bff !important;
        overflow: visible !important;
        white-space: nowrap !important;
        font-size: 28px !important;
        line-height: 1.15 !important;
        font-weight: 800 !important;
        text-align: right !important;
    }

    #invoice-table tbody td:nth-child(7)::before {
        content: "Сума";
        flex: 0 0 auto !important;
        margin: 0 !important;
        color: #687386 !important;
        font-size: 24px !important;
        font-weight: 800 !important;
        line-height: 1.15 !important;
    }

    #invoice-table tbody td:nth-child(7) .invoice-sum-text {
        flex: 1 1 auto !important;
        display: block !important;
        min-width: 0 !important;
        max-width: none !important;
        width: auto !important;
        text-align: right !important;
        overflow: visible !important;
        white-space: nowrap !important;
    }
}

@media screen and (max-width: 390px) {
    #invoice-table tbody tr {
        grid-template-columns: 72px minmax(0, 1fr) 108px !important;
        gap: 16px 10px !important;
        padding: 16px !important;
    }

    #invoice-table tbody td:nth-child(7) {
        font-size: 26px !important;
    }
}

@media screen and (max-width: 768px) {
    #invoice-table tbody tr {
        grid-template-columns: 78px minmax(0, 1fr) 112px !important;
        column-gap: 14px !important;
        padding: 18px 20px !important;
    }

    #invoice-table tbody td:nth-child(8) {
        grid-column: 3 / 4 !important;
        justify-self: end !important;
        align-self: start !important;
        width: 44px !important;
        max-width: 44px !important;
        overflow: visible !important;
        text-align: right !important;
    }

    #invoice-table tbody td:nth-child(8) button,
    #invoice-table .actions-cell button,
    #invoice-table button[class*="delete"],
    #invoice-table button[class*="remove"] {
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    #invoice-table tbody td:nth-child(2) {
        padding-right: 0 !important;
    }

    #invoice-table tbody td:nth-child(2) textarea.invoice-description-field {
        padding: 14px 22px 14px 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    #invoice-table tbody td:nth-child(3) {
        grid-column: 1 / 2 !important;
    }

    #invoice-table tbody td:nth-child(5) {
        grid-column: 2 / 3 !important;
    }

    #invoice-table tbody td:nth-child(6) {
        grid-column: 3 / 4 !important;
        justify-self: stretch !important;
    }

    #invoice-table tbody td:nth-child(5) input {
        width: 100% !important;
        font-size: 18px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    #invoice-table tbody td:nth-child(6) select {
        width: 100% !important;
        font-size: 15px !important;
        padding-left: 10px !important;
        padding-right: 24px !important;
    }

    #invoice-table tbody td:nth-child(7) {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

@media screen and (max-width: 390px) {
    #invoice-table tbody tr {
        grid-template-columns: 70px minmax(0, 1fr) 104px !important;
        column-gap: 10px !important;
        padding: 16px 18px !important;
    }

    #invoice-table tbody td:nth-child(5) input {
        font-size: 17px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    #invoice-table tbody td:nth-child(6) select {
        font-size: 14px !important;
        padding-left: 8px !important;
        padding-right: 20px !important;
    }
}

@media screen and (max-width: 768px) {
    #invoice-table tbody tr {
        grid-template-columns: 64px minmax(0, 1fr) 108px !important;
        column-gap: 10px !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    #invoice-table tbody td:nth-child(3),
    #invoice-table tbody td:nth-child(5),
    #invoice-table tbody td:nth-child(6) {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        justify-self: stretch !important;
        align-self: start !important;
        box-sizing: border-box !important;
    }

    #invoice-table tbody td:nth-child(3) {
        grid-column: 1 / 2 !important;
    }

    #invoice-table tbody td:nth-child(5) {
        grid-column: 2 / 3 !important;
    }

    #invoice-table tbody td:nth-child(6) {
        grid-column: 3 / 4 !important;
    }

    #invoice-table tbody td:nth-child(3)::before,
    #invoice-table tbody td:nth-child(5)::before,
    #invoice-table tbody td:nth-child(6)::before {
        display: block !important;
        width: 100% !important;
        margin-bottom: 8px !important;
        white-space: nowrap !important;
        overflow: visible !important;
    }

    #invoice-table tbody td:nth-child(5)::before {
        padding-left: 4px !important;
    }

    #invoice-table tbody td:nth-child(3) input,
    #invoice-table tbody td:nth-child(5) input,
    #invoice-table tbody td:nth-child(6) select {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    #invoice-table tbody td:nth-child(3) input {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    #invoice-table tbody td:nth-child(5) input {
        padding-left: 10px !important;
        padding-right: 10px !important;
        font-size: 18px !important;
        text-align: center !important;
    }

    #invoice-table tbody td:nth-child(6) select {
        padding-left: 8px !important;
        padding-right: 20px !important;
        font-size: 14px !important;
        text-align: left !important;
    }

    #invoice-table tbody td:nth-child(2) textarea.invoice-description-field {
        padding-right: 28px !important;
    }
}

@media screen and (max-width: 390px) {
    #invoice-table tbody tr {
        grid-template-columns: 58px minmax(0, 1fr) 98px !important;
        column-gap: 8px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    #invoice-table tbody td:nth-child(5) input {
        font-size: 17px !important;
    }

    #invoice-table tbody td:nth-child(6) select {
        font-size: 13px !important;
        padding-right: 16px !important;
    }
}

@media screen and (max-width: 768px) {
    #invoice-table tbody td:nth-child(2) {
        padding-right: 0 !important;
        overflow: hidden !important;
    }

    #invoice-table tbody td:nth-child(2) textarea.invoice-description-field {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 16px !important;
        padding-right: 34px !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        white-space: pre-wrap !important;
        overflow-wrap: break-word !important;
        word-break: normal !important;
    }
}

@media screen and (max-width: 768px) {
    #invoice-table tbody tr {
        grid-template-columns: 84px minmax(0, 1fr) 98px !important;
        column-gap: 10px !important;
    }

    #invoice-table tbody td:nth-child(3)::before {
        content: "Кількість" !important;
        font-size: 14px !important;
        letter-spacing: -0.3px !important;
        white-space: nowrap !important;
        overflow: visible !important;
        padding: 0;
    }

    #invoice-table tbody td:nth-child(5)::before,
    #invoice-table tbody td:nth-child(6)::before {
        font-size: 15px !important;
        white-space: nowrap !important;
        overflow: visible !important;
    }

    #invoice-table tbody td:nth-child(2) textarea.invoice-description-field {
        padding: 14px 40px 14px 16px !important;
        white-space: pre-wrap !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        line-break: anywhere !important;
        overflow-x: hidden !important;
    }
}

@media screen and (max-width: 390px) {
    #invoice-table tbody tr {
        grid-template-columns: 80px minmax(0, 1fr) 92px !important;
        column-gap: 8px !important;
    }

    #invoice-table tbody td:nth-child(3)::before {
        font-size: 13px !important;
        letter-spacing: -0.5px !important;
    }
}

@media screen and (max-width: 768px) {
    #invoice-table tbody td:nth-child(2) {
        overflow: hidden !important;
        padding-right: 0 !important;
    }

    #invoice-table tbody td:nth-child(2) textarea.invoice-description-field {
        display: block !important;
        width: calc(100% - 68px) !important;
        max-width: calc(100% - 28px) !important;
        min-width: 0 !important;
        margin-right: 28px !important;
        padding: 14px 16px !important;
        box-sizing: border-box !important;
        white-space: pre-wrap !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        overflow-x: hidden !important;
    }
}

@media screen and (max-width: 390px) {
    #invoice-table tbody td:nth-child(2) textarea.invoice-description-field {
        width: calc(100% - 34px) !important;
        max-width: calc(100% - 34px) !important;
        margin-right: 34px !important;
    }
}
