/*
 * Arbotech Field Operations App
 * Role-Based Completed Forms Dashboard
 */

.completed-forms-dashboard-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 7200;
  overflow-y: auto;
  background: #eef3f0;
}

.completed-forms-dashboard-screen.open {
  display: block;
}

#completedFormsDashboardRoot {
  padding: 18px;
}

.completed-forms-dashboard-page {
  width: min(100%, 1260px);
  margin: 0 auto 44px;
}

.completed-forms-dashboard-intro,
.completed-forms-dashboard-filters,
.completed-forms-dashboard-results {
  border: 1px solid #d7e0da;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 7px 24px rgba(28, 54, 38, 0.08);
}

.completed-forms-dashboard-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px;
}

.completed-forms-dashboard-intro h1 {
  margin: 4px 0 8px;
  color: #153d25;
  font-size: clamp(25px, 3vw, 36px);
}

.completed-forms-dashboard-intro p {
  max-width: 760px;
  margin: 0;
  color: #52635a;
  line-height: 1.5;
}

.completed-forms-dashboard-eyebrow {
  color: #257044;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.completed-forms-dashboard-user {
  display: grid;
  min-width: 220px;
  gap: 4px;
  padding: 12px;
  border-radius: 10px;
  background: #edf7f0;
}

.completed-forms-dashboard-user span {
  color: #64756a;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.completed-forms-dashboard-user strong {
  color: #153d25;
}

.completed-forms-dashboard-filters {
  margin-top: 14px;
  padding: 18px;
}

.completed-forms-dashboard-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto auto;
  align-items: end;
  gap: 10px;
}

.completed-forms-dashboard-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.completed-forms-dashboard-date-grid label,
.completed-forms-dashboard-filter-grid label {
  display: grid;
  gap: 6px;
  color: #23452f;
  font-weight: 800;
}

.completed-forms-dashboard-date-grid input,
.completed-forms-dashboard-filter-grid input,
.completed-forms-dashboard-filter-grid select {
  width: 100%;
  min-height: 43px;
  padding: 9px 10px;
  border: 1px solid #c9d5cd;
  border-radius: 8px;
  background: #ffffff;
  color: #1f3025;
  font: inherit;
}

.completed-forms-dashboard-date-grid button,
.completed-forms-dashboard-filter-actions button {
  min-height: 43px;
  padding: 9px 13px;
  border: 1px solid #98a89e;
  border-radius: 8px;
  background: #ffffff;
  color: #203f2b;
  font-weight: 800;
  cursor: pointer;
}

.completed-forms-dashboard-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 13px;
}

.completed-forms-dashboard-filter-actions
.completed-forms-dashboard-refresh {
  border-color: #246c3f;
  background: #246c3f;
  color: #ffffff;
}

.completed-forms-dashboard-results {
  margin-top: 14px;
  padding: 18px;
}

.completed-forms-dashboard-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  color: #274330;
}

.completed-forms-dashboard-summary span {
  color: #8a5b08;
  font-size: 12px;
  font-weight: 700;
}

.completed-forms-dashboard-list {
  display: grid;
  gap: 12px;
}

.completed-forms-dashboard-card {
  padding: 16px;
  border: 1px solid #d1ddd5;
  border-radius: 12px;
  background: #fbfdfb;
}

.completed-forms-dashboard-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.completed-forms-dashboard-card-heading h2 {
  margin: 4px 0 0;
  color: #163d25;
  font-size: 19px;
}

.completed-forms-dashboard-form-type {
  color: #2b6d43;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.completed-forms-dashboard-status {
  padding: 5px 9px;
  border-radius: 999px;
  background: #def3e5;
  color: #176033;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.completed-forms-dashboard-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0;
}

.completed-forms-dashboard-details > div {
  display: grid;
  gap: 3px;
  padding: 9px;
  border-radius: 8px;
  background: #f0f6f2;
}

.completed-forms-dashboard-details dt {
  color: #66776c;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.completed-forms-dashboard-details dd {
  margin: 0;
  color: #21382a;
  font-weight: 700;
}

.completed-forms-dashboard-location {
  color: #42584a;
  line-height: 1.4;
}

.completed-forms-dashboard-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 13px;
}

.completed-forms-dashboard-card-actions button {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: #246c3f;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.completed-forms-dashboard-empty {
  padding: 36px 18px;
  border: 1px dashed #bdccc2;
  border-radius: 10px;
  color: #5b6c61;
  text-align: center;
}

.completed-forms-dashboard-empty.error {
  border-color: #d8a7a7;
  background: #fff6f6;
  color: #8c2323;
}

.completed-forms-entry-button {
  margin-top: 10px;
}

@media (max-width: 880px) {
  #completedFormsDashboardRoot {
    padding: 9px;
  }

  .completed-forms-dashboard-intro {
    flex-direction: column;
  }

  .completed-forms-dashboard-user {
    width: 100%;
  }

  .completed-forms-dashboard-date-grid,
  .completed-forms-dashboard-filter-grid,
  .completed-forms-dashboard-details {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .completed-forms-dashboard-date-grid,
  .completed-forms-dashboard-filter-grid,
  .completed-forms-dashboard-details {
    grid-template-columns: 1fr;
  }

  .completed-forms-dashboard-date-grid button,
  .completed-forms-dashboard-filter-actions button,
  .completed-forms-dashboard-card-actions button {
    width: 100%;
  }

  .completed-forms-dashboard-filter-actions,
  .completed-forms-dashboard-card-actions,
  .completed-forms-dashboard-summary {
    align-items: stretch;
    flex-direction: column;
  }
}
