/* Сетка быстрого табеля (ИНТЕРФЕЙС-025).
   Ширины колонок заданы CSS-переменными — вьюха и JS читают фактические значения,
   поэтому размеры меняются в одном месте. Грабля Tailwind v4: свои media query
   пишем в rem (80rem = xl), иначе при крупном системном шрифте брейкпоинты разъезжаются. */

.ts-grid {
  --ts-name-col: 200px;  /* колонка «Сотрудник» */
  --ts-day-min: 40px;    /* ячейка дня */
  --ts-day-max: 42px;
  --ts-total-col: 50px;  /* закреплённая колонка «Итого» */
  scroll-padding-left: var(--ts-name-col);
  scroll-padding-right: var(--ts-total-col);
}

/* Компактный режим ≥80rem: месяц (31 день) виден целиком без горизонтального
   скролла — ФИО уже, ячейки дней ужимаются и растягиваются на всю ширину карточки */
@media (min-width: 80rem) {
  .ts-grid {
    --ts-name-col: 160px;
    --ts-day-min: 30px;
    --ts-day-max: none;
  }

  .ts-grid .timesheet-cell {
    font-size: 0.75rem;
  }
}

/* Признак «за краем есть ещё дни»: тень на закреплённых колонках,
   пока прокрутка не дошла до соответствующего края (классы ставит JS) */
.ts-grid.ts-more-right .ts-col-total {
  box-shadow: -10px 0 8px -8px rgba(0, 0, 0, 0.25);
}

.ts-grid.ts-more-left .ts-col-name {
  box-shadow: 10px 0 8px -8px rgba(0, 0, 0, 0.25);
}

/* ФИЧА-067: метка «день в день» — значок ₽ в правом верхнем углу ячейки */
.timesheet-cell[data-daily="true"] {
  position: relative;
}

.timesheet-cell[data-daily="true"]::after {
  content: "₽";
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
  color: #059669;
  pointer-events: none;
}

/* Числовые поля попапов сетки (разбивка смен, штрафы ЗП): стрелочки-спиннеры
   съедали место в узком поле и обрезали цифры — прячем, значение вводится с клавиатуры */
.ts-popup-num::-webkit-outer-spin-button,
.ts-popup-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* input.класс — специфичность выше, чем у .form-input (width: 100%) и утилит:
   раньше поле жило на милости flex-сжатия (46px) и цифры обрезались */
input.ts-popup-num {
  -moz-appearance: textfield;
  appearance: textfield;
  width: 4.5rem;
  /* Поле часов не сжимается флексом (сжимается селект ставки) — цифры целиком */
  flex-shrink: 0;
}

/* Попап разбивки смен: 352px — строка «смена + часы + ✓ ₽ 🗑» помещается целиком
   (кнопки не сжимаются ниже контента), на телефоне не шире экрана */
.ts-cell-popup {
  width: 22rem;
  max-width: calc(100vw - 16px);
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* Пагинация pagy (ПРОИЗВОДИТЕЛЬНОСТЬ-001) */
.pagy nav.pagy {
  display: flex;
  gap: 2px;
}

.pagy nav.pagy a,
.pagy nav.pagy span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  text-decoration: none;
  color: #374151;
  transition: background-color 0.15s;
}

.pagy nav.pagy a:hover {
  background-color: #f3f4f6;
}

.pagy nav.pagy a[aria-disabled] {
  color: #9ca3af;
  pointer-events: none;
}

.pagy nav.pagy a.current,
.pagy nav.pagy span.current {
  background-color: #2563eb;
  color: white;
  font-weight: 500;
}

.pagy nav.pagy .gap {
  color: #9ca3af;
}

/* Онбординг-тур (ФИЧА-039, ДИЗАЙН-S03/S05/S18/S34) */

/* Спотлайт: кольцо без сдвига геометрии, отличимое от active-состояния
   навигации (белый фон + синее кольцо против голубой заливки active) */
@keyframes onboarding-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #2563eb, 0 0 0 5px rgba(37, 99, 235, 0.35); }
  50%       { box-shadow: 0 0 0 2px #2563eb, 0 0 0 8px rgba(37, 99, 235, 0.12); }
}

.onboarding-highlight {
  border-radius: 6px;
  background-color: #ffffff !important;
  color: #1d4ed8 !important;
  box-shadow: 0 0 0 2px #2563eb, 0 0 0 5px rgba(37, 99, 235, 0.35);
  animation: onboarding-pulse 1.5s ease-in-out infinite;
}

/* На время шага тура штатная подсветка active-пункта приглушается —
   подсвечен ровно один пункт (ДИЗАЙН-S18) */
.onboarding-muted .nav-link-active:not(.onboarding-highlight) {
  color: #6b7280;
  background-color: transparent;
}

/* Карточка шага тура; top/left задаёт контроллер от якоря (ДИЗАЙН-S05) */
.onboarding-card {
  position: fixed;
  z-index: 10001;
  width: 300px;
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 16px;
}

/* Финальный экран — в углу под шапкой */
.onboarding-card--corner {
  top: 80px;
  right: 16px;
}

/* Стрелка-указатель на якорный элемент */
.onboarding-caret {
  position: absolute;
  top: -7px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-top: 1px solid #dbeafe;
  border-left: 1px solid #dbeafe;
  transform: rotate(45deg);
}

/* Пейджер шагов «N из M» (ДИЗАЙН-S34) */
.onboarding-pager {
  font-size: 12px;
  color: #6b7280;
}

/* Скрытый за бургером таргет: карточка — bottom-sheet, не перекрывающий
   заголовок и поля форм (ДИЗАЙН-S05); класс вешает контроллер */
.onboarding-card--sheet {
  top: auto !important;
  left: 16px !important;
  right: 16px;
  bottom: 16px;
  width: auto;
  max-width: 430px;
  margin: 0 auto;
}

/* До xl навигация спрятана за бургером — sheet принудительно.
   Граница в rem, как у Tailwind xl (80rem): px разъезжается с ней
   при увеличенном базовом шрифте браузера */
@media (width < 80rem) {
  .onboarding-card {
    top: auto !important;
    left: 16px !important;
    right: 16px;
    bottom: 16px;
    width: auto;
    max-width: 430px;
    margin: 0 auto;
  }

  .onboarding-caret {
    display: none;
  }
}

/* Режим стажировки (ФИЧА-040): тултип подсказки */
.training-hint-popup {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  background-color: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  font-size: 0.8125rem;
  color: #92400e;
  max-width: 280px;
  white-space: normal;
  line-height: 1.5;
}
