/* ─── Utilities ─────────────────────────────────────────────────────────────
   Однозначные хелперы; заменяют самые частые inline-стили.
   ────────────────────────────────────────────────────────────────────────── */

/* Display */
.hidden        { display: none; }
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-row      { flex-direction: row; }
.inline-flex   { display: inline-flex; }
.block         { display: block; }

/* Alignment */
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end   { justify-content: flex-end; }
.center        { align-items: center; justify-content: center; }

/* Gap */
.gap-4   { gap: 4px; }
.gap-6   { gap: 6px; }
.gap-8   { gap: 8px; }
.gap-10  { gap: 10px; }
.gap-16  { gap: 16px; }
.gap-20  { gap: 20px; }

/* Flex helpers */
.flex-1      { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap   { flex-wrap: wrap; }
.ml-auto     { margin-left: auto; }

/* Width / sizing */
.w-full      { width: 100%; }
.min-h-0     { min-height: 0; }

/* Text alignment */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-justify { text-align: justify; }

/* Spacing (margin-bottom) */
.mb-8    { margin-bottom: 8px; }
.mb-10   { margin-bottom: 10px; }
.mb-12   { margin-bottom: 12px; }
.mb-14   { margin-bottom: 14px; }
.mb-16   { margin-bottom: 16px; }
.mb-18   { margin-bottom: 18px; }
.mb-20   { margin-bottom: 20px; }
.mb-24   { margin-bottom: 24px; }

/* Spacing (margin-top) */
.mt-6    { margin-top: 6px; }
.mt-8    { margin-top: 8px; }
.mt-10   { margin-top: 10px; }
.mt-12   { margin-top: 12px; }
.mt-14   { margin-top: 14px; }
.mt-16   { margin-top: 16px; }

/* Pointer events */
.pointer-events-none  { pointer-events: none; }
.pointer-events-auto  { pointer-events: auto; }
.cursor-pointer       { cursor: pointer; }
.cursor-grab          { cursor: grab; }

/* Overflow */
.overflow-hidden  { overflow: hidden; }
.overflow-y-auto  { overflow-y: auto; }
.overflow-x-auto  { overflow-x: auto; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }

/* ─── CoExpera component helpers ──────────────────────────────────────────── */

/* Пустое состояние списка */
.cex-empty-state {
  text-align: center;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  color: #9A8E84;
  padding: 40px 0;
}

/* Контейнер прокручиваемого списка */
.cex-list-scroll {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
}

/* Обёртка списка (flex-колонка) */
.cex-list-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Временна́я метка в карточках */
.cex-timestamp {
  margin-left: auto;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  color: #9A8E84;
  white-space: nowrap;
}

/* Лейбл поля формы (Roboto Flex uppercase) */
.cex-field-label {
  font-family: 'Roboto Flex', sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5A5049;
  display: block;
  margin-bottom: 6px;
}

/* Вертикальный сдвиг inline-иконок */
.cex-va-offset { vertical-align: -2px; }

/* Инпут в опасном состоянии */
.cex-input-danger {
  color: #C0392B;
  border-color: #FFAFA3;
}

/* Группа кнопок действий справа */
.cex-action-group {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

/* ─── Period picker ──────────────────────────────────────────────────────── */

/* Единое бежевое поле: левая часть (число) + разделитель + правая (единица) */
.cex-period-field {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1.5px solid #CEC4B8;
  border-radius: 9px;
  overflow: hidden;
  height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.cex-period-field.cex-picker-error { border-color: #8EA68C; }

.cex-period-num--error {
  background: #EDF2EC;
}

.cex-period-num {
  width: 58px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  color: #28231E;
  cursor: pointer;
}
.cex-period-sep {
  width: 1.5px;
  background: #CEC4B8;
  flex-shrink: 0;
  margin: 9px 0;
}
.cex-period-unit {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 14px;
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  color: #28231E;
  cursor: pointer;
}

/* Затемняющий оверлей */
.cex-picker-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(40, 35, 30, 0.45);
  z-index: 9900;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.cex-picker-overlay.cex-picker-vis { opacity: 1; }

/* Панель снизу */
.cex-picker-sheet {
  display: none;
  position: fixed;
  top: 52%; bottom: 0; left: 0; right: 0;
  background: #F0EBE1;
  border-radius: 16px 16px 0 0;
  z-index: 9901;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.32, 0, 0.67, 0);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.cex-picker-sheet.cex-picker-open {
  transform: translateY(0);
  transition-timing-function: cubic-bezier(0.33, 1, 0.68, 1);
}
.cex-picker-handle {
  width: 40px; height: 4px;
  background: #CEC4B8;
  border-radius: 2px;
  margin: 10px auto 4px;
  flex-shrink: 0;
}
.cex-picker-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.cex-picker-item {
  padding: 15px 22px;
  font-family: 'Jost', sans-serif;
  font-size: 16px;
  color: #28231E;
  border-bottom: 1px solid #EDE6DA;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.cex-picker-item:last-child { border-bottom: none; }
.cex-picker-item:active { background: #EDE6DA; }
.cex-picker-item.cex-picker-sel { color: #8EA68C; font-weight: 600; }

/* На телефоне кнопка «Создать новую версию» сжимается до одного «+» */
@media (max-width: 480px) {
  .ver-create-label { display: none; }
}
