/* main.css */
/* === Общие стили === */
body {
  background-color: #202020;
  color: #e0e0e0;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
h3 {
  text-align: center;
  color: #FF6020;
}
table {
  border-collapse: collapse;
  margin: 5px;
  display: inline-block;
  vertical-align: top;
}
td {
  padding: 5px;
  border: 1px solid #A0A0A0;
  text-align: center;
  vertical-align: middle;
  font-size: 14px;
}
.td_l {
  text-align: left;
}
/* === Кнопки === */
.btn {
  display: inline-block;
  text-align: center;
  vertical-align: middle;
  text-decoration: none;
  padding: 7px 12px 7px 12px;
  margin: 4px 2px 4px 2px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s, filter 0.2s;
  box-sizing: border-box;
  font-size: 14px;
  min-height: 36px;
  color: #FFFFFF;
}
.btn--menu {
  background-color: #F5F5F5;
  color: #202020;
  border: 1px solid #ddd;
}
.btn--menu:hover {
  background-color: #AAAAAA;
}
.btn--primary {
  background-color: #FF6020;
  color: white;
}
.btn--primary:hover {
  background-color: #FF7030;
}
.btn--schedule {
  padding: 4px 2px;
  margin: 0;
  min-height: auto;
  height: auto;
  border-radius: 3px;
  background-color: #909090;
  color: #202020;
  border: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}
/* === стили content === */
.content-wrapper {
  max-width: 800px;
  margin: 20px auto;
  padding: 15px;
  background: #303030;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(100,100,100,0.1);
  min-height: 80vh;
}
.editor-link-container {
  text-align: center;
}
/* === стили login === */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
.login-box {
  padding: 30px;
  background: #303030;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  width: 300px;
  color: #e0e0e0;
}
.login-box h2 {
  text-align: center;
  margin-top: 0;
}
/* === Стили editor === */
.tabs {
  display: flex;
  gap: 10px;
  margin: 15px;
  background: #202020;
}
.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid #444;
}
.nav-tabs .btn {
  white-space: nowrap;
  padding: 6px 12px;
}
.main {
  background: #303030;
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(100,100,100,0.1);
}
.up-panel {
  margin: 15px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: flex-start;
}
.button-panel {
  display: none;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 15px;
}
.tree-item {
  padding: 2px 0;
  cursor: pointer;
}
.tree-item:hover {
  background: #505050;
}
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
    width: 100%;
    padding: 4px;
    margin: 4px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #606060 !important;
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
}

input[type="number"] {
    -webkit-text-fill-color: #000000 !important;
    color: #000000 !important;
}
.preview {
  border: 1px solid #ccc;
  padding: 10px;
  margin-top: 10px;
  min-height: 100px;
  border-radius: 4px;
}
.user-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}
.save-status {
  margin-top: 10px;
  font-weight: bold;
}
.publish-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: normal;
}
/* === Tabs Block === */
[data-block-name="tabs"] {
  margin: 16px 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}
[data-block-name="tabs"] [data-tab] {
  cursor: pointer;
}
[data-block-name="tabs"] [data-tab].active,
[data-block-name="tabs"] [data-tab]:hover {
  color: white;
}
[data-block-name="tabs"] [data-panel] {
  text-align: left;
  margin-top: 12px;
  padding: 12px;
  border-top: 1px solid #eee;
}
/* --- Стили для теста --- */
#test-question input,
#test-question textarea,
#test-question select {
  background: inherit;
  color: inherit;
  border: inherit;
  border-radius: inherit;
  padding: inherit;
  box-sizing: inherit;
  width: auto;
  text-align: left;
  -webkit-text-fill-color: inherit;
}
#test-options {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 0;
  border: none;
}
.test-answer-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 0;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
  word-wrap: break-word;
  line-height: 1.4;
}
.test-answer-wrapper input[type="radio"],
.test-answer-wrapper input[type="checkbox"] {
  flex-shrink: 0;
  margin: 0;
  align-self: flex-start;
}
.test-answer-wrapper span {
  flex-grow: 1;
  text-align: left;
  word-wrap: break-word;
  margin: 0;
  padding: 0;
  line-height: inherit;
}
/* Цветовые пресеты для кнопок */
.color-preset {
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: 2px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  background-clip: padding-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
}
.color-preset:hover {
  border-color: white;
  filter: brightness(1.2);
}
.text-color-preset {
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: 2px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  background-clip: padding-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  flex-shrink: 0;
  min-width: 24px;
  min-height: 24px;
}
.text-color-preset:hover {
  border-color: white;
  filter: brightness(1.2);
}

