/*
 *= require components/tables
 *= require_self
 */
 
.navbar-global-search {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.navbar-global-search-input-group {
  width: 100%;
}

.navbar-global-search-results {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  width: 100%;
  max-height: 360px;
  overflow-y: auto;
  z-index: 1055;
  display: none;
}

.navbar-global-search-results.show {
  display: block;
}

@media (max-width: 991.98px) {
  .navbar-global-search {
    max-width: 100%;
  }
}

.ticket-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--admin-border, #e2e8f0);
  background: var(--admin-neutral-bg, #f8fafc);
  color: var(--admin-text-muted, #475569);
  font-weight: 600;
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticket-status--active {
  color: var(--portal-success, #2f855a);
  background: var(--portal-success-bg, #f0fff4);
  border-color: var(--portal-success-border, #c6f6d5);
}

.ticket-status--pending {
  color: var(--portal-warning, #b7791f);
  background: var(--portal-warning-bg, #fffbeb);
  border-color: var(--portal-warning-border, #fbd38d);
}

.ticket-status--closed {
  color: var(--portal-neutral, #718096);
  background: var(--portal-neutral-bg, #f1f5f9);
  border-color: var(--portal-neutral-border, #e2e8f0);
}

.ticket-status--unknown {
  color: var(--portal-neutral, #64748b);
}

.ticket-card--closed {
  opacity: 0.75;
}

.sla-met,
.sla-breached,
.sla-running,
.sla-na {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
}

.sla-met {
  color: var(--admin-success, #2f855a);
}

.sla-breached {
  color: var(--admin-danger, #c53030);
}

.sla-running {
  color: var(--admin-warning, #b7791f);
}

.sla-na {
  color: var(--admin-neutral, #718096);
}

.fieldservice-block {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--admin-border, #e5e7eb);
}

.signature-trigger {
  border: 1px dashed var(--admin-border, #cbd5f5);
  border-radius: 0.75rem;
  background: var(--admin-card-bg, #fff);
  padding: 1rem;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.signature-trigger:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.signature-trigger__preview {
  max-width: 100%;
  max-height: 120px;
}

.signature-trigger__placeholder {
  color: #64748b;
  font-size: 0.95rem;
}

.signature-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  touch-action: none;
}

body.signature-overlay-active {
  overflow: hidden;
}

.signature-overlay__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.signature-overlay__canvas-wrap {
  flex: 1;
  padding: 1rem;
}

.signature-overlay__canvas {
  width: 100%;
  height: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  touch-action: none;
  display: block;
}

.ticket-conversation {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ticket-conversation__message,
.ticket-message {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
  background: #f8fafc;
  width: 100%;
  position: relative;
  padding-left: 2.5rem;
}

.ticket-conversation__message--customer,
.ticket-message--customer {
  background: #e0f2fe;
  border-color: #bae6fd;
}

.ticket-conversation__message--user,
.ticket-message--default {
  /* left-aligned by default */
}

.ticket-conversation__meta,
.ticket-message__meta {
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.ticket-message__author {
  font-weight: 600;
  color: #1e293b;
}

/* Fieldservice checklist builder */
.checklist-canvas {
  min-height: 240px;
  border: 2px dashed rgba(0,0,0,.1);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.checklist-canvas.is-hovered {
  border-color: rgba(13,110,253,.6);
  background-color: rgba(13,110,253,.04);
}

.checklist-canvas__placeholder {
  border: 1px dashed rgba(0,0,0,.08);
  border-radius: 10px;
  background: rgba(0,0,0,.02);
}

.checklist-palette .list-group-item {
  cursor: grab;
}

.checklist-builder-item summary {
  list-style: none;
  cursor: pointer;
}

.checklist-builder-item summary::-webkit-details-marker {
  display: none;
}

.checklist-builder-item[open] summary {
  border-bottom: 1px solid rgba(0,0,0,.1);
}

.checklist-builder-item .card-body {
  padding-top: 1rem;
}

.checklist-rich-text {
  min-height: 140px;
  white-space: pre-wrap;
}

.checklist-divider {
  border-top: 1px solid #e2e8f0;
}

.checklist-file-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.checklist-file-preview {
  width: 100%;
  max-height: 160px;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  object-fit: cover;
}

.checklist-file-preview--file {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: #f8fafc;
  font-size: 0.85rem;
  text-align: center;
}

.ticket-message__icon {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  font-size: 1.1rem;
  color: #64748b;
}

.ticket-message__body {
  margin-top: 0.5rem;
}

.ticket-message__attachments,
.ticket-conversation__attachments {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.ticket-attachment__image,
.ticket-conversation__image {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
}

.ticket-attachment__image {
  max-width: 420px;
}

.ticket-attachment__pdf {
  border: 1px dashed #cbd5f5;
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
}

.ticket-attachment__name {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.ticket-attachment__pdf-frame {
  width: 100%;
  height: 70vh;
  border: none;
}

.ticket-message--automation {
  background: #f1f5f9;
  border-color: #e2e8f0;
  border-left: 4px solid #94a3b8;
}

.ticket-message--technician {
  background: #eff6ff;
  border-color: #bfdbfe;
  border-left: 4px solid #3b82f6;
}

.ticket-message--support {
  background: #1e293b;
  border-color: #0f172a;
  color: #e2e8f0;
  border-left: 4px solid #38bdf8;
}

.ticket-message--support .ticket-message__meta,
.ticket-message--support .ticket-message__author {
  color: #e2e8f0;
}

.ticket-message--support a {
  color: #bae6fd;
}

.ticket-message--customer {
  border-left: 4px solid #0ea5e9;
}

.ticket-next-action {
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.ticket-fieldservice {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.ticket-fieldservice__header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  color: #1e293b;
}

.ticket-fieldservice__card {
  display: grid;
  gap: 0.5rem;
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
}

.ticket-fieldservice__line {
  display: flex;
  align-items: center;
  color: #334155;
  gap: 0.35rem;
}

.ticket-fieldservice__actions {
  margin-top: 0.25rem;
}

.fs-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.fs-status__indicator {
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fs-status--scheduled .fs-status__indicator,
.fs-status--en-route .fs-status__indicator {
  color: #f59e0b;
  animation: fs-status-pulse 2.6s ease-in-out infinite;
}

.fs-status--en-route .fs-status__indicator {
  color: #0ea5e9;
  animation: fs-status-pulse 2s ease-in-out infinite;
}

.fs-status--on-site .fs-status__indicator {
  color: #22c55e;
  animation: fs-status-ping 2.3s ease-out infinite;
}

.fs-status--in-progress .fs-status__indicator {
  color: #2563eb;
  animation: fs-status-rotate 1.6s linear infinite;
}

.fs-status--done .fs-status__indicator {
  color: #10b981;
  animation: fs-status-fade 1.4s ease-in-out 1 forwards;
}

.fs-status--cancelled {
  color: #94a3b8;
}

.fs-status--cancelled .fs-status__indicator {
  color: #cbd5f5;
  opacity: 0.6;
}

.ticket-billing {
  display: grid;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}

.ticket-billing__line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #334155;
}

.portal-reply {
  display: grid;
  gap: 1rem;
}

.portal-reply-editor {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #f8fafc;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.portal-reply-editor:focus-within {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.2);
}

.portal-reply-editor trix-toolbar {
  border: 1px solid transparent;
  background: #f1f5f9;
  padding: 0;
  margin: 0 0.75rem;
  border-radius: 0.85rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, max-height 0.2s ease, padding 0.2s ease, margin 0.2s ease, border-color 0.2s ease;
}

.portal-reply-editor:focus-within trix-toolbar,
.portal-reply-editor:hover trix-toolbar {
  opacity: 0.85;
  max-height: 3rem;
  padding: 0.35rem 0.5rem;
  margin: 0.75rem;
  border-color: #e2e8f0;
  pointer-events: auto;
}

.portal-reply-editor trix-toolbar .trix-button-group {
  margin-bottom: 0;
}

.portal-reply-editor trix-toolbar .trix-button {
  border: none;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 0.5rem;
  margin: 0 0.15rem;
}

.portal-reply-editor trix-toolbar .trix-button:not(:disabled):hover {
  background: #e2e8f0;
}

.portal-reply-editor trix-toolbar .trix-button.trix-active {
  background: #dbeafe;
  color: #1d4ed8;
}

.portal-reply-editor trix-toolbar [data-trix-attribute="strike"],
.portal-reply-editor trix-toolbar [data-trix-attribute="blockquote"],
.portal-reply-editor trix-toolbar [data-trix-attribute="code"],
.portal-reply-editor trix-toolbar [data-trix-attribute="heading1"],
.portal-reply-editor trix-toolbar [data-trix-attribute="quote"],
.portal-reply-editor trix-toolbar [data-trix-attribute="html"],
.portal-reply-editor trix-toolbar [data-trix-action="attach"],
.portal-reply-editor trix-toolbar [data-trix-button-group="file-tools"],
.portal-reply-editor trix-toolbar [data-trix-button-group="history-tools"] {
  display: none;
}

.portal-reply-editor trix-editor {
  border: none;
  padding: 0.95rem 1rem 1.1rem;
  min-height: 120px;
  background: transparent;
  font-size: 0.95rem;
  cursor: text;
}

.portal-reply-attachments {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.portal-reply-attachments-input {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.portal-reply-attachments-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px dashed #cbd5f5;
  background: #f8fafc;
  color: #334155;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.portal-reply-attachments-button:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.portal-reply-attachments-hint {
  font-size: 0.85rem;
  color: #64748b;
}

.portal-reply-actions {
  align-items: center;
}

.portal-reply-submit {
  padding: 0.7rem 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.portal-reply-back {
  color: #64748b;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  background: transparent;
  border: 1px solid transparent;
}

.portal-reply-back:hover {
  color: #1e293b;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

@keyframes fs-status-pulse {
  0% { opacity: 0.5; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.5; transform: scale(0.85); }
}

@keyframes fs-status-ping {
  0% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 0.7; }
}

@keyframes fs-status-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fs-status-fade {
  0% { opacity: 0.2; }
  100% { opacity: 1; }
}

.fieldservice-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: #334155;
}

.fieldservice-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
}

.fieldservice-status--open .fieldservice-status__dot {
  background: #94a3b8;
  animation: fieldservice-pulse 4s ease-in-out infinite;
}

.fieldservice-status--scheduled .fieldservice-status__dot {
  background: #f59e0b;
  animation: fieldservice-fade 3s ease-in-out infinite;
}

.fieldservice-status--en-route .fieldservice-status__dot {
  background: #0ea5e9;
  animation: fieldservice-move 2.5s ease-in-out infinite;
}

.fieldservice-status--on-site .fieldservice-status__dot {
  background: #22c55e;
  animation: fieldservice-glow 2.5s ease-in-out infinite;
}

.fieldservice-status--in-progress .fieldservice-status__dot {
  background: #22c55e;
  animation: fieldservice-pulse 2s ease-in-out infinite;
}

.fieldservice-status--done .fieldservice-status__dot {
  background: #64748b;
  animation: fieldservice-fade-out 1.5s ease-out 1 forwards;
}

.fieldservice-status--cancelled {
  color: #94a3b8;
  text-decoration: line-through;
}

.fieldservice-status--cancelled .fieldservice-status__dot {
  background: #cbd5f5;
}

@keyframes fieldservice-pulse {
  0% { opacity: 0.55; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.55; transform: scale(0.9); }
}

@keyframes fieldservice-fade {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

@keyframes fieldservice-move {
  0% { transform: translateX(-3px); opacity: 0.6; }
  50% { transform: translateX(3px); opacity: 1; }
  100% { transform: translateX(-3px); opacity: 0.6; }
}

@keyframes fieldservice-glow {
  0% { box-shadow: 0 0 0 rgba(34, 197, 94, 0.2); }
  50% { box-shadow: 0 0 6px rgba(34, 197, 94, 0.55); }
  100% { box-shadow: 0 0 0 rgba(34, 197, 94, 0.2); }
}

@keyframes fieldservice-fade-out {
  0% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* =========================================================
   FIX: Onboarding / Offboarding Progressbar (override)
   ========================================================= */

.onboarding-progress,
.offboarding-progress {
  display: flex !important;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-left: 0;
  margin: 24px 0;
  list-style: none;
  position: relative;
  color: #455A64;
}

.onboarding-progress .step,
.offboarding-progress .step {
  flex: 1 1 0;
  min-width: 64px;
  text-align: center;
  position: relative;
}

.onboarding-progress .step:not(:last-child)::after,
.offboarding-progress .step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  width: 100%;
  height: 4px;
  background: #C5CAE9;
  border-radius: 999px;
  z-index: 0;
}

.onboarding-progress .step-icon,
.offboarding-progress .step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #C5CAE9;
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.onboarding-progress .step.active .step-icon,
.offboarding-progress .step.active .step-icon {
  background: var(--bs-primary);
}

.onboarding-progress .step.active:not(:last-child)::after,
.offboarding-progress .step.active:not(:last-child)::after {
  background: var(--bs-primary);
}

.onboarding-progress .step.current .step-icon,
.offboarding-progress .step.current .step-icon {
  box-shadow: 0 0 10px 3px rgba(101, 31, 255, 0.35);
}

@media (max-width: 576px) {
  .onboarding-progress,
  .offboarding-progress {
    justify-content: center;
  }

  .onboarding-progress .step:not(:last-child)::after,
  .offboarding-progress .step:not(:last-child)::after {
    display: none;
  }
}

/* Stylesheet: Fieldservice Kanban board */

.kanban-board {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
  overflow-x: auto;
}

.kanban-board::-webkit-scrollbar {
  height: 8px;
}

.kanban-board::-webkit-scrollbar-thumb {
  background-color: rgba(33, 37, 41, 0.25);
  border-radius: 999px;
}

.kanban-column {
  background: #f8f9fa;
  border-radius: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  min-width: 260px;
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.kanban-column-header .status-label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kanban-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
  font-weight: 600;
  font-size: 0.75rem;
}

.kanban-cards {
  flex: 1;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 120px;
}

.kanban-card {
  background: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 10px 18px -12px rgba(33, 37, 41, 0.25);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: grab;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 20px -15px rgba(33, 37, 41, 0.35);
}

.kanban-card-ghost {
  opacity: 0.45;
  border-style: dashed;
}

.kanban-card-drag {
  opacity: 0.6;
}

.kanban-card .card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.kanban-card .card-meta strong {
  font-size: 0.9rem;
}

.kanban-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.kanban-card .badge-today {
  background: #ffc107;
  color: #212529;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.kanban-card .badge-today i {
  font-size: 0.75rem;
}

.kanban-empty-state {
  color: rgba(33, 37, 41, 0.45);
  background: rgba(248, 249, 250, 0.8);
  border: 1px dashed rgba(0, 0, 0, 0.08);
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 992px) {
  .kanban-board {
    flex-direction: column;
  }

  .kanban-column {
    min-width: auto;
  }
}

/* Stylesheet: Fieldservice timeline visualization */

.timeline-container {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1rem;
  background: #ffffff;
  overflow: hidden;
}

.timeline-hours {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  background: #f8f9fa;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-hour {
  padding: 0.75rem 0;
  text-align: center;
  color: rgba(33, 37, 41, 0.6);
  position: relative;
}

.timeline-hour::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 8px;
  background: rgba(33, 37, 41, 0.1);
}

.timeline-body {
  max-height: 70vh;
  overflow-y: auto;
}

.timeline-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.timeline-row:last-child {
  border-bottom: none;
}

.timeline-technician {
  padding: 1rem 1.25rem;
  background: rgba(248, 249, 250, 0.75);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  border-right: 1px solid rgba(0, 0, 0, 0.04);
}

.timeline-technician .technician-name {
  font-weight: 600;
  color: #212529;
}

.timeline-technician .technician-meta {
  font-size: 0.8rem;
  color: rgba(33, 37, 41, 0.6);
}

.timeline-events {
  position: relative;
  padding: 1rem 0.75rem;
  min-height: calc(var(--lanes, 1) * 2.75rem);
}

.timeline-event {
  position: absolute;
  height: 2.25rem;
  border-radius: 0.6rem;
  padding: 0.35rem 0.6rem;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 12px 18px -14px rgba(33, 37, 41, 0.55);
  top: calc(var(--lane, 0) * 2.75rem);
}

.timeline-event .event-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-event .event-time {
  font-weight: 400;
  opacity: 0.85;
}

.timeline-event .badge-today {
  background: #ffc107;
  color: #212529;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-event--open { background: #6c757d; }
.timeline-event--scheduled { background: #0d6efd; }
.timeline-event--en-route { background: #0dcaf0; color: #212529; }
.timeline-event--on-site { background: #ffc107; color: #212529; }
.timeline-event--in-progress { background: #fd7e14; }
.timeline-event--done { background: #198754; }
.timeline-event--cancelled { background: #dc3545; }

.timeline-empty-state {
  padding: 2rem;
  text-align: center;
  color: rgba(33, 37, 41, 0.55);
}

@media (max-width: 992px) {
  .timeline-row {
    grid-template-columns: 160px 1fr;
  }
}

/* Fieldservice mobile UX */
.fieldservice-mobile-header {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: #fff;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.fieldservice-mobile-body {
  --fieldservice-mobile-action-bar-height: 5rem;
  padding-bottom: calc(var(--fieldservice-mobile-action-bar-height) + env(safe-area-inset-bottom, 0px));
  scroll-padding-bottom: calc(var(--fieldservice-mobile-action-bar-height) + env(safe-area-inset-bottom, 0px));
}

.fieldservice-mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 1035;
  background: #fff;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.fieldservice-mobile-action-bar {
  box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.08);
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  transition: padding 0.2s ease, box-shadow 0.2s ease;
}

.fieldservice-action-bar__header {
  gap: 0.75rem;
}

.fieldservice-action-bar__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.fieldservice-action-bar__toggle i {
  transition: transform 0.2s ease;
}

.fieldservice-mobile-action-bar.is-collapsed {
  padding-top: 0.5rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.08);
}

.fieldservice-mobile-action-bar.is-collapsed .fieldservice-action-bar__toggle i {
  transform: rotate(180deg);
}

.fieldservice-mobile-action-bar.is-collapsed .fieldservice-action-bar__collapsible {
  display: none;
}

.fieldservice-mobile-action-bar.is-collapsed .btn-lg {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.95rem;
}

.fieldservice-mobile-action-bar.is-collapsed .fieldservice-action-bar__content {
  gap: 0.5rem;
}

.fieldservice-context-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  padding: 0.9rem;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.app-flash {
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.65rem;
  margin-bottom: 0.5rem;
}

.fieldservice-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
}

.fieldservice-info-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
}

.fieldservice-checklist-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  padding: 0.9rem;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fieldservice-checklist-card--complete {
  border-color: #bbf7d0;
  background: #f0fdf4;
  animation: fieldservice-complete-pop 0.45s ease-out;
}

.checklist-complete-banner {
  border: 1px solid #bbf7d0;
  border-radius: 0.75rem;
  background: #f0fdf4;
  padding: 1rem;
  animation: fieldservice-complete-pop 0.45s ease-out;
}

@media (max-width: 991.98px) {
  .app-flash {
    font-size: 0.8rem;
    padding: 0.4rem 0.65rem;
    border-radius: 0.65rem;
    box-shadow: none;
    border-color: rgba(148, 163, 184, 0.35);
    opacity: 0.95;
  }

  .fieldservice-mobile-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.9rem;
    padding: 1rem;
    box-shadow: none;
  }

  .fieldservice-mobile-section + .fieldservice-mobile-section {
    margin-top: 1rem;
  }

  .fieldservice-mobile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .fieldservice-mobile-tabs {
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .fieldservice-mobile-tabs .nav-link {
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.9rem;
  }

  .fieldservice-mobile-tab-content {
    margin-top: 1rem;
  }

  .fieldservice-checklist-card {
    box-shadow: none;
  }

  .fieldservice-checklist-card .btn {
    min-height: 3rem;
  }

  .fieldservice-checklist-mobile {
    --fieldservice-mobile-topbar-height: 4.25rem;
    --fieldservice-mobile-action-bar-height: 6.25rem;
    background: #f8fafc;
  }

  .fieldservice-checklist-mobile .fieldservice-mobile-topbar {
    min-height: var(--fieldservice-mobile-topbar-height);
    margin-bottom: calc(-1 * var(--fieldservice-mobile-topbar-height));
  }

  .fieldservice-checklist-mobile .fieldservice-mobile-topbar .text-truncate {
    max-width: 100%;
  }

  .fieldservice-checklist-mobile-body {
    padding: calc(var(--fieldservice-mobile-topbar-height) + env(safe-area-inset-top, 0px)) 1rem
      calc(var(--fieldservice-mobile-action-bar-height) + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .fieldservice-checklist-mobile .checklist-focus-card {
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .fieldservice-checklist-mobile .checklist-focus-card__header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.75rem;
  }

  .fieldservice-checklist-mobile .checklist-focus-card__body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .fieldservice-checklist-mobile-title {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
  }

  .fieldservice-checklist-mobile .checklist-runtime-meta {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
  }

  .fieldservice-checklist-mobile .checklist-runtime-form {
    gap: 1.75rem;
  }

  .fieldservice-checklist-mobile .checklist-runtime-item {
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .fieldservice-checklist-mobile .checklist-runtime-item .card-body {
    padding: 0;
  }

  .fieldservice-checklist-mobile .checklist-runtime-item + .checklist-runtime-item {
    margin-top: 1.25rem;
  }

  .fieldservice-checklist-mobile .checklist-runtime-item .fw-semibold {
    font-size: 1rem;
  }

  .fieldservice-checklist-mobile .checklist-runtime-item .badge {
    display: none;
  }

  .fieldservice-checklist-mobile .checklist-complete-banner {
    box-shadow: none;
    padding: 0.85rem 1rem;
  }

  .fieldservice-checklist-mobile .form-control,
  .fieldservice-checklist-mobile .form-select,
  .fieldservice-checklist-mobile .form-range {
    min-height: 3rem;
    font-size: 1rem;
  }

  .fieldservice-checklist-mobile .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
  }

  .fieldservice-checklist-mobile .signature-trigger {
    min-height: 3.5rem;
  }

  .fieldservice-checklist-mobile .checklist-divider {
    margin: 1.5rem 0;
  }
}

@keyframes fieldservice-complete-pop {
  0% {
    transform: scale(0.98);
    box-shadow: 0 0 0 rgba(16, 185, 129, 0);
  }
  60% {
    transform: scale(1.01);
    box-shadow: 0 12px 24px rgba(16, 185, 129, 0.18);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  }
}

.fs-mobile-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

.fs-mobile-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fs-mobile-title {
  font-weight: 700;
  font-size: 1.35rem;
}

.fs-mobile-subtitle {
  font-size: 0.95rem;
}

.fs-quick-tabs {
  gap: 0.5rem;
}

.fs-quick-tabs .nav-link {
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
}

.fs-mobile-section {
  background: #fff;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.fs-section-header {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.fs-section-count {
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.8rem;
}

.fs-card-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fs-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.fs-card {
  position: relative;
  display: flex;
  gap: 1rem;
  padding: 1rem 1rem 0.9rem;
  background: #f8fafc;
  border-radius: 1.1rem;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.fs-status-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0.35rem;
  background: #94a3b8;
}

.fs-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.fs-card-title {
  font-weight: 600;
  font-size: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fs-card-subtitle {
  color: #64748b;
  font-size: 0.85rem;
}

.fs-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fs-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  color: #334155;
}

.fs-status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  background: #e2e8f0;
  color: #334155;
}

.fs-card-footer {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: #475569;
}

.fs-card.status-open .fs-status-bar,
.fs-status-badge.status-open {
  background: #94a3b8;
  color: #1f2937;
}

.fs-card.status-scheduled .fs-status-bar,
.fs-status-badge.status-scheduled {
  background: #6366f1;
  color: #fff;
}

.fs-card.status-enroute .fs-status-bar,
.fs-status-badge.status-enroute {
  background: #0ea5e9;
  color: #fff;
}

.fs-card.status-onsite .fs-status-bar,
.fs-status-badge.status-onsite {
  background: #f59e0b;
  color: #1f2937;
}

.fs-card.status-inprogress .fs-status-bar,
.fs-status-badge.status-inprogress {
  background: #f97316;
  color: #1f2937;
}

.fs-card.status-done .fs-status-bar,
.fs-status-badge.status-done {
  background: #22c55e;
  color: #fff;
}

.fs-card.status-cancelled .fs-status-bar,
.fs-status-badge.status-cancelled {
  background: #ef4444;
  color: #fff;
}

.fs-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.fs-timeline-item {
  padding: 0.6rem 0.75rem;
  border-radius: 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.fs-timeline-time {
  font-weight: 700;
  font-size: 0.85rem;
  color: #2563eb;
  margin-bottom: 0.2rem;
}

.fs-timeline-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.fs-timeline-subtitle {
  color: #64748b;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.fs-timeline-dot {
  font-weight: 700;
}

.fs-empty-state {
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
  padding: 1rem 0.5rem;
}

.fs-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.08);
  z-index: 1030;
}

.fs-bottom-bar__inner {
  display: flex;
  gap: 0.75rem;
}
