/* ============================================================
   Fluxo: Área, Menu, Destino e Solicitações
   ============================================================ */

.flow-screen {
  flex-direction: column;
  min-height: 100vh;
}

.flow-main {
  flex: 1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.flow-main.narrow {
  max-width: 720px;
}

.flow-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  animation: fadeInUp 0.45s ease both;
}

.flow-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text-primary);
  margin-bottom: 10px;
  animation: fadeInUp 0.5s ease 0.05s both;
}

.flow-lead {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 560px;
  animation: fadeInUp 0.5s ease 0.1s both;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  animation: fadeIn 0.4s ease;
}

.stepper span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
}

.stepper span.active {
  width: 22px;
  border-radius: 999px;
  background: var(--accent);
}

.header-context {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.context-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(21, 168, 148, 0.08);
  border: 1px solid rgba(21, 168, 148, 0.16);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
}

.context-chip a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.context-chip a:hover {
  text-decoration: underline;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-back:hover {
  transform: translateX(-3px);
  border-color: var(--accent);
  color: var(--accent-dark);
  box-shadow: var(--shadow-sm);
}

.icon-chevron {
  width: 1em;
  height: 1em;
  display: block;
  flex-shrink: 0;
}

.icon-chevron-left {
  transform: rotate(180deg);
}

.icon-chevron-down {
  transform: rotate(90deg);
}

.icon-chevron-up {
  transform: rotate(-90deg);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.area-main {
  max-width: 1040px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: start;
  gap: 48px 56px;
  padding-top: 56px;
  overflow: visible;
}

.area-copy {
  padding-top: 8px;
}

.area-copy .flow-lead {
  margin-bottom: 0;
}

.area-picker {
  width: 100%;
  min-width: 0;
  padding: 24px 22px 22px;
  animation: fadeInUp 0.55s ease 0.16s both;
}

.area-picker-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.area-dropdown {
  position: relative;
}

.area-dropdown-trigger {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border: 1px solid var(--border-default);
  border-radius: 16px;
  background: #f7faf9;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.area-dropdown-trigger:hover {
  border-color: rgba(21, 168, 148, 0.35);
  background: #ffffff;
}

.area-dropdown.open .area-dropdown-trigger,
.area-dropdown-trigger:focus-visible {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(21, 168, 148, 0.12);
  outline: none;
}

.area-dropdown-trigger.has-value {
  color: var(--text-primary);
}

.area-dropdown-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--accent-glow);
}

.area-dropdown-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.area-dropdown-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.area-dropdown-trigger .icon-chevron {
  width: 18px;
  height: 18px;
  transition: transform 220ms ease;
}

.area-dropdown.open .area-dropdown-trigger .icon-chevron {
  transform: rotate(-90deg);
}

.area-dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0, 69, 67, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 200ms ease, transform 200ms ease, visibility 200ms ease;
  z-index: 20;
  overflow: hidden;
}

.area-dropdown.open .area-dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.area-dropdown-search {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.area-dropdown-search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: #f7faf9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") 12px center no-repeat;
  padding: 0 14px 0 38px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}

.area-dropdown-search input:focus {
  border-color: var(--accent);
  background-color: #ffffff;
}

.area-dropdown-options {
  max-height: 460px;
  overflow-y: auto;
  padding: 8px;
}

.area-option {
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.area-option:hover {
  background: rgba(21, 168, 148, 0.08);
}

.area-option.selected {
  background: rgba(21, 168, 148, 0.14);
  color: var(--accent-dark);
}

.area-dropdown-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.area-continue {
  width: 100%;
  margin-top: 18px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
}

.area-continue .icon-chevron {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

.choice-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: inherit;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 28px 26px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 280ms ease, border-color 280ms ease;
  animation: fadeInUp 0.5s ease both;
}

.choice-card:nth-child(1) { animation-delay: 0.12s; }
.choice-card:nth-child(2) { animation-delay: 0.18s; }
.choice-card:nth-child(3) { animation-delay: 0.24s; }
.choice-card:nth-child(4) { animation-delay: 0.3s; }
.choice-card:nth-child(5) { animation-delay: 0.14s; }
.choice-card:nth-child(6) { animation-delay: 0.2s; }
.choice-card:nth-child(7) { animation-delay: 0.26s; }
.choice-card:nth-child(8) { animation-delay: 0.32s; }
.choice-card:nth-child(9) { animation-delay: 0.16s; }
.choice-card:nth-child(10) { animation-delay: 0.22s; }
.choice-card:nth-child(11) { animation-delay: 0.28s; }

.choice-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(21, 168, 148, 0.08), transparent 55%);
  opacity: 0;
  transition: opacity 280ms ease;
}

