/* ===== Mangel-Tracker Live — custom styles ===== */

html { -webkit-text-size-adjust: 100%; }
body { font-feature-settings: "cv11", "ss01"; }

/* smoother focus rings */
*:focus-visible { outline: 2px solid #0015ff; outline-offset: 2px; border-radius: 6px; }

/* ===== Ticket card ===== */
.ticket {
  position: relative;
  background: #fff;
  border: 1px solid rgb(226 232 240 / 0.9);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(10,21,48,0.04), 0 8px 24px rgba(10,21,48,0.06);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  animation: ticket-in .5s cubic-bezier(.2,.8,.2,1) both;
}
.ticket:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(10,21,48,0.06), 0 18px 40px rgba(10,21,48,0.12);
  border-color: rgb(203 213 225);
}
.ticket::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent, #0015ff);
}

@keyframes ticket-in {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.pill .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: currentColor;
}
.pill-received   { background: #d1e2ff; color: #0015ff; }
.pill-assigned   { background: #ffaa66; color: #6a2a00; }
.pill-progress   { background: #ff0000; color: #ffffff; }
.pill-progress .dot { animation: pulse-dot 1.2s ease-in-out infinite; }
.pill-resolved   { background: #0015ff; color: #ffffff; }
.pill-urgent     { background: #ff0000; color: #ffffff; }
.pill-standard   { background: #d1e2ff; color: #0015ff; }
.pill-low        { background: #f1f5f9; color: #475569; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .55; transform: scale(1.4); }
}

/* Stage progress bar */
.stage {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
}
.stage .bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  position: relative;
}
.stage .bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffaa66 0%, #ff0000 100%);
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}
.stage .lbl {
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.stage.done .bar > i { width: 100%; background: #0015ff; }
.stage.done .lbl { color: #0015ff; }
.stage.active .bar > i {
  width: 55%;
  background: linear-gradient(90deg, #ffaa66 0%, #ff0000 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
.stage.active .lbl { color: #cc0000; }
@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* Photo tiles */
.photo-tile {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #f1f5f9;
  aspect-ratio: 4/3;
  box-shadow: inset 0 0 0 1px rgb(15 23 42 / 0.04);
}
.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-tile .tag {
  position: absolute;
  left: 8px; bottom: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(10, 21, 48, 0.78);
  backdrop-filter: blur(4px);
  padding: 3px 7px;
  border-radius: 6px;
}
.photo-tile .tag-before { background: rgba(204, 0, 0, 0.85); }
.photo-tile .tag-after  { background: rgba(0, 21, 255, 0.85); }

/* Technician row */
.tech {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d1e2ff 0%, #fafbff 100%);
  border: 1px solid #d1e2ff;
}
.tech .ava {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0015ff, #ff0000);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 12.5px;
  flex: 0 0 auto;
}
.tech .name { font-weight: 700; font-size: 13.5px; line-height: 1.1; }
.tech .meta { font-size: 11.5px; color: #475569; line-height: 1.2; margin-top: 2px; }
.tech .rating {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  color: #ffaa66;
}

/* Star rating widget */
.star {
  cursor: pointer;
  transition: transform .15s ease, color .15s ease;
  color: #cbd5e1;
}
.star.on, .star:hover, .star:hover ~ .star { color: #ffaa66; }
.star-row .star:hover { transform: scale(1.15); }
.star-row:hover .star { color: #cbd5e1; }
.star-row .star.on, .star-row .star:hover, .star-row:hover .star.on { color: #ffaa66; }

/* Activity log */
.log {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.log li {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  color: #334155;
  position: relative;
  padding-left: 18px;
}
.log li::before {
  content: "";
  position: absolute;
  left: 4px; top: 5px;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: #cbd5e1;
}
.log li.now::before {
  background: #ff0000;
  box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.15);
  animation: now-pulse 1.4s ease-out infinite;
}
.log li .when {
  margin-left: auto;
  font-size: 11px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
@keyframes now-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.35); }
  100% { box-shadow: 0 0 0 8px rgba(255, 0, 0, 0); }
}

/* Toast */
#toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Image upload preview */
#photo-preview-wrap { transition: opacity .2s ease; }

/* Tiny utilities */
.tabular { font-variant-numeric: tabular-nums; }
.shadow-soft { box-shadow: 0 1px 2px rgba(10,21,48,0.04), 0 8px 24px rgba(10,21,48,0.06); }

/* Mobile tweaks */
@media (max-width: 640px) {
  .ticket { border-radius: 14px; }
  .stage .lbl { display: none; }
  .tech { padding: 9px 10px; }
}
