:root {
	--accent: #1582b8;
}

body {
	/*background: url('/images/textures/grain.png');*/
	height: 100vh;
	display: flex;
	flex-direction: column;
}

body > .container {
	flex-grow: 1;
	padding-top: 20px;
}

[hidden] {
	display: none;
}

.relative {
	position: relative;
}

.bold {
	font-weight: bold;
}

.form-signin {
	max-width: 300px;
	padding: 19px 29px 29px;
	margin: 0 auto 20px;
	background-color: #fff;
	border: 1px solid #e5e5e5;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
	-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
	box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
	margin-bottom: 10px;
}
.form-signin input[type="text"],
.form-signin input[type="password"] {
	font-size: 16px;
	height: auto;
	margin-bottom: 15px;
	padding: 7px 9px;
}


.mt-10 {
	margin-top: 10px;
}
.mb-10 {
	margin-bottom: 10px;
}

table.fixed.table {
	table-layout: fixed;
	width: 100%;
}

.centered {
	text-align: center !important;
}

.right {
	text-align: right !important;
}

td.value {
	/*font-family: var(--font-mono);*/
	text-align: center;
}


/* Navbar calendar */

.cal-widget {
  position: relative;
}
.cal-toggle {
  border-radius: 8px;
  background: rgb(255 255 255 / 0.1);
  color: #fff;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  font-family: var(--font-condensed);
  font-size: 0.82rem;
}
.cal-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #f0f0f0;
  color: var(--text);
  border: 1px solid #dcdcdd;
  border-radius: 10px;
  padding: 0.5rem;
  width: min(288px, 92vw);
  z-index: 60;
  box-shadow: 0 12px 40px rgb(31 22 53 / 0.15);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.cal-weekdays {
  font-size: 0.7rem;
  color: var(--muted);
}
.cal-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  color: inherit;
  padding: 0.25rem;
  border-radius: 6px;
  font-size: 0.8rem;
}
.cal-day:hover {
  background: var(--accent);
  color: white;
}
html[data-theme="dark"] .cal-day:hover {
  background: #2f2550;
}
.cal-day.is-current {
	background: var(--accent);
	color: white;
	font-weight: bold;
}
.cal-day.is-today {
	background: #b73530;
	color: white;
	font-weight: bold;
}
.cal-empty {
  min-height: 1.75rem;
}

.caret {
	border-top-color: #555 !important;
}

.section {
	position: relative;
	margin: 15px 0;
	padding: 20px;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
}

.section.with-title {
	padding-top: 19px;
}

.section.with-title::after {
	content: attr(data-title);
	position: absolute;
	top: -1px;
	left: -1px;
	padding: 3px 7px;
	font-size: 12px;
	font-weight: bold;
	background-color: #f5f5f5;
	border: 1px solid #ddd;
	color: #9da0a4;
	-webkit-border-radius: 4px 0 4px 0;
	-moz-border-radius: 4px 0 4px 0;
	border-radius: 4px 0 4px 0;
}

.full-width {
	width: 100%;
}

.mono {
	font-family: var(--font-mono);
}

.colorPicker {
	min-width: 60px !Important;
	height: 30px !important;
}

.data-table tr td {
	padding: 0 2px;
}

.remove-meal {
	margin-top: -12px !important;
}

table td > div.controls {
	visibility: hidden;
}
table tr:hover td > div.controls {
	visibility: visible;
}

td.product-image {
	width: 1%;
	white-space: nowrap;
	padding: 0;
	text-align: center;	
	vertical-align: middle;
}

td.product-image .empty-icon {
	cursor: pointer;
}

td.product-image .preview-wrapper {
	display: inline-block;
	width: 32px;
	height: 32px;
	min-width: 32px;
	min-height: 32px;
}

/* Контейнер для иконки */
.preview-wrapper {
	position: relative;
	display: inline-block;
	cursor: pointer;
}

