/* 71-prep-hub-alerts-and-settings.css
   Prep Hub: timer alerts, oven priority, streak badge, discipline ladder.
   Files in css/ load in filename order and the cascade depends on it: see docs/CSS.md. */

/* Prep Hub timer alerts and tab-scoped settings controls */
.prep-hub-card-stat.is-timer b {
  transition:
    color 0.28s ease,
    text-shadow 0.28s ease;
}
.prep-settings-divider {
  margin: 22px 0 18px;
  border: 0;
  border-top: 1px solid var(--line);
}
/* Caution/warning now read as a pulsing glow around the timer box itself,
   not a text-color change — the digits stay neutral so they stay legible
   at a glance from across the kitchen. */
.prep-hub-card-stat.is-timer {
  position: relative;
  overflow: hidden;
}
.prep-hub-card-stat.is-timer:has(b.is-caution) {
  animation: prep-timer-pulse-caution 1.4s ease-in-out infinite;
}
.prep-hub-card-stat.is-timer:has(b.is-warning) {
  animation: prep-timer-pulse-warning 1s ease-in-out infinite;
}
.prep-hub-card-stat.is-timer b {
  position: relative;
  z-index: 1;
}
@keyframes prep-timer-pulse-caution {
  0%,
  100% {
    box-shadow: inset 0 0 0 0 rgba(255, 212, 90, 0);
    background-color: rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: inset 0 0 34px 14px rgba(255, 212, 90, 0.95);
    background-color: rgba(255, 212, 90, 0.4);
  }
}
@keyframes prep-timer-pulse-warning {
  0%,
  100% {
    box-shadow: inset 0 0 0 0 rgba(255, 100, 104, 0);
    background-color: rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: inset 0 0 38px 16px rgba(255, 100, 104, 1);
    background-color: rgba(255, 100, 104, 0.48);
  }
}
@media (prefers-reduced-motion: reduce) {
  .prep-hub-card-stat.is-timer:has(b.is-caution),
  .prep-hub-card-stat.is-timer:has(b.is-warning) {
    animation: none;
  }
  .prep-hub-card-stat.is-timer:has(b.is-caution) {
    box-shadow: inset 0 0 30px 10px rgba(255, 212, 90, 0.7);
    background-color: rgba(255, 212, 90, 0.25);
  }
  .prep-hub-card-stat.is-timer:has(b.is-warning) {
    box-shadow: inset 0 0 32px 12px rgba(255, 100, 104, 0.75);
    background-color: rgba(255, 100, 104, 0.3);
  }
}
.prep-settings-nav button[data-prep-settings-tab="timer-alerts"]::before {
  content: "◷";
}
.prep-timer-settings > header h3 {
  margin: 0;
  font-size: 24px;
}
.prep-timer-settings > header p {
  margin: 7px 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.prep-timer-thresholds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
  transition: opacity 0.18s ease;
}
.prep-timer-thresholds[hidden] {
  display: none;
}

.prep-timer-thresholds > label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.prep-timer-thresholds strong,
.prep-timer-thresholds small {
  display: block;
}
.prep-timer-thresholds small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.prep-timer-thresholds > label > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.prep-timer-thresholds input {
  box-sizing: border-box;
  width: 64px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  font-weight: 850;
  text-align: center;
}
.prep-timer-thresholds em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
}
.prep-pane-reset {
  margin-top: 18px;
}
.prep-settings-nav button[data-prep-settings-tab="monday"]::before {
  content: "M";
}
.prep-settings-nav button[data-prep-settings-tab="saturday"]::before {
  content: "S";
}
.prep-monday-settings > header h3,
.prep-saturday-settings > header h3 {
  margin: 0;
  font-size: 24px;
}
.prep-monday-settings > header p,
.prep-saturday-settings > header p {
  margin: 7px 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.prep-monday-body,
.prep-saturday-body {
  margin-top: 18px;
  transition: opacity 0.18s ease;
}

.prep-week-select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.prep-week-select-row span {
  font-size: 14px;
  font-weight: 750;
}
.prep-week-select-row select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 850;
}
.prep-week-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
}
.prep-priority-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prep-priority-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
  width: 50%;
  padding: 7px 26px 7px 9px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  background: var(--btn-color);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: grab;
}
.prep-priority-card.is-light {
  color: #17120a;
}
.prep-priority-card.is-dragging {
  cursor: grabbing;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  z-index: 2;
  position: relative;
}
.prep-priority-grip {
  flex: 0 0 auto;
  opacity: 0.75;
  font-size: 13px;
  line-height: 1;
}
.prep-priority-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prep-priority-card small {
  position: absolute;
  top: 6px;
  right: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}