.choice-card:hover {
  transform: translateY(-6px);
  border-color: rgba(21, 168, 148, 0.28);
  box-shadow: 0 16px 36px rgba(0, 69, 67, 0.1);
}

.choice-card:hover::after {
  opacity: 1;
}

.choice-card:active {
  transform: translateY(-2px);
}

.choice-card.selected {
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(21, 168, 148, 0.16);
}

.choice-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--accent-glow);
}

.choice-icon.soft {
  background: rgba(21, 168, 148, 0.1);
  color: var(--accent-dark);
  box-shadow: none;
}

.choice-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choice-card h2,
.choice-card h3 {
  position: relative;
  z-index: 1;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.choice-card p {
  position: relative;
  z-index: 1;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.choice-arrow {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  margin-top: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(21, 168, 148, 0.1);
  color: var(--accent-dark);
  font-size: 18px;
  transition: transform 280ms ease, background 280ms ease;
}

.choice-card:hover .choice-arrow {
  transform: translateX(4px);
  background: var(--accent);
  color: white;
}

.choice-arrow .icon-chevron {
  width: 18px;
  height: 18px;
}

.choice-card:hover .choice-arrow .icon-chevron {
  filter: brightness(0) invert(1);
}

.outros-panel {
  display: none;
  margin-top: 14px;
  padding: 0;
  animation: fadeInUp 0.35s ease;
}

.outros-panel.show {
  display: block;
}

.outros-panel .field-label {
  margin-bottom: 8px;
}

.btn-continue {
  margin-top: 16px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--accent-glow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.btn-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(21, 168, 148, 0.28);
}

.btn-continue:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.field-locked {
  position: relative;
}

.field-locked .field-input,
.field-locked .select-trigger {
  background: #e8ebed;
  color: #7a8490;
  cursor: not-allowed;
  border-color: rgba(0, 0, 0, 0.06);
  pointer-events: none;
  box-shadow: none;
}

.field-locked .select-trigger::after {
  content: '🔒';
  font-size: 11px;
}

.locked-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(0, 69, 67, 0.08);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.orders-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  animation: fadeInUp 0.45s ease 0.12s both;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  border: 1px solid var(--border-default);
  background: white;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.filter-pill.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
  box-shadow: var(--accent-glow);
}

.orders-list {
  display: grid;
  gap: 14px;
}

.order-card {
  padding: 22px 24px;
  animation: fadeInUp 0.4s ease both;
}

.order-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.order-id-lg {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--accent-dark);
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.order-materials {
  display: grid;
  gap: 8px;
}

.order-material {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-input);
  border-radius: 10px;
  font-size: 13px;
}

.order-material .sap {
  color: var(--accent-dark);
  font-weight: 700;
}

.empty-state {
  text-align: center;
  padding: 56px 24px;
}

.empty-state h3 {
  margin: 12px 0 8px;
}

.empty-state p {
  color: var(--text-secondary);
}

.form-source-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 860px) {
  .area-main {
    display: flex;
    flex-direction: column;
    max-width: 560px;
    gap: 20px;
    padding-top: 20px;
    min-height: 0;
  }

  .area-copy {
    padding-top: 0;
  }

  .area-copy .flow-lead {
    margin-bottom: 0;
  }

  .area-dropdown-options {
    max-height: min(360px, 52vh);
  }

  .choice-grid,
  .choice-grid.areas {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .flow-title {
    font-size: 26px;
  }

  .choice-grid,
  .choice-grid.areas {
    grid-template-columns: 1fr;
  }

  .order-material {
    grid-template-columns: 1fr;
  }

  .header-context {
    width: 100%;
  }
}
