/* Work groups list */
.diore-workgroups-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

  .diore-workgroups-create-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-weight: 600;
    max-width: 220px;
    min-width: 100px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

.diore-workgroups-list {
  width: 100%;
  border: 1px solid #d8dde3;
  background: #fff;
}

.diore-workgroups-list-header,
.diore-workgroups-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 160px) minmax(0, 160px) minmax(0, 64px);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.diore-workgroups-list-header {
  color: #3f4f5f;
  font-weight: 700;
  background: #f1f1f1;
}

  .diore-workgroups-list-header div {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

.diore-workgroups-list-row {
  color: #526273;
  border-top: 1px solid #e6e9ed;
  text-decoration: none;
  transition: background 0.15s ease;
}

  .diore-workgroups-list-row:hover {
    color: #3f4f5f;
    background: #f8f9fa;
    text-decoration: none;
  }

  .diore-workgroups-list-row .name {
    font-weight: 600;
    color: #3f4f5f;
  }

  .diore-workgroups-list-row span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .diore-workgroups-list-row .actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .diore-workgroups-list-row .arrow {
    flex: 0 0 auto;
    color: #3f4f5f;
    font-size: 18px;
    line-height: 1;
  }

.diore-workgroups-delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #8893a0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

  .diore-workgroups-delete-button:hover {
    color: #c0392b;
    border-color: #c0392b;
    background: #fff;
  }

  .diore-workgroups-delete-button .label {
    /* Visually hidden, but available to screen readers */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

.diore-workgroups-empty {
  padding: 24px 18px;
  color: #526273;
  background: #fff;
  border-top: 1px solid #e6e9ed;
  text-align: center;
}

/* Work groups create form */
.diore-workgroups-create-form .buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

  .diore-workgroups-create-submit-button,
  .diore-workgroups-create-cancel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    max-width: 175px;
    min-width: 100px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

/* Work groups details page */
.diore-workgroups-details-section-title {
  margin: 24px 0 12px;
  color: #3f4f5f;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
}

.diore-workgroups-subaccounts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

  .diore-workgroups-subaccounts-toolbar .diore-workgroups-details-section-title {
    margin: 0;
  }

  .diore-workgroups-add-subaccount-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-weight: 600;
    max-width: 220px;
    min-width: 100px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

/* Work groups details page - subaccounts list */
.diore-workgroups-subaccounts-list {
  width: 100%;
  border: 1px solid #d8dde3;
  background: #fff;
}

.diore-workgroups-subaccounts-list-header,
.diore-workgroups-subaccounts-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 160px) minmax(0, 160px) minmax(0, 96px);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.diore-workgroups-subaccounts-list-header {
  color: #3f4f5f;
  font-weight: 700;
  background: #f1f1f1;
}

  .diore-workgroups-subaccounts-list-header div {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

.diore-workgroups-subaccounts-list-row {
  color: #526273;
  border-top: 1px solid #e6e9ed;
  text-decoration: none;
  transition: background 0.15s ease;
}

  .diore-workgroups-subaccounts-list-row:hover {
    color: #3f4f5f;
    background: #f8f9fa;
    text-decoration: none;
  }

  .diore-workgroups-subaccounts-list-row span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .diore-workgroups-subaccounts-list-row .disconnect {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .diore-workgroups-subaccounts-list-row .arrow {
    flex: 0 0 auto;
    color: #3f4f5f;
    font-size: 18px;
    line-height: 1;
  }

.diore-workgroups-subaccounts-disconnect-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #8893a0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

  .diore-workgroups-subaccounts-disconnect-button:hover {
    color: #c0392b;
    border-color: #c0392b;
    background: #fff;
  }

  .diore-workgroups-subaccounts-disconnect-button .label {
    /* Visually hidden, but available to screen readers */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

.diore-workgroups-subaccounts-empty {
  padding: 24px 18px;
  color: #526273;
  background: #fff;
  border-top: 1px solid #e6e9ed;
  text-align: center;
}

/* Work groups details - construction sites section */
.diore-workgroups-sites-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

  .diore-workgroups-sites-toolbar .diore-workgroups-details-section-title {
    margin: 0;
  }

  .diore-workgroups-sites-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-weight: 600;
    max-width: 220px;
    min-width: 100px;
    white-space: nowrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

.diore-workgroups-sites-list {
  width: 100%;
  border: 1px solid #d8dde3;
  background: #fff;
  margin-bottom: 24px;
}

.diore-workgroups-sites-list-header,
.diore-workgroups-sites-list-row {
  display: grid;
  grid-template-columns: minmax(0, 28%) minmax(0, 18%) minmax(0, 18%) minmax(0, 16%) minmax(0, 12%) minmax(0, 24px);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.diore-workgroups-sites-list-header {
  color: #3f4f5f;
  font-weight: 700;
  background: #f1f1f1;
}

  .diore-workgroups-sites-list-header div {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

.diore-workgroups-sites-list-row {
  color: #526273;
  border-top: 1px solid #e6e9ed;
  text-decoration: none;
}

  .diore-workgroups-sites-list-row:hover {
    color: #3f4f5f;
    background: #f8f9fa;
    text-decoration: none;
  }

  .diore-workgroups-sites-list-row span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .diore-workgroups-sites-list-row .name {
    font-weight: 600;
    color: #3f4f5f;
  }

  .diore-workgroups-sites-list-row .arrow {
    flex: 0 0 auto;
    color: #3f4f5f;
    font-size: 20px;
    text-align: right;
  }

.diore-workgroups-sites-empty {
  padding: 18px 16px;
  margin-bottom: 24px;
  color: #526273;
  background: #f8f9fa;
  border: 1px dashed #d8dde3;
  text-align: center;
}

/* Work groups - construction site edit/create form */
.diore-workgroups-sites-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin-bottom: 12px;
}

  .diore-workgroups-sites-form-grid > .full-width {
    grid-column: 1 / -1;
  }

.diore-workgroups-sites-amount-input {
  display: flex;
  align-items: stretch;
  vertical-align: middle;
  width: 100%;
  flex-direction: row;
}

  .diore-workgroups-sites-amount-input input {
    flex: 1 1 auto;
    width: auto;
    margin: 0;
  }

  .diore-workgroups-sites-amount-postfix {
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 12px;
    color: #526273;
    border: 1px solid #ddd;
    border-left: 0;
    background: #f8f9fa;
  }

.diore-workgroups-sites-readonly {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  padding: 12px 14px;
  margin: 0 0 12px;
  background: #f8f9fa;
  border: 1px solid #e6e9ed;
}

  .diore-workgroups-sites-readonly > div {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .diore-workgroups-sites-readonly .label {
    color: #526273;
    font-weight: 600;
    margin-right: 6px;
  }

  .diore-workgroups-sites-readonly .value {
    color: #3f4f5f;
  }

.diore-workgroups-sites-checkbox-input {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px 8px;
  margin: 6px 0 12px;
}

  .diore-workgroups-sites-checkbox-input input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 4px;
  }

  .diore-workgroups-sites-checkbox-input label {
    width: auto;
    margin: 0;
    text-align: left;
  }

.diore-workgroups-sites-form .buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

  .diore-workgroups-sites-submit-button,
  .diore-workgroups-sites-cancel-button,
  .diore-workgroups-sites-delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    max-width: 200px;
    min-width: 100px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .diore-workgroups-sites-delete-button {
    margin-left: auto;
    color: #b00020;
  }

/* Work groups - construction site details (read-only summary) */
.diore-workgroups-site-summary {
  padding: 18px 20px;
  margin-bottom: 24px;
  background: #f1f1f1;
  border: 1px solid #d8dde3;
}

  .diore-workgroups-site-summary-title {
    margin: 0 0 16px;
    color: #3f4f5f;
    font-size: 17px;
    font-weight: 700;
  }

.diore-workgroups-site-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 0 0 16px;
}

  .diore-workgroups-site-summary-grid > div {
    display: grid;
    grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
    gap: 12px;
    align-items: baseline;
  }

  .diore-workgroups-site-summary-grid dt {
    margin: 0;
    color: #3f4f5f;
    font-weight: 600;
  }

  .diore-workgroups-site-summary-grid dd {
    margin: 0;
    color: #526273;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

.diore-workgroups-site-summary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

  .diore-workgroups-site-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    max-width: 200px;
    min-width: 100px;
    text-decoration: none;
  }

  .diore-workgroups-site-delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    max-width: 200px;
    min-width: 100px;
    white-space: nowrap;
  }

.diore-workgroups-site-products {
  margin-top: 12px;
}

  .diore-workgroups-site-products-title {
    margin: 24px 0 12px;
    color: #3f4f5f;
    font-size: 17px;
    font-weight: 700;
  }

  .diore-workgroups-site-products-empty {
    padding: 14px 16px;
    margin-bottom: 12px;
    color: #526273;
    background: #fff;
    border: 1px solid #d8dde3;
  }

.diore-workgroups-site-products-search {
  display: flex;
}

  .diore-workgroups-site-products-search-input {
    width: 100%;
    padding: 10px 14px;
    color: #526273;
    background: #fff;
    border: 1px solid #d8dde3;
  }

  .diore-workgroups-site-products-search-input:disabled {
    cursor: not-allowed;
    background: #f8f9fa;
  }

/* Work groups add subaccount form */
.diore-workgroups-add-subaccount-form .buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

  .diore-workgroups-add-subaccount-submit-button,
  .diore-workgroups-add-subaccount-cancel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    max-width: 175px;
    min-width: 100px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

@media (max-width: 768px) {
  .diore-workgroups-toolbar {
    justify-content: stretch;
  }

    .diore-workgroups-create-button {
      max-width: none;
      width: 100%;
    }

  .diore-workgroups-list-header {
    display: none;
  }

  .diore-workgroups-list-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px 12px;
  }

    .diore-workgroups-list-row span {
      grid-column: 1;
    }

    .diore-workgroups-list-row .actions {
      grid-column: 1;
      justify-content: center;
    }

    .diore-workgroups-list-row .arrow {
      display: none;
    }

  .diore-workgroups-create-form .buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

    .diore-workgroups-create-submit-button,
    .diore-workgroups-create-cancel-button {
      max-width: none;
      width: 100%;
    }

  .diore-workgroups-subaccounts-toolbar {
    flex-wrap: wrap;
  }

    .diore-workgroups-add-subaccount-button {
      max-width: none;
      width: 100%;
    }

  .diore-workgroups-subaccounts-list-header {
    display: none;
  }

  .diore-workgroups-subaccounts-list-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px 12px;
  }

    .diore-workgroups-subaccounts-list-row span {
      grid-column: 1;
    }

    .diore-workgroups-subaccounts-list-row .disconnect {
      grid-column: 1;
      justify-content: center;
    }

    .diore-workgroups-subaccounts-list-row .arrow {
      display: none;
    }

  .diore-workgroups-add-subaccount-form .buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

    .diore-workgroups-add-subaccount-submit-button,
    .diore-workgroups-add-subaccount-cancel-button {
      max-width: none;
      width: 100%;
    }

  .diore-workgroups-sites-toolbar {
    flex-wrap: wrap;
    justify-content: stretch;
  }

    .diore-workgroups-sites-add-button {
      max-width: none;
      width: 100%;
    }

  .diore-workgroups-sites-list-header {
    display: none;
  }

  .diore-workgroups-sites-list-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px 12px;
  }

    .diore-workgroups-sites-list-row span {
      grid-column: 1;
    }

    .diore-workgroups-sites-list-row .arrow {
      display: none;
    }

  .diore-workgroups-sites-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .diore-workgroups-sites-readonly {
    grid-template-columns: minmax(0, 1fr);
  }

  .diore-workgroups-sites-form .buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

    .diore-workgroups-sites-submit-button,
    .diore-workgroups-sites-cancel-button,
    .diore-workgroups-sites-delete-button {
      max-width: none;
      width: 100%;
      margin-left: 0;
    }

  .diore-workgroups-site-summary-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px 12px;
  }

    .diore-workgroups-site-summary-grid > div {
      grid-template-columns: minmax(0, 1fr);
      gap: 2px;
    }

  .diore-workgroups-site-summary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

    .diore-workgroups-site-edit-button,
    .diore-workgroups-site-delete-button {
      max-width: none;
      width: 100%;
    }
}