.prep-priority-card.is-light small {
  color: rgba(0, 0, 0, 0.65);
}
.prep-hour-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prep-hour-row {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.prep-hour-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.prep-hour-head strong {
  font-size: 14px;
}
.prep-hour-head select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}
.prep-hour-readout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 8px;
}
.prep-hour-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  background: var(--btn-color);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.prep-hour-card.is-light {
  color: #17120a;
}
.prep-hour-card > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prep-hour-card b {
  flex: 0 0 auto;
  font-weight: 900;
}
.prep-not-in-rotation {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: var(--card);
  margin-bottom: var(--drawer-reserve, 98px);
}
.prep-not-in-rotation-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.prep-hub-flyout-card {
  position: fixed;
  z-index: 60;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--btn-color);
  color: #fff;
  font-size: 18px;
  font-weight: 850;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.prep-hub-flyout-card.is-light {
  color: #17120a;
}
.prep-not-in-rotation-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.prep-not-in-rotation-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--btn-color);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  opacity: 0.7;
}
.prep-not-in-rotation-card.is-light {
  color: #17120a;
}
.prep-not-in-rotation-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prep-not-in-rotation-card b {
  flex: 0 0 auto;
  font-weight: 900;
}
.prep-settings-editor > .prep-pane-reset {
  width: 100%;
}
.prep-settings-actions .settings-save[hidden] {
  display: none;
}
@media (min-width: 601px) and (max-width: 1100px) and (orientation: portrait) {
  .prep-settings-host .prep-modal {
    height: 72%;
    max-height: 760px;
  }
  .prep-timer-thresholds {
    grid-template-columns: 1fr;
  }
  .prep-settings-columns.prep-oven-columns,
  .prep-settings-row.prep-oven-row {
    grid-template-columns: minmax(105px, 1fr) 58px 58px 46px 54px 44px 34px;
  }
}

/* Suite-wide settings close button: anchor the SVG to the circle's exact center. */
.settings-header .settings-close {
  position: relative;
  display: block;
  padding: 0 !important;
}
.settings-header .settings-close svg {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  margin: 0;
  transform: translate(-50%, -50%);
}

