/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.onboarding-tour {
  position: fixed;
  z-index: 60;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}

.onboarding-tour-focus {
  position: absolute;
  border: 3px solid #6d28d9;
  border-radius: 0.75rem;
  box-shadow: 0 0 0 100vmax rgb(31 22 54 / 44%);
}

.onboarding-tour-panel {
  position: absolute;
  box-sizing: border-box;
  width: min(22rem, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  pointer-events: auto;
}

/* Keep an explicit rejection visible while polling refreshes the surrounding status. */
#quote-prices-error + .price-summary [data-economic-live="prices-feedback"],
#quote-line-items:has(#quote-quantities-error) [data-economic-live="quantities-feedback"],
#quote-costs-error + #quote-economic-status #quote-costs-status {
  display: none;
}

.planning-gantt {
  height: min(68vh, 720px);
  min-height: 430px;
}

.planning-gantt .gantt_task_line.planning-activity {
  background: #6d28d9;
  border-color: #5b21b6;
  cursor: grab;
}

.planning-gantt .gantt_task_line.planning-activity:active { cursor: grabbing; }

.planning-gantt .gantt_row.planning-editable-row { cursor: pointer; }

.planning-gantt .gantt_row.planning-editable-row:hover,
.planning-gantt .gantt_row.planning-editable-row.gantt_selected {
  background: #f5f3ff;
  box-shadow: inset 4px 0 #6d28d9;
}

.planning-gantt .gantt_task_line.planning-locked::after {
  content: "Bloqueada";
  position: absolute;
  inset-inline-end: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
}

.planning-gantt .gantt_task_line.planning-phase {
  background: #374151;
  border-color: #1f2937;
}

