/* Department setup guidance + workmode.
   Loaded from layouts/application.html.erb AFTER dashboard.css.
   Must beat dashboard.css nukes:
     .card { background/border !important }
     a { color: teal !important }
     p, span, div, li { color: #1e293b !important }
     body.ty-app h3 { color: navy !important }
     * { margin: 0; padding: 0 } */

.dept-setup-panel,
.dept-setup-panel.card {
  border: 1px solid #f59e0b !important;
  border-left: 4px solid #d97706 !important;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%) !important;
  color: #78350f !important;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(12, 31, 63, 0.08), 0 4px 12px rgba(12, 31, 63, 0.06);
  overflow: hidden;
  transform: none !important;
}

.dept-setup-panel.card:hover,
.dept-setup-workmode.card:hover {
  transform: none !important;
  box-shadow: 0 1px 3px rgba(12, 31, 63, 0.08), 0 4px 12px rgba(12, 31, 63, 0.06) !important;
}

.dept-setup-panel.card:focus-within,
.dept-setup-workmode.card:focus-within {
  outline: none;
}

.dept-setup-panel--info,
.dept-setup-panel--info.card {
  border-color: #7dd3fc !important;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%) !important;
  color: #0c4a6e !important;
}

.fleet-dashboard__setup {
  padding: 0 24px 4px;
}

.fleet-dashboard > .dept-setup-panel {
  margin-left: 24px;
  margin-right: 24px;
}

.dept-setup-panel__header {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  padding: 1.125rem 1.25rem 0.75rem !important;
}

.dept-setup-panel .dept-setup-panel__icon,
.dept-setup-panel div.dept-setup-panel__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fef3c7 !important;
  color: #b45309 !important;
}

.dept-setup-panel .dept-setup-panel__icon--info,
.dept-setup-panel div.dept-setup-panel__icon--info {
  background: #e0f2fe !important;
  color: #0369a1 !important;
}

.dept-setup-panel__copy,
.dept-setup-panel__header > div:not(.dept-setup-panel__icon) {
  flex: 1;
  min-width: 0;
}

body.ty-app .dept-setup-panel h3.dept-setup-panel__title,
.dept-setup-panel h3.dept-setup-panel__title,
.dept-setup-panel .dept-setup-panel__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #78350f !important;
}

body.ty-app .dept-setup-panel--info h3.dept-setup-panel__title,
.dept-setup-panel--info h3.dept-setup-panel__title {
  color: #0c4a6e !important;
}

.dept-setup-panel p.dept-setup-panel__lead,
.dept-setup-panel .dept-setup-panel__lead {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #92400e !important;
}

.dept-setup-panel--info p.dept-setup-panel__lead,
.dept-setup-panel--info .dept-setup-panel__lead {
  color: #0c4a6e !important;
}

.dept-setup-panel ol.dept-setup-steps,
.dept-setup-steps {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0 !important;
  padding: 0.25rem 1.25rem 1.25rem !important;
  padding-inline-start: 1.25rem !important;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .dept-setup-panel ol.dept-setup-steps,
  .dept-setup-steps {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}

.dept-setup-steps > li::marker {
  content: none;
}

.dept-setup-panel li.dept-setup-step,
.dept-setup-step {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  height: 100%;
  min-width: 0;
  padding: 0.875rem 1rem !important;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff !important;
  color: #1e293b !important;
}

.dept-setup-panel li.dept-setup-step--active,
.dept-setup-step--active {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15);
}

.dept-setup-panel li.dept-setup-step--done,
.dept-setup-step--done {
  border-color: #86efac;
  background: #f0fdf4 !important;
}

.dept-setup-panel li.dept-setup-step--waiting,
.dept-setup-step--waiting {
  background: #f8fafc !important;
  border-style: dashed;
  border-color: #cbd5e1;
}

.dept-setup-panel span.dept-setup-step__badge,
.dept-setup-step__badge {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 800;
  background: #f1f5f9 !important;
  color: #475569 !important;
}

.dept-setup-panel .dept-setup-step--active span.dept-setup-step__badge,
.dept-setup-step--active .dept-setup-step__badge {
  background: #f59e0b !important;
  color: #fff !important;
}