/* Prep Hub oven-priority settings and motion. */
.prep-oven-settings > header {
  display: block;
}
.prep-products-settings > header,
.prep-kanban-settings > header,
.prep-timer-settings > header,
.prep-tablet-settings > header,
.prep-monday-settings > header,
.prep-saturday-settings > header {
  display: block;
}
.prep-oven-type select {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  outline: none;
}
.prep-oven-type select:focus {
  border-color: #6975ff;
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.13);
}
.prep-hub-card-wrap.is-oven .prep-hub-card.is-active {
  display: block;
  padding: 26px 24px;
}
.prep-hub-oven-card-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}
.prep-hub-card-wrap.is-oven:not(.is-active) .prep-hub-oven-card-line {
  grid-template-columns: minmax(0, 1fr) auto;
}
.prep-hub-oven-instruction {
  justify-self: center;
  font-size: 27px;
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: 0.025em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
.prep-hub-card-wrap.is-oven:not(.is-active) .prep-hub-oven-instruction {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 69px;
  padding: 8px 14px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 19px;
}
.prep-hub-card-wrap.is-oven:not(.is-active) .prep-hub-card.is-light .prep-hub-oven-instruction {
  background: rgba(0, 0, 0, 0.1);
}
.prep-hub-card-wrap.is-oven .prep-hub-card-stat.is-timer {
  justify-self: end;
  min-width: 104px;
}
.prep-hub-card-wrap.is-oven.is-active .prep-hub-oven-card-line {
  position: relative;
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.prep-hub-card-wrap.is-oven.is-active .prep-hub-oven-instruction {
  position: static;
  left: auto;
  justify-self: center;
  box-sizing: border-box;
  min-height: 73px;
  padding: 10px 16px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.2);
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prep-hub-card-wrap.is-oven.is-active .prep-hub-card.is-light .prep-hub-oven-instruction {
  background: rgba(0, 0, 0, 0.1);
}
.prep-settings-nav button[data-prep-settings-tab="oven-items"]::before {
  content: "♨";
}
@media (max-width: 680px) {
}
@media (max-width: 680px) {
  .prep-settings-columns.prep-oven-columns,
  .prep-settings-row.prep-oven-row {
    grid-template-columns: minmax(105px, 1fr) 58px 58px 46px 54px 44px 34px;
  }
  .prep-hub-oven-card-line {
    gap: 10px;
  }
  .prep-hub-oven-instruction {
    font-size: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .prep-hub-card-wrap.is-oven::after {
    animation: none !important;
  }
}

/* Shared visual treatment for a hub's own settings-trigger button when the
   signed-in manager lacks that module's Settings permission (see
   window.CFAGateSettingsButton in app.js). Stays visible so the manager
   knows the feature exists, but reads as inert. */
.cfa-settings-locked {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
.cfa-settings-locked:hover {
  opacity: 0.4;
}

/* Gamified streak badge — how many cards in a row were bumped before
   hitting their warning threshold. Sits behind the Add to Queue drawer
   (lower z-index) so it’s naturally covered when the drawer opens, and
   only appears once there’s something to celebrate. */
.prep-hub-streak {
  position: absolute;
  z-index: 5;
  right: 16px;
  bottom: calc(var(--drawer-reserve, 98px) + var(--not-in-rotation-h, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 26px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffb020, #ff5f45);
  color: #241200;
  font-weight: 900;
  box-shadow:
    0 14px 36px rgba(255, 120, 40, 0.45),
    0 0 0 1.5px rgba(255, 255, 255, 0.22) inset;
  animation: prep-streak-glow 2.2s ease-in-out infinite;
}
/* The wide-viewport frame always simulates a portrait iPad, so it should
   carry the same tablet-portrait styling the real device gets from the
   @media(...)and(orientation:portrait) block below -- that query never
   matches an actual desktop window (which is never portrait), so without
   this the preview showed the wide desktop-style topbar/Tools button
   instead of matching the real tablet. */
.prep-hub-stage.is-ipad-framed .prep-hub-topbar {
  padding: 18px 20px;
}
.prep-hub-stage.is-ipad-framed .prep-hub-icon-btn {
  width: 64px;
  height: 64px;
  font-size: 29px;
}
.prep-hub-stage.is-ipad-framed .prep-hub-settings-btn svg {
  width: 31px;
  height: 31px;
}
.prep-hub-stage.is-ipad-framed .prep-hub-tools-btn {
  width: 64px;
  padding: 0;
  justify-content: center;
}
.prep-hub-stage.is-ipad-framed .prep-hub-tools-btn > span:last-child {
  display: none;
}
.prep-hub-stage.is-ipad-framed .prep-hub-tools-btn .tools-home-icon {
  grid-template-columns: repeat(3, 5px);
  grid-template-rows: repeat(3, 5px);
  gap: 2px;
}
.prep-hub-stage.is-ipad-framed .prep-hub-tools-btn .tools-home-icon i {
  width: 5px;
  height: 5px;
}
.prep-hub-stage.is-ipad-framed .prep-hub-buttons {
  padding-bottom: 10px;
}
.prep-hub-streak-label {
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}
.prep-hub-streak-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.prep-hub-streak-flame {
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25));
}
.prep-hub-streak-count {
  font-size: 46px;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.prep-hub-streak-week {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1.5px solid rgba(36, 18, 0, 0.22);
}
.prep-hub-streak-week-label {
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}
.prep-hub-streak-week-day {
  font-size: 19px;
  font-weight: 900;
  white-space: nowrap;
}
.prep-hub-streak-week-time {
  font-size: 19px;
  font-weight: 900;
  opacity: 0.85;
  margin-bottom: 2px;
  white-space: nowrap;
}
.prep-hub-streak-week-count {
  font-size: 32px;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
@keyframes prep-streak-glow {
  0%,
  100% {
    box-shadow:
      0 10px 26px rgba(255, 120, 40, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.18) inset;
  }
  50% {
    box-shadow:
      0 10px 34px rgba(255, 120, 40, 0.7),
      0 0 0 1px rgba(255, 255, 255, 0.28) inset;
  }
}
@media (prefers-reduced-motion: reduce) {
  .prep-hub-streak {
    animation: none;
  }
}

/* Discipline page: policy thresholds in one vertical column */
.attendance-thresholds-panel .attendance-thresholds {
  grid-template-columns: 1fr !important;
}
.attendance-thresholds-panel {
  flex: 0 1 300px;
}
/* Discipline page: policy thresholds as a color-coded ladder */
.attendance-thresholds-panel .attendance-thresholds {
  gap: 8px;
  margin: 14px 0 0;
}
.attendance-thresholds-panel .attendance-thresholds span {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-left: 4px solid var(--tc, #999);
  border-radius: 10px;
  background: color-mix(in srgb, var(--tc, #999) 13%, #14161b);
  color: #e8eaee;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}
.attendance-thresholds-panel .attendance-thresholds b {
  margin: 0;
  color: var(--tc, #999);
  font-size: 25px;
  line-height: 1;
  text-align: left;
}
.attendance-thresholds-panel .attendance-thresholds b::after {
  content: "pts";
  display: block;
  margin-top: 3px;
  color: #7d8494;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* the real suite logo on the sign-in and invite pages */
.auth-logo-img {
  display: block;
  width: 64px;
  height: 64px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
  border-radius: 14px;
}