.planning-gantt .gantt_task_content {
  color: #fff;
  font-weight: 600;
  overflow: hidden;
  padding-inline: 0.35rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-origin-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.price-origin-trigger:hover { background: #ede9fe; }
.price-origin-trigger:focus-visible { outline: 2px solid #7c3aed; outline-offset: 2px; }
.price-origin-tooltip {
  position: fixed;
  z-index: 60;
  box-sizing: border-box;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 14px 16px;
  border: 1px solid #ddd6fe;
  border-radius: 10px;
  background: #fff;
  color: #4b5563;
  box-shadow: 0 6px 24px rgb(17 24 39 / 12%);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: anywhere;
}
.price-origin-tooltip p { margin: 6px 0 0; }

/* Gantt adds its tooltip to the document body, outside the chart scroller. */
body .gantt_tooltip {
  box-sizing: border-box;
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  white-space: normal;
  overflow-wrap: anywhere;
}

.planning-gantt .gantt_task_drag.task_left,
.planning-gantt .gantt_task_drag.task_right {
  top: 50%;
  width: 24px;
  height: 24px;
  margin-top: -12px;
}

.planning-gantt .gantt_task_drag.task_left { left: -12px; }
.planning-gantt .gantt_task_drag.task_right { right: -12px; }

.planning-gantt .planning-weekend {
  background-color: #f3f4f6;
}

.planning-gantt .planning-holiday {
  background-color: #fef3c7;
  background-image: repeating-linear-gradient(135deg, transparent 0, transparent 5px, rgb(180 83 9 / 14%) 5px, rgb(180 83 9 / 14%) 8px);
}

.planning-gantt .gantt_row:focus-within,
.planning-gantt .gantt_task_row:focus-within,
.planning-gantt [tabindex]:focus-visible {
  outline: 3px solid #6d28d9;
  outline-offset: -3px;
}

[data-planning-gantt-target="row"][data-selected] {
  background: #f5f3ff;
  box-shadow: inset 4px 0 #6d28d9;
}

[data-planning-gantt-target="dependencyRow"][data-selected-role] {
  background: #f5f3ff;
  box-shadow: inset 4px 0 #6d28d9;
}

@media (max-width: 767px) {
  .planning-gantt {
    height: 480px;
    min-height: 420px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .planning-gantt *,
  dialog[open] {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* One compact summary for price coverage, actions and optional diagnostics. */
.price-summary { border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; color: #111827; box-shadow: 0 1px 2px rgb(0 0 0 / 3%); }
.price-summary__overview { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px 12px; }
.price-summary__state { min-width: 0; }
.price-summary__heading, .price-summary__status, .price-summary__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.price-summary__heading h2 { font-size: 16px; line-height: 24px; font-weight: 600; }
.price-summary__coverage { color: #6b7280; font-size: 13px; line-height: 20px; }
.price-summary__coverage strong { color: #374151; font-weight: 500; white-space: nowrap; }
.price-summary__status { margin-top: 6px; font-size: 13px; line-height: 20px; color: #4b5563; }
.price-summary__badge { padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.price-summary__badge--warning { background: #fef3c7; color: #92400e; }
.price-summary__badge--danger { background: #fee2e2; color: #991b1b; }
.price-summary__failure { color: #991b1b; font-weight: 500; }
.price-summary__actions { flex-shrink: 0; gap: 8px; }
.price-summary__actions form { margin: 0; }
.price-summary__location { flex-shrink: 1; width: 100%; max-width: 26rem; min-width: 0; }
.price-summary__location > div { flex: 1 1 100%; min-width: 0; }
.price-summary__location input[type="text"] { display: block; width: 100%; }
.price-summary__button { min-height: 44px; border: 1px solid transparent; border-radius: 8px; padding: 8px 14px; font-size: 13px; line-height: 20px; font-weight: 600; cursor: pointer; }
.price-summary__button--primary { color: #fff; background: #6d28d9; }
.price-summary__button--primary:hover { background: #5b21b6; }
.price-summary__button--secondary { color: #4b5563; background: #fff; border-color: #d1d5db; }
.price-summary__button--secondary:hover { background: #f9fafb; }
.price-summary__button:focus-visible, .price-summary__details summary:focus-visible, .price-summary__items:focus-visible { outline: 2px solid #7c3aed; outline-offset: 3px; }
.price-summary__details { border-top: 1px solid #f3f4f6; padding: 0 20px; }
.price-summary__details summary { width: fit-content; padding: 12px 0; cursor: pointer; font-size: 13px; line-height: 20px; font-weight: 500; color: #6d28d9; }
.price-summary__detail-content { display: flex; flex-direction: column; gap: 8px; padding: 0 0 16px; font-size: 13px; line-height: 20px; color: #4b5563; overflow-wrap: anywhere; }
.price-summary__diagnostics h3 { margin-top: 4px; font-weight: 600; color: #111827; }
.price-summary__reasons { list-style: disc; padding-left: 18px; margin-top: 6px; }
.price-summary__items { margin-top: 8px; max-height: 256px; overflow-y: auto; border-top: 1px solid #e5e7eb; }
.price-summary__item { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; }
.price-summary__item + .price-summary__item { border-top: 1px solid #f3f4f6; }
.price-summary__stage { font-size: 12px; color: #6b7280; }
.price-summary__progress { display: flex; flex-direction: column; gap: 4px; padding: 0 20px 12px; font-size: 12px; color: #6b7280; }
.price-summary__progress progress { width: 100%; height: 6px; accent-color: #6d28d9; border: 0; border-radius: 4px; overflow: hidden; }
.price-summary__progress progress::-webkit-progress-bar { background: #ede9fe; border-radius: 4px; }
.price-summary__progress progress::-webkit-progress-value { background: #6d28d9; }
.price-summary__progress-heading { display: flex; align-items: center; gap: 4px; font-weight: 500; color: #4b5563; }
.price-summary__progress progress.price-summary__bar--waiting { accent-color: #9ca3af; }
.price-summary__progress progress.price-summary__bar--waiting::-webkit-progress-bar { background: #e5e7eb; }
.price-summary__progress progress.price-summary__bar--waiting::-webkit-progress-value { background: #9ca3af; }
@media (max-width: 1023px) {
  .price-summary__overview { align-items: flex-start; flex-direction: column; gap: 12px; }
}
@media (max-width: 479px) {
  .price-summary__overview { padding: 14px 16px 12px; }
  .price-summary__heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .price-summary__actions { width: 100%; }
  .price-summary__actions form { flex: 1 1 100%; }
  .price-summary__button { width: 100%; }
  .price-summary__details { padding: 0 16px; }
  .price-summary__progress { padding-right: 16px; padding-left: 16px; }
}

.price-location-dialog { border: 1px solid #e5e7eb; border-radius: 12px; padding: 24px; margin: auto; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.price-location-dialog::backdrop { background: rgb(17 24 39 / 35%); }
.price-location-dialog h2 { font-size: 18px; font-weight: 600; }
.price-location-dialog p { margin: 8px 0 16px; color: #6b7280; font-size: 14px; }
.price-location-dialog label { display: block; font-size: 14px; margin-bottom: 6px; }
.price-location-dialog input[type=text] { width: 100%; border: 1px solid #9ca3af; border-radius: 6px; padding: 8px 10px; margin-bottom: 20px; }