.dept-setup-panel .dept-setup-step--done span.dept-setup-step__badge,
.dept-setup-step--done .dept-setup-step__badge {
  background: #22c55e !important;
  color: #fff !important;
}

.dept-setup-step__content {
  flex: 1;
  min-width: 0;
}

.dept-setup-step__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.dept-setup-panel .dept-setup-step__head strong,
.dept-setup-step__head strong {
  font-size: 0.9375rem;
  color: #1e293b !important;
}

.dept-setup-panel span.dept-setup-step__count,
.dept-setup-step__count,
.dept-setup-panel span.dept-setup-step__status,
.dept-setup-step__status {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
}

.dept-setup-panel span.dept-setup-step__count,
.dept-setup-step__count {
  background: #fef3c7 !important;
  color: #92400e !important;
}

.dept-setup-panel .dept-setup-step--waiting span.dept-setup-step__count,
.dept-setup-step--waiting .dept-setup-step__count {
  background: #e2e8f0 !important;
  color: #475569 !important;
}

.dept-setup-panel span.dept-setup-step__status,
.dept-setup-step__status {
  background: #dcfce7 !important;
  color: #166534 !important;
}

.dept-setup-panel p.dept-setup-step__hint,
.dept-setup-panel span.dept-setup-step__next,
.dept-setup-step__hint,
.dept-setup-step__next {
  display: block;
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #64748b !important;
}

.dept-setup-panel a.btn.btn-warning,
.dept-setup-panel a.dept-setup-step__cta,
.dept-setup-workmode a.btn.btn-warning {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 0.75rem;
  padding: 0.45rem 0.85rem !important;
  border-radius: 0.5rem !important;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  color: #ffffff !important;
  border: 1px solid #b45309 !important;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(180, 83, 9, 0.25);
}

.dept-setup-panel a.btn.btn-warning:hover,
.dept-setup-workmode a.btn.btn-warning:hover {
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%) !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

.dept-setup-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  padding: 0 1.25rem 1.25rem;
}

.dept-setup-panel span.dept-setup-legend__text,
.dept-setup-legend__text {
  font-size: 0.8125rem;
  color: #64748b !important;
}

.dept-setup-panel span.badge-dept-pending,
.badge-dept-pending {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fcd34d;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.dept-setup-workmode,
.dept-setup-workmode.card {
  border: 1px solid #f59e0b !important;
  background: #fffbeb !important;
  color: #78350f !important;
  transform: none !important;
}

.dept-setup-workmode--inline {
  border: 0 !important;
  background: transparent !important;
  padding: 0 1.25rem 1.25rem;
}

.dept-setup-workmode__top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem 0.75rem;
}

.dept-setup-workmode span.dept-setup-workmode__step,
.dept-setup-workmode__step {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b45309 !important;
}

body.ty-app h4.dept-setup-workmode__title,
.dept-setup-workmode__title {
  margin: 0.25rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: #78350f !important;
}

.dept-setup-workmode p.dept-setup-workmode__instruction,
.dept-setup-workmode__instruction {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #92400e !important;
}

.dept-setup-workmode__meta {
  text-align: right;
  flex-shrink: 0;
}

.dept-setup-workmode span.dept-setup-workmode__remaining-value,
.dept-setup-workmode__remaining-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: #b45309 !important;
}

.dept-setup-workmode span.dept-setup-workmode__remaining-label,
.dept-setup-workmode__remaining-label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #92400e !important;
}

.dept-setup-workmode span.dept-setup-workmode__shown,
.dept-setup-workmode__shown {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #64748b !important;
}

.dept-setup-workmode__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(245, 158, 11, 0.25);
}

.dept-setup-workmode span.dept-setup-workmode__footer-text,
.dept-setup-workmode__footer-text {
  font-size: 0.8125rem;
  color: #92400e !important;
}

.dept-setup-workmode a.dept-setup-workmode__exit,
.dept-setup-workmode__exit {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #b45309 !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dept-setup-workmode__actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
}

@media (max-width: 640px) {
  .dept-setup-panel__header,
  .dept-setup-step,
  .dept-setup-workmode__top {
    gap: 0.75rem;
  }

  .dept-setup-workmode__top {
    flex-direction: column;
  }

  .dept-setup-workmode__meta {
    text-align: left;
  }
}