/* Скрываем большую картинку и настраиваем её появление */
.preview-wrapper .large-preview {
	opacity: 0;
	visibility: hidden;
	position: absolute;

	/* Позиционируем по центру сверху от иконки */
	bottom: 125%; 
	left: 50%;
	transform: translateX(-50%);

	/* Ограничиваем размер всплывающего окна */
	max-width: 300px; 
	max-height: 300px;
	object-fit: contain;

	/* Красивые эффекты (тень, рамка, скругление) */
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-shadow: 0 4px 15px rgba(0,0,0,0.2);
	z-index: 999; /* Чтобы картинка была поверх всех строк таблицы */

	/* Плавное появление */
	transition: opacity 0.2s ease, visibility 0.2s;
}

/* Показываем большую картинку при наведении на обертку */
.preview-wrapper:hover .large-preview {
	opacity: 1;
	visibility: visible;
}

.ajs-content > input.form-control {
	width: 100%;
}

table.table tfoot tr,
table.table thead tr
{
	background: #f5f5f5;
}

#day-meals-controls {
	display: flex;
	justify-content: space-between;
	gap: 10px;
}

td > input:not([type="checkbox"]) {
	margin: 0 !important;
	width: calc(100% - 14px) !important;
}

.mass-input {
	padding: 2px 6px !important;
	font-size: 13px !important;
}

table.meal-table,
table.recipe-table {
	font-size: 16px;
}
table.meal-table td,
table.recipe-table td {
	vertical-align: inherit;
	white-space: nowrap;
}
table.meal-table .mono,
table.recipe-table .mono {
	text-align: center;
	width: 1%;
}
table.meal-table tr.footer-pct,
table.recipe-table tr.footer-pct {
	font-size: 12px;
}

.meal-entry-row td:first-child {
	max-width: 100px !important;
}

.js-remove-meal-entry {
	cursor: pointer;
}

.mass-input.changed {
	border-color: green !important;
}
.mass-input.changed:focus {
	border-color: green !important;
}

#day-weight {
	font-size: 22px;
	margin-top: 4px;
	cursor: pointer;
}

.meal-over-time-container {
	text-align: right;
	cursor: pointer;
}

.meal-over-time-header {
	font-weight: bold;
	font-size: 20px;
}

/* Базовые стили для аккуратного UI Time-Picker */
.time-picker-container .time-label {
	font-size: 14px;
	font-weight: 500;
	color: #333;
}

.time-picker-container .input-wrapper {
	position: relative;
}

#time-input.invalid {
	border-color: #dc3545;
	background-color: #fff8f8;
}

.time-picker-container .error-message {
	display: none;
	color: #dc3545;
	font-size: 12px;
	margin-top: 4px;
}

#time-input.invalid + .error-message {
	display: block;
}

.meal-block:not(:first-child) {
	margin-top: 80px;
}

.footer {
	text-align: center;
	padding: 30px 0;
	margin-top: 70px;
	border-top: 1px solid #e5e5e5;
	background-color: #f5f5f5;
}

.tab-content {
	overflow: visible !important;
}

.progress-white.progress-striped .bar, .progress-striped .bar-white {
	background-color: #cdcdcd;
}

.progress-yellow.progress-striped .bar, .progress-striped .bar-yellow {
	background-color: #ded65b;
}

.norm-table {
	margin-bottom: 0;
}

.norm-table tr.bold.success {
	font-size: 16px;
}

td.entry-recipe {
	color: #00615d;
}

.table thead th {
	vertical-align: middle;
}

.table-scroll > .background {
	position: absolute;
	width: 100%;
	height: 100%;
	z-index: 2;
	user-select: none;
	pointer-events: none;
}

@media (max-width: 992px) {
	body > .container {
		width: calc(100% - 20px);
	}
}

.sticky-norms {
	position: fixed;
	z-index: 999;
	width: 100%;
	display: inline-table;
	left: 0;
	top: 0;
}

.sticky-norms > td:first-child {
	display: none;
}

.norm-table .progress {
	margin-bottom: 0;
}

.progress-label {
	position: absolute;
	width: 100%;
	left: 0;
	text-shadow: 1px 1px 1px #e7e7e7;
}