/* === ЕДИНЫЕ СТИЛИ ДЛЯ РАСПИСАНИЙ === */
.schedule-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}
.schedule-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.schedule-nav .btn {
  padding: 6px 10px;
  font-size: 12px;
}

/* --- НЕДЕЛЯ (универсал и менеджер) --- */
.schedule-week {
  display: flex;
  gap: 2px; /* ← разделитель между столбцами */
  margin-bottom: 8px;
}
.schedule-week-day-cell {
  display: flex;
  flex-direction: column;
  gap: 2px; /* ← разделитель между верхней и нижней ячейкой */
}
.schedule-week-header,
.schedule-week-content {
  width: 50px;
  height: 36px;
  font-size: 11px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  background: #808080;
  color: #000;
  font-weight: bold;
  padding: 0;
  margin: 0;
  border: none; /* ← убираем бордер */
}
.schedule-week-day-cell.schedule-day-today {
  box-shadow: 0 0 0 2px #FF8040;
  border-radius: 2px;
  padding: 2px;
  margin: -2px;
  position: relative;
  z-index: 10;
}

/* --- МЕСЯЦ (универсал и менеджер) --- */
.schedule-month {
  display: flex;
  flex-direction: column;
  gap: 2px; /* ← разделитель между неделями */
  width: 366px;
}
.schedule-month-weekdays {
  display: flex;
  gap: 2px; /* ← разделитель между днями недели */
  margin-bottom: 2px;
}
.schedule-month-week {
  display: flex;
  gap: 2px; /* ← разделитель между ячейками дней */
}
.schedule-month-weekday {
  width: 50px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 11px;
  background: #808080;
  color: #000;
  border: none;
  margin: 0;
  padding: 0;
}
.schedule-month-weekday.weekend {
  background: #A09080;
}
.schedule-week-header.weekend,
.schedule-week-content.weekend {
    background: #A09080 !important;
    color: #000 !important;
}
.schedule-month-day-cell {
  width: 50px;
  height: 50px;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  text-align: center;
  font-weight: bold;
  background: #808080;
  color: #000;
  position: relative;
  margin: 0;
  border: none; /* ← убираем бордер */
}
.schedule-month-day-cell.weekend {
  background: #A09080;
}
.schedule-month-day-cell.other-month {
  background: #404040;
  color: #666;
  font-weight: normal;
}
.schedule-month-day-cell.schedule-day-today {
  box-shadow: 0 0 0 2px #FF8040;
  border-radius: 2px;
  padding: 2px;
  margin: -2px;
  position: relative;
  z-index: 10;
}
.schedule-month-day-cell.schedule-day-selected {
    background: #FF6020 !important;
    color: #FFFFFF !important;
    font-weight: bold;
}

/* === Стили для расписания менеджера (неделя) — ЕДИНЫЙ СТИЛЬ === */
.schedule-manager-week-table {
  margin: 8px auto;
  border-collapse: separate;
  border-spacing: 2px;
  background-color: #303030;
}
.schedule-manager-week-table td {
  padding: 4px 4px;
  font-size: 12px;
  text-align: center;
  vertical-align: top;
  min-width: 50px;
  font-weight: bold;
  background: #808080;
  color: #000;
  border: none;
}
.schedule-manager-week-table td.weekend {
  background: #A09080 !important;
  color: #000 !important;
}
.schedule-manager-week-table .schedule-today-row {
  box-shadow: 0 0 0 3px #FF8040;
  border-radius: 2px;
  margin: -2px;
  position: relative;
  z-index: 10;
}
.schedule-manager-week-table .date-cell {
  background: #808080 !important;
  color: #000 !important;
  width: 40px;
  vertical-align: top;
  font-weight: bold;
  padding: 4px 2px;
}
.schedule-manager-week-table .date-cell.weekend {
  background: #A09080 !important;
}
#schedulePlaceButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
    align-items: center;
}
.condition-message {
    display: inline-block;
    vertical-align: middle;
}
/* === Placeholder styles === */
input::placeholder,
textarea::placeholder {
    color: #303030 !important;
    -webkit-text-fill-color: #303030 !important;
    opacity: 1 !important;
}
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
    color: #303030 !important;
    -webkit-text-fill-color: #303030 !important;
    opacity: 1 !important;
}
input::-moz-placeholder,
textarea::-moz-placeholder {
    color: #303030 !important;
    opacity: 1 !important;
}
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
    color: #303030 !important;
    opacity: 1 !important;
}
/* Принудительное подавление стилей автозаполнения */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #606060 inset !important;
    -webkit-text-fill-color: #000000 !important;
    transition: background-color 5000s ease-in-out 0s;
}
/* === Узкие ячейки часов в таблице смены менеджера === */
.schedule-shift-hours td:not(.date-cell) {
width: 22px;
min-width: 22px;
height: 35px;
vertical-align: middle;
padding: 2px 0;
font-size: 12px;
}
/* === Маленькие кнопки смайлов (оценка) === */
.rating-btn {
padding: 4px 6px;
min-height: auto;
height: auto;
font-size: 17px;
line-height: 1;
}
/* === Цвета станций — ЕДИНЫЙ ИСТОЧНИК === */
.station_z { background-color: #30A000 !important; color: white !important; }
.station_sh { background-color: #FF6020 !important; color: white !important; }
.station_k { background-color: #4040A0 !important; color: white !important; }
.station_m { background-color: #A000A0 !important; color: white !important; }
/* Для таблицы смены менеджера — фон без цвета текста (он задаётся в JS) */
.schedule-shift-hours td:not([class*="station_"]) {
    background-color: #808080;
    color: #000;
    font-weight: bold;
}
/* Единая таблица */
.schedule-table {
    border-collapse: separate !important;
    border-spacing: 2px;
    background-color: #303030;
    width: 100%;
    margin-top: 8px;
}
.schedule-table th,
.schedule-table td {
    padding: 4px;
    text-align: center;
    vertical-align: middle;
    min-width: 60px;
    font-size: 12px;
    font-weight: bold;
    color: #000;
    border: none;
}
.schedule-table .weekend {
    background: #A09080 !important;
    color: #000 !important;
}
.schedule-table .schedule-day-today {
    outline: 2px solid #FFFF00;
    outline-offset: -2px;
}
.schedule-table .schedule-today-row {
    box-shadow: 0 0 0 3px #FF8040;
    border-radius: 2px;
    margin: -2px;
    position: relative;
    z-index: 10;
}
/* === Стили для учебной игры "Генератор случайных заказов" === */
.random-order-container {
    border: 1px solid #555;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    background: #303030;
}

.random-order-generate-btn {
    padding: 6px 12px;
    background-color: #30A000;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.random-order-result {
    font-weight: bold;
    color: #FFD700;
    min-width: 120px;
}

.ingredients-line {
    display: flex;
    gap: 4px;
    width: 100%;
    justify-content: center;
}

.ingredient-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s, box-shadow 0.2s;
    color: #303030;
    background-color: #A0A0A0;
}

.ingredient-item:hover {
    filter: brightness(1.1);
}

.ingredient-item.lifted {
    transform: translateY(-10px);
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.5);
}

.ingredient-placeholder {
    width: 40px;
    height: 40px;
    border: 2px dashed #666;
    border-radius: 6px;
}

.ingredient-on-scales {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    color: #303030;
    background-color: #A0A0A0;
}

.ingredient-on-scales:hover {
    filter: brightness(1.1);
    transform: scale(1.05);
}

.scales-zone {
    width: 200px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #666;
    border-radius: 6px;
    background: #404040;
    cursor: pointer;
    transition: background-color 0.2s;
}

.scales-zone:hover {
    background-color: #484848;
}

.scales-ingredients-container {
    display: flex;
    gap: 8px;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.scales-empty-slot {
    width: 40px;
    height: 40px;
    border: 2px dashed #666;
    border-radius: 6px;
}

.scales-placeholder-text {
    color: #888;
    font-size: 12px;
}

.random-order-debug {
    width: 100%;
    background: #404040;
    color: #CCCCCC;
    font-family: monospace;
    font-size: 12px;
    margin-top: 12px;
    resize: vertical;
}

/* Принудительное подавление выделения текста */
.ingredient-item,
.ingredient-on-scales,
.ingredient-placeholder {
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}